Mercurial > hg > orthanc
diff Core/Images/JpegWriter.h @ 1916:5bcf721bde4f
IImageWriter
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 09 Feb 2016 15:26:37 +0100 |
parents | 7454019be8f3 |
children | baf8dd89b4e0 |
line wrap: on
line diff
--- a/Core/Images/JpegWriter.h Tue Feb 09 14:50:29 2016 +0100 +++ b/Core/Images/JpegWriter.h Tue Feb 09 15:26:37 2016 +0100 @@ -32,16 +32,27 @@ #pragma once -#include "ImageAccessor.h" - -#include <string> -#include <stdint.h> -#include <boost/noncopyable.hpp> +#include "IImageWriter.h" namespace Orthanc { - class JpegWriter : public boost::noncopyable + class JpegWriter : public IImageWriter { + protected: + virtual void WriteToFileInternal(const std::string& filename, + unsigned int width, + unsigned int height, + unsigned int pitch, + PixelFormat format, + const void* buffer); + + virtual void WriteToMemoryInternal(std::string& jpeg, + unsigned int width, + unsigned int height, + unsigned int pitch, + PixelFormat format, + const void* buffer); + private: uint8_t quality_; @@ -56,33 +67,5 @@ { return quality_; } - - void WriteToFile(const char* filename, - unsigned int width, - unsigned int height, - unsigned int pitch, - PixelFormat format, - const void* buffer); - - void WriteToMemory(std::string& jpeg, - unsigned int width, - unsigned int height, - unsigned int pitch, - PixelFormat format, - const void* buffer); - - void WriteToFile(const char* filename, - const ImageAccessor& accessor) - { - WriteToFile(filename, accessor.GetWidth(), accessor.GetHeight(), - accessor.GetPitch(), accessor.GetFormat(), accessor.GetConstBuffer()); - } - - void WriteToMemory(std::string& jpeg, - const ImageAccessor& accessor) - { - WriteToMemory(jpeg, accessor.GetWidth(), accessor.GetHeight(), - accessor.GetPitch(), accessor.GetFormat(), accessor.GetConstBuffer()); - } }; }