Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

VizKit::VisualImage Class Reference

#include <VisualImage.h>

Inherits VizKit::VisualObject.

Collaboration diagram for VizKit::VisualImage:
Collaboration graph
[legend]

List of all members.

Classes

struct  VisualImageHistogramPixelColors

Public Member Functions

 VisualImage ()
 ~VisualImage ()
 VisualImage (const VisualImage &other)
VisualImageoperator= (const VisualImage &other)
virtual VisualImageclone (void) const
VisualImagecloneIndependently (void) const
bool initWithFile (VisualFile &aFile)
bool initWithARGBPixelData (PixelColor *argbPixels, uint32 width, uint32 height)
bool initWithEncodedData (const char *const bufferData, size_t size)
bool initWithStyledString (VisualStyledString &styledString)
bool initWithURL (VisualString &anURL, VisualItemIdentifier &anId)
bool initWithLoadedEncodedData (void)
bool initWithFramebuffer (const BottomLeftPositionedPixelRect &clipRect)
bool writeToPNGFile (VisualFile &aVisualFile) const
void writeToPNGFileAsync (VisualFile &aVisualFile)
void writeToPNGFileAsyncAndDelete (VisualFile &aVisualFile)
void applyConvolutionFilter (const VisualConvolutionFilter &aConvolutionFilter)
uint32 getWidth (void) const
uint32 getHeight (void) const
double getLogicalWidth (void) const
double getLogicalHeight (void) const
void draw (const VertexChain *const aVertexChain, bool debug=false)
bool isEmpty (void) const
BlendMode getBlendMode (void) const
void setBlendMode (BlendMode aBlendMode)
void resample (const PixelRect &pixelRect)
VisualTextureContainergetTextureContainer (void) const
virtual void dataLoadDidEnd (const VisualItemIdentifier &identifier)
void createHistogram (void)
VisualHistogram::PixelColorHistogramgetHistogram (void)

Static Public Member Functions

static VisualImagecreateWithFile (VisualFile &aFile)
static VisualImagecreateWithARGBPixelData (PixelColor *argbPixels, uint32 width, uint32 height)
static VisualImagecreateWithEncodedData (const char *const bufferData, uint32 size)
static VisualImagecreateWithStyledString (VisualStyledString &styledString)
static VisualImagecreateWithURL (VisualString &anURL, VisualItemIdentifier &anId)
static VisualImagecreateWithFramebuffer (const BottomLeftPositionedPixelRect &clipRect)

Private Member Functions

void copy (const VisualImage &other)
void getRGBHistogramInputPixels (std::vector< PixelColor > &inputValues) const

Private Attributes

VisualTextureContainervisualTextureContainer
bool isSet
BlendMode blendMode
VisualHistogram::PixelColorHistogramhistogram

Detailed Description

Bitmap raster image.


Constructor & Destructor Documentation

VisualImage::VisualImage (  ) 

The constructor.

VisualImage::~VisualImage (  ) 

The destructor.

VisualImage::VisualImage ( const VisualImage other  ) 

Copy constructor.

Parameters:
other Reference to another VisualImage.

Member Function Documentation

void VisualImage::applyConvolutionFilter ( const VisualConvolutionFilter aConvolutionFilter  ) 

Applies a convolution filter to the image.

Parameters:
aConvolutionFilter The convolution filter to apply to the image.
VisualImage * VisualImage::clone ( void   )  const [virtual]

Copies the current VisualImage and returns a pointer to a new VisualImage.

Remarks:
Cloning the image returns an image pointing to the same framebuffer data. To create an independent image, use createIndependentCopy().

Implements VizKit::VisualObject.

VisualImage * VisualImage::cloneIndependently ( void   )  const

Creates an independent copy of the image.

Remarks:
The image copy is independent of the original image. Cloning the image returns an image pointing to the same framebuffer data.
void VisualImage::copy ( const VisualImage other  )  [private]

Copy method for assignment operator and copy constructor.

