←Select platform

IccHeader Structure

Summary
Contains all the information and data about an ICC profile header.
Syntax
C#
C++/CLI
Python
public struct IccHeader 
public value class IccHeader : public System.ValueType  
class IccHeader: 
Remarks
  • The CmmID value shall match a CMM type signature registered in the ICC registry. If no preferred CMM is identified, this member shall be set to zero (00000000h). The registration authority for this data is the ICC Technical Secretary. See the ICC web site (https://www.color.org/index.xalter) for contact information.
  • The Version shall contain the value 0x04200000h for ICC version 4.2.0.0 over which this ICC profile structure and all the methods associated with it was built.
  • For all profile classes, other than a device link profile, the profile connection space member Pcs shall be either XyzData or LabData. When the device class is a device link profile, the value of the profile connection space shall be the appropriate color space from the list in IccColorspaceType.
  • The ProfileSignature contains the fixed value of 0x61637379h.
  • If there is no primary platform identified, the Platform shall be set to NoPlatformSignature.
  • The Manufacturer and Model values shall match the signature contained in the appropriate section of the ICC signature registry found at (https://www.color.org/index.xalter). If not used, this member shall be set to zero (00000000h).
  • For the Illuminant member, the only illuminant permitted for the profile connection space is D50 (where X=0.9642; Y=1.0 and z=0.8249).
  • The Creator value shall match the signature contained in the device manufacturer section of the ICC signature registry found at (https://www.color.org/index.xalter). If not used, this member shall be set to zero (00000000h).
  • The ProfileId value is generated using the MD5 fingerprinting method as defined in the Internet RFC 1321. If it has not been calculated, the value of the ProfileId shall be set to zero (00000000h).
  • The Reserved value reserved for future ICC definition and shall be set to zero (00000000h).
Example
C#
using Leadtools; 
using Leadtools.ColorConversion; 
 
 
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 shouldn't 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 shouldn't 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(); 
   string IccfileName = Path.Combine(LEAD_VARS.ImagesDir, "IccProfileExtendedCS.icc"); 
   iccProfile.GenerateIccFile(IccfileName); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

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

Leadtools.ColorConversion Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.