Rogue Wave Views
Foundation Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions
IlvRGBBitmapData Class Reference

Bitmap data class. More...

#include <ilviews/bitmaps/data.h>

Inheritance diagram for IlvRGBBitmapData:
IlvBitmapData

Public Member Functions

 IlvRGBBitmapData (IlUInt width, IlUInt height)
 Constructor. More...
 
void activateChannels (Channel channels)
 Activates the given channels. More...
 
void alphaCompose (const IlvRGBBitmapData *src, const IlvRect &srcrect, const IlvPoint &to, IlUChar blend=255)
 Blends from a source bitmap data. More...
 
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. More...
 
virtual void copy (const IlvBitmapData *src, const IlvRect &srcrect, const IlvPoint &to)
 Copies all components from a source bitmap data. More...
 
virtual void copyA (const IlvRGBBitmapData *src, const IlvRect &srcrect, const IlvPoint &to)
 Copies the alpha component from a source bitmap data. More...
 
virtual void copyRGB (const IlvRGBBitmapData *src, const IlvRect &srcrect, const IlvPoint &to)
 Copies the color component from a source bitmap data. More...
 
void deactivateChannels (Channel channels)
 Deactivates the given channels. More...
 
void fastCopyPixel (IlUInt xdst, IlUInt ydst, const IlvRGBBitmapData *src, IlUInt xsrc, IlUInt ysrc)
 Copies a pixel from a source bitmap data. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual void fill (const IlvRect &rect, IlUChar r, IlUChar g, IlUChar b, IlUChar a=255)
 Fills the bitmap data with a given color. More...
 
void fillAlpha (const IlvRect &rect, IlUChar alpha)
 Fills the alpha channel of a given region. More...
 
Channel getActiveChannels () const
 Returns the active channels. More...
 
IlUChar getAlpha (IlUInt x, IlUInt y) const
 returns the alpha value of a given pixel. More...
 
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. More...
 
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. More...
 
virtual IlUInt getUsedColorNum ()
 Returns the number of referenced colors in the bitmap data. More...
 
IlBoolean isAlphaPremultiplied () const
 Return whether the image is alpha-premultiplied. More...
 
void setAlpha (IlUInt x, IlUInt y, IlUChar alpha)
 Sets the alpha component of a given pixel. More...
 
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. More...
 
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. More...
 
void stretch (const IlvBitmapData *srcdata, const IlvRect &srcrect, const IlvRect &dstrect)
 Stretches an image. More...
 
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. More...
 
void tile (IlvBitmapData *src, const IlvPoint &offset)
 Tiles an image. More...
 
void tileCompose (IlvRGBBitmapData *src, const IlvPoint &offset, IlUChar blend=255)
 Tiles an image. More...
 
- Public Member Functions inherited from IlvBitmapData
 IlvBitmapData (IlUInt width, IlUInt height, IlUShort depth, IlUInt padding=32)
 Constructor. More...
 
virtual ~IlvBitmapData ()
 Destructor. More...
 
virtual void blendPixel (IlUInt xdst, IlUInt ydst, const IlvBitmapData *src, IlUInt xsrc, IlUInt ysrc, IlUChar blend)
 Blends a pixel from another bitmap data to the given position. More...
 
virtual void copyPixel (IlUInt xdst, IlUInt ydst, const IlvBitmapData *src, IlUInt xsrc, IlUInt ysrc)
 Copies a pixel from another bitmap data. More...
 
IlUInt getByteWidth () const
 Returns the size in bytes of a row of the image stored in the instance. More...
 
IlUInt getCount () const
 Returns the reference count for this instance.
 
IlUChargetData () const
 Returns a pointer to the internal storage memory of the instance. More...
 
IlUShort getDepth () const
 Returns the number of bits needed to describe a pixel of the image stored in the instance. More...
 
IlUInt getHeight () const
 Returns the height in pixels of the image stored in the instance. More...
 
IlvBitmapInformationgetInformation () const
 Returns the bitmap information. More...
 
virtual IlvBWBitmapDatagetMask () const
 Returns the mask bitmap data of the instance. More...
 
IlUInt getPadding () const
 Returns the padding used by the instance. More...
 
IlUChargetRowStartData (IlUInt idx) const
 Returns a pointer to the storage memory of a given row of the image in the instance. More...
 
IlUInt getWidth () const
 Returns the width in pixels of the image stored in the instance. More...
 
IlBoolean hasMask () const
 Returns whether the instance has a mask. More...
 
void lock ()
 Locks the current instance.
 
void setInformation (IlvBitmapInformation *info)
 Sets the bitmap information. More...
 
virtual void setMask (IlvBWBitmapData *mask)
 Sets the mask of the current instance. More...
 
void unLock ()
 Unlocks the current instance.
 

Detailed Description

Bitmap data class.

Library: xviews or winviews or mviews (mutually exclusive)

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::IlvRGBBitmapData ( IlUInt  width,
IlUInt  height 
)

Constructor.

Initializes a new IlvRGBBitmapData object.

Parameters
widthThe width of the bitmap data.
heightThe height of the bitmap data.

Member Function Documentation

§ activateChannels()

void IlvRGBBitmapData::activateChannels ( Channel  channels)

Activates the given channels.

Parameters
channelsThe channels to activate.

§ alphaCompose()

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
srcThe source bitmap data.
srcrectThe source rectangle.
toThe destination position.
blendThe blend factor.

§ blend()

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
srcThe source bitmap data.
srcrectThe source rectangle.
toThe destination position.
blendThe blend factor.

