rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvRGBBitmapData Class Reference

Bitmap data class. More...

#include <ilviews/bitmaps/data.h>

Inheritance diagram for IlvRGBBitmapData:
IlvBitmapData

List of all members.

Public Member Functions

 IlvRGBBitmapData (IlUInt width, IlUInt height)
 Constructor.
void activateChannels (Channel channels)
 Activates the given channels.
void alphaCompose (const IlvRGBBitmapData *src, const IlvRect &srcrect, const IlvPoint &to, IlUChar blend=255)
 Blends from a source bitmap data.
void alphaDivide ()
 Un-alpha-premultiplies the bitmap data.
void alphaMultiply ()
 Alpha-premultiplies the bitmap data.
virtual void blend (const IlvBitmapData *src, const IlvRect &srcrect, const IlvPoint &to, IlUChar blend)
 Blends from a source bitmap data.
virtual void copy (const IlvBitmapData *src, const IlvRect &srcrect, const IlvPoint &to)
 Copies all components from a source bitmap data.
virtual void copyA (const IlvRGBBitmapData *src, const IlvRect &srcrect, const IlvPoint &to)
 Copies the alpha component from a source bitmap data.
virtual void copyRGB (const IlvRGBBitmapData *src, const IlvRect &srcrect, const IlvPoint &to)
 Copies the color component from a source bitmap data.
void deactivateChannels (Channel channels)
 Deactivates the given channels.
void fastCopyPixel (IlUInt xdst, IlUInt ydst, const IlvRGBBitmapData *src, IlUInt xsrc, IlUInt ysrc)
 Copies a pixel from a source bitmap data.
void fastGetARGBPixel (IlUInt x, IlUInt y, IlUChar &a, IlUChar &r, IlUChar &g, IlUChar &b) const
 Returns a true color representation of a pixel located in the image at the x and y coordinates.
void fastGetRGBPixel (IlUInt x, IlUInt y, IlUChar &r, IlUChar &g, IlUChar &b) const
 Returns a true color representation of a pixel located in the image at the x and y coordinates.
void fastSetRGBPixel (IlUInt x, IlUInt y, IlUChar r, IlUChar g, IlUChar b)
 Sets a pixel of the image stored in the instance to the given true color representation.
virtual void fill (const IlvRect &rect, IlUChar r, IlUChar g, IlUChar b, IlUChar alpha=255)
 Fills the bitmap data with a given color.
void fillAlpha (const IlvRect &rect, IlUChar alpha)
 Fills the alpha channel of a given region.
Channel getActiveChannels () const
 Returns the active channels.
IlUChar getAlpha (IlUInt x, IlUInt y) const
 returns the alpha value of a given pixel.
virtual void getRGBPixel (IlUInt x, IlUInt y, IlUChar &r, IlUChar &g, IlUChar &b) const
 Returns a true color representation of a pixel located in the image at the x and y coordinates.
virtual IlUChargetRGBPixels (const IlvRect &rect, IlUInt &size, IlUChar *data=0) const
 Returns a true color representation of a region of the image stored in the instance.
virtual IlUInt getUsedColorNum ()
 Returns the number of referenced colors in the bitmap data.
IlBoolean isAlphaPremultiplied () const
 Return whether the image is alpha-premultiplied.
void setAlpha (IlUInt x, IlUInt y, IlUChar alpha)
 Sets the alpha component of a given pixel.
void setAlphaPremultiplied (IlBoolean)
 Forces the premultiplied state of the bitmap data.
virtual void setRGBPixel (IlUInt x, IlUInt y, IlUChar r, IlUChar g, IlUChar b)
 Sets a pixel of the image stored in the instance to the given true color representation.
virtual void setRGBPixels (IlUChar *data, IlUInt byteWidth, const IlvRect &rect, const IlvPoint &to)
 Sets a region of the image stored in the instance to the given true color representation.
void stretch (const IlvBitmapData *srcdata, const IlvRect &srcrect, const IlvRect &dstrect)
 Stretches an image.
void stretchSmooth (const IlvBitmapData *srcdata, const IlvRect &srcrect, const IlvRect &dstrect, IlvResampleFilter filter=IlvMitchellFilter, IlvResampleFunction func=0, IlFloat support=0)
 Stretches an image using resampling.
void tile (IlvBitmapData *src, const IlvPoint &offset)
 Tiles an image.
void tileCompose (IlvRGBBitmapData *src, const IlvPoint &offset, IlUChar blend=255)
 Tiles an image.

Detailed Description

Bitmap data class.

Library: display

The IlvRGBBitmapData class lets you manipulate true color images. Each pixel in an RGB image is stored using 4 bytes, one for each color component.

