#ifndef IMAGEWRITER_H #define IMAGEWRITER_H class SectorSet; class ImageSpec; class ImageWriter { public: ImageWriter(const SectorSet& sectors, const ImageSpec& spec); virtual ~ImageWriter() {}; public: static std::unique_ptr create(const SectorSet& sectors, const ImageSpec& spec); static void verifyImageSpec(const ImageSpec& filename); private: typedef std::function< std::unique_ptr(const SectorSet& sectors, const ImageSpec& spec) > Constructor; static std::map formats; static std::unique_ptr createImgImageWriter( const SectorSet& sectors, const ImageSpec& spec); static std::unique_ptr createLDBSImageWriter( const SectorSet& sectors, const ImageSpec& spec); static std::unique_ptr createD64ImageWriter( const SectorSet& sectors, const ImageSpec& spec); static Constructor findConstructor(const ImageSpec& spec); public: virtual void adjustGeometry(); void printMap(); void writeCsv(const std::string& filename); virtual void writeImage() = 0; protected: const SectorSet& sectors; ImageSpec spec; }; #endif