Index

C/C++ Functions

fxImageWrite

DT_SLONG fxImageWrite(DT_AUX_INFO* info, const DT_UBYTE* bitmap_ptr, const DT_UBYTE* alpha_ptr, DT_SLONG bitmap_padding, DT_SLONG alpha_padding, DT_ID_SWORD bitmap_format, DT_SWORD bitmap_subformat, DT_SLONG width, DT_SLONG height, DT_UWORD flags, const DT_AUX_GRAPHICS_ATTRIBS* gattribs, DT_AUX_USER_STREAM* user_stream)

Short Description: Write bitmap image to user stream

This function takes a plain bitmap stored in a memory buffer and writes it to a compressed image in a user-defined stream. The image compression format is specified by the FileFormat member variable of the info structure.

Parameters

ParameterDescription

info

Pointer to the DT_AUX_INFO structure containing the applicable initialization parameters.

bitmap_ptr

A valid pointer to a buffer that holds the bitmap. The format of the bitmap is specified using the bitmap_format parameter.

alpha_ptr

A valid pointer to a buffer that holds the bitmap's alpha channel. This is always an 8-bpp bitmap. If no alpha channel should be used, alpha_ptr should be set to DV_NULL.

The alpha channel is supported only when bitmap_format is 24 and the format of the compressed image is DV_AUX_FILEFORMAT_PNG. In all other cases, alpha_ptr is ignored and should be set to DV_NULL.

bitmap_padding

Padding of the bitmap, in bytes. For contiguous pixel rows this value is 0. For non-contiguous pixel rows, this will be a positive value. The value indicates how many extra bytes at the end of each row need to be skipped before the next row of the bitmap starts.

alpha_padding

Padding of the alpha channel, in bytes. For contiguous pixel rows this value is 0. For non-contiguous pixel rows, this will be a positive value. The value indicates how many extra bytes at the end of each row need to be skipped before the next row of the alpha channel starts.

bitmap_format

Specifies the format, or number of bits-per-pixel, of the bitmap. This value must be eiter 8 or 24 as these are the only values currently supported by this function. The value 8 should be used for 8-bpp grayscale bitmaps and 24 for 24-bit RGB bitmaps.

bitmap_subformat

Color configuration of the pixel. This value must be 0 as this is the only value currently supported by this function.

width

The width of the bitmap, in pixels.

height

The height of the bitmap, in pixels.

flags

A bitmask value.

  • bit 0 (1) — Flip the bitmap vertically

gattribs

See DT_AUX_GRAPHICS_ATTRIBS.

user_stream

See DT_AUX_USER_STREAM.

Return Value

If the function was successful, the return value is 1. Otherwise, the function returns 0.

 

Index