On Sun, Aug 30, 2015 at 5:05 PM, <marti.ma...@littlecms.com> wrote: > > Hi, > > Okay, so you are suggesting I try to take a set of colors, generated spaced >> out over the different channels(so if I were to make 10 samples per >> channel, RGB would give me 10³ colors and CMYK would give me 10⁴ colors... >> perhaps a bit too many samples). Then transform those colors to XYZ(using >> relative colorimetric mapping as indicated by your suggestion of the AtoB1 >> tag), then to xyY, find the outliers, draw a polygon around them, and then >> use that to give feedback on the gamut? >> > > Yes, could work. Just use 5^3 or 5^4 points, would be be enough for this > purpose. > > > That still doesn't help me because when I use this code, which is the only >> version of the code that compiles and doesn't crash(it crashes when I try >> to read the PCS as an array)... >> if (cmsIsTag(d->profile, cmsSigColorantTableTag)) { >> d->namedColorList = ((cmsNAMEDCOLORLIST *)cmsReadTag >> (d->profile, cmsSigColorantTableTag)); >> for (cmsUInt16Number >> i=0;i<cmsNamedColorCount(d->namedColorList);i++) { >> char name; >> char prefix; >> char suffix; >> cmsUInt16Number pcs; >> cmsUInt16Number col; >> cmsNamedColorInfo(d->namedColorList, i, &name, &prefix, >> &suffix, &pcs, &col); >> qDebug()<<d->name<<i<<","<< name<<","<< prefix<<","<< >> suffix; >> if (pcs){qDebug()<<pcs;} else {qDebug()<<"no pcs >> retrieved";} >> } >> } >> } >> > > > > Try this, with the sizes the manual says: > > > Name: Pointer to a 256-char array to get the name, NULL to ignore. >>> Prefix: Pointer to a 33-char array to get the prefix, NULL to ignore >>> Suffix: Pointer to a 33-char array to get the suffix, NULL to ignore. >>> PCS: Pointer to a 3-cmsUInt16Number to get the encoded PCS, NULL to >>> ignore >>> Colorant: Pointer to a 16-cmsUInt16Number to get the encoded Colorant, >>> NULL to ignore >>> >> > > for (cmsUInt16Number i=0;i<cmsNamedColorCount(d->namedColorList);i++) { > char name[256]; > char prefix[33]; > char suffix[33]; > cmsUInt16Number pcs[3]; > cmsUInt16Number col[16]; > cmsNamedColorInfo(d->namedColorList, i, name, prefix, suffix, pcs, col); > > Yes, the declartion difference indeed helped. Thanks! (Now to ponder if it's actually of any use considering Krita itself doesn't support named color profiles outside of the rare CMYK profile)
> > Well, I am not very interested in the exact implementation either. As a >> Krita programmer, I need three things: A way to linearise values from a >> color in a given color space, a way to de-linearise linear values into >> colors in a given colorspace(both for luminance calculations in filters), >> > > Okay, so you need 2 profiles. One describing the space linearized and > another describing the space delinearized. Use color transforms and > floating > point to convert between spaces and forgot messing out with TRC. > Hacking the internal of profiles is always a bad idea. > Okay, so, if I do not have such a linear profile on hand, I assume you would suggest making the profile on the fly using LCMs' profile making functionality? > > For the use feedback, you can use softproofing, but it is hard to say... > if done porperly you should see no differences. > > Well, the thing is that color maths is different between profiles with different TRCs. In particular, blending in non-linear spaces can give darkened halos in color mixtures, as well, the mixing of black and white feels different between different TRCs. As Krita is an image authoring program, those subtle difference are very clear to the user and I just want to be able to give the best possible feedback on what they can expect. > Sorry if I am asking too many questions, but I am not very experienced with >> programming and in these particular cases it seems there's not many people >> who have come before me. >> > > Your questions are interesting and you are welcome. > Regards > Marti > > Alright, well, if nothing else, at the very least there's documented answers to these questions now :) -- Wolthera
------------------------------------------------------------------------------
_______________________________________________ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user