Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Bitmap data base class. More...
#include <ilviews/bitmaps/data.h>
Public Member Functions | |
IlvBitmapData (IlUInt width, IlUInt height, IlUShort depth, IlUInt padding=32) | |
Constructor. | |
virtual | ~IlvBitmapData () |
Destructor. | |
virtual void | blend (const IlvBitmapData *src, const IlvRect &srcrect, const IlvPoint &to, IlUChar blend) |
Blends a rectangle from another bitmap data to the given position. | |
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. | |
virtual void | copy (const IlvBitmapData *src, const IlvRect &srcrect, const IlvPoint &to) |
Copies a rectangle from another bitmap data to the given position. | |
virtual void | copyPixel (IlUInt xdst, IlUInt ydst, const IlvBitmapData *src, IlUInt xsrc, IlUInt ysrc) |
Copies a pixel from another bitmap data. | |
virtual void | fill (const IlvRect &rect, IlUChar r, IlUChar g, IlUChar b, IlUChar a=255) |
Fills the bitmap data with the specified color. | |
IlUInt | getByteWidth () const |
Returns the size in bytes of a row of the image stored in the instance. | |
IlUInt | getCount () const |
Returns the reference count for this instance. | |
IlUChar * | getData () const |
Returns a pointer to the internal storage memory of the instance. | |
IlUShort | getDepth () const |
Returns the number of bits needed to describe a pixel of the image stored in the instance. | |
IlUInt | getHeight () const |
Returns the height in pixels of the image stored in the instance. | |
IlvBitmapInformation * | getInformation () const |
Returns the bitmap information. | |
virtual IlvBWBitmapData * | getMask () const |
Returns the mask bitmap data of the instance. | |
IlUInt | getPadding () const |
Returns the padding used by the instance. | |
virtual void | getRGBPixel (IlUInt x, IlUInt y, IlUChar &r, IlUChar &g, IlUChar &b) const =0 |
Returns a true color representation of a pixel located in the image at x and y coordinates. | |
virtual IlUChar * | getRGBPixels (const IlvRect &rect, IlUInt &size, IlUChar *data=0) const |
Returns a true color representation of a region of the image stored in the instance. | |
IlUChar * | getRowStartData (IlUInt idx) const |
Returns a pointer to the storage memory of a given row of the image in the instance. | |
virtual IlUInt | getUsedColorNum ()=0 |
Returns the number of referenced colors in the bitmap data. | |
IlUInt | getWidth () const |
Returns the width in pixels of the image stored in the instance. | |
IlBoolean | hasMask () const |
Returns whether the instance has a mask. | |
void | lock () |
Locks the current instance. | |
void | setInformation (IlvBitmapInformation *info) |
Sets the bitmap information. | |
virtual void | setMask (IlvBWBitmapData *mask) |
Sets the mask of the current instance. | |
virtual void | setRGBPixel (IlUInt x, IlUInt y, IlUChar r, IlUChar g, IlUChar b)=0 |
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 | unLock () |
Unlocks the current instance. |
Bitmap data base class.
Library: display
The bitmap data lets you manipulate abstract representations of images in memory. This class hides internal memory storage of data and provides a uniform way of dealing with the data. Subclasses of IlvBitmapData
handle specific types of data such as indexed data with colormaps, true color data, and black and white data.
IlvIndexedBitmapData
, IlvRGBBitmapData
, IlvBWBitmapData
, IlvBitmap
, IlvQuantizer
, IlvQuickQuantizer
, IlvWUQuantizer
. Constructor.
Initializes a new IlvBitmapData
object representing an image of width width and height height; each pixel of the image is represented using depth bits. The image is stored internally top-bottom; images are stored in rows of scanline, with each line padded to bits. IlvBitmapData
can have an associated mask. A mask is a black and white BitmapData
that indicates which of the pixels in the image will be displayed.
width | The width of the image. | |
height | The height of the image. | |
depth | The number of bits needed to describe a pixel. | |
padding | The padding of a scanline in the internal representation. |
virtual IlvBitmapData::~IlvBitmapData | ( | ) | [virtual] |
Destructor.
The destructor releases all the memory used by the instance.
virtual void IlvBitmapData::blend | ( | const IlvBitmapData * | src, | |
const IlvRect & | srcrect, | |||
const IlvPoint & | to, | |||
IlUChar | blend | |||
) | [virtual] |
Blends a rectangle from another bitmap data to the given position.
src | The source bitmap data. | |
srcrect | The rectangle in the source data. | |
to | The position to copy the image to. | |
blend | The blend factor (ranges from 0 to 255). |
Reimplemented in IlvRGBBitmapData.
virtual void IlvBitmapData::blendPixel | ( | IlUInt | xdst, | |
IlUInt | ydst, | |||
const IlvBitmapData * | src, | |||
IlUInt | xsrc, | |||
IlUInt | ysrc, | |||
IlUChar | blend | |||
) | [virtual] |
Blends a pixel from another bitmap data to the given position.
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. | |
blend | The blend factor (ranges from 0 to 255). |
virtual void IlvBitmapData::copy | ( | const IlvBitmapData * | src, | |
const IlvRect & | srcrect, | |||
const IlvPoint & | to | |||
) | [virtual] |
Copies a rectangle from another bitmap data to the given position.
src | The source bitmap data. | |
srcrect | The rectangle in the source data. | |
to | The position to copy the image to. |
Reimplemented in IlvRGBBitmapData.
virtual void IlvBitmapData::copyPixel | ( | IlUInt | xdst, | |
IlUInt | ydst, | |||
const IlvBitmapData * | src, | |||
IlUInt | xsrc, | |||
IlUInt | ysrc | |||
) | [virtual] |
Copies a pixel from another bitmap data.
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. |
virtual void IlvBitmapData::fill | ( | const IlvRect & | rect, | |
IlUChar | r, | |||
IlUChar | g, | |||
IlUChar | b, | |||
IlUChar | a = 255 | |||
) | [virtual] |
Fills the bitmap data with the specified color.
r | The red component of the color. | |
g | The green component of the color. | |
b | The blue component of the color. |
Reimplemented in IlvRGBBitmapData.
IlUInt IlvBitmapData::getByteWidth | ( | ) | const |
Returns the size in bytes of a row of the image stored in the instance.
IlUChar* IlvBitmapData::getData | ( | ) | const |
Returns a pointer to the internal storage memory of the instance.
IlUShort IlvBitmapData::getDepth | ( | ) | const |
Returns the number of bits needed to describe a pixel of the image stored in the instance.
IlUInt IlvBitmapData::getHeight | ( | ) | const |
Returns the height in pixels of the image stored in the instance.
IlvBitmapInformation* IlvBitmapData::getInformation | ( | ) | const |
Returns the bitmap information.
virtual IlvBWBitmapData* IlvBitmapData::getMask | ( | ) | const [virtual] |
Returns the mask bitmap data of the instance.
Returns 0
if the instance has no mask.
IlvBWBitmapData
instance describing the mask. IlUInt IlvBitmapData::getPadding | ( | ) | const |
Returns the padding used by the instance.
virtual void IlvBitmapData::getRGBPixel | ( | IlUInt | x, | |
IlUInt | y, | |||
IlUChar & | r, | |||
IlUChar & | g, | |||
IlUChar & | b | |||
) | const [pure virtual] |
Returns a true color representation of a pixel located in the image at x and y coordinates.
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. |
Implemented in IlvIndexedBitmapData, IlvRGBBitmapData, and IlvBWBitmapData.
virtual IlUChar* IlvBitmapData::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.
rect | The region of the image. | |
size | The size of the returned data. | |
data | The preallocated data. |
Reimplemented in IlvIndexedBitmapData, IlvRGBBitmapData, and IlvBWBitmapData.
Returns a pointer to the storage memory of a given row of the image in the instance.
idx | The row. |
virtual IlUInt IlvBitmapData::getUsedColorNum | ( | ) | [pure virtual] |
Returns the number of referenced colors in the bitmap data.
Implemented in IlvIndexedBitmapData, IlvRGBBitmapData, and IlvBWBitmapData.
IlUInt IlvBitmapData::getWidth | ( | ) | const |
Returns the width in pixels of the image stored in the instance.
IlBoolean IlvBitmapData::hasMask | ( | ) | const |
Returns whether the instance has a mask.
IlTrue
if the instance has a mask. void IlvBitmapData::setInformation | ( | IlvBitmapInformation * | info | ) |
Sets the bitmap information.
info | The new bitmap information. |
virtual void IlvBitmapData::setMask | ( | IlvBWBitmapData * | mask | ) | [virtual] |
Sets the mask of the current instance.
The old mask is deleted if present.
mask | The mask to use for the instance. |
virtual void IlvBitmapData::setRGBPixel | ( | IlUInt | x, | |
IlUInt | y, | |||
IlUChar | r, | |||
IlUChar | g, | |||
IlUChar | b | |||
) | [pure virtual] |
Sets a pixel of the image stored in the instance to the given true color representation.
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. |
Implemented in IlvIndexedBitmapData, IlvRGBBitmapData, and IlvBWBitmapData.
virtual void IlvBitmapData::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
.
data | The true color representation of the source pixels. | |
byteWidth | The width in bytes of the source data. | |
rect | The region of the source data. | |
to | The position in the destination image. |
Reimplemented in IlvIndexedBitmapData, and IlvRGBBitmapData.
© 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.