←Select platform

IccProfileDescription Structure

Summary
Contains profile description data used in the IccProfileSequenceDescription structure.
Syntax
C#
C++/CLI
Python
public struct IccProfileDescription 
public value class IccProfileDescription : public System.ValueType  
class IccProfileDescription: 
Example
C#
using Leadtools; 
using Leadtools.ColorConversion; 
 
using Leadtools.Codecs; 
 
public string outputIccProfile = Path.Combine(LEAD_VARS.ImagesDir, "ColorConversion", "GetIccProfileTag", "IccProfileSequenceDescriptionTagType.icc"); 
 
public void IccProfileSequenceDescriptionTagTypeExample() 
{ 
   // Load an ICC profile 
   string fileName = Path.Combine(LEAD_VARS.ImagesDir, "ColorConversion", "InputProfile.icc"); 
   IccProfileExtended iccProfile = new IccProfileExtended(fileName); 
 
   // Define the device attributes must be 8 bytes 
   byte[] deviceAttribs = new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; 
 
   // Define the device manufacturer and model descriptions 
   IccMultiLocalizedUnicodeTagType devManufacturerDesc = FillIccMultiLocalizedUnicodeTagType(); 
   IccMultiLocalizedUnicodeTagType devModelDesc = FillIccMultiLocalizedUnicodeTagType(); 
 
   // If a tag type is used inside another tag type, it should be converted into BigIndian notation first 
   // This can be done by calling the IccProfile.CreateICCTagData() method 
   devManufacturerDesc = (IccMultiLocalizedUnicodeTagType)IccTools.CreateTagType(devManufacturerDesc, IccTagTypeBase.MultiLocalizedUnicodeTypeSignature); 
   devModelDesc = (IccMultiLocalizedUnicodeTagType)IccTools.CreateTagType(devModelDesc, IccTagTypeBase.MultiLocalizedUnicodeTypeSignature); 
 
   // Define the 1 profile descriptions 
   IccProfileDescription[] profileDescription = new IccProfileDescription[1]; 
   profileDescription[0] = new IccProfileDescription( 
      0x46464549, 
      0x0, 
      deviceAttribs, 
      IccTechnologySignatureType.None, 
      devManufacturerDesc, 
      devModelDesc); 
 
   // Create the IccProfileSequenceDescription class 
   IccProfileSequenceDescription profileSeqDesc = new IccProfileSequenceDescription(profileDescription); 
 
   // Define the tag type 
   IccProfileSequenceDescriptionTagType profileSeqDescTagType = new IccProfileSequenceDescriptionTagType(profileSeqDesc); 
 
   // Add the new tag to the ICC profile 
   iccProfile.AddTag(profileSeqDescTagType, IccTag.ProfileSequenceDescTag, IccTagTypeBase.ProfileSequenceDescTypeSignature); 
 
   // 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(outputIccProfile); 
} 
 
public IccMultiLocalizedUnicodeTagType FillIccMultiLocalizedUnicodeTagType() 
{ 
   ushort nameLanguageCode = 'e'; 
   nameLanguageCode <<= 8; 
   nameLanguageCode |= 'n'; 
 
   ushort nameCountryCode = 'c'; 
   nameCountryCode <<= 8; 
   nameCountryCode |= 'a'; 
 
   string[] names = new string[2]; 
   names[0] = "first name record"; 
   names[1] = "second name record"; 
 
   IccNameRecord[] nameRecord = new IccNameRecord[2]; 
 
   nameRecord[0] = new IccNameRecord(nameLanguageCode, nameCountryCode, names[0].Length * 2, 16 + (2 * 12)); 
   nameRecord[1] = new IccNameRecord(nameLanguageCode, nameCountryCode, names[1].Length * 2, ((16 + (2 * 12)) + (names[0].Length * 2))); 
 
   char[] firstName = new char[names[0].Length]; 
   firstName = names[0].ToCharArray(); 
 
   char[] secondName = new char[names[1].Length]; 
   secondName = names[1].ToCharArray(); 
 
   ushort[] unicodeChars = new ushort[names[0].Length + names[1].Length]; 
   int nCntr = 0; 
   int nX = 0; 
   while (nX < names[0].Length) 
   { 
      unicodeChars[nCntr] = firstName[nX]; 
      nX++; 
      nCntr++; 
   } 
   nX = 0; 
   while (nX < names[1].Length) 
   { 
      unicodeChars[nCntr] = secondName[nX]; 
      nX++; 
      nCntr++; 
   } 
 
   IccMultiLocalizedUnicode iccMultiLocalized = new IccMultiLocalizedUnicode(12, nameRecord, unicodeChars); 
   IccMultiLocalizedUnicodeTagType iccMultiLocalizedTagType = new IccMultiLocalizedUnicodeTagType(iccMultiLocalized); 
 
   return iccMultiLocalizedTagType; 
} 
 
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.