#pragma once #include "PlatformImage.h" #include #include class Color; class AbstractGrid; template class Grid; class Image { public: enum class DataType { UCHAR }; using Index = std::pair; using Indices = std::vector; Image(unsigned width, unsigned height, DataType dataType = DataType::UCHAR); ~Image(); static std::unique_ptr Create(unsigned width, unsigned height, DataType dataType = DataType::UCHAR); unsigned getBytesPerRow() const; unsigned getWidth() const; unsigned getHeight() const; unsigned getBitDepth() const; unsigned getNumChannels() const; AbstractGrid* getData() const; template Grid* getDataT() const; DataType getType() const; PlatformImage* getPlatformImage(); void setPixelValues(const Indices& indices, const std::vector& colors); void setWidth(unsigned width); void setHeight(unsigned height); void setBitDepth(unsigned bitDepth); void setNumChannels(unsigned numChannels); private: void initialize(); unsigned mWidth{1}; unsigned mHeight{1}; unsigned mBitDepth{8}; unsigned mNumChannels{4}; DataType mDataType; std::unique_ptr mData; std::unique_ptr mPlatformImage; };