Leadtools.ColorConversion Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.5.7
IccProfileSequenceDescriptionTagType Class
See Also  Members   Example 
Leadtools.ColorConversion Namespace : IccProfileSequenceDescriptionTagType Class




Contains the profileSequenceDescriptionType tag type data.

Object Model


Syntax

Visual Basic (Declaration) 
Public Class IccProfileSequenceDescriptionTagType 
   Inherits IccTagTypeBase
Visual Basic (Usage)Copy Code
Dim instance As IccProfileSequenceDescriptionTagType
C# 
public class IccProfileSequenceDescriptionTagType : IccTagTypeBase 
Managed Extensions for C++ 
public __gc class IccProfileSequenceDescriptionTagType : public IccTagTypeBase 
C++/CLI 
public ref class IccProfileSequenceDescriptionTagType : public IccTagTypeBase 

Example

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

Visual BasicCopy Code
Public Function FillIccMultiLocalizedUnicodeTagType() As IccMultiLocalizedUnicodeTagType
   Dim nameLanguageCode As UShort = CUShort(AscW("e"c))
   nameLanguageCode <<= 8
   nameLanguageCode = nameLanguageCode Or CUShort(&HFF)
   nameLanguageCode = nameLanguageCode And CUShort((&HFF00 Or AscW("n"c)))
   Dim nameCountryCode As UShort = CUShort(AscW("c"c))
   nameCountryCode <<= 8
   nameCountryCode = nameCountryCode Or CUShort(&HFF)
   nameCountryCode = nameCountryCode And CUShort(&HFF00 Or AscW("a"c))

   Dim names() As String = {"first name record", "second name record"}

   Dim nameRecord(1) As IccNameRecord

   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)))

   Dim firstName() As Char = names(0).ToCharArray()
   Dim secondName() As Char = names(1).ToCharArray()

   Dim unicodeChars(names(0).Length + names(1).Length) As UShort
   Dim nCntr As Integer = 0
   Dim nX As Integer = 0

   While (nX < names(0).Length)
      unicodeChars(nCntr) = CUShort(AscW(firstName(nX)))
      nX += 1
      nCntr += 1
   End While

   nX = 0
   While (nX < names(1).Length)
      unicodeChars(nCntr) = CUShort(AscW(secondName(nX)))
      nX += 1
      nCntr += 1
   End While

   Dim iccMultiLocalized As New IccMultiLocalizedUnicode(12, nameRecord, unicodeChars)
   Dim iccMultiLocalizedTagType As New IccMultiLocalizedUnicodeTagType(iccMultiLocalized)

   Return iccMultiLocalizedTagType
End Function


Public Sub IccProfileSequenceDescriptionTagTypeExample()
   ' load an Icc Profile
   Dim iccProfile As New IccProfileExtended("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\EmptyIcc.icc")

   ' define the device attributes must be 8 bytes
   Dim deviceAttribs() As Byte = {0, 0, 0, 0, 0, 0, 0, 0}

   ' define the device manufacturer and model descriptions
   Dim devManufacturerDesc As IccMultiLocalizedUnicodeTagType = FillIccMultiLocalizedUnicodeTagType()
   Dim devModelDesc As IccMultiLocalizedUnicodeTagType = FillIccMultiLocalizedUnicodeTagType()

   ' if a tag type is used inside another tag type, it should be converted
   ' into BigIndian notation first. And that can be done by calling the
   ' IccProfile.CreateICCTagData() method
   devManufacturerDesc = DirectCast(IccTools.CreateTagType(devManufacturerDesc, IccTagTypeBase.MultiLocalizedUnicodeTypeSignature), IccMultiLocalizedUnicodeTagType)
   devModelDesc = DirectCast(IccTools.CreateTagType(devModelDesc, IccTagTypeBase.MultiLocalizedUnicodeTypeSignature), IccMultiLocalizedUnicodeTagType)

   ' define the 1 profile descriptions
   Dim profileDescription() As IccProfileDescription = {New IccProfileDescription(&H46464549, _
         &H0, _
         deviceAttribs, _
         IccTechnologySignatureType.None, _
         devManufacturerDesc, _
         devModelDesc)}

   ' create the IccProfileSequenceDescription class
   Dim profileSeqDesc As New IccProfileSequenceDescription(profileDescription)

   ' define the tag type
   Dim profileSeqDescTagType As 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("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\IccProfileSequenceDescriptionTagTypeVB.icc")
End Sub
C#Copy Code
public IccMultiLocalizedUnicodeTagType FillIccMultiLocalizedUnicodeTagType() 

   ushort nameLanguageCode = 'e'; 
   nameLanguageCode <<= 8; 
   nameLanguageCode |= 0x00FF; 
   nameLanguageCode &= 0xFF00 | 'n'; 
   ushort nameCountryCode = 'c'; 
   nameCountryCode <<= 8; 
   nameCountryCode |= 0x00FF; 
   nameCountryCode &= 0xFF00 | '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; 

 
 
public void IccProfileSequenceDescriptionTagTypeExample() 

   // load an Icc Profile 
   IccProfileExtended iccProfile = new IccProfileExtended(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\EmptyIcc.icc"); 
 
   // 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. And that 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(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\IccProfileSequenceDescriptionTagTypeCS.icc"); 
}

Remarks

Inheritance Hierarchy

System.Object
   Leadtools.ColorConversion.IccTagTypeBase
      Leadtools.ColorConversion.IccProfileSequenceDescriptionTagType

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also