Fix the LUMINANCE of rgba8_image_to_tex_image_data

The internal format and format values match, thus the canvas or image input
must be interpreted as already in LUMINANCE format.
This commit is contained in:
Anthony Ramine 2018-09-08 19:24:24 +02:00
parent 9a362391d5
commit e61c7b757f
5 changed files with 26 additions and 1243 deletions

View file

@ -4035,10 +4035,7 @@ fn rgba8_image_to_tex_image_data(
},
(TexFormat::Luminance, TexDataType::UnsignedByte) => {
for i in 0..pixel_count {
let p = {
let rgb = &pixels[i * 4..i * 4 + 3];
luminance(rgb[0], rgb[1], rgb[2])
};
let p = pixels[i * 4];
pixels[i] = p;
}
pixels.truncate(pixel_count);