Grayscale to RGB colorspace converter. More...

Functions

AFAPI array gray2rgb (const array &in, const float rFactor=1.0, const float gFactor=1.0, const float bFactor=1.0)
 C++ Interface for gray to RGB conversion. More...
 
AFAPI af_err af_gray2rgb (af_array *out, const af_array in, const float rFactor, const float gFactor, const float bFactor)
 C Interface for converting gray to RGB. More...
 

Detailed Description

Grayscale to RGB colorspace converter.

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

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.

The grayscale internsity of a pixel is calculated using the following formula

\(R = rFactor * intensity\)

\(G = gFactor * intensity\)

\(B = bFactor * intensity\)


Function Documentation

AFAPI af_err af_gray2rgb ( af_array out,
const af_array  in,
const float  rFactor,
const float  gFactor,
const float  bFactor 
)

C Interface for converting gray to RGB.

Parameters
[out]outis an array in target color space
[in]inis an array in the Grayscale color space
[in]rFactoris percentage of intensity value contributing to red channel
[in]gFactoris percentage of intensity value contributing to green channel
[in]bFactoris percentage of intensity value contributing to blue channel
Returns
AF_SUCCESS if the color transformation is successful, otherwise an appropriate error code is returned.
Note
in must be two dimensional for Grayscale to RGB conversion.
AFAPI array af::gray2rgb ( const array in,
const float  rFactor = 1.0,
const float  gFactor = 1.0,
const float  bFactor = 1.0 
)

C++ Interface for gray to RGB conversion.

Parameters
[in]inis an array in the Grayscale colorspace
[in]rFactoris percentage of intensity value contributing to red channel
[in]gFactoris percentage of intensity value contributing to green channel
[in]bFactoris percentage of intensity value contributing to blue channel
Returns
array in RGB colorspace
Note
in must be two dimensional for Grayscale to RGB conversion.