img_expand_getfunc()
QNX SDP8.0Image Library ReferenceAPIDeveloperProgramming
Get a function to convert a palette format to a direct format
Synopsis:
#include <img/img.h> img_expand_f *img_expand_getfunc( img_format_t src, img_format_t lut )
Arguments:
- src
- The palette-based img_format_t image format to convert from
- lut
- The img_format_t direct image format to convert to
Library:
libimg
Use the -l img option to qcc to link against this library.
Description:
This function returns a pointer to a data conversion function (or NULL if the requested conversion is not supported) which you can call to expand
(that is, convert) a run of pixels from a palette-based format src to a direct
format in a lookup table lut.
A conversion function takes the form:
void img_expand_f( const uint8 *src,
uint8 *dst,
unsigned n,
const uint8 *lut);
Here's a sample procedure for converting from PAL8 to ARGB1555:
- Convert your lookup table to the destination format:
img_convert_data(IMG_FMT_PKHE_ARGB8888, palette, IMG_FMT_PKLE_ARGB1555, palette, npalette);
- Get the handle to the expand function that will expand the data:
img_expand_getfunc(IMG_FMT_PAL8, IMG_FMT_PKLE_ARGB1555);
- Call the expand function for each run of indexed data you want to expand:
expand_f(sptr, dptr, npixels, palette);
Note:
You can use img_dtransform_create() instead to abstract the details of expansion and conversion.
Returns:
- IMG_ERR_OK
- Success.
- IMG_ERR_NOSUPPORT
- One of the formats specified is invalid.
Classification:
Image library
Safety: | |
---|---|
Signal handler | No |
Thread | No |
Page updated: