mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 10:26:19 +03:00
Stop decoding BC1 punchthrough alpha in BC2&3
This commit is contained in:
parent
d374015504
commit
097f7d0f56
|
@ -69,7 +69,7 @@ decode_565(UINT16 x) {
|
|||
}
|
||||
|
||||
static void
|
||||
decode_bc1_color(rgba *dst, const UINT8 *src) {
|
||||
decode_bc1_color(rgba *dst, const UINT8 *src, int separate_alpha) {
|
||||
bc1_color col;
|
||||
rgba p[4];
|
||||
int n, cw;
|
||||
|
@ -150,13 +150,13 @@ decode_bc3_alpha(char *dst, const UINT8 *src, int stride, int o) {
|
|||
|
||||
static void
|
||||
decode_bc1_block(rgba *col, const UINT8 *src) {
|
||||
decode_bc1_color(col, src);
|
||||
decode_bc1_color(col, src, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
decode_bc2_block(rgba *col, const UINT8 *src) {
|
||||
int n, bitI, byI, av;
|
||||
decode_bc1_color(col, src + 8);
|
||||
decode_bc1_color(col, src + 8, 1);
|
||||
for (n = 0; n < 16; n++) {
|
||||
bitI = n * 4;
|
||||
byI = bitI >> 3;
|
||||
|
@ -168,7 +168,7 @@ decode_bc2_block(rgba *col, const UINT8 *src) {
|
|||
|
||||
static void
|
||||
decode_bc3_block(rgba *col, const UINT8 *src) {
|
||||
decode_bc1_color(col, src + 8);
|
||||
decode_bc1_color(col, src + 8, 1);
|
||||
decode_bc3_alpha((char *)col, src, sizeof(col[0]), 3);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user