mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
BcnDecode: add comment about BC2&3 color blocks
This commit is contained in:
parent
ddd3a2b482
commit
b08c514ee7
|
@ -84,7 +84,10 @@ decode_bc1_color(rgba *dst, const UINT8 *src, int separate_alpha) {
|
|||
r1 = p[1].r;
|
||||
g1 = p[1].g;
|
||||
b1 = p[1].b;
|
||||
if (col.c0 > col.c1) {
|
||||
|
||||
|
||||
/* NOTE: BC2 and BC3 reuse BC1 color blocks but always act like c0 > c1 */
|
||||
if (col.c0 > col.c1 || separate_alpha) {
|
||||
p[2].r = (2 * r0 + 1 * r1) / 3;
|
||||
p[2].g = (2 * g0 + 1 * g1) / 3;
|
||||
p[2].b = (2 * b0 + 1 * b1) / 3;
|
||||
|
|
Loading…
Reference in New Issue
Block a user