22 RGB = PNG_COLOR_TYPE_RGB,
23 RGBA = PNG_COLOR_TYPE_RGB_ALPHA
33 bool read(
const PPath & fileName);
34 bool write(
const PPath & fileName);
44 void setColor(
const T * matValue,
size_t nbRow,
size_t nbCol,
const PColorMap & colorMap);
53 const png_byte*
getData()
const;
unsigned char color_t
Type des of a color.
unsigned int NbColorByte
Number of bytes use in the image color (3 for RGB, 4 for RGBA)
Describe a color map to adapt color with input value.
Class which manipulate png image.
void initialisationPImagePng()
Initialisation function of the class PImagePng.
bool createImage(size_t width, size_t height, PImagePng::ColorType colorType=PImagePng::RGB)
Create an image.
void setColor(size_t idxWidth, size_t idxHeight, color_t red, color_t green, color_t blue)
Set the color of the pixel at (idxWidth, idxHeight)
void fill(color_t red, color_t green, color_t blue, color_t alpha=255)
Fill the image with the given color.
bool read(const PPath &fileName)
Read the given png image.
NbColorByte getNbBytePerPixel() const
Get the number of bytes per pixel.
png_image p_image
Png image.
void clear()
Clear the image and buffer.
PImagePng()
Default constructor of PImagePng.
void copyPImagePng(const PImagePng &other)
Copy function of PImagePng.
png_byte * p_buffer
Buffer use to store the image data.
PImagePng & operator=(const PImagePng &other)
Definition of equal operator of PImagePng.
const png_byte * getData() const
Get the buffer data of the current PImagePng.
PImagePng::ColorType p_colorType
Type of the color of the current image.
NbColorByte p_nbBytePerPixel
Number of bytes per pixel (3 for RGB, 4 for RGBA)
virtual ~PImagePng()
Destructor of PImagePng.
unsigned int getHeight() const
Get the height of the image.
void getColor(size_t idxWidth, size_t idxHeight, color_t &red, color_t &green, color_t &blue) const
Get the color of the pixel at (idxWidth, idxHeight)
bool write(const PPath &fileName)
Write a png file.
unsigned int getWidth() const
Get the width of the image.