Mercurial > hg > orthanc
comparison OrthancFramework/Sources/Images/PngWriter.h @ 4642:69bbb4bd35cb
PngWriter recreates a new libpng context for each encoding
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 28 Apr 2021 11:22:39 +0200 |
parents | d9473bd5ed43 |
children | 7053502fbf97 |
comparison
equal
deleted
inserted
replaced
4641:b02dc8303cf6 | 4642:69bbb4bd35cb |
---|---|
37 | 37 |
38 namespace Orthanc | 38 namespace Orthanc |
39 { | 39 { |
40 class ORTHANC_PUBLIC PngWriter : public IImageWriter | 40 class ORTHANC_PUBLIC PngWriter : public IImageWriter |
41 { | 41 { |
42 private: | |
43 class Context; | |
44 | |
42 protected: | 45 protected: |
43 #if ORTHANC_SANDBOXED == 0 | 46 #if ORTHANC_SANDBOXED == 0 |
44 virtual void WriteToFileInternal(const std::string& filename, | 47 virtual void WriteToFileInternal(const std::string& filename, |
45 unsigned int width, | 48 unsigned int width, |
46 unsigned int height, | 49 unsigned int height, |
53 unsigned int width, | 56 unsigned int width, |
54 unsigned int height, | 57 unsigned int height, |
55 unsigned int pitch, | 58 unsigned int pitch, |
56 PixelFormat format, | 59 PixelFormat format, |
57 const void* buffer) ORTHANC_OVERRIDE; | 60 const void* buffer) ORTHANC_OVERRIDE; |
58 | |
59 private: | |
60 struct PImpl; | |
61 boost::shared_ptr<PImpl> pimpl_; | |
62 | |
63 void Compress(unsigned int width, | |
64 unsigned int height, | |
65 unsigned int pitch, | |
66 PixelFormat format); | |
67 | |
68 void Prepare(unsigned int width, | |
69 unsigned int height, | |
70 unsigned int pitch, | |
71 PixelFormat format, | |
72 const void* buffer); | |
73 | |
74 public: | |
75 PngWriter(); | |
76 | |
77 ~PngWriter(); | |
78 }; | 61 }; |
79 } | 62 } |