VintaSoft Imaging .NET SDK 15.2: Documentation for .NET developer
Vintasoft.Imaging.ColorManagement Namespace / ColorTransforms Class
Members Object Syntax Example Hierarchy Requirements SeeAlso
In This Topic
ColorTransforms Class
In This Topic
Represents a collection of most commonly used standard color transforms.
Object Model
ColorTransform ColorTransform ColorTransform ColorTransform ColorTransform ColorTransform ColorTransform CompositeColorTransformWithWhitePoint CompositeColorTransformWithWhitePoint CompositeColorTransformWithWhitePoint CompositeColorTransformWithWhitePoint CompositeColorTransformWithWhitePoint CompositeColorTransformWithWhitePoint CompositeColorTransformWithWhitePoint ColorTransformWithWhitePoint ColorTransformWithWhitePoint ColorTransforms
Syntax
'Declaration

Public MustInherit NotInheritable Class ColorTransforms

public static class ColorTransforms

Example

Here is an example that shows how to convert a color in RGB format to a color in XYZ format using standard color transform from sRGB to PCSXYZ:


''' <summary>
''' Returns a XYZ color converted from specified RGB color
''' using standard color transform.
''' </summary>
Public Shared Function TransformRgbToXyz(rgbColor As Vintasoft.Imaging.ImageColors.Rgb24Color) As Vintasoft.Imaging.ImageColors.XyzColor
    ' fill buffer of RGB color
    Dim sourceColor As Byte() = New Byte(2) {}
    sourceColor(0) = rgbColor.Red
    sourceColor(1) = rgbColor.Green
    sourceColor(2) = rgbColor.Blue

    ' create buffer for XYZ color
    Dim destColor As Double() = New Double(2) {}
    ' perform color transform from byte values to double values
    Vintasoft.Imaging.ColorManagement.ColorTransforms.SRgbToPcsXyzD50.TransformFrom8bitVector(sourceColor, 0, 1, destColor, 0)

    ' return XYZ color
    Return New Vintasoft.Imaging.ImageColors.XyzColor(destColor(0), destColor(1), destColor(2))
End Function


/// <summary>
/// Returns a XYZ color converted from specified RGB color
/// using standard color transform.
/// </summary>
public static Vintasoft.Imaging.ImageColors.XyzColor TransformRgbToXyz(
    Vintasoft.Imaging.ImageColors.Rgb24Color rgbColor)
{
    // fill buffer of RGB color
    byte[] sourceColor = new byte[3];
    sourceColor[0] = rgbColor.Red;
    sourceColor[1] = rgbColor.Green;
    sourceColor[2] = rgbColor.Blue;

    // create buffer for XYZ color
    double[] destColor = new double[3];
    // perform color transform from byte values to double values
    Vintasoft.Imaging.ColorManagement.ColorTransforms.SRgbToPcsXyzD50.TransformFrom8bitVector(
        sourceColor, 0, 1, destColor, 0);

    // return XYZ color
    return new Vintasoft.Imaging.ImageColors.XyzColor(destColor[0], destColor[1], destColor[2]);
}

Inheritance Hierarchy

System.Object
   Vintasoft.Imaging.ColorManagement.ColorTransforms

Requirements

Target Platforms: .NET 11; .NET 10; .NET 9; .NET 8; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

See Also