VintaSoft Imaging .NET SDK 12.3: Documentation for .NET developer
Vintasoft.Imaging.ImageProcessing.Color Namespace / ColorTransformCommand Class
Members Object Syntax Remarks Example Hierarchy Requirements SeeAlso
In This Topic
    ColorTransformCommand Class
    In This Topic
    Applies a ColorTransform to an image.
    Object Model
    ColorTransform BitmapChannelsFormat BitmapChannelsFormat ProcessingCommandResults ColorTransformCommand
    Syntax
    'Declaration
    
    Public Class ColorTransformCommand
       Inherits Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
    
    
    public class ColorTransformCommand : Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
    
    
    public __gc class ColorTransformCommand : public Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase*
    
    
    public ref class ColorTransformCommand : public Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase^
    
    
    Remarks

    This command supports images with PixelFormat.Undefined pixel format (N-channels and M-bits per channel).

    Example

    This C#/VB.NET code shows how to transform colors of the RGB image using specified output ICC profile.

    
    ''' <summary>
    ''' Applies a color transform command to specified VintasoftImage
    ''' using specified output RGB profile.
    ''' </summary>
    Public Shared Sub ApplyColorTransformCommand(image As Vintasoft.Imaging.VintasoftImage, outputRgbProfile As Vintasoft.Imaging.ColorManagement.Icc.IccProfile)
        ' create new color management decoding settings
        Dim colorManagement As New Vintasoft.Imaging.ColorManagement.ColorManagementDecodeSettings()
        ' set output RGB profile
        colorManagement.OutputRgbProfile = outputRgbProfile
        ' get color transform
        Dim colorTransform As Vintasoft.Imaging.ColorManagement.ColorTransform = colorManagement.GetColorTransform(Vintasoft.Imaging.ColorSpaceFormats.Bgr, Vintasoft.Imaging.ColorSpaceFormats.Bgr)
        ' create a color transform command
        Dim colorTransformCommand As New Vintasoft.Imaging.ImageProcessing.Color.ColorTransformCommand()
        ' set color transform
        colorTransformCommand.ColorTransform = colorTransform
        ' apply color transform command
        colorTransformCommand.ExecuteInPlace(image)
    End Sub
    
    
    
    /// <summary>
    /// Applies a color transform command to specified VintasoftImage
    /// using specified output RGB profile.
    /// </summary>
    public static void ApplyColorTransformCommand(
        Vintasoft.Imaging.VintasoftImage image,
        Vintasoft.Imaging.ColorManagement.Icc.IccProfile outputRgbProfile)
    {
        // create new color management decoding settings
        Vintasoft.Imaging.ColorManagement.ColorManagementDecodeSettings colorManagement =
            new Vintasoft.Imaging.ColorManagement.ColorManagementDecodeSettings();
        // set output RGB profile
        colorManagement.OutputRgbProfile = outputRgbProfile;
        // get color transform
        Vintasoft.Imaging.ColorManagement.ColorTransform colorTransform =
            colorManagement.GetColorTransform(
                Vintasoft.Imaging.ColorSpaceFormats.Bgr,
                Vintasoft.Imaging.ColorSpaceFormats.Bgr
            );
        // create a color transform command
        Vintasoft.Imaging.ImageProcessing.Color.ColorTransformCommand colorTransformCommand =
            new Vintasoft.Imaging.ImageProcessing.Color.ColorTransformCommand();
        // set color transform
        colorTransformCommand.ColorTransform = colorTransform;
        // apply color transform command
        colorTransformCommand.ExecuteInPlace(image);
    }
    
    

    Inheritance Hierarchy

    System.Object
       Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase
          Vintasoft.Imaging.ImageProcessing.Color.ColorTransformCommand

    Requirements

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

    See Also