Reimplemented from IlvBitmapData.

§ copy()

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

Copies all components from a source bitmap data.

Parameters
srcThe source bitmap data.
srcrectThe source rectangle.
toThe destination position.

Reimplemented from IlvBitmapData.

§ copyA()

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

Copies the alpha component from a source bitmap data.

Parameters
srcThe source bitmap data.
srcrectThe source rectangle.
toThe destination position.

§ copyRGB()

virtual void IlvRGBBitmapData::copyRGB ( const IlvRGBBitmapData src,
const IlvRect srcrect,
const IlvPoint to 
)
virtual

Copies the color component from a source bitmap data.

Parameters
srcThe source bitmap data.
srcrectThe source rectangle.
toThe destination position.

§ deactivateChannels()

void IlvRGBBitmapData::deactivateChannels ( Channel  channels)

Deactivates the given channels.

Parameters
channelsThe channels to deactivate.

§ fastCopyPixel()

void IlvRGBBitmapData::fastCopyPixel ( IlUInt  xdst,
IlUInt  ydst,
const IlvRGBBitmapData src,
IlUInt  xsrc,
IlUInt  ysrc 
)

Copies a pixel from a source bitmap data.

Parameters
xdstThe destination x coordinate.
ydstThe destination y coordinate.
srcThe source bitmap data.
xsrcThe source x coordinate.
ysrcThe source y coordinate.

§ fastGetARGBPixel()

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
xThe x coordinate of the pixel.
yThe y coordinate of the pixel.
aThe alpha component of the pixel.
rThe red component of the pixel.
gThe green component of the pixel.
bThe blue component of the pixel.

§ fastGetRGBPixel()

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
xThe x coordinate of the pixel.
yThe y coordinate of the pixel.
rThe red component of the pixel.
gThe green component of the pixel.
bThe blue component of the pixel.

§ fastSetRGBPixel()

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
xThe x position of the pixel.
yThe y position of the pixel.
rThe red component of the pixel.
gThe green component of the pixel.
bThe blue component of the pixel.

§ fill()

virtual void IlvRGBBitmapData::fill ( const IlvRect rect,
IlUChar  r,
IlUChar  g,
IlUChar  b,
IlUChar  a = 255 
)
virtual

Fills the bitmap data with a given color.

Parameters
rectThe region to fill.
rThe red component of the color.
gThe green component of the color.
bThe blue component of the color.
aThe alpha component of the color.

Reimplemented from IlvBitmapData.

§ fillAlpha()

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

Fills the alpha channel of a given region.

Parameters
rectThe region to fill.
alphaThe alpha value to use.

§ getActiveChannels()

Channel IlvRGBBitmapData::getActiveChannels ( ) const

Returns the active channels.

Returns
The active channels.

§ getAlpha()

IlUChar IlvRGBBitmapData::getAlpha ( IlUInt  x,
IlUInt  y 
) const

returns the alpha value of a given pixel.

Parameters
xThe x coordinate of the pixel.
yThe y coordinate of the pixel.
Returns
The alpha value of the given pixel.

§ getRGBPixel()

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
xThe x coordinate of the pixel.
yThe y coordinate of the pixel.
rThe red component of the pixel.
gThe green component of the pixel.
bThe blue component of the pixel.

Implements IlvBitmapData.

§ getRGBPixels()

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
rectThe region of the image.
sizeThe size of the returned data.
dataThe preallocated data.
Returns
The pointer to the data.

Reimplemented from IlvBitmapData.

§ getUsedColorNum()

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.

§ isAlphaPremultiplied()

IlBoolean IlvRGBBitmapData::isAlphaPremultiplied ( ) const

Return whether the image is alpha-premultiplied.

Returns
IlTrue if the image is alpha-premultiplied.

§ setAlpha()

void IlvRGBBitmapData::setAlpha ( IlUInt  x,
IlUInt  y,
IlUChar  alpha 
)

Sets the alpha component of a given pixel.

Parameters
xThe x coordinate of the pixel.
yThe y coordinate of the pixel.
alphaThe new alpha value of the pixel.

§ setRGBPixel()

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
xThe x position of the pixel.
yThe y position of the pixel.
rThe red component of the pixel.
gThe green component of the pixel.
bThe blue component of the pixel.

Implements IlvBitmapData.

§ setRGBPixels()

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
dataThe true color representation of the source pixels.
byteWidthThe width in bytes of the source.
rectThe region of the source data.
toThe position in the destination image

Reimplemented from IlvBitmapData.

§ stretch()

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

Stretches an image.

Parameters
srcdataThe bitmap data to stretch.
srcrectThe source rectangle in the source bitmap data.
dstrectThe destination rectangle in the destination bitmap data.

§ stretchSmooth()

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
srcdataThe bitmap data to stretch.
srcrectThe source rectangle in the source bitmap data.
dstrectThe destination rectangle in the destination bitmap data.
filterThe resampling filter to use.
funcThe resampling function.
supportThe resampling function width.

§ tile()

void IlvRGBBitmapData::tile ( IlvBitmapData src,
const IlvPoint offset 
)

Tiles an image.

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

Parameters
srcThe bitmap data to tile.
offsetThe offset.

§ tileCompose()

void IlvRGBBitmapData::tileCompose ( IlvRGBBitmapData src,
const IlvPoint offset,
IlUChar  blend = 255 
)

Tiles an image.

This method uses the alpha channel of the source.

Parameters
srcThe bitmap data to tile.
offsetThe offset.
blendThe blend factor.

© Copyright 2017, 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.