←Select platform

IccNamedColor2TagType Class

Summary
Contains the namedColor2Type tag type data.
Syntax
C#
C++/CLI
Python
public class IccNamedColor2TagType : IccTagTypeBase 
public ref class IccNamedColor2TagType : public IccTagTypeBase  
class IccNamedColor2TagType(IccTagTypeBase): 
Remarks
Example

This example method can be used in creating an "namedColor2Type" mentioned in the ICC.1:2004-10 specification.

C#
using Leadtools; 
using Leadtools.ColorConversion; 
 
using Leadtools.Codecs; 
 
public string outputIccFile = Path.Combine(LEAD_VARS.ImagesDir, "IccNamedColor2TagType.icc"); 
 
public void IccNamedColor2TagTypeExample() 
{ 
   // Load an ICC profile 
   string fileName = Path.Combine(LEAD_VARS.ImagesDir, "InputProfile.icc"); 
   IccProfileExtended iccProfile = new IccProfileExtended(fileName); 
 
   // Define the color root names 
   byte[] colorRootName1 = new byte[32]; 
   colorRootName1[0] = (byte)'a'; 
   colorRootName1[1] = (byte)'n'; 
   colorRootName1[2] = (byte)'y'; 
   colorRootName1[3] = (byte)' '; 
   colorRootName1[4] = (byte)'n'; 
   colorRootName1[5] = (byte)'a'; 
   colorRootName1[6] = (byte)'m'; 
   colorRootName1[7] = (byte)'e'; 
   colorRootName1[8] = (byte)'1'; 
   colorRootName1[9] = (byte)0; 
 
   byte[] colorRootName2 = new byte[32]; 
   colorRootName2[0] = (byte)'a'; 
   colorRootName2[1] = (byte)'n'; 
   colorRootName2[2] = (byte)'y'; 
   colorRootName2[3] = (byte)' '; 
   colorRootName2[4] = (byte)'n'; 
   colorRootName2[5] = (byte)'a'; 
   colorRootName2[6] = (byte)'m'; 
   colorRootName2[7] = (byte)'e'; 
   colorRootName2[8] = (byte)'2'; 
   colorRootName2[9] = (byte)0; 
 
   // Define color PCS coordinates, must be 3 values only 
   ushort[] colorPCSCoords = new ushort[3] { 1, 2, 3 }; 
 
   // Define the Device coordinates 
   ushort[] colorDEVCoords = new ushort[4] { 4, 3, 2, 1 }; 
 
   // Define two named color data 
   IccNamedColor2Data[] namedColors = new IccNamedColor2Data[2]; 
   namedColors[0] = new IccNamedColor2Data(colorRootName1, colorPCSCoords, colorDEVCoords); 
   namedColors[1] = new IccNamedColor2Data(colorRootName2, colorPCSCoords, colorDEVCoords); 
 
   // Define any vendor flag 
   int vendorFlag = 0x00001234; 
 
   // Define the prefix for each color name, must be 32 bytes 
   byte[] prefix = new byte[32]; 
   prefix[0] = (byte)'a'; 
   prefix[1] = (byte)'n'; 
   prefix[2] = (byte)'y'; 
   prefix[3] = (byte)' '; 
   prefix[4] = (byte)'p'; 
   prefix[5] = (byte)'r'; 
   prefix[6] = (byte)'e'; 
   prefix[7] = (byte)'f'; 
   prefix[8] = (byte)'i'; 
   prefix[9] = (byte)'x'; 
   prefix[10] = (byte)0; 
 
   // Define the suffix for each color name, must be 32 bytes 
   byte[] suffix = new byte[32]; 
   suffix[0] = (byte)'a'; 
   suffix[1] = (byte)'n'; 
   suffix[2] = (byte)'y'; 
   suffix[3] = (byte)' '; 
   suffix[4] = (byte)'s'; 
   suffix[5] = (byte)'u'; 
   suffix[6] = (byte)'f'; 
   suffix[7] = (byte)'f'; 
   suffix[8] = (byte)'i'; 
   suffix[9] = (byte)'x'; 
   suffix[10] = (byte)0; 
 
   // Create the IccNamedColor2 class 
   IccNamedColor2 iccNamedColor2 = new IccNamedColor2(vendorFlag, prefix, suffix, namedColors); 
 
   // Define the tag type 
   IccNamedColor2TagType namedColor2TagType = new IccNamedColor2TagType(iccNamedColor2); 
 
   // Add the new tag to the ICC profile 
   iccProfile.AddTag(namedColor2TagType, IccTag.NamedColor2Tag, IccTagTypeBase.NamedColor2TypeSignature); 
 
   // Generate the new profile ID 
   iccProfile.GenerateProfileId(); 
 
   // Update the ICC array with the new changes 
   iccProfile.UpdateDataArray(); 
 
   // Write the ICC profile into a new file 
   iccProfile.GenerateIccFile(outputIccFile); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.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.