Add alpha channel to QOI_HASH

This commit is contained in:
Dominic Szablewski 2021-12-08 11:30:58 +01:00
parent eb29269432
commit d6b1ec673a

2
qoi.h
View File

@ -312,7 +312,7 @@ void *qoi_decode(const void *data, int size, qoi_desc *desc, int channels);
#define QOI_MASK_2 0xc0 // 11000000 #define QOI_MASK_2 0xc0 // 11000000
#define QOI_COLOR_HASH(C) (C.rgba.r * 3 + C.rgba.g * 5 + C.rgba.b * 7) #define QOI_COLOR_HASH(C) (C.rgba.r * 3 + C.rgba.g * 5 + C.rgba.b * 7 + C.rgba.a * 11)
#define QOI_MAGIC \ #define QOI_MAGIC \
(((unsigned int)'q') << 24 | ((unsigned int)'o') << 16 | \ (((unsigned int)'q') << 24 | ((unsigned int)'o') << 16 | \
((unsigned int)'i') << 8 | ((unsigned int)'f')) ((unsigned int)'i') << 8 | ((unsigned int)'f'))