The Conley-Morse Graphs Software
|
An interface to the PNG library. More...
#include <pngimage.h>
Public Member Functions | |
PngImage (int _width, int _height, int _bgcolor=0xFFFFFF) | |
The constructor of an empty 24-bit PNG image. More... | |
PngImage (const char *filename) | |
The constructor which reads a PNG image from a file. More... | |
~PngImage () | |
The destructor. More... | |
void | putPixel (int x, int y, int color=0x000000) |
Plots a pixel in the image with the given RGB color. More... | |
int | getPixel (int x, int y) const |
Returns the 0xRRGGBB color value of the given pixel or -1 if the pixel is outside the image. More... | |
int | width () const |
Returns the width of the image. More... | |
int | height () const |
Returns the height of the image. More... | |
void | save (const char *filename) const |
Writes the image to a PNG file. More... | |
Private Member Functions | |
PngImage (const PngImage &src) | |
The copy constructor is not allowed. More... | |
PngImage & | operator= (const PngImage &src) |
The assignment operator is not allowed. More... | |
Private Attributes | |
int | imgWidth |
The width of the image in pixels. More... | |
int | imgHeight |
The height of the image in pixels. More... | |
unsigned char * | buffer |
The buffer of the picture in RGB byte sequences. More... | |
An interface to the PNG library.
Supports creating a 24-bit image, writing individual pixels, and saving the image to a PNG file.
Definition at line 51 of file pngimage.h.
|
inline |
The constructor of an empty 24-bit PNG image.
The default background color is white.
Definition at line 103 of file pngimage.h.
|
inline |
|
inline |
|
inlineprivate |
The copy constructor is not allowed.
Definition at line 134 of file pngimage.h.
|
inline |
Returns the 0xRRGGBB color value of the given pixel or -1 if the pixel is outside the image.
Definition at line 155 of file pngimage.h.
|
inline |
Returns the height of the image.
Definition at line 168 of file pngimage.h.
References imgHeight.
Referenced by PngImage().
The assignment operator is not allowed.
Definition at line 139 of file pngimage.h.
|
inline |
Plots a pixel in the image with the given RGB color.
The color is encoded as 0xRRGGBB. Black by default.
Definition at line 144 of file pngimage.h.
|
inline |
Writes the image to a PNG file.
Throws an error text message (const char *) in case of failure.
Definition at line 267 of file pngimage.h.
|
inline |
Returns the width of the image.
Definition at line 163 of file pngimage.h.
References imgWidth.
Referenced by PngImage().
|
private |
The buffer of the picture in RGB byte sequences.
Definition at line 97 of file pngimage.h.
Referenced by getPixel(), PngImage(), putPixel(), save(), and ~PngImage().
|
private |
The height of the image in pixels.
Definition at line 94 of file pngimage.h.
Referenced by getPixel(), height(), PngImage(), putPixel(), and save().
|
private |
The width of the image in pixels.
Definition at line 91 of file pngimage.h.
Referenced by getPixel(), PngImage(), putPixel(), save(), and width().