←Select platform

InputProfile Property

Summary
Gets or sets a character string that contains the input profile name, used with the ConversionMethodFlags.UseCustomIcc active conversion method.
Syntax
C#
C++/CLI
Python
public string InputProfile { get; set; } 
public: 
property String^ InputProfile { 
   String^ get(); 
   void set (    String^ ); 
} 
InputProfile # get and set (ConversionParameters) 

Property Value

Character string that contains the input file name used with the ConversionMethodFlags.ConversionMethodFlags.UseCustomIcc active conversion method (ActiveMethod property).

Example

This example will convert CMYK color to RGB using custom ICM Profile.

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ColorConversion; 
 
using Leadtools.ImageProcessing; 
 
// Rgb and Cmyk color buffer arrays 
public byte[] cmykColor = { 100, 100, 100, 100 }; // Input CMYK byte array 
public byte[] rgbColorLoaded = new byte[3]; // Output RGB byte array using a loaded ICC profile 
public byte[] rgbColorBuiltIn = new byte[3]; // Output RGB byte array using the built in ICC profile 
 
public void InputProfileExample() 
{ 
   // StartUp the color conversion engine  
   RasterColorConverterEngine.Startup(); 
 
   // Use custom ICC method in conversion parameters 
   ConversionParameters convParams = new ConversionParameters(); 
   convParams.Method = ConversionMethodFlags.UseCustomIcc | ConversionMethodFlags.UseBuiltIn; 
   convParams.ActiveMethod = ConversionMethodFlags.UseCustomIcc; 
   // Set the input and output profiles 
   convParams.InputProfile = Path.Combine(LEAD_VARS.ImagesDir, "ColorConversion", "CmykProfile.icc"); 
   convParams.OutputProfile = Path.Combine(LEAD_VARS.ImagesDir, "ColorConversion", "RgbProfile.icc"); 
   // Set the DestinationInputTable property  
   convParams.DestinationInputTable = string.Empty; 
   // Whitepoint and CMYK Properties 
   convParams.WhitePoint = new ConversionWhitePoint() { WhitePoint = ConversionWhitePointType.D50 }; 
   convParams.CmykParameters = new ConversionCmykParameters() { GcrLevel = 175, Mask = ConversionCmykMask.Gcr }; 
 
   // Convert CMYK to RGB  
   using (RasterColorConverterEngine colorConverterEngine = new RasterColorConverterEngine()) 
   { 
      colorConverterEngine.Start(ConversionColorFormat.Cmyk, ConversionColorFormat.Rgb, convParams); 
      colorConverterEngine.Convert(cmykColor, 0, rgbColorLoaded, 0, 1, 1, 0, 0); 
      Debug.WriteLine("RGB Values after conversion using loaded profiles:\t" + rgbColorLoaded[0] + " " + rgbColorLoaded[1] + " " + rgbColorLoaded[2]); 
 
      // Change the active method for conversion 
      convParams.Method = ConversionMethodFlags.ChangeActiveMethod; 
      convParams.ActiveMethod = ConversionMethodFlags.UseBuiltIn; // Switch to built-in method 
 
      // Convert CMYK to RGB with new parameters 
      colorConverterEngine.SetParameters(convParams); 
      colorConverterEngine.Convert(cmykColor, 0, rgbColorBuiltIn, 0, 1, 1, 0, 0); 
      Debug.WriteLine("RGB Values after conversion using built-in profiles:\t" + rgbColorBuiltIn[0] + " " + rgbColorBuiltIn[1] + " " + rgbColorBuiltIn[2]); 
                
      colorConverterEngine.Stop(); 
   } 
 
   // Shutdown the color conversion engine 
   RasterColorConverterEngine.Shutdown(); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.10.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.ColorConversion Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.