The IlvRGBBitmapData Class
The IlvRGBBitmapData class is dedicated to true color images, where raster data is a direct representation of the colors of the pixels.
Creating a True Color Bitmap Data of Dimensions 256 * 256 Pixels and Filling it With a Gradient
IlvRGBBitmapData* bdata = new IlvRGBBitmapData(256, 256);
for (IlUInt h = 0; h < 256; ++h)
for (IlUInt w = 0; w < 256; ++w)
bdata->fastSetRGBPixel(w, h, w, h, w);
As with IlvIndexedBitmapData, you can then create an IlvBitmap and display it using Views standard methods.
When on an 8-bit color display, the Views library automatically converts this true color image to an indexed image using an algorithm yielding a very high quality image.
The internal representation for true color bitmap data is an array of width * height entries. Each entry is a 4-byte quadruplet describing a pixel as follows:
-
First byte is the alpha component.
-
Second byte is the red component.
-
Third byte is the green component.
-
Fourth byte is the blue component.
The array can be described top-bottom or bottom-top, so you have a line access method using getRowStartData.
You can use various methods to access raster data:
-
getData
-
getRGBPixel
-
getRGBPixels
-
fill
-
copy
-
blend
-
alphaCompose
-
tile
-
stretch
-
stretchSmooth
You can also independently access the color and alpha values for a given pixel.