Skip to content

Commit 80af77d

Browse files
authored
Merge pull request #1 from radarhere/unpack-bgra16
Updated BGRA comments
2 parents e500dcf + 29c122f commit 80af77d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libImaging/Unpack.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ ImagingUnpackBGR15(UINT8 *out, const UINT8 *in, int pixels) {
705705
void
706706
ImagingUnpackBGRA15(UINT8 *out, const UINT8 *in, int pixels) {
707707
int i, pixel;
708-
/* RGB, reversed bytes, 5/5/5/1 bits per pixel */
708+
/* RGB, rearranged channels, 5/5/5/1 bits per pixel */
709709
for (i = 0; i < pixels; i++) {
710710
pixel = in[0] + (in[1] << 8);
711711
out[B] = (pixel & 31) * 255 / 31;
@@ -1056,7 +1056,7 @@ unpackABGR(UINT8 *_out, const UINT8 *in, int pixels) {
10561056
static void
10571057
unpackBGRA(UINT8 *_out, const UINT8 *in, int pixels) {
10581058
int i;
1059-
/* RGBA, reversed bytes */
1059+
/* RGBA, rearranged channels */
10601060
for (i = 0; i < pixels; i++) {
10611061
UINT32 iv = MAKE_UINT32(in[2], in[1], in[0], in[3]);
10621062
memcpy(_out, &iv, sizeof(iv));
@@ -1068,7 +1068,7 @@ unpackBGRA(UINT8 *_out, const UINT8 *in, int pixels) {
10681068
static void
10691069
unpackBGRA16L(UINT8 *_out, const UINT8 *in, int pixels) {
10701070
int i;
1071-
/* 16-bit RGBA, little-endian order, reversed words */
1071+
/* 16-bit RGBA, little-endian order, rearranged channels */
10721072
for (i = 0; i < pixels; i++) {
10731073
UINT32 iv = MAKE_UINT32(in[5], in[3], in[1], in[7]);
10741074
memcpy(_out, &iv, sizeof(iv));
@@ -1080,7 +1080,7 @@ unpackBGRA16L(UINT8 *_out, const UINT8 *in, int pixels) {
10801080
static void
10811081
unpackBGRA16B(UINT8 *_out, const UINT8 *in, int pixels) {
10821082
int i;
1083-
/* 16-bit RGBA, big-endian order, reversed words */
1083+
/* 16-bit RGBA, big-endian order, rearranged channels */
10841084
for (i = 0; i < pixels; i++) {
10851085
UINT32 iv = MAKE_UINT32(in[4], in[2], in[0], in[6]);
10861086
memcpy(_out, &iv, sizeof(iv));

0 commit comments

Comments
 (0)