Lines Matching refs:im
11 extern void gdImageGd (gdImagePtr im, FILE * out);
22 int _gdGetColors (gdIOCtx * in, gdImagePtr im, int gd2xFlag) in _gdGetColors() argument
34 if (trueColorFlag != im->trueColor) { in _gdGetColors()
38 if (!im->trueColor) { in _gdGetColors()
39 if (!gdGetWord(&im->colorsTotal, in)) { in _gdGetColors()
42 if (im->colorsTotal > gdMaxColors) { in _gdGetColors()
47 if (!gdGetInt(&im->transparent, in)) { in _gdGetColors()
51 if (!gdGetByte(&im->colorsTotal, in)) { in _gdGetColors()
54 if (!gdGetWord(&im->transparent, in)) { in _gdGetColors()
57 if (im->transparent == 257) { in _gdGetColors()
58 im->transparent = (-1); in _gdGetColors()
62 GD2_DBG(printf("Pallette had %d colours (T=%d)\n", im->colorsTotal, im->transparent)); in _gdGetColors()
64 if (im->trueColor) { in _gdGetColors()
69 if (!gdGetByte(&im->red[i], in)) { in _gdGetColors()
72 if (!gdGetByte(&im->green[i], in)) { in _gdGetColors()
75 if (!gdGetByte(&im->blue[i], in)) { in _gdGetColors()
79 if (!gdGetByte(&im->alpha[i], in)) { in _gdGetColors()
85 for (i = 0; i < im->colorsTotal; i++) { in _gdGetColors()
86 im->open[i] = 0; in _gdGetColors()
99 gdImagePtr im; in _gdCreateFromFile() local
124 im = gdImageCreateTrueColor(*sx, *sy); in _gdCreateFromFile()
126 im = gdImageCreate(*sx, *sy); in _gdCreateFromFile()
128 if(!im) { in _gdCreateFromFile()
131 if (!_gdGetColors(in, im, gd2xFlag)) { in _gdCreateFromFile()
135 return im; in _gdCreateFromFile()
137 gdImageDestroy(im); in _gdCreateFromFile()
144 gdImagePtr im; in gdImageCreateFromGd() local
148 im = gdImageCreateFromGdCtx(in); in gdImageCreateFromGd()
152 return im; in gdImageCreateFromGd()
157 gdImagePtr im; in gdImageCreateFromGdPtr() local
159 im = gdImageCreateFromGdCtx(in); in gdImageCreateFromGdPtr()
162 return im; in gdImageCreateFromGdPtr()
169 gdImagePtr im; in gdImageCreateFromGdCtx() local
172 im = _gdCreateFromFile(in, &sx, &sy); in gdImageCreateFromGdCtx()
174 if (im == NULL) { in gdImageCreateFromGdCtx()
180 if (im->trueColor) { in gdImageCreateFromGdCtx()
187 im->tpixels[y][x] = pix; in gdImageCreateFromGdCtx()
199 im->pixels[y][x] = ch; in gdImageCreateFromGdCtx()
204 return im; in gdImageCreateFromGdCtx()
207 gdImageDestroy (im); in gdImageCreateFromGdCtx()
212 void _gdPutColors (gdImagePtr im, gdIOCtx * out) in _gdPutColors() argument
216 gdPutC(im->trueColor, out); in _gdPutColors()
217 if (!im->trueColor) { in _gdPutColors()
218 gdPutWord(im->colorsTotal, out); in _gdPutColors()
220 gdPutInt(im->transparent, out); in _gdPutColors()
221 if (!im->trueColor) { in _gdPutColors()
223 gdPutC((unsigned char) im->red[i], out); in _gdPutColors()
224 gdPutC((unsigned char) im->green[i], out); in _gdPutColors()
225 gdPutC((unsigned char) im->blue[i], out); in _gdPutColors()
226 gdPutC((unsigned char) im->alpha[i], out); in _gdPutColors()
231 static void _gdPutHeader (gdImagePtr im, gdIOCtx * out) in _gdPutHeader() argument
236 if (im->trueColor) { in _gdPutHeader()
241 gdPutWord(im->sx, out); in _gdPutHeader()
242 gdPutWord(im->sy, out); in _gdPutHeader()
244 _gdPutColors(im, out); in _gdPutHeader()
247 static void _gdImageGd (gdImagePtr im, gdIOCtx * out) in _gdImageGd() argument
251 _gdPutHeader(im, out); in _gdImageGd()
253 for (y = 0; y < im->sy; y++) { in _gdImageGd()
254 for (x = 0; x < im->sx; x++) { in _gdImageGd()
256 if (im->trueColor) { in _gdImageGd()
257 gdPutInt(im->tpixels[y][x], out); in _gdImageGd()
259 gdPutC((unsigned char) im->pixels[y][x], out); in _gdImageGd()
265 void gdImageGd (gdImagePtr im, FILE * outFile) in gdImageGd() argument
268 _gdImageGd(im, out); in gdImageGd()
272 void *gdImageGdPtr (gdImagePtr im, int *size) in gdImageGdPtr() argument
276 _gdImageGd(im, out); in gdImageGdPtr()