←Select platform

IccNamedColor2TagType Class

Summary
Contains the namedColor2Type tag type data.
Syntax
C#
C++
public class IccNamedColor2TagType : IccTagTypeBase 
vb[VB Syntax] 
  
Public Class IccNamedColor2TagType  
   Inherits IccTagTypeBase 
public ref class IccNamedColor2TagType : public 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; 
 
 
public void IccNamedColor2TagTypeExample() 
{ 
   // load an Icc Profile 
   string fileName = Path.Combine(LEAD_VARS.ImagesDir, "EmptyIcc.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 }; 
 
   // and then 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); 
 
   // any vendor flag 
   int vendorFlag = 0x00001234; 
 
   // 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; 
 
   // 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 
   string IccfileName = Path.Combine(LEAD_VARS.ImagesDir, "IccNamedColor2TagTypeCS.icc"); 
   iccProfile.GenerateIccFile(IccfileName); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

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

Leadtools.ColorConversion Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2022 LEAD Technologies, Inc. All Rights Reserved.