BitmapBitsFormatEnum

BitmapBitsFormatEnum enumeration constants describe the formats of bitmap data that ABBYY FineReader Engine can work with.

Bitmap data is consumed by PrepareBitmapBits and OpenBitmapBits methods of Engine object. These methods receive input image format type (value of BitmapBitsFormatEnum enumeration), image dimensions (width, height and byteWidth) and a pointer to buffer containing image data.

Image is stored in buffer continuously, line-by-line, from top to bottom. Each line occupies byteWidth bytes. Entire image occupies (height * byteWidth) bytes. Interpretation of image data depends upon image format.

typedef enum {
 BBF_BlackAndWhite,
 BBF_Gray,
 BBF_Color
} BitmapBitsFormatEnum;
    

Elements

Name Description
BBF_BlackAndWhite Black-and-white bitmap data (each pixel is represented as 1 bit). One line of black-and-white bitmap is stored as a sequence of at least N = ceil( width / 8 ) bytes. Each byte encodes colors of 8 adjacent pixels, most significant bit of the first byte corresponds to leftmost pixel of the line. Bit value of 0 denotes black pixel, value if 1 denotes white pixel. If width is not a multiple of 8, least significant bits of N-th byte are ignored. If byteWidth is greater than N, trailing extra bytes are ignored (this allows lines to be word or double word aligned).
BBF_Color Color bitmap data (each 24 bits use 8 bits of each R, G, B component). One line of color bitmap is stored as a sequence of at least N = 3 * width bytes treated as a sequence of byte triplets. Each triplet encodes one pixel, first triplet corresponds to the leftmost pixel of the line. The first byte of triplet contains an intensity of the Blue color component, the second byte — the intensity of the Green component, the third byte — the intensity of the Red component. Black pixel is represented as (0, 0, 0) triplet, white pixel as (255, 255, 255) triplet, pixel of pure red color as (0, 0, 255) triplet etc. If byteWidth is greater than N, trailing extra bytes are ignored.
BBF_Gray Gray bitmap data (each pixel is represented as 8 bits). One line of gray bitmap is stored as a sequence of at least N = width bytes. Each byte encodes gray color intensity for one pixel: 0 denotes black color, 255 denotes white color. First byte corresponds to the leftmost pixel of the line. If byteWidth is greater than N, trailing extra bytes are ignored.

Used in

IEngine::PrepareBitmapBits

IEngine::OpenBitmapBits

7/3/2024 8:50:25 AM

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.