Re #4477: All usage (except Lua) of double converted to float. printf("%f") still uses promotion to double, (floating point va_args are always promoted to double) (#4483)
This commit is contained in:
committed by
Bertrand Songis
parent
f36d01d560
commit
2fbd1d8955
Vendored
+2
-2
@@ -1404,7 +1404,7 @@ static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp)
|
||||
if (comp & 1) n = comp; else n = comp-1;
|
||||
for (i=0; i < x*y; ++i) {
|
||||
for (k=0; k < n; ++k) {
|
||||
output[i*comp + k] = (float) (pow(data[i*comp+k]/255.0f, stbi__l2h_gamma) * stbi__l2h_scale);
|
||||
output[i*comp + k] = (float) (powf(data[i*comp+k]/255.0f, stbi__l2h_gamma) * stbi__l2h_scale);
|
||||
}
|
||||
if (k < comp) output[i*comp + k] = data[i*comp+k]/255.0f;
|
||||
}
|
||||
@@ -1424,7 +1424,7 @@ static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp)
|
||||
if (comp & 1) n = comp; else n = comp-1;
|
||||
for (i=0; i < x*y; ++i) {
|
||||
for (k=0; k < n; ++k) {
|
||||
float z = (float) pow(data[i*comp+k]*stbi__h2l_scale_i, stbi__h2l_gamma_i) * 255 + 0.5f;
|
||||
float z = (float) powf(data[i*comp+k]*stbi__h2l_scale_i, stbi__h2l_gamma_i) * 255 + 0.5f;
|
||||
if (z < 0) z = 0;
|
||||
if (z > 255) z = 255;
|
||||
output[i*comp + k] = (stbi_uc) stbi__float2int(z);
|
||||
|
||||
Reference in New Issue
Block a user