Класс SimpleCompositeColorTransform
Простое преобразование цвета, содержащее группу преобразований цвета.
Вот пример, показывающий, как создать составное преобразование из указанных преобразований цвета:
''' <summary>
''' Creates composite color transform that converts color from BGR format to RGB format
''' and then converts to XYZ format using standard color transform.
''' </summary>
Public Shared Function CreateCompositeColorTransform() As Vintasoft.Imaging.ColorManagement.ColorTransform
' channels order for BGR format
Dim bgrOrder As New Vintasoft.Imaging.ColorChannelsOrder(New Integer() {2, 1, 0})
' channels order for RGB format
Dim rgbOrder As New Vintasoft.Imaging.ColorChannelsOrder(New Integer() {0, 1, 2})
' create the channels order conversion transform
Dim bgrToRgbTransform As Vintasoft.Imaging.ColorManagement.ColorTransform = New Vintasoft.Imaging.ColorManagement.ChannelsOrderConverterTransform(Vintasoft.Imaging.ColorSpaceType.sRGB, bgrOrder, rgbOrder)
' create the composite transform using channels order conversion transform and standard transform
Return Vintasoft.Imaging.ColorManagement.SimpleCompositeColorTransform.Create(bgrToRgbTransform, Vintasoft.Imaging.ColorManagement.ColorTransforms.SRgbToPcsXyzD50)
End Function
/// <summary>
/// Creates composite color transform that converts color from BGR format to RGB format
/// and then converts to XYZ format using standard color transform.
/// </summary>
public static Vintasoft.Imaging.ColorManagement.ColorTransform CreateCompositeColorTransform()
{
// channels order for BGR format
Vintasoft.Imaging.ColorChannelsOrder bgrOrder =
new Vintasoft.Imaging.ColorChannelsOrder(new int[] { 2, 1, 0 });
// channels order for RGB format
Vintasoft.Imaging.ColorChannelsOrder rgbOrder =
new Vintasoft.Imaging.ColorChannelsOrder(new int[] { 0, 1, 2 });
// create the channels order conversion transform
Vintasoft.Imaging.ColorManagement.ColorTransform bgrToRgbTransform =
new Vintasoft.Imaging.ColorManagement.ChannelsOrderConverterTransform(
Vintasoft.Imaging.ColorSpaceType.sRGB, bgrOrder, rgbOrder);
// create the composite transform using channels order conversion transform and standard transform
return Vintasoft.Imaging.ColorManagement.SimpleCompositeColorTransform.Create(
bgrToRgbTransform, Vintasoft.Imaging.ColorManagement.ColorTransforms.SRgbToPcsXyzD50);
}
Целевые платформы: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5