Canola  0.8.D001
Public Member Functions | Protected Types | Protected Member Functions | Private Member Functions | Private Attributes
image_format Class Reference

#include <format.h>

Inheritance diagram for image_format:
image image_format_jpeg image_format_png

List of all members.

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_tget_data () const
const data_tget_data (int y) const
const data_tget_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_formatoperator= (const image_format &)

Private Attributes

unsigned width
unsigned height
data_tdata

Detailed Description

The image_format class is used to represent an image of a specific format, e.g. GIF or PNG.

Definition at line 27 of file format.h.


Member Typedef Documentation

typedef unsigned char image_format::data_t [protected]

Definition at line 49 of file format.h.


Constructor & Destructor Documentation

The destructor.

Definition at line 23 of file format.cc.

image_format::image_format ( int  width,
int  height,
data_t data 
) [protected]

The constructor.

Parameters:
widthThe width of the image
heightThe height of the image
dataThe data is ordered as row then column then component (RGBA).

Definition at line 29 of file format.cc.

image_format::image_format ( int  width,
int  height 
) [protected]

The constructor.

The image will be completely blank and transparent.

Parameters:
widthThe width of the image
heightThe height of the image

Definition at line 40 of file format.cc.

The default constructor. Do not use.

image_format::image_format ( const image_format ) [private]

The copy constructor. Do not use.


Member Function Documentation

const data_t* image_format::get_data ( ) const [protected]
const data_t* image_format::get_data ( int  y) const [inline, protected]

Definition at line 54 of file format.h.

const data_t* image_format::get_data ( int  x,
int  y 
) const [inline, protected]

Definition at line 61 of file format.h.

unsigned image_format::get_height ( ) const [protected, virtual]

The get_height method may be used to obtain the height of the image, in pixels.

Implements image.

Definition at line 76 of file format.cc.

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.

Parameters:
xThe X cordinate of the pixel
yThe Y cordinate of the pixel
valueThe 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]

The get_width method may be used to obtain the width of the image, in pixels.

Implements image.

Definition at line 68 of file format.cc.

image_format & image_format::operator= ( const image_format arg) [private]

The assignment operator. Do not use.

Definition at line 52 of file format.cc.

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.

Parameters:
filenameThe 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.

Parameters:
xThe X coordinate of the pixel to be set
yThe Y coordinate of the pixel to be set
valueThe value of the pixel to be set.

Implements image.

Definition at line 22 of file set_pixel.cc.


Member Data Documentation

Definition at line 103 of file format.h.

unsigned image_format::height [private]

Definition at line 102 of file format.h.

unsigned image_format::width [private]

Definition at line 101 of file format.h.


The documentation for this class was generated from the following files: