|
Colorspace conversion function. More...
Functions | |
AFAPI array | colorspace (const array &image, const CSpace to, const CSpace from) |
C++ Interface wrapper for colorspace conversion. More... | |
AFAPI array | colorSpace (const array &image, const CSpace to, const CSpace from) |
C++ Interface wrapper for colorspace conversion. More... | |
AFAPI af_err | af_color_space (af_array *out, const af_array image, const af_cspace_t to, const af_cspace_t from) |
C Interface wrapper for color space conversion. More... | |
Colorspace conversion function.
RGB (Red, Green, Blue) is the most common format used in computer imaging. RGB stores individual values for red, green and blue, and hence the 3 values per pixel. A combination of these three values produces the gamut of unique colors.
HSV (Hue, Saturation, Value), also known as HSB (hue, saturation, brightness), is often used by artists because it is more natural to think about a color in terms of hue and saturation than in terms of additive or subtractive color components (as in RGB). HSV is a transformation of RGB colorspace; its components and colorimetry are relative to the RGB colorspace from which it was derived. Like RGB, HSV also uses 3 values per pixel.
Grayscale is a single channel color space where pixel value ranges from 0 to 1. Zero represents black, one represent white and any value between zero & one is a gray value
Supported conversions
From | To |
---|---|
AF_RGB | AF_GRAY |
AF_GRAY | AF_RGB |
AF_RGB | AF_HSV |
AF_HSV | AF_RGB |
AFAPI af_err af_color_space | ( | af_array * | out, |
const af_array | image, | ||
const af_cspace_t | to, | ||
const af_cspace_t | from | ||
) |
C Interface wrapper for color space conversion.
[out] | out | is an array in target color space |
[in] | image | is the input array |
[in] | to | is the target array color space |
[in] | from | is the input array color space |
C++ Interface wrapper for colorspace conversion.
[in] | image | is the input array |
[in] | to | is the target array colorspace |
[in] | from | is the input array colorspace |
image
must be 3 dimensional for AF_HSV to AF_RGB, AF_RGB to AF_HSV, & AF_RGB to AF_GRAY transformations. For AF_GRAY to AF_RGB transformation, 2D array is expected. C++ Interface wrapper for colorspace conversion.
[in] | image | is the input array |
[in] | to | is the target array colorspace |
[in] | from | is the input array colorspace |
image
must be 3 dimensional for AF_HSV to AF_RGB, AF_RGB to AF_HSV, & AF_RGB to AF_GRAY transformations. For AF_GRAY to AF_RGB transformation, 2D array is expected.