Parameters:
other Another VisualImage.
void VisualImage::createHistogram ( void   ) 

Creates a histogram of RGB pixel color values. A histogram contains the salient color values of the image.

Remarks:
The histogram is created asynchronously. On finish, a notification is sent (kImageHistogramCompletedMsg) on which actors can be registered. The image is downsampled and the histogram is calculated with the k-means algorithm.
VisualImage * VisualImage::createWithARGBPixelData ( PixelColor argbPixels,
uint32  width,
uint32  height 
) [static]

Creates an image with a buffer of ARGB pixel data.

Parameters:
argbPixels Pointer to ARGB pixel data.
width The width of the pixel data.
height The height of the pixel data.
Returns:
Initialized instance of VisualImage. NULL in case of failure.
Remarks:
The caller has to release (delete) the allocated memory. No reference to the pixel data is stored, pixel data can be savely disposed after the call.
VisualImage * VisualImage::createWithEncodedData ( const char *const   bufferData,
uint32  size 
) [static]

Creates an image with a data pointer to encoded image data.

Parameters:
bufferData A pointer to the data.
size The size of the data pointed to in bytes.
Returns:
Initialized instance of VisualImage. NULL in case of failure.
Remarks:
The caller has to release (delete) the initialized image.
VisualImage * VisualImage::createWithFile ( VisualFile aFile  )  [static]

Creates an image with a file.

Parameters:
aFile Reference to a file.
Returns:
Initialized instance of VisualImage. NULL in case of failure.
Remarks:
The caller has to release (delete) the allocated memory.
VisualImage * VisualImage::createWithFramebuffer ( const BottomLeftPositionedPixelRect clipRect  )  [static]

Creates an image with contents of the current screen (framebuffer).

Parameters:
clipRect The dimensions and position of the clip rect.
Remarks:
The caller has to release (delete) the allocated memory.
VisualImage * VisualImage::createWithStyledString ( VisualStyledString styledString  )  [static]

Creates an image with a styled string.

Parameters:
styledString The styled string to convert into bitmap image.
Returns:
Initialized instance of VisualImage. NULL in case of failure.
Remarks:
The caller has to release (delete) the allocated memory.
VisualImage * VisualImage::createWithURL ( VisualString anURL,
VisualItemIdentifier anId 
) [static]

Creates an image with an URL.

Parameters:
anURL URL of the image.
anId Identifier that can be queried to track the progress of this asynchronous creation.
Returns:
Initialized instance of VisualImage.
Remarks:
The caller has to release (delete) the allocated memory.
void VisualImage::dataLoadDidEnd ( const VisualItemIdentifier identifier  )  [virtual]

Notification that the loading of data ended.

Parameters:
identifier The identifier of the data load request.

Reimplemented from VizKit::VisualObject.

void VisualImage::draw ( const VertexChain *const   aVertexChain,
bool  debug = false 
)

Draws the image.

Parameters:
aVertexChain The chain of vertices with which the image is drawn.
debug If true, details of the drawing operation can be traced for diagnostical purposes.
BlendMode VisualImage::getBlendMode ( void   )  const

Returns the blend mode of the image.

Returns:
The blend mode of the image.
uint32 VisualImage::getHeight ( void   )  const

Returns the height of the bitmap image (in pixels).

Returns:
The height of the bitmap image (in pixels).
VisualHistogram::PixelColorHistogram * VisualImage::getHistogram ( void   ) 

Returns the internal histogram.

Returns:
The histogram. Can be NULL in case no histogram has been set.
double VisualImage::getLogicalHeight ( void   )  const

Returns the logical height of the texture.

Returns:
The logical height of the texture.
double VisualImage::getLogicalWidth ( void   )  const

Returns the logical width of the texture.

Returns:
The logical width of the texture.
void VisualImage::getRGBHistogramInputPixels ( std::vector< PixelColor > &  inputValues  )  const [private]

Returns the array of RGB color pixels as required to create a histogram.

