mirror of
https://github.com/nothings/stb
synced 2024-12-14 20:12:34 +03:00
Merge branch 'optimize_stbi__ldr_to_hdr' of https://github.com/technik/stb into working
This commit is contained in:
commit
f9d9a419a9
@ -84,6 +84,7 @@ RECENT REVISION HISTORY:
|
||||
Fabian "ryg" Giesen Anael Seghezzi (is-16-bit query)
|
||||
Arseny Kapoulkine
|
||||
John-Mark Allen
|
||||
Carmelo J Fdez-Agüera
|
||||
|
||||
Bug & warning fixes
|
||||
Marc LeBlanc David Woo Guillaume George Martins Mozeiko
|
||||
@ -1679,7 +1680,11 @@ static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp)
|
||||
for (k=0; k < n; ++k) {
|
||||
output[i*comp + k] = (float) (pow(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;
|
||||
}
|
||||
if (n < comp) {
|
||||
for (i=0; i < x*y; ++i) {
|
||||
output[i*comp + n] = data[i*comp + n]/255.0f;
|
||||
}
|
||||
}
|
||||
STBI_FREE(data);
|
||||
return output;
|
||||
|
Loading…
Reference in New Issue
Block a user