cmft icon indicating copy to clipboard operation
cmft copied to clipboard

Typo in RGBM encoding?

Open nxddsnc opened this issue 4 years ago • 0 comments

https://github.com/dariomanesku/cmft/blob/cad5f31bac66fd05987d667af62311c444df6d46/src/cmft/image.cpp#L2672 The float m value is overrided in the next line. According to http://graphicrants.blogspot.com/2009/04/rgbm-color-encoding.html, it should be something like:

            rgbm[3] = fsaturate(fmaxf(fmaxf(rgbm[0], rgbm[1]), fmaxf(rgbm[2], 1e-6f)));
            float m = ceil(rgbm[3] * 255.0f) / 255.0f;

Please correct me if I'm wrong.

nxddsnc avatar May 28 '20 08:05 nxddsnc