See also:
IlvIndexedBitmapData, IlvBWBitmapData

Constructor & Destructor Documentation

IlvRGBBitmapData::IlvRGBBitmapData ( IlUInt  width,
IlUInt  height 
)

Constructor.

Initializes a new IlvRGBBitmapData object.

Parameters:
width The width of the bitmap data.
height The height of the bitmap data.

Member Function Documentation

void IlvRGBBitmapData::activateChannels ( Channel  channels  ) 

Activates the given channels.

Parameters:
channels The channels to activate.
void IlvRGBBitmapData::alphaCompose ( const IlvRGBBitmapData src,
const IlvRect srcrect,
const IlvPoint to,
IlUChar  blend = 255 
)

Blends from a source bitmap data.

This method does make use of the alpha components of the source.

Parameters:
src The source bitmap data.
srcrect The source rectangle.
to The destination position.
blend The blend factor.
virtual void IlvRGBBitmapData::blend ( const IlvBitmapData src,
const IlvRect srcrect,
const IlvPoint to,
IlUChar  blend 
) [virtual]

Blends from a source bitmap data.

This method does not use the alpha components of the source.

Parameters:
src The source bitmap data.
srcrect The source rectangle.
to The destination position.
blend The blend factor.

Reimplemented from IlvBitmapData.

virtual void IlvRGBBitmapData::copy ( const IlvBitmapData src,
const IlvRect srcrect,
const IlvPoint to 
) [virtual]

Copies all components from a source bitmap data.

Parameters:
src The source bitmap data.
srcrect The source rectangle.
to The destination position.

Reimplemented from IlvBitmapData.

virtual void IlvRGBBitmapData::copyA ( const IlvRGBBitmapData src,
const IlvRect srcrect,
const IlvPoint to 
) [virtual]

Copies the alpha component from a source bitmap data.

Parameters:
src The source bitmap data.
srcrect The source rectangle.
to The destination position.
virtual void IlvRGBBitmapData::copyRGB ( const IlvRGBBitmapData src,
const IlvRect srcrect,
const IlvPoint to 
) [virtual]

Copies the color component from a source bitmap data.

Parameters:
src The source bitmap data.
srcrect The source rectangle.
to The destination position.
void IlvRGBBitmapData::deactivateChannels ( Channel  channels  ) 

Deactivates the given channels.

Parameters:
channels The channels to deactivate.
void IlvRGBBitmapData::fastCopyPixel ( IlUInt  xdst,
IlUInt  ydst,
const IlvRGBBitmapData src,
IlUInt  xsrc,
IlUInt  ysrc 
)

Copies a pixel from a source bitmap data.

Parameters:
xdst The destination x coordinate.
ydst The destination y coordinate.
src The source bitmap data.
xsrc The source x coordinate.
ysrc The source y coordinate.
void IlvRGBBitmapData::fastGetARGBPixel ( IlUInt  x,
IlUInt  y,
IlUChar a,
IlUChar r,
IlUChar g,
IlUChar b 
) const

Returns a true color representation of a pixel located in the image at the x and y coordinates.

This method is optimized for speed.

Parameters:
x The x coordinate of the pixel.
y The y coordinate of the pixel.
a The alpha component of the pixel.
g The green component of the pixel.
g The green component of the pixel.
b The blue component of the pixel.
void IlvRGBBitmapData::fastGetRGBPixel ( IlUInt  x,
IlUInt  y,
IlUChar r,
IlUChar g,
IlUChar b 
) const

Returns a true color representation of a pixel located in the image at the x and y coordinates.

This method is optimized for speed.

Parameters:
x The x coordinate of the pixel.
y The y coordinate of the pixel.
r The red component of the pixel.
g The green component of the pixel.
b The blue component of the pixel.
void IlvRGBBitmapData::fastSetRGBPixel ( IlUInt  x,
IlUInt  y,
IlUChar  r,
IlUChar  g,
IlUChar  b 
)

Sets a pixel of the image stored in the instance to the given true color representation.

This method is optimized for speed.

Parameters:
x The x position of the pixel.
y The y position of the pixel.
r The red component of the pixel.
g The green component of the pixel.
b The blue component of the pixel.
virtual void IlvRGBBitmapData::fill ( const IlvRect rect,
IlUChar  r,
IlUChar  g,
IlUChar  b,
IlUChar  alpha = 255 
) [virtual]

Fills the bitmap data with a given color.

Parameters:
rect The region to fill.
r The red component of the color.
g The green component of the color.
b The blue component of the color.
a The alpha component of the color.

Reimplemented from IlvBitmapData.

void IlvRGBBitmapData::fillAlpha ( const IlvRect rect,
IlUChar  alpha 
)

Fills the alpha channel of a given region.

