Skip to content

Commit 1e5237a

Browse files
authored
Removed unused access for I;32L and I;32B (#9238)
2 parents 33eb16b + 5d3086b commit 1e5237a

File tree

1 file changed

+2
-43
lines changed

1 file changed

+2
-43
lines changed

src/libImaging/Access.c

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
#include "Imaging.h"
1313

1414
/* use make_hash.py from the pillow-scripts repository to calculate these values */
15-
#define ACCESS_TABLE_SIZE 35
16-
#define ACCESS_TABLE_HASH 8940
15+
#define ACCESS_TABLE_SIZE 23
16+
#define ACCESS_TABLE_HASH 28677
1717

1818
static struct ImagingAccessInstance access_table[ACCESS_TABLE_SIZE];
1919

@@ -87,30 +87,6 @@ get_pixel_32(Imaging im, int x, int y, void *color) {
8787
memcpy(color, &im->image32[y][x], sizeof(INT32));
8888
}
8989

90-
static void
91-
get_pixel_32L(Imaging im, int x, int y, void *color) {
92-
UINT8 *in = (UINT8 *)&im->image[y][x * 4];
93-
#ifdef WORDS_BIGENDIAN
94-
INT32 out =
95-
in[0] + ((INT32)in[1] << 8) + ((INT32)in[2] << 16) + ((INT32)in[3] << 24);
96-
memcpy(color, &out, sizeof(out));
97-
#else
98-
memcpy(color, in, sizeof(INT32));
99-
#endif
100-
}
101-
102-
static void
103-
get_pixel_32B(Imaging im, int x, int y, void *color) {
104-
UINT8 *in = (UINT8 *)&im->image[y][x * 4];
105-
#ifdef WORDS_BIGENDIAN
106-
memcpy(color, in, sizeof(INT32));
107-
#else
108-
INT32 out =
109-
in[3] + ((INT32)in[2] << 8) + ((INT32)in[1] << 16) + ((INT32)in[0] << 24);
110-
memcpy(color, &out, sizeof(out));
111-
#endif
112-
}
113-
11490
/* store individual pixel */
11591

11692
static void
@@ -131,21 +107,6 @@ put_pixel_16B(Imaging im, int x, int y, const void *color) {
131107
out[1] = in[0];
132108
}
133109

134-
static void
135-
put_pixel_32L(Imaging im, int x, int y, const void *color) {
136-
memcpy(&im->image8[y][x * 4], color, 4);
137-
}
138-
139-
static void
140-
put_pixel_32B(Imaging im, int x, int y, const void *color) {
141-
const char *in = color;
142-
UINT8 *out = (UINT8 *)&im->image8[y][x * 4];
143-
out[0] = in[3];
144-
out[1] = in[2];
145-
out[2] = in[1];
146-
out[3] = in[0];
147-
}
148-
149110
static void
150111
put_pixel_32(Imaging im, int x, int y, const void *color) {
151112
memcpy(&im->image32[y][x], color, sizeof(INT32));
@@ -174,8 +135,6 @@ ImagingAccessInit(void) {
174135
#else
175136
ADD("I;16N", get_pixel_16L, put_pixel_16L);
176137
#endif
177-
ADD("I;32L", get_pixel_32L, put_pixel_32L);
178-
ADD("I;32B", get_pixel_32B, put_pixel_32B);
179138
ADD("F", get_pixel_32, put_pixel_32);
180139
ADD("P", get_pixel_8, put_pixel_8);
181140
ADD("PA", get_pixel_32_2bands, put_pixel_32);

0 commit comments

Comments
 (0)