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.
Parameter | Description |
---|---|
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.
|
gattribs | |
user_stream |
See DT_AUX_USER_STREAM. |
If the function was successful, the return value is 1. Otherwise, the function returns 0.