ImageGear Professional DLL v17.1 for Windows Accusoft
IG_colorspace_conversion_result_palette_get
Send Feedback  
ImageGear Professional DLL v17.1 for Windows > API Reference Guide > Core Component API Reference > Core Component Functions Reference > Color Space Conversion Functions > IG_colorspace_conversion_result_palette_get

Glossary Item Box

This function builds the result palette.

Declaration:

  Copy Code
AT_ERRCOUNT ACCUAPI IG_colorspace_conversion_result_palette_get(
        HIGCSCONVERTER hCSConverter,
        AT_RGBQUAD* palette,
        AT_INT* paletteLength
);

Arguments:

hCSConverter Handle of color space converter.
palette Array of palette entries.
paletteLength Number of palette entries.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

All pixel formats supported by ImageGear Professional.

Sample:

None

Example:

  Copy Code
/* Use the color space converter to convert an image 
to 8-bit indexed, no alpha or extra channels */
AT_ERRCOUNT nErrcount;  /* Number of errors on stack */
HIGCSCONVERTER hCSConv; /* Color space converter handle */
HIGEAR hImage;          /* HIGEAR handle of image */
AT_INT depths[] = {8};  /* Result channel depths */
AT_RGBQUAD pal[256];    /* Result palette */
AT_INT nEntries;        /* # of palette entries */
nErrcount = IG_colorspace_conversion_create_from_image(
    hImage, IG_COLOR_SPACE_ID_I, depths, 1, NULL, &hCSConv);
nErrcount = IG_colorspace_conversion_apply_to_image(
    hCSConv, hImage);
nErrcount = IG_colorspace_conversion_result_palette_get(
    hCSConv, pal, &nEntries);
nErrcount = IG_colorspace_conversion_destroy(hCSConv);

Remarks:

If the resultant color space is indexed, paletteLength will be filled with the quantity of palette entries.

©2012. Accusoft Corporation. All Rights Reserved.