#include <ggi/gcp.h>
typedef ggi_pixel gcp_pixel;
typedef ggi_color gcp_RGBAcolor;
typedef struct { ggi_float y,u,v; } gcp_YUVcolor;
typedef struct { uint16_t c,m,y,k; } gcp_CMYKcolor;
typedef struct { ggi_float h,s,v; } gcp_HSVcolor;
typedef struct { uint16_t y,c1,c2; } gcp_YCCcolor;
gcp_pixels are display-dependent pixel values. They are used by all GCP operations for efficiency. Use gcpMap*Color(3) to convert gcp_*colors to gcp_pixels.
gcp_YUVcolor represents the YUV colorspace. It consists of y, u and v. They correspond to the luminance and chrominance components.
gcp_CMYKcolor represents the CMYK colorspace. It consists of c, m, y and k. They correspond to the cyan, magenta, yellow and black channels.
gcp_HSVcolor represents the HSV colorspace. It consists of h, s and v. They correspond to the hue, saturation and velocity.
gcp_YCCcolor, better known as Kodak PhotoCD. It consists of y, c1 and c2.
gcp_pixels format depends on the actual display and mode. For those who want to operate directly on pixel values, this format is described in the ggi_pixelformat(3) structure.
The buffers provided to these functions must be big enough to store or read enough pixels. Although it is safe to use 32 bits per pixel, the optimum size (in bits) can be calculated by multiplying the number of pixel by their size. Don't forget to round up to a multiple of 8 to get the number of bytes.
If you want to access such buffers directly, do not use pointer arithmetics with gcp_pixels.