Platforms to show: All Mac Windows Linux Cross-Platform

Back to LCMS2ProfileMBS class.

LCMS2ProfileMBS.Constructor(context as LCMS2ContextMBS = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new empty profile.

On success the handle property is not zero.

See also:

LCMS2ProfileMBS.Constructor(file as folderitem, write as boolean = false)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates profile by reading in an existing profile or creating a new profile at the given location.

file: file location.
write: Whether to create new profile.

On success the handle property is not zero.

See also:

LCMS2ProfileMBS.DetectBlackPoint(Intent as Integer, Flags as Integer) as LCMS2CIEXYZMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Estimate the black point.

LCMS2ProfileMBS.DetectDestinationBlackPoint(Intent as Integer, Flags as Integer) as LCMS2CIEXYZMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Calculates the black point of a destination profile.

This algorithm comes from the Adobe paper disclosing its black point compensation method.

LCMS2ProfileMBS.DetectRGBProfileGamma(threshold as double) as double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 22.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Estimate gamma space, always positive.

Returns -1 on error.
threshold e.g. 0.01.

LCMS2ProfileMBS.DetectTAC as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Detects total area coverage.

When several colors are printed on top of each other, there is a limit to the amount of ink that can be put on paper. This maximum total dot percentage is referred to as either TIC (Total Ink Coverage) or TAC (Total Area Coverage). This function does estimate total area coverage for a given profile in %. Only works on output profiles. On RGB profiles, 400% is returned. TAC is detected by subsampling Lab color space on 6x74x74 points.

Returns estimated area coverage in % on success, 0 on error.

LCMS2ProfileMBS.FormatterForBitmap(BitCount as Integer = 8) as UInt32

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Build a suitable formatter for the colorspace of this profile.

This is a convenience function which prepares you a pixel format for use with LCMS2BitmapMBS class.
Formatters are used to describe how bitmap buffers are organized.

Some examples using this method:

LCMS2ProfileMBS.FormatterForColorspace(nBytes as UInt32, IsFloat as boolean = false) as UInt32

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Build a suitable formatter for the colorspace of this profile.

nBytes is number of bytes per color value. For 3 byte RGB, you pass 1 here.
Formatters are used to describe how bitmap buffers are organized.

e.g.
nBytes = 1 and isfloat = false gives UInt8.
nBytes = 2 and isfloat = false gives UInt16.
nBytes = 4 and isfloat = true gives 32-bit float, which is Single in Xojo.
nBytes = 8 and isfloat = true gives 64-bit float, which is Double in Xojo.

Some examples using this method:

LCMS2ProfileMBS.FormatterForPCS(nBytes as UInt32, IsFloat as boolean = false) as UInt32

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Build a suitable formatter for the colorspace of this profile.

Formatters are used to describe how bitmap buffers are organized.

LCMS2ProfileMBS.GetProfileInfo(Info as Integer, LanguageCode as string, CountryCode as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Gets several information strings from the profile, dealing with localization.

Info: A selector of which info to return. (kInfoCopyright, kInfoDescription, kInfoManufacturer or kInfoModel)
Language Code: first name language code from ISO-639/2.
Country Code: first name region code from ISO-3166.

Returns the string. (empty string on error)

LCMS2ProfileMBS.IsCLUT(Intent as UInt32, UsedDirection as UInt32) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns whatever a CLUT is present in the profile for the given intent and direction.

Intent: The intent code.
UsedDirection: UsedAsInput = 0, UsedAsOutput = 1, UsedAsProof = 2.
Returns true CLUT is present for given intent and direction, false otherwise.

LCMS2ProfileMBS.IsIntentSupported(Intent as UInt32, UsedDirection as UInt32) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns true if the requested intent is implemented in the given direction.

Little CMS has a fallback strategy that allows to specify any rendering intent when creating the transform, but the intent really being used may be another if the requested intent is not implemented.

UsedDirection: UsedAsInput = 0, UsedAsOutput = 1, UsedAsProof = 2.
Returns true if the intent is implemented, false otherwise.

LCMS2ProfileMBS.IsTag(TagSignature as Integer) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns true if a tag with signature sig is found on the profile.

Useful to check if a profile contains a given tag.
Returns true if the tag is found or false otherwise.

LCMS2ProfileMBS.LinkTag(sig as Integer, dest as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a directory entry on tag sig that points to same location as tag dest.

Using this function you can collapse several tag entries to the same block in the profile.

sig: Signature of linking tag.
dest: Signature of linked tag.

Returns ture on success, false on error

Some examples using this method:

LCMS2ProfileMBS.MD5computeID as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Computes a MD5 checksum and stores it as Profile ID in the profile header.

Returns true on success or false on failure.

LCMS2ProfileMBS.PostScriptCRD(context as LCMS2ContextMBS, intent as UInt32, flags as UInt32 = 0) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 12.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
A wrapper on cmsGetPostScriptColorResource to simplify CRD generation.

context: Optional a user-defined context cargo.
Intent: The intent code, as described in Intents constants.
Flags: A combination of bit-field kcmsFLAGS* constants.

Returns: The resource as string or an empty string on error.

LCMS2ProfileMBS.PostScriptCSA(context as LCMS2ContextMBS, intent as UInt32, flags as UInt32 = 0) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 12.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
A wrapper on cmsGetPostScriptColorResource to simplify CSA generation.

context: Optional a user-defined context cargo.
Intent: The intent code, as described in Intents constants.
Flags: A combination of bit-field kcmsFLAGS* constants.

Returns: The resource as string or an empty string on error.

LCMS2ProfileMBS.SaveProfileToFile(file as folderitem) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Saves the contents of a profile to a given file.

Returns true on success and false on failure.

Some examples using this method:

LCMS2ProfileMBS.SaveProfileToMemory as Memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Saves the contents of a profile to a memoryblock.

Returns memoryblock on success and nil on failure.

Some examples using this method:

LCMS2ProfileMBS.SaveProfileToString as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Saves the contents of a profile to a string.

Returns string with profile data on success and "" on failure.

Some examples using this method:

LCMS2ProfileMBS.TagLinkedTo(sig as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the tag linked to sig, in the case two tags are sharing same resource, or nil if the tag is not linked to any other tag.

sig: Signature of linking tag.

Returns signature of linked tag, or 0 if no tag is linked.

LCMS2ProfileMBS.TagSignature(index as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the signature of a tag located in n position being n a 0-based index: i.e., first tag is indexed with n=0.

index: index to a tag position (0-based)

Returns the tag signature on success, 0 on error.
Changed in v23.5 to raise exception for invalid index.

LCMS2ProfileMBS.TagSignatures as Integer()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the array of tag signatures.
Example
Var path As String = "/Library/ColorSync/Profiles/Blue Tone.icc"
Var file as new FolderItem(path, FolderItem.PathModes.Native)
Var p As LCMS2ProfileMBS = LCMS2ProfileMBS.OpenProfileFromFile(file)

Var tags() As Integer = p.TagSignatures
Break // inspect array in debugger

The array contains all tags and you can loop over the array and use ReadTag()

The items on this page are in the following plugins: MBS Images Plugin.


The biggest plugin in space...