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




Contains all of the data for a complete ICC profile.

Object Model



Syntax

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

Example

Visual BasicCopy Code
Public Function FillDateTimeTagType() As IccDateTimeTagType
   ' get the current system data
   Dim sysDateTime As DateTime = DateTime.Now
   ' create a new iccDateTime class
   Dim iccDateTime As New IccDateTime(CUShort(sysDateTime.Year), _
         CUShort(sysDateTime.Month), _
         CUShort(sysDateTime.Day), _
         CUShort(sysDateTime.Hour), _
         CUShort(sysDateTime.Minute), _
         CUShort(sysDateTime.Second))

   ' define the tag type
   Dim iccDateTimeTagType As New IccDateTimeTagType(iccDateTime)

   Return iccDateTimeTagType
End Function

Public Function FillIccXyzTagType() As IccXyzTagType
   ' define the array of XYZ numbers
   Dim data() As IccXyzNumber = {New IccXyzNumber(IccTools.FromDoubleTo2bFixed2bNumber(1.0), _
         IccTools.FromDoubleTo2bFixed2bNumber(2.0), _
         IccTools.FromDoubleTo2bFixed2bNumber(3.0))}

   ' define the tag type
   Dim xyzTagType As New IccXyzTagType(data)

   Return xyzTagType
End Function


Public Sub IccProfileExtendedExample()
   ' define the IccProfileExtended Class
   Dim iccProfile As New IccProfileExtended()

   ' define the IccHeader class
   Dim header As IccHeader = IccHeader.Empty

   ' filling the ICC header
   ' note that the Illuminant, ProfileSignature, and Version are filled
   ' with the default values in the IccProfile.Empty property,
   ' and they shouldnt be changed unless the user knows what he is doing
   ' the rest of the fields are the user's responsibility
   ' except for the ProfileID which will be filled automatically upon the call
   ' for the method IccProfile.GenerateProfileId, but this method must be called at the
   ' end when the ICC Profile is completely prepared.
   ' Finally, the Size field will be filled automatically by the different ICC methods,
   ' and it shouldnt be changed unless the user knows what he is doing.
   header.CmmID = &H6170706C
   header.DeviceClass = IccProfileClassType.DeviceLinkClass
   header.ColorSpace = IccColorspaceType.LabData
   header.Pcs = IccColorspaceType.LabData
   header.ProfileSignature = &H61637370
   header.Platform = IccPlatformSignatureType.MacintoshSignature
   header.Flags = IccProfileFlags.None
   header.Manufacturer = &H46464549
   header.Model = 0
   header.Attributes = IccProfileMediaFlags.ColorMedia
   header.RenderingIntent = IccRenderingIntentType.AbsoluteColorimetric
   header.Creator = &H46464549

   ' set the system date/time as the date/time of the Icc Profile
   Dim sysDateTime As System.DateTime = System.DateTime.Now
   Dim iccDateTime As New IccDateTime(CUShort(sysDateTime.Year), _
         CUShort(sysDateTime.Month), _
         CUShort(sysDateTime.Day), _
         CUShort(sysDateTime.Hour), _
         CUShort(sysDateTime.Minute), _
         CUShort(sysDateTime.Second))

   header.DateTime = iccDateTime
   iccProfile.Header = header

   ' create all the tags you want
   ' 1- mediaBlackPointTag (needs XYZ tag type)
   Dim xyzTagType As IccXyzTagType = FillIccXyzTagType()

   ' then insert it into the profile
   iccProfile.AddTag(xyzTagType, IccTag.MediaBlackPointTag, IccTagTypeBase.XyzTypeSignature)

   ' 2- calibrationDateTimeTag
   Dim dateTimeTagType As IccDateTimeTagType = FillDateTimeTagType()
   iccProfile.AddTag(dateTimeTagType, IccTag.CalibrationDateTimeTag, IccTagTypeBase.DateTimeTypeSignature)

   ' 3- and so on...

   ' to get the tag type signature of any tag in the profile,
   Dim tagTypeSignature As Integer = iccProfile.GetTagTypeSignature(IccTag.MediaBlackPointTag)

   ' to delete one of the two tags
   xyzTagType = CType(iccProfile.DeleteTag(IccTag.MediaBlackPointTag), IccXyzTagType)

   ' to get the calibrationDateTimeTag
   dateTimeTagType = CType(iccProfile.GetTag(IccTag.CalibrationDateTimeTag), IccDateTimeTagType)

   ' at the end, generate the profileID. For the time being, it will be filled with 0's
   iccProfile.GenerateProfileId()

   ' finally generate the new Icc Profile by generating the Data Array
   ' and then generating the file
   iccProfile.UpdateDataArray()
   iccProfile.GenerateIccFile("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\IccProfileExtendedVB.icc")
End Sub
C#Copy Code
public IccDateTimeTagType FillDateTimeTagType() 

   // get the current system data 
   System.DateTime sysDateTime = System.DateTime.Now; 
   // create a new iccDateTime class 
   IccDateTime iccDateTime = new IccDateTime((ushort)sysDateTime.Year, 
      (ushort)sysDateTime.Month, 
      (ushort)sysDateTime.Day, 
      (ushort)sysDateTime.Hour, 
      (ushort)sysDateTime.Minute, 
      (ushort)sysDateTime.Second); 
 
   // define the tag type 
   IccDateTimeTagType iccDateTimeTagType = new IccDateTimeTagType(iccDateTime); 
 
   return iccDateTimeTagType; 

 
