RgbaImage Class Reference

Image class supporting a standard 32-bit Rgba pixel format. More...

#include <RgbaImage.h>

Inheritance diagram for RgbaImage:

Image

List of all members.

Public Member Functions

Constructors
 RgbaImage (unsigned width=640, unsigned height=480)
 RgbaImage (QImage &image)
virtual ~RgbaImage ()
Data Accessors / Mutators
Note:
You can extract a particular pixel via [][]. For example:
RgbaImage image;
image[2][0] = Rgba32(255, 0, 0);
This example sets the pixel in the third row, first column to red.


virtual bool isHDR () const
Rgba32operator[] (unsigned index)
const Rgba32operator[] (unsigned index) const
Rgba32getData ()
const Rgba32getData () const
virtual real_t getLuminance (unsigned row, unsigned col) const
Mutators
virtual void setSize (unsigned width, unsigned height)
 Sets the dimensions of this image, most likely allocating a new underlying buffer and erasing its previous contents.
Miscellaneous
virtual Imageclone () const
virtual void copyData (const Image *image)
 Overwrites this image's data with the given image which is assumed to have the same dimensions as this image (and may have been created from this image by, for example, the clone function).

Protected Member Functions

virtual Rgba32 _getPixelRgba32 (unsigned row, unsigned col) const
virtual RgbaHDR _getPixelRgbaHDR (unsigned row, unsigned col) const
virtual void _setPixel (unsigned row, unsigned col, const Rgba32 &val)
virtual void _setPixel (unsigned row, unsigned col, const RgbaHDR &val)
virtual void _setData (const Rgba32 *data)
virtual void _setData (const RgbaHDR *data)

Protected Attributes

Rgba32m_data
bool m_ownData


Detailed Description

Image class supporting a standard 32-bit Rgba pixel format.

Author:
Travis Fischer (fisch0920@gmail.com)
Date:
January 2008

Definition at line 17 of file RgbaImage.h.


Constructor & Destructor Documentation

RgbaImage::RgbaImage ( unsigned  width = 640,
unsigned  height = 480 
) [inline]

Definition at line 13 of file RgbaImage.inl.

RgbaImage::RgbaImage ( QImage &  image  )  [explicit]

Definition at line 14 of file RgbaImage.cpp.

RgbaImage::~RgbaImage (  )  [virtual]

Definition at line 35 of file RgbaImage.cpp.


Member Function Documentation

bool RgbaImage::isHDR (  )  const [virtual]

Returns:
whether or not the underlying data for this image is stored in a floating-point HDR format
Note:
that some operations will be more of less efficient when performed on an HDR image versus a standard 32-bit Rgba image, and knowing whether or not an image is in HDR format can facilitate efficient usage (cutting down on the number of implicit conversions between HDR and non-HDR pixel formats that must be performed)

returns false for RgbaImage

Implements Image.

Definition at line 40 of file RgbaImage.cpp.

Rgba32 * RgbaImage::operator[] ( unsigned  index  )  [inline]

Returns:
the underlying data in the given row index

Definition at line 19 of file RgbaImage.inl.

const Rgba32 * RgbaImage::operator[] ( unsigned  index  )  const [inline]

Returns:
the underlying data in the given row index

Definition at line 25 of file RgbaImage.inl.

Rgba32 * RgbaImage::getData (  )  [inline]

Returns:
the underlying data in row major order

Definition at line 31 of file RgbaImage.inl.

const Rgba32 * RgbaImage::getData (  )  const [inline]

Returns:
the underlying data in row major order

Definition at line 35 of file RgbaImage.inl.

real_t RgbaImage::getLuminance ( unsigned  row,
unsigned  col 
) const [virtual]

Returns:
the luminance of the pixel at the given row and column which is guaranteed to lie in [0, 1]

Implements Image.

Definition at line 44 of file RgbaImage.cpp.

void RgbaImage::setSize ( unsigned  width,
unsigned  height 
) [virtual]

Sets the dimensions of this image, most likely allocating a new underlying buffer and erasing its previous contents.

Implements Image.

Definition at line 66 of file RgbaImage.cpp.

Image * RgbaImage::clone (  )  const [virtual]

Returns:
a copy of this Image and its underlying data

Implements Image.

Definition at line 97 of file RgbaImage.cpp.

void RgbaImage::copyData ( const Image image  )  [virtual]

Overwrites this image's data with the given image which is assumed to have the same dimensions as this image (and may have been created from this image by, for example, the clone function).

Implements Image.

Definition at line 104 of file RgbaImage.cpp.

Rgba32 RgbaImage::_getPixelRgba32 ( unsigned  row,
unsigned  col 
) const [protected, virtual]

Implements Image.

Definition at line 50 of file RgbaImage.cpp.

RgbaHDR RgbaImage::_getPixelRgbaHDR ( unsigned  row,
unsigned  col 
) const [protected, virtual]

Implements Image.

Definition at line 54 of file RgbaImage.cpp.

void RgbaImage::_setPixel ( unsigned  row,
unsigned  col,
const Rgba32 val 
) [protected, virtual]

Implements Image.

Definition at line 58 of file RgbaImage.cpp.

void RgbaImage::_setPixel ( unsigned  row,
unsigned  col,
const RgbaHDR val 
) [protected, virtual]

Implements Image.

Definition at line 62 of file RgbaImage.cpp.

void RgbaImage::_setData ( const Rgba32 data  )  [protected, virtual]

Implements Image.

Definition at line 81 of file RgbaImage.cpp.

void RgbaImage::_setData ( const RgbaHDR data  )  [protected, virtual]

Implements Image.

Definition at line 88 of file RgbaImage.cpp.


Member Data Documentation

Rgba32* RgbaImage::m_data [protected]

Definition at line 114 of file RgbaImage.h.

bool RgbaImage::m_ownData [protected]

Definition at line 115 of file RgbaImage.h.


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

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6