Canola
0.8.D001
|
#include <format.h>
Public Member Functions | |
virtual | ~image_format () |
Protected Types | |
typedef unsigned char | data_t |
Protected Member Functions | |
void | get_pixel (int x, int y, icon_pixel &value) const |
void | set_pixel (int x, int y, const icon_pixel &value) |
unsigned | get_width () const |
unsigned | get_height () const |
const data_t * | get_data () const |
const data_t * | get_data (int y) const |
const data_t * | get_data (int x, int y) const |
virtual void | save_to_file (const std::string &filename) const |
image_format (int width, int height, data_t *data) | |
image_format (int width, int height) | |
Private Member Functions | |
image_format () | |
image_format (const image_format &) | |
image_format & | operator= (const image_format &) |
Private Attributes | |
unsigned | width |
unsigned | height |
data_t * | data |
The image_format class is used to represent an image of a specific format, e.g. GIF or PNG.
typedef unsigned char image_format::data_t [protected] |
image_format::~image_format | ( | ) | [virtual] |
image_format::image_format | ( | int | width, |
int | height, | ||
data_t * | data | ||
) | [protected] |
image_format::image_format | ( | int | width, |
int | height | ||
) | [protected] |
image_format::image_format | ( | ) | [private] |
The default constructor. Do not use.
image_format::image_format | ( | const image_format & | ) | [private] |
The copy constructor. Do not use.
const data_t* image_format::get_data | ( | ) | const [protected] |
const data_t* image_format::get_data | ( | int | y | ) | const [inline, protected] |
const data_t* image_format::get_data | ( | int | x, |
int | y | ||
) | const [inline, protected] |
unsigned image_format::get_height | ( | ) | const [protected, virtual] |
void image_format::get_pixel | ( | int | x, |
int | y, | ||
icon_pixel & | value | ||
) | const [protected, virtual] |
The get_pixel method may be used to obtain the value of the pixel at the given location.
x | The X cordinate of the pixel |
y | The Y cordinate of the pixel |
value | The place where the pixel value is to be stored on return. |
Implements image.
Definition at line 22 of file get_pixel.cc.
unsigned image_format::get_width | ( | ) | const [protected, virtual] |
image_format & image_format::operator= | ( | const image_format & | arg | ) | [private] |
void image_format::save_to_file | ( | const std::string & | filename | ) | const [protected, virtual] |
The save_to_file method is used to store the image data into a file on disk.
filename | The name of the file to be written. |
Implements image.
Reimplemented in image_format_jpeg, and image_format_png.
Definition at line 25 of file save_to_file.cc.
void image_format::set_pixel | ( | int | x, |
int | y, | ||
const icon_pixel & | value | ||
) | [protected, virtual] |
The set_pixel method may be used to set the value of the pixel at the given location. Transparency is ignored, the pixel becomes exactly as given; if you want transparentcy taken into account, use overlay_pixel. The pen_clr tracks the given value.
x | The X coordinate of the pixel to be set |
y | The Y coordinate of the pixel to be set |
value | The value of the pixel to be set. |
Implements image.
Definition at line 22 of file set_pixel.cc.
data_t* image_format::data [private] |
unsigned image_format::height [private] |
unsigned image_format::width [private] |