hughbe / iccreader Goto Github PK
View Code? Open in Web Editor NEWSwift definitions for structures, enumerations and functions defined in the [ICC Profile Format Specification]
Swift definitions for structures, enumerations and functions defined in the [ICC Profile Format Specification]
There's no apparent licensing information for this package or its contents…?
Hello Hugh, (I know, I’m a troublemaker😅)
Working on last version I’ve noticed some things:
func getVersionColorProfile(of profile: ICCColorProfile) -> String {
let majorVersion = profile.header.version.majorVersion
let minorVersion = profile.header.version.minorVersion
let reserved1 = profile.header.version.reserved1
return "\(majorVersion).\(minorVersion).\(reserved1)"
}
For example sRGB_v4_ICC_preference_displayclass.icc (v. 4.2.0
) appears 4.32.0
, AdobeRGB1998.icc (v. 2.1.0
) appears 2.16.0
.
Tag acsp
This tag (pag. 16 of icc32.pdf) for profile file signature (byte offset 36-39) has not ecoding. I can think that it is only necessary to check its presence as rawValue in that byte offset as acsp
. Using profile.getTag(signature: "acsp”)
it returns always nil
. Am I doing something wrong?
Tag desc
The previous refactor facilitated access to header tags like profile.getTag(signature: ICCTagSignature.copyright)!.data
. Getting the profile name only desc tag is no longer possible.
Using profile.getTag(signature: ICCTagSignature.profileDescription.value)
the console log is:
ICCTag(signature: ICCReader.ICCSignature(value: "desc"), type: ICCReader.ICCSignature(value: "desc"), data: ICCReader.ICCTagData.textDescription(ICCReader.textDescriptionType(sig: ICCReader.ICCSignature(value: "desc"), reserved: 0, count: 17, desc: "Adobe RGB (1998)", ucLangCode: 0, ucCount: 0, ucDesc: "", scCode: 0, scCount: 0, scDesc: “”)))
Are changes needed or am I probably doing something wrong to get for example only Adobe RGB (1998)?
According to ICC.2-2019 the gamma value should appear in 10.2.2 curveType to retrieve values such as:
"ROMMRGB" : 1.8
"DisplayP3": 2.4
"Adobe98" : 2.2
Printing tag rTRC - gTRC - bTRC
profile `DisplayP3" (gamma 2.4):
print(profile.getTag(signature: "rTRC"))
// Optional(ICCReader.ICCTag(signature: ICCReader.ICCSignature(value: "rTRC"), type: ICCReader.ICCSignature(value: "para"), data: ICCReader.ICCTagData.parametricCurve(ICCReader.parametricCurveType(sig: ICCReader.ICCSignature(value: "para"), reserved1: 0, functionType: 3, reserved2: 0, values: [ICCReader.s15Fixed16Number(iPart: 2, fPart: 26214), ICCReader.s15Fixed16Number(iPart: 0, fPart: 62119), ICCReader.s15Fixed16Number(iPart: 0, fPart: 3417), ICCReader.s15Fixed16Number(iPart: 0, fPart: 5072), ICCReader.s15Fixed16Number(iPart: 0, fPart: 2651)]))))
Following your code how can I get this gamma value?
Finally seems sRGB cannot be expressed as a single numeric value. Is there a way to return 1024 points
. Is it possible to use the same method to get the standard-2.2
?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.