Skip to content

Commit 58dd0ab

Browse files
radarhereYay295
authored andcommitted
Removed unpackers with identical output
1 parent f5ad3bd commit 58dd0ab

File tree

1 file changed

+3
-33
lines changed

1 file changed

+3
-33
lines changed

src/libImaging/Unpack.c

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -882,36 +882,6 @@ ImagingUnpackBGR565(UINT8 *out, const UINT8 *in, const int pixels) {
882882
}
883883
}
884884

885-
void
886-
ImagingUnpackRGB4B(UINT8 *out, const UINT8 *in, int pixels) {
887-
int i, pixel;
888-
/* RGB, 4 bits per pixel, little-endian */
889-
for (i = 0; i < pixels; i++) {
890-
pixel = in[0] + (in[1] << 8);
891-
out[R] = (pixel & 15) * 17;
892-
out[G] = ((pixel >> 4) & 15) * 17;
893-
out[B] = ((pixel >> 8) & 15) * 17;
894-
out[A] = 255;
895-
out += 4;
896-
in += 2;
897-
}
898-
}
899-
900-
void
901-
ImagingUnpackRGBA4B(UINT8 *out, const UINT8 *in, int pixels) {
902-
int i, pixel;
903-
/* RGBA, 4 bits per pixel, little-endian */
904-
for (i = 0; i < pixels; i++) {
905-
pixel = in[0] + (in[1] << 8);
906-
out[R] = (pixel & 15) * 17;
907-
out[G] = ((pixel >> 4) & 15) * 17;
908-
out[B] = ((pixel >> 8) & 15) * 17;
909-
out[A] = ((pixel >> 12) & 15) * 17;
910-
out += 4;
911-
in += 2;
912-
}
913-
}
914-
915885
static void
916886
ImagingUnpackXBGR4(UINT8 *out, const UINT8 *in, const int pixels) {
917887
/* XBGR, 4 bits per pixel, little-endian */
@@ -1783,7 +1753,7 @@ static struct {
17831753
{"RGB", "RGB;565", 16, ImagingUnpackRGB565},
17841754
{"RGB", "BGR;16", 16, ImagingUnpackBGR16},
17851755
{"RGB", "BGR;565", 16, ImagingUnpackBGR565},
1786-
{"RGB", "RGB;4B", 16, ImagingUnpackRGB4B},
1756+
{"RGB", "RGB;4B", 16, ImagingUnpackXBGR4},
17871757
{"RGB", "XBGR;4", 16, ImagingUnpackXBGR4},
17881758
{"RGB", "ABGR;4", 16, ImagingUnpackABGR4},
17891759
{"RGB", "BGR;5", 16, ImagingUnpackBGR15}, /* compat */
@@ -1835,7 +1805,7 @@ static struct {
18351805
{"RGBA", "RGBA;15", 16, ImagingUnpackRGBA15},
18361806
{"RGBA", "BGRA;15", 16, ImagingUnpackBGRA15},
18371807
{"RGBA", "BGRA;15Z", 16, ImagingUnpackBGRA15Z},
1838-
{"RGBA", "RGBA;4B", 16, ImagingUnpackRGBA4B},
1808+
{"RGBA", "RGBA;4B", 16, ImagingUnpackABGR4},
18391809
{"RGBA", "ABGR;4", 16, ImagingUnpackABGR4},
18401810
{"RGBA", "RGBA;16L", 64, unpackRGBA16L},
18411811
{"RGBA", "RGBA;16B", 64, unpackRGBA16B},
@@ -1904,7 +1874,7 @@ static struct {
19041874
{"RGBX", "BGR;15", 16, ImagingUnpackBGR15},
19051875
{"RGBX", "XBGR;1555", 16, ImagingUnpackXBGR1555},
19061876
{"RGBX", "BGR;565", 16, ImagingUnpackBGR565},
1907-
{"RGBX", "RGB;4B", 16, ImagingUnpackRGB4B},
1877+
{"RGBX", "RGB;4B", 16, ImagingUnpackXBGR4},
19081878
{"RGBX", "XBGR;4", 16, ImagingUnpackXBGR4},
19091879
{"RGBX", "BGR;5", 16, ImagingUnpackBGR15}, /* compat */
19101880
{"RGBX", "RGBX", 32, copy4},

0 commit comments

Comments
 (0)