Name: Anonymous 2019-08-08 9:34
https://gamedev.stackexchange.com/questions/174428/fastest-software-gamma-2-2-for-rgb
because my question is too smart for them.
because my question is too smart for them.
for someone at your levelNice insult. They do not know that the one that asked the question is the legendary creator of Symta and spells of hamstery.
Yet all standard graphic formats mandate the use of gamma=2.2,Any idea why? Is it so that they get to force people to use OpenGL and drive the GPU prices upwards?
#define CFP_MANTISSA_BITS 11
#define CFP_MANTISSA_MASK ((1<<CFP_MANTISSA_BITS)-1)
#define CFP_EXPONENT_BITS (16-CFP_MANTISSA_BITS)
#define CFP_POINT (CFP_MANTISSA_BITS-1)
uint16_t int2cfp(uint32_t n) {
int e = log2(n) - CFP_POINT; //log2 is basically x86 BSF's or ARM's CLZ
if (e < 0) return n; //can be replaced by a table
return (e<<CFP_MANTISSA_BITS) | (n>>e);
}
uint32_t cfp2int(uint16_t n) {
return ((uint32_t)n&CFP_MANTISSA_MASK)<<(n>>CFP_MANTISSA_BITS);
}
__attribute__ ((__target__("f16c"))) uint16_t x86_f2h(float value)
{
return _mm_cvtsi128_si32(_mm_cvtps_ph(_mm_set_ss(value), _MM_FROUND_TO_ZERO));
}
this threadWhy are we stuck with 8bit color?
me comparing 10bit monitors