26 int red = 0, green = 0, blue = 0;
30 ret = XpmReadFileToXpmImage(filename, &image, &info);
31 if (
ret != XpmSuccess) {
34 number = image.ncolors;
35 for(i = 0; i < number; i++) {
36 if (!image.colorTable[i].c_color) {
46 for (i = 0; i < number; i++) {
47 switch (
strlen (image.colorTable[i].c_color)) {
50 buf[0] = image.colorTable[i].c_color[1];
53 buf[0] = image.colorTable[i].c_color[2];
56 buf[0] = image.colorTable[i].c_color[3];
62 buf[0] = image.colorTable[i].c_color[1];
63 buf[1] = image.colorTable[i].c_color[2];
66 buf[0] = image.colorTable[i].c_color[3];
67 buf[1] = image.colorTable[i].c_color[4];
70 buf[0] = image.colorTable[i].c_color[5];
71 buf[1] = image.colorTable[i].c_color[6];
77 buf[0] = image.colorTable[i].c_color[1];
78 buf[1] = image.colorTable[i].c_color[2];
79 buf[2] = image.colorTable[i].c_color[3];
83 buf[0] = image.colorTable[i].c_color[4];
84 buf[1] = image.colorTable[i].c_color[5];
85 buf[2] = image.colorTable[i].c_color[6];
89 buf[0] = image.colorTable[i].c_color[7];
90 buf[1] = image.colorTable[i].c_color[8];
91 buf[2] = image.colorTable[i].c_color[9];
98 buf[0] = image.colorTable[i].c_color[1];
99 buf[1] = image.colorTable[i].c_color[2];
100 buf[2] = image.colorTable[i].c_color[3];
101 buf[3] = image.colorTable[i].c_color[4];
105 buf[0] = image.colorTable[i].c_color[5];
106 buf[1] = image.colorTable[i].c_color[6];
107 buf[2] = image.colorTable[i].c_color[7];
108 buf[3] = image.colorTable[i].c_color[8];
112 buf[0] = image.colorTable[i].c_color[9];
113 buf[1] = image.colorTable[i].c_color[10];
114 buf[2] = image.colorTable[i].c_color[11];
115 buf[3] = image.colorTable[i].c_color[12];
125 pointer = (
int *) image.data;
126 for (i = 0; i < image.height; i++) {
127 for (
j = 0;
j < image.width;
j++) {
135 XpmFreeXpmImage(&image);
136 XpmFreeXpmInfo(&info);
zend_ffi_ctype_name_buf buf
gdImagePtr gdImageCreateFromXpm(char *filename)
gdImagePtr gdImageCreate(int sx, int sy)
int gdImageColorResolve(gdImagePtr im, int r, int g, int b)
void gdImageSetPixel(gdImagePtr im, int x, int y, int color)
const phpdbg_color_t * colors[PHPDBG_COLORS]
#define safe_emalloc(nmemb, size, offset)