Public Member Functions | Static Public Member Functions | Private Attributes
puma2::ColorImageRGBa8 Class Reference

Imageclass for an 8-bit, 4 channel RGBA color image. More...

#include <ColorImageRGBa8.h>

Inheritance diagram for puma2::ColorImageRGBa8:
Inheritance graph
[legend]

List of all members.

Public Member Functions

MultiElementImage< byte, 4 > & asMultiElementImage ()
void assign (int i, int j, int n, int v)
 ColorImageRGBa8 (int x=0, int y=0)
 ColorImageRGBa8 (int x, int y, ColorImageRGBa8 *m, int xo, int yo)
double getElementTypeMaximum () const
double getElementTypeMinimum () const
void readFromFile (const char *fileName)
void writeToFile (const char *fileName) const

Static Public Member Functions

static int numberOfChannels ()

Private Attributes

MultiElementImage< byte, 4 > alt

Detailed Description

Imageclass for an 8-bit, 4 channel RGBA color image.

This class superseeds ColorImageRGB in two aspects: It internally uses a data structure to store all samples of a pixel, which allows for the efficient assignment of entire pixels in a single statement, and it adds an alpha channel, containing transparency information for each pixel. In fact, the alpha value stores not the 'transparency' but the 'opacity' of a pixel (which is just the inverse). That is, alpha = 0 (better: alpha = getValueRangeMinimum()) means least opacity (== full transparency), while alpha = getValueRangeMaximum() denotes maximum opacity (== totally intransparent, as it would be considered for an image without alpha channel). Alpha values are considered to be in the range of 0.0 .. 1.0 (represented as 0 .. 255 in ColorImageRGBa8). $\alpha = 0.5$ then represents a 50% opaqe pixel. For any pixel p in the image with some alpha value $\alpha$, which is to be rendered above some background color b, the resulting color c is computed as $c = \alpha\cdot p + (1-\alpha)\cdot b$ Alpha channels can be stored with some common image file formats, notably PNG and TIFF, but not with e.g. PPM/PGM or JPEG.

Definition at line 63 of file ColorImageRGBa8.h.


Constructor & Destructor Documentation

ColorImageRGBa8::ColorImageRGBa8 ( int  x = 0,
int  y = 0 
)

Definition at line 7 of file ColorImageRGBa8.cpp.

ColorImageRGBa8::ColorImageRGBa8 ( int  x,
int  y,
ColorImageRGBa8 m,
int  xo,
int  yo 
)

Definition at line 11 of file ColorImageRGBa8.cpp.


Member Function Documentation

Definition at line 22 of file ColorImageRGBa8.cpp.

void ColorImageRGBa8::assign ( int  i,
int  j,
int  n,
int  v 
)

Set a single value

Parameters:
[in]iLine
[in]jRow
[in]nChannel
[in]vValue

Definition at line 16 of file ColorImageRGBa8.cpp.

double puma2::ColorImageRGBa8::getElementTypeMaximum ( ) const [inline, virtual]

see Image::getElementTypeMaximum()

Reimplemented from puma2::TBaseImg< RGBa8 >.

Definition at line 89 of file ColorImageRGBa8.h.

double puma2::ColorImageRGBa8::getElementTypeMinimum ( ) const [inline, virtual]

see Image::getElementTypeMinimum()

Reimplemented from puma2::TBaseImg< RGBa8 >.

Definition at line 86 of file ColorImageRGBa8.h.

Reimplemented from puma2::SingleElementImage< RGBa8 >.

Definition at line 26 of file ColorImageRGBa8.cpp.

void ColorImageRGBa8::readFromFile ( const char *  fileName)

see Image::readFromFile()

Reimplemented from puma2::TBaseImg< RGBa8 >.

Definition at line 30 of file ColorImageRGBa8.cpp.

void ColorImageRGBa8::writeToFile ( const char *  fileName) const

see Image::writeToFile()

Reimplemented from puma2::TBaseImg< RGBa8 >.

Definition at line 35 of file ColorImageRGBa8.cpp.


Member Data Documentation

TEST - ONE DESIGN OPTION: The image pointer alt will be initialized using the sub-image constructor. Using a hard type conversion cast we will cheat and this image will not allocate memory itself. Instead, it will reuse the memory allocated for the matrix in the base class SingleElementImage.

(validity of casts could be checked by a singleton upon initialization of the program)

Definition at line 108 of file ColorImageRGBa8.h.


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


obj_rec_gui
Author(s): AGAS/agas@uni-koblenz.de
autogenerated on Mon Oct 6 2014 02:53:43