public IccXyzTagType FillIccXyzTagType() 

   // define the array of XYZ numbers 
   IccXyzNumber[] data = new IccXyzNumber[1]; 
   data[0] = new IccXyzNumber( 
      IccTools.FromDoubleTo2bFixed2bNumber(1.0), 
      IccTools.FromDoubleTo2bFixed2bNumber(2.0), 
      IccTools.FromDoubleTo2bFixed2bNumber(3.0)); 
 
   // define the tag type 
   IccXyzTagType xyzTagType = new IccXyzTagType(data); 
 
   return xyzTagType; 

 
 
public void IccProfileExtendedExample() 

   // define the IccProfileExtended Class 
   IccProfileExtended iccProfile = new IccProfileExtended(); 
 
   // define the IccHeader class 
   IccHeader header = IccHeader.Empty; 
 
   // filling the ICC header 
   // note that the Illuminant, ProfileSignature, and Version are filled  
   // with the default values in the IccProfile.Empty property, 
   // and they shouldnt be changed unless the user knows what he is doing 
   // the rest of the fields are the user's responsibility 
   // except for the ProfileID which will be filled automatically upon the call 
   // for the method IccProfile.GenerateProfileId, but this method must be called at the 
   // end when the ICC Profile is completely prepared. 
   // Finally, the Size field will be filled automatically by the different ICC methods, 
   // and it shouldnt be changed unless the user knows what he is doing. 
   header.CmmID = 0x6170706C;     // any CMM ID 
   header.DeviceClass = IccProfileClassType.DeviceLinkClass; 
   header.ColorSpace = IccColorspaceType.LabData; 
   header.Pcs = IccColorspaceType.LabData; 
   header.ProfileSignature = 0x61637370;   // any profile signature 
   header.Platform = IccPlatformSignatureType.MacintoshSignature; 
   header.Flags = IccProfileFlags.None; 
   header.Manufacturer = 0x46464549;       // any manufacturer 
   header.Model = 0x0;   // any model 
   header.Attributes = IccProfileMediaFlags.ColorMedia; 
   header.RenderingIntent = IccRenderingIntentType.AbsoluteColorimetric; 
   header.Creator = 0x46464549;   // any creator 
 
   // set the system date/time as the date/time of the Icc Profile 
   System.DateTime sysDateTime = System.DateTime.Now; 
   IccDateTime iccDateTime = new IccDateTime((ushort)sysDateTime.Year, 
      (ushort)sysDateTime.Month, 
      (ushort)sysDateTime.Day, 
      (ushort)sysDateTime.Hour, 
      (ushort)sysDateTime.Minute, 
      (ushort)sysDateTime.Second); 
 
   header.DateTime = iccDateTime; 
   iccProfile.Header = header; 
   // create all the tags you want 
   // 1- mediaBlackPointTag (needs XYZ tag type) 
   IccXyzTagType xyzTagType = FillIccXyzTagType(); 
 
   // then insert it into the profile 
   iccProfile.AddTag(xyzTagType, IccTag.MediaBlackPointTag, IccTagTypeBase.XyzTypeSignature); 
 
   // 2- calibrationDateTimeTag 
   IccDateTimeTagType dateTimeTagType = FillDateTimeTagType(); 
   iccProfile.AddTag(dateTimeTagType, IccTag.CalibrationDateTimeTag, IccTagTypeBase.DateTimeTypeSignature); 
 
   // 3- and so on... 
 
   // to get the tag type signature of any tag in the profile, 
   int tagTypeSignature = iccProfile.GetTagTypeSignature(IccTag.MediaBlackPointTag); 
 
   // to delete one of the two tags 
   xyzTagType = (IccXyzTagType) iccProfile.DeleteTag(IccTag.MediaBlackPointTag); 
 
   // to get the calibrationDateTimeTag 
   dateTimeTagType = (IccDateTimeTagType) iccProfile.GetTag(IccTag.CalibrationDateTimeTag); 
 
   // at the end, generate the profileID. For the time being, it will be filled with 0's 
   iccProfile.GenerateProfileId(); 
 
   // finally generate the new Icc Profile by updating the Data Array 
   // and then generating the file 
   iccProfile.UpdateDataArray(); 
   iccProfile.GenerateIccFile(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\IccProfileExtendedCS.icc"); 
}

Remarks

  • The data in all the members (except for the data in the tagData and the data arrays)is converted into Little Endian format.
  • The data in the data member and tagData array is not directly accessed. ICC defined methods use the data in them, so they are kept in Big Endian format.
  • When an existing ICC profile is loaded into this structure, the data member contains all of the profile data as one block of memory. The TagData array contains only the tag data in one block of memory.
  • Whether a new ICC profile is being created or an existing one is being modified, the TagData always contains the right values. The Data array, however, will not contain the correct values until a call to the UpdateDataArray method is made. This call updates the Data array with the latest modifications.

Inheritance Hierarchy

System.Object
   Leadtools.ColorConversion.IccProfileExtended

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