Mercurial > hg > orthanc
comparison OrthancFramework/Sources/Images/IImageWriter.cpp @ 4311:cb9aef006229
turning IImageWriter into a pure interface
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 09 Nov 2020 15:07:55 +0100 |
parents | 2ae905070221 |
children | d9473bd5ed43 |
comparison
equal
deleted
inserted
replaced
4310:2ae905070221 | 4311:cb9aef006229 |
---|---|
40 WriteToMemoryInternal(compressed, width, height, pitch, format, buffer); | 40 WriteToMemoryInternal(compressed, width, height, pitch, format, buffer); |
41 SystemToolbox::WriteFile(compressed, path); | 41 SystemToolbox::WriteFile(compressed, path); |
42 } | 42 } |
43 #endif | 43 #endif |
44 | 44 |
45 void IImageWriter::WriteToMemory(std::string &compressed, | 45 void IImageWriter::WriteToMemory(IImageWriter& writer, |
46 std::string &compressed, | |
46 const ImageAccessor &accessor) | 47 const ImageAccessor &accessor) |
47 { | 48 { |
48 WriteToMemoryInternal(compressed, accessor.GetWidth(), accessor.GetHeight(), | 49 writer.WriteToMemoryInternal(compressed, accessor.GetWidth(), accessor.GetHeight(), |
49 accessor.GetPitch(), accessor.GetFormat(), accessor.GetConstBuffer()); | 50 accessor.GetPitch(), accessor.GetFormat(), accessor.GetConstBuffer()); |
50 } | 51 } |
51 | 52 |
52 #if ORTHANC_SANDBOXED == 0 | 53 #if ORTHANC_SANDBOXED == 0 |
53 void IImageWriter::WriteToFile(const std::string &path, | 54 void IImageWriter::WriteToFile(IImageWriter& writer, |
55 const std::string &path, | |
54 const ImageAccessor &accessor) | 56 const ImageAccessor &accessor) |
55 { | 57 { |
56 WriteToFileInternal(path, accessor.GetWidth(), accessor.GetHeight(), | 58 writer.WriteToFileInternal(path, accessor.GetWidth(), accessor.GetHeight(), |
57 accessor.GetPitch(), accessor.GetFormat(), accessor.GetConstBuffer()); | 59 accessor.GetPitch(), accessor.GetFormat(), accessor.GetConstBuffer()); |
58 } | 60 } |
59 #endif | 61 #endif |
60 } | 62 } |