VintaSoft Imaging .NET SDK v8.7
Vintasoft.Imaging.ImageProcessing.Color Namespace / ColorTransformCommand Class
Members Example



In This Topic
    ColorTransformCommand Class
    In This Topic
    Applies a ColorTransform to an image.
    Object Model
    ColorTransformCommand ClassColorTransform ClassBitmapChannelsFormat ClassBitmapChannelsFormat ClassProcessingCommandResults ClassProcessingCommandResult Class
    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 Vintasoft.Imaging.PixelFormat.Undefined pixel format (N-channels and M-bits per channel).
    Example
    This example 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.ColorManagement.ColorSpaceFormats.Bgr, Vintasoft.Imaging.ColorManagement.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.ColorManagement.ColorSpaceFormats.Bgr,
                Vintasoft.Imaging.ColorManagement.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: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also