I'm looking at a 1% error in what I expect my gamma to be and now I'm wondering 
if it is an LCMS bug! Run this program. 

#include "lcms.h"

int main (int argc, const char * argv[]) {
        
        const int numberOfEntries = 100;

        LPGAMMATABLE transferFunctionsDebug;
        transferFunctionsDebug = cmsBuildGamma(numberOfEntries, 1.0);

        int max = transferFunctionsDebug[0].GammaTable[numberOfEntries-1];

        float value;
        int vInt;
        
        for(int i =0; i < 100; i++) {
                value = i;                                                      
        // convert to float
                value = (value * max)/numberOfEntries;          // normalize to 
gamma range
                vInt = (int) (value + 0.5);
                
                fprintf(stdout, "%d\t%d\n", vInt, 
transferFunctionsDebug->GammaTable[i]);
        }
}

I get this output:

0       0
655     662
1311    1324
...
62914   63549
63569   64211
64224   64873
64880   65535

I would have expected the columns to be the same. Does cmsBuildGamma not build 
a perfectly linear LUT?


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to