Parameters:
rect The region to fill.
alpha The alpha value to use.
Channel IlvRGBBitmapData::getActiveChannels (  )  const

Returns the active channels.

Returns:
The active channels.
IlUChar IlvRGBBitmapData::getAlpha ( IlUInt  x,
IlUInt  y 
) const

returns the alpha value of a given pixel.

Parameters:
x The x coordinate of the pixel.
y The y coordinate of the pixel.
Returns:
The alpha value of the given pixel.
virtual void IlvRGBBitmapData::getRGBPixel ( IlUInt  x,
IlUInt  y,
IlUChar r,
IlUChar g,
IlUChar b 
) const [virtual]

Returns a true color representation of a pixel located in the image at the x and y coordinates.

Parameters:
x The x coordinate of the pixel.
y The y coordinate of the pixel.
r The red component of the pixel.
g The green component of the pixel.
b The blue component of the pixel.

Implements IlvBitmapData.

virtual IlUChar* IlvRGBBitmapData::getRGBPixels ( const IlvRect rect,
IlUInt size,
IlUChar data = 0 
) const [virtual]

Returns a true color representation of a region of the image stored in the instance.

Each pixel uses 4 bytes of storage; the first byte is not used, the second byte represents the red component of the pixel color, the third byte represents the green component of the pixel color, and the fourth byte represents the blue component of the pixel color. The array of memory returned has size bytes. If the data parameter is given, this method does not allocate memory and writes the data to data. The array must be deleted by the application.

Parameters:
rect The region of the image.
size The size of the returned data.
data The preallocated data.
Returns:
The pointer to the data.

Reimplemented from IlvBitmapData.

virtual IlUInt IlvRGBBitmapData::getUsedColorNum (  )  [virtual]

Returns the number of referenced colors in the bitmap data.

Returns:
The number of colors used in the bitmap data.

Implements IlvBitmapData.

IlBoolean IlvRGBBitmapData::isAlphaPremultiplied (  )  const

Return whether the image is alpha-premultiplied.

Returns:
IlTrue if the image is alpha-premultiplied.
void IlvRGBBitmapData::setAlpha ( IlUInt  x,
IlUInt  y,
IlUChar  alpha 
)

Sets the alpha component of a given pixel.

Parameters:
x The x coordinate of the pixel.
y The y coordinate of the pixel.
alpha The new alpha value of the pixel.
virtual void IlvRGBBitmapData::setRGBPixel ( IlUInt  x,
IlUInt  y,
IlUChar  r,
IlUChar  g,
IlUChar  b 
) [virtual]

Sets a pixel of the image stored in the instance to the given true color representation.

Parameters:
x The x position of the pixel.
y The y position of the pixel.
r The red component of the pixel.
g The green component of the pixel.
b The blue component of the pixel.

Implements IlvBitmapData.

virtual void IlvRGBBitmapData::setRGBPixels ( IlUChar data,
IlUInt  byteWidth,
const IlvRect rect,
const IlvPoint to 
) [virtual]

Sets a region of the image stored in the instance to the given true color representation.

The format of the data is the same as the one returned by getRGBPixels.

Parameters:
data The true color representation of the source pixels.
byteWidth The width in bytes of the source.
rect The region of the source data.
to The position in the destination image

Reimplemented from IlvBitmapData.

void IlvRGBBitmapData::stretch ( const IlvBitmapData srcdata,
const IlvRect srcrect,
const IlvRect dstrect 
)

Stretches an image.

Parameters:
srcdata The bitmap data to stretch.
srcrect The source rectangle in the source bitmap data.
dstrect The destination rectangle in the destination bitmap data.
void IlvRGBBitmapData::stretchSmooth ( const IlvBitmapData srcdata,
const IlvRect srcrect,
const IlvRect dstrect,
IlvResampleFilter  filter = IlvMitchellFilter,
IlvResampleFunction  func = 0,
IlFloat  support = 0 
)

Stretches an image using resampling.

Parameters:
srcdata The bitmap data to stretch.
srcrect The source rectangle in the source bitmap data.
dstrect The destination rectangle in the destination bitmap data.
filter The resampling filter to use.
func The resampling function.
support The resampling function width.
void IlvRGBBitmapData::tile ( IlvBitmapData src,
const IlvPoint offset 
)

Tiles an image.

This method does not use the alpha channel of the source.

Parameters:
src The bitmap data to tile.
offset The offset.
void IlvRGBBitmapData::tileCompose ( IlvRGBBitmapData src,
const IlvPoint offset,
IlUChar  blend = 255 
)

Tiles an image.

This method uses the alpha channel of the source.

Parameters:
src The bitmap data to tile.
offset The offset.
blend The blend factor.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.