Hi Guy, Guy K. Kloss wrote: > Hi, > > I'm trying to access the gamma tables from ICC profile tags. Unfortunately > the > documentation is a bit spotty on the subject of gamma tables. E. g. these > four > functions are mentioned in LCMSAPI.TXT, but they're not described: > > LPGAMMATABLE > cmsReadICCGamma(cmsHPROFILE hProfile, icTagSignature sig); > > LPGAMMATABLE > cmsReadICCGammaReversed(cmsHPROFILE hProfile, icTagSignature sig); > > int > cmsReadICCText(cmsHPROFILE hProfile, icTagSignature sig, char *Text); > > int > cmsReadICCTextEx(cmsHPROFILE hProfile, icTagSignature sig, char *Text, > size_t size); > > > I'm just assuming that cmsReadICCGamma() retrieves a gamma table from an ICC > profile tag, and cmsReadICCGammaReversed() does the same, but reverses it > (using cmsReverseGamma()). Is that correct? > Yes. In some situations the reversing is more efficient in this way. For example when the gamma is stored as a single number in the profile.
> I've got no idea what the other two are doing. > > Read any text-based tag, like copyright and description.cmsReadICCTextEx was introduced latter to allow a second parameter for maximum buffer size. > What also is not clear to me is this: How do I get access to the pre- and > post-linearisation tables (L1 and L2) from an AToBx/BToAx tag? I presume > these > are handled as gamma tables, but I could not find any documentation or > anything sensible to identify the specific tables to access them. Of course I > can get the LPLUT reference using cmsReadICCLut(), and then access the L1 > and > L2 attributes of it directly. But the way the information is encoded in them > is not really unambiguously comprehensible to me. L1/L2 are arrays of 16 > LPWORDs. Am I correct that the tag may contain 16 of these tables at the max, > and I can find the linearisation table for channel n by accessing element > [n-1] of that attribute? Does each of these L1 tables contain InputEntries > elements and each of the L2 tables contain OutputEntries elements? > You can't unless you access directly LPLUT. There are no functions to retrieve LPLUT members, only functions to set them. This (weird) behaviour is fixed in 2.0 with a new different approach (the pipelines). And yes, L1,L2,L3L4 are linearization curves, one for channel (up to 15). The use depends of the Lut type, as some v4 ones are more complicated. > Furthermore this function below is in lcms.h, and it is also used in the > sample codes. From that the behaviour is quite clear, but it is not even > mentioned in the API documentation: > > LPGAMMATABLE > cmsJoinGammaEx(LPGAMMATABLE, LPGAMMATABLE, c_int); > > I know that the whole concept of gamma tables is to be revised in the 2.0 > version (I believe they were basically to be renamed to "tone curves" or so). > But still I'd like to know how I need to approach things for now in an LCMS > 1.x environment. > Sure. There was many things to fix on this part. So, 2.0 tone curves does include all gamma functionality and new ways like segmented curves.Also, LPLUT is now superseeded by pipelines, which basically are chains of operations which can include matrixes, CLUTS and tone curves. Hopefully that would clarify a little bit all that mess. Regards Marti ------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev _______________________________________________ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user