public void GenerateIccFile(
string fileName
)
public:
void GenerateIccFile(
String^ fileName
)
def GenerateIccFile(self,fileName):
fileName
File name of the generated ICC profile.
using Leadtools;
using Leadtools.ColorConversion;
using Leadtools.Codecs;
public string outputIccFile = Path.Combine(LEAD_VARS.ImagesDir, "IccProfileExtended.icc");
public DateTime sysDateTime = DateTime.Now; // Get the current system data
public void IccProfileExtendedExample()
{
// Define the IccProfileExtended Class
IccProfileExtended iccProfile = new IccProfileExtended();
// Define the IccHeader class
IccHeader header = IccHeader.Empty;
// Fill the ICC header
// The Illuminant, ProfileSignature, and Version are filled with the default values in the IccProfile.Empty property
// The Size field will be filled automatically by the different ICC methods
// These should not be changed unless the user knows what they are doing
// The ProfileID which will be filled using the IccProfile.GenerateProfileId method
// This method must be called at the end when the ICC Profile is completely prepared
// The rest of the fields are the user's responsibility
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
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 and add required tags to the extended profile
// mediaBlackPointTag (needs the XYZ tag type)
// 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));
// Create the XYZ tag type
IccXyzTagType xyzTagType = new IccXyzTagType(data);
// Insert into the profile
iccProfile.AddTag(xyzTagType, IccTag.MediaBlackPointTag, IccTagTypeBase.XyzTypeSignature);
// calibrationDateTimeTag
// Define the tag type
IccDateTimeTagType dateTimeTagType = new IccDateTimeTagType(iccDateTime);
// Insert into the profile
iccProfile.AddTag(dateTimeTagType, IccTag.CalibrationDateTimeTag, IccTagTypeBase.DateTimeTypeSignature);
// This method shows how to get the tag type signature of any tag in the profile
int tagTypeSignature = iccProfile.GetTagTypeSignature(IccTag.MediaBlackPointTag);
// This method shows how to delete a specified tag
xyzTagType = (IccXyzTagType)iccProfile.DeleteTag(IccTag.MediaBlackPointTag);
// This method shows how to retrieve the value of a tag
dateTimeTagType = (IccDateTimeTagType)iccProfile.GetTag(IccTag.CalibrationDateTimeTag);
// Generate the profileId. For the time being, it will be filled with 0's
iccProfile.GenerateProfileId();
// Generate the new ICC profile by updating the Data Array and then generating the file
iccProfile.UpdateDataArray();
iccProfile.GenerateIccFile(outputIccFile);
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.