mirror of https://github.com/nothings/stb.git
add documentation explaining why even a 64K table for srgb_to_uint8 would be inaccurate
This commit is contained in:
parent
9a6af9a8d3
commit
8849501a3f
|
@ -565,6 +565,10 @@ static float stbir__srgb_uchar_to_linear_float[256] = {
|
|||
};
|
||||
|
||||
// sRGB transition values, scaled by 1<<28
|
||||
// note that if you only scaled by 1<<16, all the values would be 4K smaller,
|
||||
// so [1] would be ~10, and so that would have around 5% error (10 +- 0.5)
|
||||
// at the boundary between uint8 0 and 1. This also means that a 64K-entry table
|
||||
// would have the same 5% error there.
|
||||
static int stbir__srgb_offset_to_linear_scaled[256] =
|
||||
{
|
||||
0, 40738, 122216, 203693, 285170, 366648, 448125, 529603,
|
||||
|
|
Loading…
Reference in New Issue