LUVToRGB

Convert from LUV to RGB

Supported Technologies

MT

Synopsis

FwStatus   fwiLUVToRGB_8u_C3R ( const Fw8u * pSrcint srcStepFw8u * pDstint dstStepFwiSize roiSize );
FwStatus   fwiLUVToRGB_8u_AC4R ( const Fw8u * pSrcint srcStepFw8u * pDstint dstStepFwiSize roiSize );
FwStatus   fwiLUVToRGB_16u_C3R ( const Fw16u * pSrcint srcStepFw16u * pDstint dstStepFwiSize roiSize );
FwStatus   fwiLUVToRGB_16u_AC4R ( const Fw16u * pSrcint srcStepFw16u * pDstint dstStepFwiSize roiSize );
FwStatus   fwiLUVToRGB_16s_C3R ( const Fw16s * pSrcint srcStepFw16s * pDstint dstStepFwiSize roiSize );
FwStatus   fwiLUVToRGB_16s_AC4R ( const Fw16s * pSrcint srcStepFw16s * pDstint dstStepFwiSize roiSize );
FwStatus   fwiLUVToRGB_32f_C3R ( const Fw32f * pSrcint srcStepFw32f * pDstint dstStepFwiSize roiSize );
FwStatus   fwiLUVToRGB_32f_AC4R ( const Fw32f * pSrcint srcStepFw32f * pDstint dstStepFwiSize roiSize );

Parameters

dstStep   Destination buffer step size (width of the buffer in bytes).
pDst   Pointer to a location in a destination buffer.
pSrc   Pointer to a location in a source buffer.
roiSize   Specifies the height and width of an ROI.
srcStep   Source buffer step size (width of the buffer in bytes).

Description

A CIE LUV image (pSrc) declared in the ROI is converted to a gamma-corrected RGB image (pDst) in two steps.

1. Convert( ) CIE LUV to XYZ as follows.

Scale( ) data to the range [0 to 1]

8U data type:

 L = L * 100 / FW_MAX_8U
 U = (U * 354 / FW_MAX_8U) - 134
 V = (V * 256 / FW_MAX_8U) - 140

16U data type:

 L = L * 100 / FW_MAX_16U
 U = (U * 354 / FW_MAX_16U) - 134
 V = (V * 256 / FW_MAX_16U) - 140

16S data type:

 U = ((U - FW_MIN_16S) * 354 / FW_MAX_16U) - 134
 V = ((V - FW_MIN_16S) * 256 / FW_MAX_16U) - 140

32F data type:

 L, U, and V must already be in the range [0...1]

D65 white point:

 CIE chromaticity coordinates:

  xn = 0.312713
  yn = 0.329016

 CIE luminance:

  Yn = 1.0

 un = 4*xn / (-2*xn + 12*yn + 3)
 vn = 9*yn / (-2*xn + 12*yn + 3)
 u = U / (14 * L) + un
 v = V / (13 * L) + vn
 Y = Yn * ((L + 16) / 116) ^ 3
 X = -9 * Y * u / ((u - 4) * v - u * v) = (9 / 4) * Y * u / v
 Z = (9 * Y - 15 * v * Y - v * X) / (3 * v)

2.  Convert( ) XYZ to RGB using the following formulas:

 X = 3.240479*X - 1.53715 *Y - 0.498535*Z
 Y = -0.969256*X + 1.875991*Y + 0.041556*Z
 Z = 0.055648*X - 0.204043*Y + 1.057311*Z

 The formulas assume that X, Y, and Z values are normalized to [0 to 1] for integer data types.
 For floating point data types, the data must already be in the range [0 to 1].
 For integer data types, the converted image data is saturated to [0 to 1] and scaled to the data type range.
 For floating point data type, data is saturated to [0 to 1].