Parameters:
[out] inputValues The pixels that can be used as input for histogram creation.
VisualTextureContainer * VisualImage::getTextureContainer ( void   )  const

Returns a pointer to the texture container of the image.

Returns:
A pointer to the texture container of the image.
uint32 VisualImage::getWidth ( void   )  const

Returns the width of the bitmap image (in pixels).

Returns:
The width of the bitmap image (in pixels).
bool VisualImage::initWithARGBPixelData ( PixelColor argbPixels,
uint32  width,
uint32  height 
)

Initializes the image with a buffer of ARGB pixel data.

Parameters:
argbPixels Pointer to ARGB pixel data.
width The width of the pixel data.
height The height of the pixel data.
Returns:
True on succes, false on failure.
Remarks:
No reference to the pixel data is stored, pixel data can be savely disposed after the call.
bool VisualImage::initWithEncodedData ( const char *const   bufferData,
size_t  size 
)

Initializes the image with a data pointer to encoded image data.

Parameters:
bufferData A pointer to the data.
size The size of the data pointed to in bytes.
Returns:
True on success, false on failure.
bool VisualImage::initWithFile ( VisualFile aFile  ) 

Initializes the image with a file.

Parameters:
aFile Reference to a file.
Returns:
True on success, false on failure.
bool VisualImage::initWithFramebuffer ( const BottomLeftPositionedPixelRect clipRect  ) 

Initializes the image with contents of the current screen (framebuffer).

Parameters:
clipRect The dimensions and position of the clip rect.
Returns:
True on success, false on failure.
bool VisualImage::initWithLoadedEncodedData ( void   ) 

Initializes the image with loaded encoded image data.

Returns:
True on success, false on failure.
bool VisualImage::initWithStyledString ( VisualStyledString styledString  ) 

Initializes the image with a styled string.

Parameters:
styledString The styled string to convert into bitmap image.
Returns:
True on success, false on failure
bool VisualImage::initWithURL ( VisualString anURL,
VisualItemIdentifier anId 
)

Initializes the image with an URL.

Parameters:
anURL URL of the image.
anId Identifier that can be queried to track the progress of this asynchronous initialization.
Returns:
True on success, false on failure.
bool VisualImage::isEmpty ( void   )  const

Answers the question whether the image is empty or set.

VisualImage & VisualImage::operator= ( const VisualImage other  ) 

Assignment operator.

Parameters:
other Reference to another VisualImage.
void VisualImage::resample ( const PixelRect pixelRect  ) 

Resamples the pixel data of the texture to the given dimensions of the pixelRect.

Parameters:
pixelRect The resampling dimensions.
void VisualImage::setBlendMode ( BlendMode  aBlendMode  ) 

Sets the blend mode of the image.

Parameters:
aBlendMode The blend mode of the image.
bool VisualImage::writeToPNGFile ( VisualFile aVisualFile  )  const

Writes the image as PNG encoded data to a file on disk.

Parameters:
aVisualFile Access to file the image is to be written into.
Returns:
True on success, false on failure.
void VisualImage::writeToPNGFileAsync ( VisualFile aVisualFile  ) 

Writes the image as PNG encoded data to a file on disk asynchronously.

Parameters:
aVisualFile Access to file the image is to be written into.
void VisualImage::writeToPNGFileAsyncAndDelete ( VisualFile aVisualFile  ) 

Writes the image as PNG encoded data to a file on disk asynchronously and deletes the VisualImage afterwards.

Parameters:
aVisualFile Access to file the image is to be written into.

Member Data Documentation

The blend mode of the image.

Creates a histogram of RGB pixel color values.

Parameters:
visualImageHistogramPixelColors Pixel color values and pointer to image. Histogram.

True if image has been set. False if image is not valid or has not been set yet.

Pointer to the VisualTextureContainer.


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

Generated on Sun Sep 26 2010 13:29:36 for VizKit by doxygen 1.7.1