Mercurial > hg > orthanc
comparison Core/Images/IImageWriter.h @ 2083:bfeacb51af20
cleaning up code
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 08 Sep 2016 16:32:13 +0200 |
parents | d2a0c41869ab |
children | baf8dd89b4e0 |
comparison
equal
deleted
inserted
replaced
2082:d2a0c41869ab | 2083:bfeacb51af20 |
---|---|
31 | 31 |
32 | 32 |
33 #pragma once | 33 #pragma once |
34 | 34 |
35 #include "ImageAccessor.h" | 35 #include "ImageAccessor.h" |
36 #include "../Toolbox.h" | |
37 | 36 |
38 #include <boost/noncopyable.hpp> | 37 #include <boost/noncopyable.hpp> |
39 | 38 |
40 namespace Orthanc | 39 namespace Orthanc |
41 { | 40 { |
52 virtual void WriteToFileInternal(const std::string& path, | 51 virtual void WriteToFileInternal(const std::string& path, |
53 unsigned int width, | 52 unsigned int width, |
54 unsigned int height, | 53 unsigned int height, |
55 unsigned int pitch, | 54 unsigned int pitch, |
56 PixelFormat format, | 55 PixelFormat format, |
57 const void* buffer) | 56 const void* buffer); |
58 { | |
59 #if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1 | |
60 std::string compressed; | |
61 WriteToMemoryInternal(compressed, width, height, pitch, format, buffer); | |
62 Toolbox::WriteFile(compressed, path); | |
63 #else | |
64 throw OrthancException(ErrorCode_CannotWriteFile); // Unavailable in sandboxed environments | |
65 #endif | |
66 } | |
67 | 57 |
68 public: | 58 public: |
69 virtual ~IImageWriter() | 59 virtual ~IImageWriter() |
70 { | 60 { |
71 } | 61 } |