Index

PowerDoc Objects

Bitmap Image Data

Overview

This object represents a raw bitmap. The bitmap's pixels can be stored in RGBA, RGB, GA, G or monochrome format. The Bitmap Image Data object does not have a visual representation, however, it is the key building block used in the construction of the Bitmap Image object.

Designated Rendering Function: NONE

Note: pdImageDataRGB, pdImageDataRGBAlpha, pdImageDataGray and pdImageDataGrayAlpha cannot be used at the same time. pdImageDataRGBAlpha takes precedence over pdImageDataRGB. pdImageDataRGB takes precedence over pdImageDataGrayAlpha. pdImageDataGrayAlpha takes precedence over pdImageDataGray. Finally, pdImageDataGray takes precedence over pdImageDataMono.

None

Properties

pdNw (1039)   PD_WORD_UNSIGNED

Also appears in: Pattern Fill Definition, Grid

Number of items in horizontal direction. Depending on the context, the items can be pixels, rows, grid lines etc.

pdNh (1040)   PD_WORD_UNSIGNED

Also appears in: Pattern Fill Definition, Grid

Number of items in vertical direction. Depending on the context, the items can be pixels, rows, grid lines etc.

pdImageDataRGB (1045)   PD_HEX

Supported Compression Methods: 009, 002

Image data in RGB format (variable length, 3 bytes per pixel).

pdImageDataGray (1046)   PD_HEX

Supported Compression Methods: 011, 006

Also appears in: Pattern Fill Definition

Image data in grayscale format (variable length, 1 byte per pixel).

pdImageDataRGBAlpha (1095)   PD_HEX

Supported Compression Methods: 008, 000

Image data in RGBA (RGB with Alpha) format (variable length, 4 bytes per pixel).

pdImageDataGrayAlpha (1096)   PD_HEX

Supported Compression Methods: 010, 004

Image data in the GA (grayscale with Alpha) format (variable length, 2 bytes per pixel).

pdImageDataMono (1129)   PD_HEX

Also appears in: Pattern Fill Definition

Monochrome image data (variable length, 1 byte stores 8 pixels).

pdPitch (1133)   PD_LONG_SIGNED

The distance, in bytes, between the beginning of two neighbouring pixel rows. This property makes it possible to pass to D-Type Power Engine bitmap images that have some padding (extra bytes) at the end of each bitmap row.

This property works with all supported Bitmap Image Data formats (pdImageDataGray, pdImageDataGrayAlpha, pdImageDataRGB, pdImageDataRGBAlpha) except pdImageDataMono.

A valid pitch value must not be less than pdNw * bytes_per_pixel, where bytes_per_pixel is 1 for pdImageDataGray, 2 for pdImageDataGrayAlpha, 3 for pdImageDataRGB and 4 for pdImageDataRGBAlpha. A pitch value that is exactly pdNw * bytes_per_pixel bytes indicates that the pixel rows are contiguous; in other words there are no extra bytes between the neighbouring pixel rows. A pitch value that is larger than pdNw * bytes_per_pixel bytes indicates that the pixel rows are non contiguous; in other words at the end of each row there are some extra bytes (the number of extra bytes is pdPitch - pdNw * bytes_per_pixel). Note that D-Type Power Engine does not read or use these extra bytes.

If pdPitch is not specified, D-Type Power Engine will use the value pdNw * bytes_per_pixel, i.e. assume that pixel rows are contiguous. If pdPitch is not properly defined, D-Type Power Engine will not be able to display the bitmap image.

Example

C/C++

DT_ID_SLONG obj[1];

obj[0] = pdObjAdd(pd, 0, "Grayscale Image Data");

/* Properties for object 0 */
pdPropAdd(pd, obj[0], pdNw, "4", PD_WORD_UNSIGNED);
pdPropAdd(pd, obj[0], pdNh, "4", PD_WORD_UNSIGNED);
pdPropAdd(pd, obj[0], pdImageDataGray, "88880000 88880000 00008888 00008888", PD_HEX);

INTEGRAL DSL

/* Lambda shortcuts */

local o = @(label = "") CDTObj(::my.doc, label); /* to make object */
local p = @(id, str, len = PD_DEFAULT) CDTProp(id, str, len); /* to add property - general */
local s = @(id, str) CDTPropStr(id, str); /* to add property - string */
local i = @(id, num) CDTPropInt(id, num); /* to add property - integer */
local l = @(id, obj) CDTLink(id, obj); /* to add link */

/* Objects */

local obj_0 = o("Grayscale Image Data");

/* Object Properties */

obj_0 + i(pdNw, 4);
obj_0 + i(pdNh, 4);
obj_0 + p(pdImageDataGray, "88880000 88880000 00008888 00008888");
 

Index