8class ImageWriterFactory;
20 virtual int Write(
const unsigned char *buffer,
const unsigned int width,
const unsigned int height) = 0;
34 static std::vector<ImageWriterFactory *> factories;
46#define REGISTER_IMAGEWRITER(name) \
47 class name##Factory : public ImageWriterFactory { \
49 name##Factory() : ImageWriterFactory(name::GetFileExtensions()) { ImageWriter::RegisterFactory(this); } \
50 virtual ImageWriter *Create(const std::string &path) { return new name(path); } \
52 static name##Factory registration_##name##Factory;
const std::vector< std::string > Extensions
ImageWriterFactory(std::vector< std::string > extensions)
virtual ImageWriter * Create(const std::string &path)=0
Interface for image writers.
ImageWriter(const std::string &path)
static ImageWriter * CreateImageWriterForFile(const std::string &path)
virtual int Write(const unsigned char *buffer, const unsigned int width, const unsigned int height)=0
static void RegisterFactory(ImageWriterFactory *factory)