Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/gf/dev_guide/img/img_expand_getfunc.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/gf/dev_guide/img/img_expand_getfunc.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/gf/dev_guide/img/img_expand_getfunc.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/gf/dev_guide/img/img_expand_getfunc.html on line 8

img_expand_getfunc()

Get a function to convert a palette format to a direct format

Synopsis:

#include <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:

img

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 is a sample procedure for converting from PAL8 to ARGB1555:

  1. Convert your lookup table to the destination format (ARGB1555). For example:
    img_convert_data(IMG_FMT_PKHE_ARGB8888, palette, IMG_FMT_PKLE_ARGB1555, palette, npalette);
  2. Get the handle to the expand function that will expand the data. For example:
    img_expand_getfunc(IMG_FMT_PAL8, IMG_FMT_PKLE_ARGB1555);
  3. Call the expand function for each run of indexed data you want to expand. For example:
    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:
Interrupt handler No
Signal handler No
Thread No

See also:

img_convert_data(), img_dtransform_create(), IMG_FMT_BPL(), img_lib_attach()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/gf/dev_guide/img/img_expand_getfunc.html on line 155

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/gf/dev_guide/img/img_expand_getfunc.html on line 155