PixelFormat

Since: BlackBerry 10.0.0

#include <bb/PixelFormat>

To link against this class, add the following line to your .pro file: LIBS += -lbb

An enumeration of the possible formats for the pixels of an ImageData object.

The RGBX 32 bit RGB format is stored in memory as 8 red bits, 8 green bits, 8 blue bits, and 8 ignored bits. For example:
unsigned char *pPixels;
pPixels[0] = 0x60; // red
pPixels[1] = 0x30; // green
pPixels[2] = 0xE0; // blue
pPixels += 4; // skip to next pixel
The RGBA_Premultiplied 32 bit RGBA format is stored in memory as 8 pre-multiplied red bits, 8 pre-multiplied green bits, 8 pre-multiplied blue bits, and 8 alpha bits. For example:
unsigned char *pPixels;
pPixels[0] = (0x60*0x80)>>8; // premultiplied red
pPixels[1] = (0x30*0x80)>>8; // premultiplied green
pPixels[2] = (0xE0*0x80)>>8; // premultiplied blue
pPixels[3] = 0x80;           // alpha
pPixels += 4; // skip to next pixel


Overview

Public Types Index

enum Type

RGBX = 0, RGBA_Premultiplied = 1

Public Types

Type

An enumeration of the possible formats for the pixels of an ImageData object.

Since:

BlackBerry 10.0.0

RGBX = 0

32 bits per pixel, with Red Green Blue each 0-255 then a skipped byte.

Since:

BlackBerry 10.0.0

RGBA_Premultiplied = 1

32 bits per pixel, with Red Green Blue Alpha each 0-255 where RGB is premultiplied by Alpha.

Since:

BlackBerry 10.0.0

Last modified: 2014-03-13

comments powered by Disqus