|
|
@ -1040,7 +1040,7 @@ static stbr_inline void stbr__encode_pixel(void* output_buffer, int output_texel |
|
|
|
|
|
|
|
|
|
|
|
if (premul_alpha_channel) { |
|
|
|
if (premul_alpha_channel) { |
|
|
|
float alpha = encode_buffer[encode_texel_index + premul_alpha_channel]; |
|
|
|
float alpha = encode_buffer[encode_texel_index + premul_alpha_channel]; |
|
|
|
float reciprocal_alpha = alpha ? 1.0 / alpha : 0; |
|
|
|
float reciprocal_alpha = alpha ? 1.0f / alpha : 0; |
|
|
|
for (n = 0; n < channels; n++) |
|
|
|
for (n = 0; n < channels; n++) |
|
|
|
if (n != premul_alpha_channel) |
|
|
|
if (n != premul_alpha_channel) |
|
|
|
encode_buffer[encode_texel_index + n] *= reciprocal_alpha; |
|
|
|
encode_buffer[encode_texel_index + n] *= reciprocal_alpha; |
|
|
|