Middleware, development tools, realtime operating system
software and services for superior embedded design


Home
QNX Community Resources
QNX Documentation Library
PgColorMatch

PgColorMatch

QNX Software Systems
Developer Resources
Blogs
Board support packages
Foundry27 projects
Forums
Hardware support listing
Online video tutorials
Product documentation
Technical Articles

PgColorMatch()

Query for best color matches

Synopsis:

int PgColorMatch(int n, 
                 PgColor_t const *in, 
                 PgColor_t *out);

Arguments:

n
The number of colors in the array to find a match for.
in
An array of PgColor_t objects that specifies the colors that you want to match.
out
An array of PgColor_t objects that the function fills with the best color matches for the corresponding entry in the in array.

Library:

ph

Description:

This function queries the graphics driver for the best color matches for a number of color values. This is particularly useful with a palette-based graphics driver.

An array of n colors from the in array is passed to the driver, which selects the closest match for each color and returns these in the out array.

With a true or direct-color driver, the color is returned unchanged. With a palette-based driver, the closest color is found by computing within a RGB color cube the Cartesian distance between the color and each palette entry, and selecting the closest entry of a similar intensity.

Returns:

0
Successful completion.
-1
An error occurred.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgColor_t

"Color" in the Raw Drawing and Animation chapter of the Photon Programmer's Guide