Canola
0.8.D001
|
#include <icon_pixel.h>
The icon_pixel class is used to represent a pixel of an RGBA image.
(It isn't called plain "pixel" because of the anencephalic design [actually, a distinct *lack* of design] of libnetpbm. Name space pollution everywhere! Sheesh.)
Definition at line 32 of file icon_pixel.h.
typedef unsigned char icon_pixel::byte_type |
Definition at line 47 of file icon_pixel.h.
typedef double icon_pixel::real_type |
Definition at line 45 of file icon_pixel.h.
typedef unsigned short icon_pixel::short_type |
Definition at line 46 of file icon_pixel.h.
icon_pixel::~icon_pixel | ( | ) | [inline] |
The destructor. It is not virtual, shou shalt not derive from this class.
Definition at line 39 of file icon_pixel.h.
icon_pixel::icon_pixel | ( | ) | [inline] |
The default constructor. The default pixel is completely transparent.
Definition at line 53 of file icon_pixel.h.
icon_pixel::icon_pixel | ( | short_type | rr, |
short_type | gg, | ||
short_type | bb | ||
) | [inline] |
The constructor.
rr | The red channel value, range [0, 65535]. |
gg | The green channel value, range [0, 65535]. |
bb | The blue channel value, range [0, 65535]. |
The default alpha channel is completely opaque.
Definition at line 79 of file icon_pixel.h.
icon_pixel::icon_pixel | ( | short_type | rr, |
short_type | gg, | ||
short_type | bb, | ||
short_type | aa | ||
) | [inline] |
The constructor.
rr | The red channel value, range [0, 65535]. |
gg | The green channel value, range [0, 65535]. |
bb | The blue channel value, range [0, 65535]. |
aa | The alpha channel value, range [0, 65535]. |
Definition at line 105 of file icon_pixel.h.
icon_pixel::icon_pixel | ( | real_type | rr, |
real_type | gg, | ||
real_type | bb | ||
) | [inline] |
The constructor.
rr | The red channel value, range [0.0, 1.0]. |
gg | The green channel value, range [0.0, 1.0]. |
bb | The blue channel value, range [0.0, 1.0]. |
The default alpha channel is completely opaque.
Definition at line 131 of file icon_pixel.h.
icon_pixel::icon_pixel | ( | real_type | rr, |
real_type | gg, | ||
real_type | bb, | ||
real_type | aa | ||
) | [inline] |
The constructor.
rr | The red channel value, range [0.0, 1.0]. |
gg | The green channel value, range [0.0, 1.0]. |
bb | The blue channel value, range [0.0, 1.0]. |
aa | The alpha channel value, range [0.0, 1.0]. |
Definition at line 157 of file icon_pixel.h.
icon_pixel::icon_pixel | ( | const icon_pixel & | arg | ) | [inline] |
The copy constructor.
Definition at line 174 of file icon_pixel.h.
static short_type icon_pixel::convert_channel_real_to_short | ( | real_type | x | ) | [inline, static, private] |
The convert_channel_real_to_short class method is used to convert a double in [0.0, 1.0] to an integer in [0, 65535] The conversion is designed to divide the input range into 65536 equally-sized regions. This is achieved by multiplying by 65536 and then special-casing the result of an input value of 1.0 so that it maps to 65535 instead of 65536.
Definition at line 518 of file icon_pixel.h.
static real_type icon_pixel::convert_channel_short_to_real | ( | short_type | x | ) | [inline, static, private] |
The convert_channel_short_to_real class method is used to convert * an integer in [0, 65535] to a double in [0.0, 1.0]. This is achieved by dividing by 65536 and then special-casing the result of an input value of 65535 so that it maps to 1.0 instead of 0.9999847412109375.
Definition at line 549 of file icon_pixel.h.
void icon_pixel::convert_real_to_short | ( | void | ) | const [inline, private] |
The convert_real_to_short method is used to translate the realRGBA values into shortRGBA values. This is done on demand.
Definition at line 531 of file icon_pixel.h.
void icon_pixel::convert_short_to_real | ( | void | ) | const [inline, private] |
Definition at line 557 of file icon_pixel.h.
real_type icon_pixel::get_alpha | ( | void | ) | const [inline] |
Definition at line 293 of file icon_pixel.h.
byte_type icon_pixel::get_alpha_byte | ( | void | ) | const [inline] |
Definition at line 365 of file icon_pixel.h.
short_type icon_pixel::get_alpha_short | ( | void | ) | const [inline] |
Definition at line 356 of file icon_pixel.h.
real_type icon_pixel::get_blue | ( | void | ) | const [inline] |
Definition at line 284 of file icon_pixel.h.
byte_type icon_pixel::get_blue_byte | ( | void | ) | const [inline] |
Definition at line 347 of file icon_pixel.h.
short_type icon_pixel::get_blue_short | ( | void | ) | const [inline] |
Definition at line 338 of file icon_pixel.h.
real_type icon_pixel::get_green | ( | void | ) | const [inline] |
Definition at line 275 of file icon_pixel.h.
byte_type icon_pixel::get_green_byte | ( | void | ) | const [inline] |
Definition at line 329 of file icon_pixel.h.
short_type icon_pixel::get_green_short | ( | void | ) | const [inline] |
Definition at line 320 of file icon_pixel.h.
icon_pixel::real_type icon_pixel::get_intensity | ( | void | ) | const |
The get_intensity is used to obtain the value of the Y channel (the monochome channel).
Definition at line 136 of file icon_pixel.cc.
real_type icon_pixel::get_red | ( | void | ) | const [inline] |
Definition at line 266 of file icon_pixel.h.
byte_type icon_pixel::get_red_byte | ( | void | ) | const [inline] |
Definition at line 311 of file icon_pixel.h.
short_type icon_pixel::get_red_short | ( | void | ) | const [inline] |
Definition at line 302 of file icon_pixel.h.
icon_pixel icon_pixel::invert | ( | void | ) | const [inline] |
The invert method may be used to create a new ixcon_pixel from this one, where the color channels are inverted. The alpha channel retains the same value.
Definition at line 240 of file icon_pixel.h.
bool icon_pixel::is_opaque | ( | void | ) | const [inline] |
The is_opaque method is used to determine whether or not a pixel is opaque, without incuring any on-demand conversion penalty.
Definition at line 228 of file icon_pixel.h.
bool icon_pixel::is_transparent | ( | void | ) | const [inline] |
The is_transparent method is used to determine whether or not a pixel is transparent, without incuring any on-demand conversion penalty.
Definition at line 216 of file icon_pixel.h.
icon_pixel icon_pixel::monochrome | ( | void | ) | const |
The monochrome method may be used to calculate a monochrime pixel value, based on this pixlel.
Definition at line 146 of file icon_pixel.cc.
bool icon_pixel::operator!= | ( | const icon_pixel & | rhs | ) | const [inline] |
The inequality operator is used to compare two pixel values to see if they represent the different colors.
rhs | The right hand side of the comparison. |
Definition at line 396 of file icon_pixel.h.
icon_pixel icon_pixel::operator* | ( | const icon_pixel & | rhs | ) | const |
The multiply in situ operator.
Definition at line 83 of file icon_pixel.cc.
icon_pixel icon_pixel::operator* | ( | double | rhs | ) | const |
The multiply in situ operator.
Definition at line 126 of file icon_pixel.cc.
void icon_pixel::operator*= | ( | const icon_pixel & | rhs | ) |
The multiply in situ operator.
Definition at line 63 of file icon_pixel.cc.
void icon_pixel::operator*= | ( | double | rhs | ) |
The multiply in situ operator.
Definition at line 93 of file icon_pixel.cc.
icon_pixel& icon_pixel::operator= | ( | const icon_pixel & | arg | ) | [inline] |
The assignment operator.
Definition at line 192 of file icon_pixel.h.
bool icon_pixel::operator== | ( | const icon_pixel & | rhs | ) | const |
The equality operator is used to compare two pixel values to see if they represent the same color.
rhs | The right hand side of the comparison. |
Definition at line 44 of file icon_pixel.cc.
std::string icon_pixel::representation | ( | void | ) | const |
The representation method is used to obtain a representation of this icon_pixel, usually for printing within debug messages.
Definition at line 28 of file icon_pixel.cc.
static short_type icon_pixel::short_from_byte | ( | byte_type | x | ) | [inline, static] |
The short_from_byte class method is used to turn a byte value into a short value.
Definition at line 439 of file icon_pixel.h.
real_type icon_pixel::alpha_real [mutable, private] |
The alpha_real instance variable is used to remember the value of the Red channel, as a floating point number in the range [0.0, 1.0].
Definition at line 489 of file icon_pixel.h.
short_type icon_pixel::alpha_short [mutable, private] |
The alpha_short instance variable is used to remember the value of the Alpha channel, as an integer in the range [0, 65535].
Definition at line 495 of file icon_pixel.h.
const icon_pixel icon_pixel::black [static] |
Definition at line 41 of file icon_pixel.h.
real_type icon_pixel::blue_real [mutable, private] |
The blue_real instance variable is used to remember the value of the Blue channel, as a floating point number in the range [0.0, 1.0].
Definition at line 476 of file icon_pixel.h.
short_type icon_pixel::blue_short [mutable, private] |
The blue_short instance variable is used to remember the value of the Blue channel, as an integer in the range [0, 65535].
Definition at line 482 of file icon_pixel.h.
real_type icon_pixel::green_real [mutable, private] |
The green_real instance variable is used to remember the value of the Green channel, as a floating point number in the range [0.0, 1.0].
Definition at line 463 of file icon_pixel.h.
short_type icon_pixel::green_short [mutable, private] |
The green_short instance variable is used to remember the value of the Green channel, as an integer in the range [0, 65535].
Definition at line 469 of file icon_pixel.h.
bool icon_pixel::real_valid [mutable, private] |
The real_valid instance variable is used to remember whether or not the *_real instance variables are valid.
Definition at line 501 of file icon_pixel.h.
real_type icon_pixel::red_real [mutable, private] |
The red_real instance variable is used to remember the value of the Red channel, as a floating point number in the range [0.0, 1.0].
Definition at line 450 of file icon_pixel.h.
short_type icon_pixel::red_short [mutable, private] |
The red_short instance variable is used to remember the value of the Red channel, as an integer in the range [0, 65535].
Definition at line 456 of file icon_pixel.h.
bool icon_pixel::short_valid [mutable, private] |
The short_valid instance variable is used to remember whether or not the *_short instance variables are valid.
Definition at line 507 of file icon_pixel.h.
const icon_pixel icon_pixel::transparent [static] |
Definition at line 43 of file icon_pixel.h.
const icon_pixel icon_pixel::white [static] |
Definition at line 42 of file icon_pixel.h.