Core Optical, Inc.
ColorimetricConverter ConvertLinearRGBtoXYZ Method Industrial Strength, Scientific Grade
Transforms data in-place from linear normalized sRGB to normalized CIE XYZ tristimulus values.

Namespace: PrecisionImage.Colorimetry
Assembly: PrecisionImage (in PrecisionImage.dll) Version: 2.0.0.0 (2.0.0.0)
Syntax

public void ConvertLinearRGBtoXYZ(
	SourceData dataSource
)

Parameters

dataSource
Type: PrecisionImage SourceData
A SourceData object encapsulating the image data to be converted.
Exceptions

Remarks

The conversion is computed in reference to the D65 white point according to the ITU-R BT.709 standard. Results are generally within the nominal range 0.0 - 1.0 but may be fall outside that range depending on the source data. The conversion is applied under the assumption that the data in dataSource represents linearized sRGB values. Resulting values are not clamped to any arbitrary range and are stored as-is with the X values in channel 0, Y values in channel 1 and Z values in channel 2 of the dataSource object. dataSource must contain at least 3 channels or an OnlineArgumentOutOfRangeException exception will result.
Examples

The following converts linear RGB data to CIE XYZ space.
using PrecisionImage;
using PrecisionImage.Colorimetry;

// Instantiate the SourceData object. "MyBitmapSource" is an rgb image with no alpha channel: 
SourceData imageData = new SourceData(MyBitmapSource);

// Instantiate the ColorimetricConverter object: 
ColorimetricConverter colorConverter = new ColorimetricConverter();

// Image data is currently in linear RGB space. Transform to CIE XYZ in-place (imageData must have exactly 3 channels 
// or exception will result):
colorConverter.ConvertLinearRGBtoXYZ(imageData);

// Assume some processing on one or more of the tristimulus channels:
.
.
.
// After channel processing, transform XYZ values back to linear RGB (in-place):
colorConverter.ConvertXYZtoLinearRGB(imageData);
See Also