Lines Matching refs:im

166 static void gdImageBrushApply(gdImagePtr im, int x, int y);
167 static void gdImageTileApply(gdImagePtr im, int x, int y);
169 int gdImageGetTrueColorPixel(gdImagePtr im, int x, int y);
174 gdImagePtr im; in gdImageCreate() local
186 im = (gdImage *) gdCalloc(1, sizeof(gdImage)); in gdImageCreate()
189 im->pixels = (unsigned char **) gdMalloc(sizeof(unsigned char *) * sy); in gdImageCreate()
190 im->polyInts = 0; in gdImageCreate()
191 im->polyAllocated = 0; in gdImageCreate()
192 im->brush = 0; in gdImageCreate()
193 im->tile = 0; in gdImageCreate()
194 im->style = 0; in gdImageCreate()
197 im->pixels[i] = (unsigned char *) gdCalloc(sx, sizeof(unsigned char)); in gdImageCreate()
199 im->sx = sx; in gdImageCreate()
200 im->sy = sy; in gdImageCreate()
201 im->colorsTotal = 0; in gdImageCreate()
202 im->transparent = (-1); in gdImageCreate()
203 im->interlace = 0; in gdImageCreate()
204 im->thick = 1; in gdImageCreate()
205 im->AA = 0; in gdImageCreate()
207 im->open[i] = 1; in gdImageCreate()
208 im->red[i] = 0; in gdImageCreate()
209 im->green[i] = 0; in gdImageCreate()
210 im->blue[i] = 0; in gdImageCreate()
212 im->trueColor = 0; in gdImageCreate()
213 im->tpixels = 0; in gdImageCreate()
214 im->cx1 = 0; in gdImageCreate()
215 im->cy1 = 0; in gdImageCreate()
216 im->cx2 = im->sx - 1; in gdImageCreate()
217 im->cy2 = im->sy - 1; in gdImageCreate()
218 im->res_x = GD_RESOLUTION; in gdImageCreate()
219 im->res_y = GD_RESOLUTION; in gdImageCreate()
220 im->interpolation = NULL; in gdImageCreate()
221 im->interpolation_id = GD_BILINEAR_FIXED; in gdImageCreate()
222 return im; in gdImageCreate()
228 gdImagePtr im; in gdImageCreateTrueColor() local
240 im = (gdImage *) gdMalloc(sizeof(gdImage)); in gdImageCreateTrueColor()
241 memset(im, 0, sizeof(gdImage)); in gdImageCreateTrueColor()
242 im->tpixels = (int **) gdMalloc(sizeof(int *) * sy); in gdImageCreateTrueColor()
243 im->polyInts = 0; in gdImageCreateTrueColor()
244 im->polyAllocated = 0; in gdImageCreateTrueColor()
245 im->brush = 0; in gdImageCreateTrueColor()
246 im->tile = 0; in gdImageCreateTrueColor()
247 im->style = 0; in gdImageCreateTrueColor()
249 im->tpixels[i] = (int *) gdCalloc(sx, sizeof(int)); in gdImageCreateTrueColor()
251 im->sx = sx; in gdImageCreateTrueColor()
252 im->sy = sy; in gdImageCreateTrueColor()
253 im->transparent = (-1); in gdImageCreateTrueColor()
254 im->interlace = 0; in gdImageCreateTrueColor()
255 im->trueColor = 1; in gdImageCreateTrueColor()
262 im->saveAlphaFlag = 0; in gdImageCreateTrueColor()
263 im->alphaBlendingFlag = 1; in gdImageCreateTrueColor()
264 im->thick = 1; in gdImageCreateTrueColor()
265 im->AA = 0; in gdImageCreateTrueColor()
266 im->cx1 = 0; in gdImageCreateTrueColor()
267 im->cy1 = 0; in gdImageCreateTrueColor()
268 im->cx2 = im->sx - 1; in gdImageCreateTrueColor()
269 im->cy2 = im->sy - 1; in gdImageCreateTrueColor()
270 im->res_x = GD_RESOLUTION; in gdImageCreateTrueColor()
271 im->res_y = GD_RESOLUTION; in gdImageCreateTrueColor()
272 im->interpolation = NULL; in gdImageCreateTrueColor()
273 im->interpolation_id = GD_BILINEAR_FIXED; in gdImageCreateTrueColor()
274 return im; in gdImageCreateTrueColor()
277 void gdImageDestroy (gdImagePtr im) in gdImageDestroy() argument
280 if (im->pixels) { in gdImageDestroy()
281 for (i = 0; i < im->sy; i++) { in gdImageDestroy()
282 gdFree(im->pixels[i]); in gdImageDestroy()
284 gdFree(im->pixels); in gdImageDestroy()
286 if (im->tpixels) { in gdImageDestroy()
287 for (i = 0; i < im->sy; i++) { in gdImageDestroy()
288 gdFree(im->tpixels[i]); in gdImageDestroy()
290 gdFree(im->tpixels); in gdImageDestroy()
292 if (im->polyInts) { in gdImageDestroy()
293 gdFree(im->polyInts); in gdImageDestroy()
295 if (im->style) { in gdImageDestroy()
296 gdFree(im->style); in gdImageDestroy()
298 gdFree(im); in gdImageDestroy()
301 int gdImageColorClosest (gdImagePtr im, int r, int g, int b) in gdImageColorClosest() argument
303 return gdImageColorClosestAlpha (im, r, g, b, gdAlphaOpaque); in gdImageColorClosest()
306 int gdImageColorClosestAlpha (gdImagePtr im, int r, int g, int b, int a) in gdImageColorClosestAlpha() argument
314 if (im->trueColor) { in gdImageColorClosestAlpha()
317 for (i = 0; i < im->colorsTotal; i++) { in gdImageColorClosestAlpha()
319 if (im->open[i]) { in gdImageColorClosestAlpha()
322 rd = im->red[i] - r; in gdImageColorClosestAlpha()
323 gd = im->green[i] - g; in gdImageColorClosestAlpha()
324 bd = im->blue[i] - b; in gdImageColorClosestAlpha()
326 ad = im->alpha[i] - a; in gdImageColorClosestAlpha()
472 int gdImageColorClosestHWB (gdImagePtr im, int r, int g, int b) in gdImageColorClosestHWB() argument
479 if (im->trueColor) { in gdImageColorClosestHWB()
482 for (i = 0; i < im->colorsTotal; i++) { in gdImageColorClosestHWB()
484 if (im->open[i]) { in gdImageColorClosestHWB()
487 dist = HWB_Diff(im->red[i], im->green[i], im->blue[i], r, g, b); in gdImageColorClosestHWB()
497 int gdImageColorExact (gdImagePtr im, int r, int g, int b) in gdImageColorExact() argument
499 return gdImageColorExactAlpha (im, r, g, b, gdAlphaOpaque); in gdImageColorExact()
502 int gdImageColorExactAlpha (gdImagePtr im, int r, int g, int b, int a) in gdImageColorExactAlpha() argument
505 if (im->trueColor) { in gdImageColorExactAlpha()
508 for (i = 0; i < im->colorsTotal; i++) { in gdImageColorExactAlpha()
509 if (im->open[i]) { in gdImageColorExactAlpha()
512 if ((im->red[i] == r) && (im->green[i] == g) && (im->blue[i] == b) && (im->alpha[i] == a)) { in gdImageColorExactAlpha()
519 int gdImageColorAllocate (gdImagePtr im, int r, int g, int b) in gdImageColorAllocate() argument
521 return gdImageColorAllocateAlpha (im, r, g, b, gdAlphaOpaque); in gdImageColorAllocate()
524 int gdImageColorAllocateAlpha (gdImagePtr im, int r, int g, int b, int a) in gdImageColorAllocateAlpha() argument
528 if (im->trueColor) { in gdImageColorAllocateAlpha()
531 for (i = 0; i < im->colorsTotal; i++) { in gdImageColorAllocateAlpha()
532 if (im->open[i]) { in gdImageColorAllocateAlpha()
538 ct = im->colorsTotal; in gdImageColorAllocateAlpha()
542 im->colorsTotal++; in gdImageColorAllocateAlpha()
544 im->red[ct] = r; in gdImageColorAllocateAlpha()
545 im->green[ct] = g; in gdImageColorAllocateAlpha()
546 im->blue[ct] = b; in gdImageColorAllocateAlpha()
547 im->alpha[ct] = a; in gdImageColorAllocateAlpha()
548 im->open[ct] = 0; in gdImageColorAllocateAlpha()
564 int gdImageColorResolve (gdImagePtr im, int r, int g, int b) in gdImageColorResolve() argument
566 return gdImageColorResolveAlpha(im, r, g, b, gdAlphaOpaque); in gdImageColorResolve()
569 int gdImageColorResolveAlpha (gdImagePtr im, int r, int g, int b, int a) in gdImageColorResolveAlpha() argument
576 if (im->trueColor) in gdImageColorResolveAlpha()
581 for (c = 0; c < im->colorsTotal; c++) in gdImageColorResolveAlpha()
583 if (im->open[c]) in gdImageColorResolveAlpha()
588 if (c == im->transparent) in gdImageColorResolveAlpha()
594 rd = (long) (im->red[c] - r); in gdImageColorResolveAlpha()
595 gd = (long) (im->green[c] - g); in gdImageColorResolveAlpha()
596 bd = (long) (im->blue[c] - b); in gdImageColorResolveAlpha()
597 ad = (long) (im->alpha[c] - a); in gdImageColorResolveAlpha()
612 op = im->colorsTotal; in gdImageColorResolveAlpha()
617 im->colorsTotal++; in gdImageColorResolveAlpha()
619 im->red[op] = r; in gdImageColorResolveAlpha()
620 im->green[op] = g; in gdImageColorResolveAlpha()
621 im->blue[op] = b; in gdImageColorResolveAlpha()
622 im->alpha[op] = a; in gdImageColorResolveAlpha()
623 im->open[op] = 0; in gdImageColorResolveAlpha()
627 void gdImageColorDeallocate (gdImagePtr im, int color) in gdImageColorDeallocate() argument
629 if (im->trueColor) { in gdImageColorDeallocate()
633 im->open[color] = 1; in gdImageColorDeallocate()
636 void gdImageColorTransparent (gdImagePtr im, int color) in gdImageColorTransparent() argument
641 if (!im->trueColor) { in gdImageColorTransparent()
642 if((color >= im->colorsTotal)) { in gdImageColorTransparent()
646 if (im->transparent != -1) { in gdImageColorTransparent()
647 im->alpha[im->transparent] = gdAlphaOpaque; in gdImageColorTransparent()
649 im->alpha[color] = gdAlphaTransparent; in gdImageColorTransparent()
651 im->transparent = color; in gdImageColorTransparent()
763 void gdImageSetPixel (gdImagePtr im, int x, int y, int color) in gdImageSetPixel() argument
768 if (!im->style) { in gdImageSetPixel()
772 p = im->style[im->stylePos++]; in gdImageSetPixel()
775 gdImageSetPixel(im, x, y, p); in gdImageSetPixel()
777 im->stylePos = im->stylePos % im->styleLength; in gdImageSetPixel()
780 if (!im->style) { in gdImageSetPixel()
784 p = im->style[im->stylePos++]; in gdImageSetPixel()
786 gdImageSetPixel(im, x, y, gdBrushed); in gdImageSetPixel()
788 im->stylePos = im->stylePos % im->styleLength; in gdImageSetPixel()
791 gdImageBrushApply(im, x, y); in gdImageSetPixel()
794 gdImageTileApply(im, x, y); in gdImageSetPixel()
799 gdImageSetPixel(im, x, y, im->AA_color); in gdImageSetPixel()
802 if (gdImageBoundsSafe(im, x, y)) { in gdImageSetPixel()
803 if (im->trueColor) { in gdImageSetPixel()
804 switch (im->alphaBlendingFlag) { in gdImageSetPixel()
807 im->tpixels[y][x] = color; in gdImageSetPixel()
811 im->tpixels[y][x] = gdAlphaBlend(im->tpixels[y][x], color); in gdImageSetPixel()
814 im->tpixels[y][x] = gdLayerOverlay(im->tpixels[y][x], color); in gdImageSetPixel()
817 im->tpixels[y][x] = gdLayerMultiply(im->tpixels[y][x], color); in gdImageSetPixel()
821 im->pixels[y][x] = color; in gdImageSetPixel()
828 int gdImageGetTrueColorPixel (gdImagePtr im, int x, int y) in gdImageGetTrueColorPixel() argument
830 int p = gdImageGetPixel(im, x, y); in gdImageGetTrueColorPixel()
832 if (!im->trueColor) { in gdImageGetTrueColorPixel()
833 …return gdTrueColorAlpha(im->red[p], im->green[p], im->blue[p], (im->transparent == p) ? gdAlphaTra… in gdImageGetTrueColorPixel()
839 static void gdImageBrushApply (gdImagePtr im, int x, int y) in gdImageBrushApply() argument
846 if (!im->brush) { in gdImageBrushApply()
850 hy = gdImageSY(im->brush) / 2; in gdImageBrushApply()
852 y2 = y1 + gdImageSY(im->brush); in gdImageBrushApply()
853 hx = gdImageSX(im->brush) / 2; in gdImageBrushApply()
855 x2 = x1 + gdImageSX(im->brush); in gdImageBrushApply()
858 if (im->trueColor) { in gdImageBrushApply()
859 if (im->brush->trueColor) { in gdImageBrushApply()
864 p = gdImageGetTrueColorPixel(im->brush, srcx, srcy); in gdImageBrushApply()
866 if (p != gdImageGetTransparent(im->brush)) { in gdImageBrushApply()
867 gdImageSetPixel(im, lx, ly, p); in gdImageBrushApply()
879 p = gdImageGetPixel(im->brush, srcx, srcy); in gdImageBrushApply()
880 tc = gdImageGetTrueColorPixel(im->brush, srcx, srcy); in gdImageBrushApply()
882 if (p != gdImageGetTransparent(im->brush)) { in gdImageBrushApply()
883 gdImageSetPixel(im, lx, ly, tc); in gdImageBrushApply()
895 p = gdImageGetPixel(im->brush, srcx, srcy); in gdImageBrushApply()
897 if (p != gdImageGetTransparent(im->brush)) { in gdImageBrushApply()
899 if (im->brush->trueColor) { in gdImageBrushApply()
900 gdImageSetPixel(im, lx, ly, gdImageColorResolveAlpha(im, gdTrueColorGetRed(p), in gdImageBrushApply()
905 gdImageSetPixel(im, lx, ly, im->brushColorMap[p]); in gdImageBrushApply()
915 static void gdImageTileApply (gdImagePtr im, int x, int y) in gdImageTileApply() argument
917 gdImagePtr tile = im->tile; in gdImageTileApply()
925 if (im->trueColor) { in gdImageTileApply()
931 gdImageSetPixel(im, x, y, p); in gdImageTileApply()
939 gdImageSetPixel(im, x, y, gdImageColorResolveAlpha(im, in gdImageTileApply()
945 gdImageSetPixel(im, x, y, im->tileColorMap[p]); in gdImageTileApply()
952 static int gdImageTileGet (gdImagePtr im, int x, int y) in gdImageTileGet() argument
956 if (!im->tile) { in gdImageTileGet()
959 srcx = x % gdImageSX(im->tile); in gdImageTileGet()
960 srcy = y % gdImageSY(im->tile); in gdImageTileGet()
961 p = gdImageGetPixel(im->tile, srcx, srcy); in gdImageTileGet()
963 if (im->trueColor) { in gdImageTileGet()
964 if (im->tile->trueColor) { in gdImageTileGet()
967 …olor = gdTrueColorAlpha( gdImageRed(im->tile,p), gdImageGreen(im->tile,p), gdImageBlue (im->tile,p… in gdImageTileGet()
970 if (im->tile->trueColor) { in gdImageTileGet()
971 …tileColor = gdImageColorResolveAlpha(im, gdTrueColorGetRed (p), gdTrueColorGetGreen (p), gdTrueCol… in gdImageTileGet()
974 …= gdImageColorResolveAlpha(im, gdImageRed (im->tile,p), gdImageGreen (im->tile,p), gdImageBlue (im in gdImageTileGet()
981 int gdImageGetPixel (gdImagePtr im, int x, int y) in gdImageGetPixel() argument
983 if (gdImageBoundsSafe(im, x, y)) { in gdImageGetPixel()
984 if (im->trueColor) { in gdImageGetPixel()
985 return im->tpixels[y][x]; in gdImageGetPixel()
987 return im->pixels[y][x]; in gdImageGetPixel()
994 void gdImageAABlend (gdImagePtr im) in gdImageAABlend() argument
996 (void)im; in gdImageAABlend()
999 static void _gdImageFilledHRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color);
1001 static void gdImageHLine(gdImagePtr im, int y, int x1, int x2, int col) in gdImageHLine() argument
1003 if (im->thick > 1) { in gdImageHLine()
1004 int thickhalf = im->thick >> 1; in gdImageHLine()
1005 _gdImageFilledHRectangle(im, x1, y - thickhalf, x2, y + im->thick - thickhalf - 1, col); in gdImageHLine()
1014 gdImageSetPixel(im, x1, y, col); in gdImageHLine()
1020 static void gdImageVLine(gdImagePtr im, int x, int y1, int y2, int col) in gdImageVLine() argument
1022 if (im->thick > 1) { in gdImageVLine()
1023 int thickhalf = im->thick >> 1; in gdImageVLine()
1024 gdImageFilledRectangle(im, x - thickhalf, y1, x + im->thick - thickhalf - 1, y2, col); in gdImageVLine()
1033 gdImageSetPixel(im, x, y1, col); in gdImageVLine()
1040 void gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color) in gdImageLine() argument
1045 int thick = im->thick; in gdImageLine()
1053 gdImageAALine(im, x1, y1, x2, y2, im->AA_color); in gdImageLine()
1058 if (!clip_1d(&x1,&y1,&x2,&y2,gdImageSX(im)-1) || !clip_1d(&y1,&x1,&y2,&x2,gdImageSY(im)-1)) { in gdImageLine()
1066 gdImageVLine(im, x1, y1, y2, color); in gdImageLine()
1069 gdImageHLine(im, y1, x1, x2, color); in gdImageLine()
1109 gdImageSetPixel(im, x, w, color); in gdImageLine()
1123 gdImageSetPixel (im, x, w, color); in gdImageLine()
1137 gdImageSetPixel (im, x, w, color); in gdImageLine()
1173 gdImageSetPixel (im, w, y, color); in gdImageLine()
1187 gdImageSetPixel (im, w, y, color); in gdImageLine()
1201 gdImageSetPixel (im, w, y, color); in gdImageLine()
1215 inline static void gdImageSetAAPixelColor(gdImagePtr im, int x, int y, int color, int t) in gdImageSetAAPixelColor() argument
1222 p = gdImageGetPixel(im,x,y); in gdImageSetAAPixelColor()
1230 im->tpixels[y][x]=gdTrueColorAlpha(dr, dg, db, gdAlphaOpaque); in gdImageSetAAPixelColor()
1236 void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col) in gdImageAALine() argument
1242 if (!im->trueColor) { in gdImageAALine()
1244 gdImageLine(im, x1, y1, x2, y2, col); in gdImageAALine()
1249 if (!clip_1d(&x1,&y1,&x2,&y2,gdImageSX(im)-1) || !clip_1d(&y1,&x1,&y2,&x2,gdImageSY(im)-1)) { in gdImageAALine()
1274 gdImageSetAAPixelColor(im, x, y, col, (frac >> 8) & 0xFF); in gdImageAALine()
1275 if (y + 1 < im->sy) { in gdImageAALine()
1276 gdImageSetAAPixelColor(im, x, y + 1, col, (~frac >> 8) & 0xFF); in gdImageAALine()
1302 gdImageSetAAPixelColor(im, x, y, col, (frac >> 8) & 0xFF); in gdImageAALine()
1303 if (x + 1 < im->sx) { in gdImageAALine()
1304 gdImageSetAAPixelColor(im, x + 1, y, col, (~frac >> 8) & 0xFF); in gdImageAALine()
1318 static void dashedSet (gdImagePtr im, int x, int y, int color, int *onP, int *dashStepP, int wid, i…
1320 void gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color) in gdImageDashedLine() argument
1327 int thick = im->thick; in gdImageDashedLine()
1357 dashedSet(im, x, y, color, &on, &dashStep, wid, vert); in gdImageDashedLine()
1367 dashedSet(im, x, y, color, &on, &dashStep, wid, vert); in gdImageDashedLine()
1378 dashedSet(im, x, y, color, &on, &dashStep, wid, vert); in gdImageDashedLine()
1406 dashedSet(im, x, y, color, &on, &dashStep, wid, vert); in gdImageDashedLine()
1416 dashedSet(im, x, y, color, &on, &dashStep, wid, vert); in gdImageDashedLine()
1427 dashedSet(im, x, y, color, &on, &dashStep, wid, vert); in gdImageDashedLine()
1433 static void dashedSet (gdImagePtr im, int x, int y, int color, int *onP, int *dashStepP, int wid, i… in dashedSet() argument
1448 gdImageSetPixel(im, x, w, color); in dashedSet()
1453 gdImageSetPixel(im, w, y, color); in dashedSet()
1461 void gdImageChar (gdImagePtr im, gdFontPtr f, int x, int y, int c, int color) in gdImageChar() argument
1480 gdImageSetPixel(im, px, py, color); in gdImageChar()
1489 void gdImageCharUp (gdImagePtr im, gdFontPtr f, int x, int y, int c, int color) in gdImageCharUp() argument
1508 gdImageSetPixel(im, px, py, color); in gdImageCharUp()
1517 void gdImageString (gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color) in gdImageString() argument
1523 gdImageChar(im, f, x, y, s[i], color); in gdImageString()
1528 void gdImageStringUp (gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color) in gdImageStringUp() argument
1534 gdImageCharUp(im, f, x, y, s[i], color); in gdImageStringUp()
1541 void gdImageString16 (gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color) in gdImageString16() argument
1547 gdImageChar(im, f, x, y, s[i], color); in gdImageString16()
1552 void gdImageStringUp16 (gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color) in gdImageStringUp16() argument
1558 gdImageCharUp(im, f, x, y, s[i], color); in gdImageStringUp16()
1589 void gdImageArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color) in gdImageArc() argument
1591 gdImageFilledArc(im, cx, cy, w, h, s, e, color, gdNoFill); in gdImageArc()
1594 void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int st… in gdImageFilledArc() argument
1632 gdImageLine(im, lx, ly, x, y, color); in gdImageFilledArc()
1663 gdImageLine(im, cx, cy, lx, ly, color); in gdImageFilledArc()
1664 gdImageLine(im, cx, cy, fx, fy, color); in gdImageFilledArc()
1666 gdImageLine(im, fx, fy, lx, ly, color); in gdImageFilledArc()
1674 gdImageFilledPolygon(im, pts, 3, color); in gdImageFilledArc()
1679 gdImageLine(im, cx, cy, lx, ly, color); in gdImageFilledArc()
1680 gdImageLine(im, cx, cy, fx, fy, color); in gdImageFilledArc()
1703 gdImageFilledPolygon(im, pts, pti+1, color); in gdImageFilledArc()
1715 void gdImageEllipse(gdImagePtr im, int mx, int my, int w, int h, int c) in gdImageEllipse() argument
1722 gdImageSetPixel(im,mx+a, my, c); in gdImageEllipse()
1723 gdImageSetPixel(im,mx-a, my, c); in gdImageEllipse()
1747 gdImageSetPixel(im,mx1, my1, c); in gdImageEllipse()
1748 gdImageSetPixel(im,mx1, my2, c); in gdImageEllipse()
1749 gdImageSetPixel(im,mx2, my1, c); in gdImageEllipse()
1750 gdImageSetPixel(im,mx2, my2, c); in gdImageEllipse()
1754 void gdImageFilledEllipse (gdImagePtr im, int mx, int my, int w, int h, int c) in gdImageFilledEllipse() argument
1765 gdImageSetPixel(im, x, my, c); in gdImageFilledEllipse()
1794 gdImageSetPixel(im,i,my1,c); in gdImageFilledEllipse()
1795 gdImageSetPixel(im,i,my2,c); in gdImageFilledEllipse()
1802 void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color) in gdImageFillToBorder() argument
1814 if (!im->trueColor) { in gdImageFillToBorder()
1815 if ((color > (im->colorsTotal - 1)) || (border > (im->colorsTotal - 1)) || (color < 0)) { in gdImageFillToBorder()
1820 restoreAlphaBlending = im->alphaBlendingFlag; in gdImageFillToBorder()
1821 im->alphaBlendingFlag = 0; in gdImageFillToBorder()
1823 if (x >= im->sx) { in gdImageFillToBorder()
1824 x = im->sx - 1; in gdImageFillToBorder()
1828 if (y >= im->sy) { in gdImageFillToBorder()
1829 y = im->sy - 1; in gdImageFillToBorder()
1835 if (gdImageGetPixel(im, i, y) == border) { in gdImageFillToBorder()
1838 gdImageSetPixel(im, i, y, color); in gdImageFillToBorder()
1842 im->alphaBlendingFlag = restoreAlphaBlending; in gdImageFillToBorder()
1847 for (i = (x + 1); i < im->sx; i++) { in gdImageFillToBorder()
1848 if (gdImageGetPixel(im, i, y) == border) { in gdImageFillToBorder()
1851 gdImageSetPixel(im, i, y, color); in gdImageFillToBorder()
1859 int c = gdImageGetPixel(im, i, y - 1); in gdImageFillToBorder()
1862 gdImageFillToBorder(im, i, y - 1, border, color); in gdImageFillToBorder()
1872 if (y < ((im->sy) - 1)) { in gdImageFillToBorder()
1875 int c = gdImageGetPixel(im, i, y + 1); in gdImageFillToBorder()
1879 gdImageFillToBorder(im, i, y + 1, border, color); in gdImageFillToBorder()
1887 im->alphaBlendingFlag = restoreAlphaBlending; in gdImageFillToBorder()
1904 #define FILL_MAX ((int)(im->sy*im->sx)/4)
1912 static void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc);
1914 void gdImageFill(gdImagePtr im, int x, int y, int nc) in gdImageFill() argument
1927 if (!im->trueColor && nc > (im->colorsTotal -1)) { in gdImageFill()
1931 alphablending_bak = im->alphaBlendingFlag; in gdImageFill()
1932 im->alphaBlendingFlag = 0; in gdImageFill()
1935 _gdImageFillTiled(im,x,y,nc); in gdImageFill()
1936 im->alphaBlendingFlag = alphablending_bak; in gdImageFill()
1940 wx2=im->sx;wy2=im->sy; in gdImageFill()
1941 oc = gdImageGetPixel(im, x, y); in gdImageFill()
1943 im->alphaBlendingFlag = alphablending_bak; in gdImageFill()
1950 if (im->sx < 4) { in gdImageFill()
1954 c = gdImageGetPixel(im, ix, iy); in gdImageFill()
1958 gdImageSetPixel(im, ix, iy, nc); in gdImageFill()
1959 } while(ix++ < (im->sx -1)); in gdImageFill()
1961 } while(iy++ < (im->sy -1)); in gdImageFill()
1965 stack = (struct seg *)safe_emalloc(sizeof(struct seg), ((int)(im->sy*im->sx)/4), 1); in gdImageFill()
1975 for (x=x1; x>=0 && gdImageGetPixel(im,x, y)==oc; x--) { in gdImageFill()
1976 gdImageSetPixel(im,x, y, nc); in gdImageFill()
1989 for (; x<=wx2 && gdImageGetPixel(im,x, y)==oc; x++) { in gdImageFill()
1990 gdImageSetPixel(im, x, y, nc); in gdImageFill()
1997 skip: for (x++; x<=x2 && (gdImageGetPixel(im, x, y)!=oc); x++); in gdImageFill()
2006 im->alphaBlendingFlag = alphablending_bak; in gdImageFill()
2009 static void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc) in _gdImageFillTiled() argument
2019 if (!im->tile) { in _gdImageFillTiled()
2023 wx2=im->sx;wy2=im->sy; in _gdImageFillTiled()
2025 nc = gdImageTileGet(im,x,y); in _gdImageFillTiled()
2027 pts = (char **) ecalloc(im->sy + 1, sizeof(char *)); in _gdImageFillTiled()
2028 for (i = 0; i < im->sy + 1; i++) { in _gdImageFillTiled()
2029 pts[i] = (char *) ecalloc(im->sx + 1, sizeof(char)); in _gdImageFillTiled()
2032 stack = (struct seg *)safe_emalloc(sizeof(struct seg), ((int)(im->sy*im->sx)/4), 1); in _gdImageFillTiled()
2035 oc = gdImageGetPixel(im, x, y); in _gdImageFillTiled()
2043 for (x=x1; x>=0 && (!pts[y][x] && gdImageGetPixel(im,x,y)==oc); x--) { in _gdImageFillTiled()
2044 nc = gdImageTileGet(im,x,y); in _gdImageFillTiled()
2046 gdImageSetPixel(im,x, y, nc); in _gdImageFillTiled()
2059 for(; x<wx2 && (!pts[y][x] && gdImageGetPixel(im,x, y)==oc); x++) { in _gdImageFillTiled()
2060 nc = gdImageTileGet(im,x,y); in _gdImageFillTiled()
2062 gdImageSetPixel(im, x, y, nc); in _gdImageFillTiled()
2069 skip: for(x++; x<=x2 && (pts[y][x] || gdImageGetPixel(im,x, y)!=oc); x++); in _gdImageFillTiled()
2074 for(i = 0; i < im->sy + 1; i++) { in _gdImageFillTiled()
2084 void gdImageRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) in gdImageRectangle() argument
2086 int thick = im->thick; in gdImageRectangle()
2090 gdImageSetPixel(im, x1, y1, color); in gdImageRectangle()
2120 gdImageSetPixel(im, cx, cy, color); in gdImageRectangle()
2128 gdImageSetPixel(im, cx, cy, color); in gdImageRectangle()
2136 gdImageSetPixel(im, cx, cy, color); in gdImageRectangle()
2144 gdImageSetPixel(im, cx, cy, color); in gdImageRectangle()
2151 gdImageLine(im, x1, y1, x2, y2, color); in gdImageRectangle()
2153 gdImageLine(im, x1, y1, x2, y1, color); in gdImageRectangle()
2154 gdImageLine(im, x1, y2, x2, y2, color); in gdImageRectangle()
2155 gdImageLine(im, x1, y1 + 1, x1, y2 - 1, color); in gdImageRectangle()
2156 gdImageLine(im, x2, y1 + 1, x2, y2 - 1, color); in gdImageRectangle()
2161 static void _gdImageFilledHRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) in _gdImageFilledHRectangle() argument
2166 gdImageSetPixel(im, x1, y1, color); in _gdImageFilledHRectangle()
2186 if (x2 >= gdImageSX(im)) { in _gdImageFilledHRectangle()
2187 x2 = gdImageSX(im) - 1; in _gdImageFilledHRectangle()
2194 if (y2 >= gdImageSY(im)) { in _gdImageFilledHRectangle()
2195 y2 = gdImageSY(im) - 1; in _gdImageFilledHRectangle()
2200 gdImageSetPixel (im, x, y, color); in _gdImageFilledHRectangle()
2205 static void _gdImageFilledVRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) in _gdImageFilledVRectangle() argument
2210 gdImageSetPixel(im, x1, y1, color); in _gdImageFilledVRectangle()
2230 if (x2 >= gdImageSX(im)) { in _gdImageFilledVRectangle()
2231 x2 = gdImageSX(im) - 1; in _gdImageFilledVRectangle()
2238 if (y2 >= gdImageSY(im)) { in _gdImageFilledVRectangle()
2239 y2 = gdImageSY(im) - 1; in _gdImageFilledVRectangle()
2244 gdImageSetPixel (im, x, y, color); in _gdImageFilledVRectangle()
2249 void gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) in gdImageFilledRectangle() argument
2251 _gdImageFilledVRectangle(im, x1, y1, x2, y2, color); in gdImageFilledRectangle()
2641 void gdImagePolygon (gdImagePtr im, gdPointPtr p, int n, int c) in gdImagePolygon() argument
2648 gdImageLine (im, p->x, p->y, p[n - 1].x, p[n - 1].y, c); in gdImagePolygon()
2649 gdImageOpenPolygon (im, p, n, c); in gdImagePolygon()
2652 void gdImageOpenPolygon (gdImagePtr im, gdPointPtr p, int n, int c) in gdImageOpenPolygon() argument
2665 gdImageLine(im, lx, ly, p->x, p->y, c); in gdImageOpenPolygon()
2681 void gdImageFilledPolygon (gdImagePtr im, gdPointPtr p, int n, int c) in gdImageFilledPolygon() argument
2701 fill_color = im->AA_color; in gdImageFilledPolygon()
2706 if (!im->polyAllocated) { in gdImageFilledPolygon()
2707 im->polyInts = (int *) gdMalloc(sizeof(int) * n); in gdImageFilledPolygon()
2708 im->polyAllocated = n; in gdImageFilledPolygon()
2710 if (im->polyAllocated < n) { in gdImageFilledPolygon()
2711 while (im->polyAllocated < n) { in gdImageFilledPolygon()
2712 im->polyAllocated *= 2; in gdImageFilledPolygon()
2714 if (overflow2(sizeof(int), im->polyAllocated)) { in gdImageFilledPolygon()
2717 im->polyInts = (int *) gdRealloc(im->polyInts, sizeof(int) * im->polyAllocated); in gdImageFilledPolygon()
2739 gdImageLine(im, x1, miny, x2, miny, c); in gdImageFilledPolygon()
2747 if (maxy >= gdImageSY(im)) { in gdImageFilledPolygon()
2748 maxy = gdImageSY(im) - 1; in gdImageFilledPolygon()
2783 im->polyInts[ints++] = (float) ((y - y1) * (x2 - x1)) / (float) (y2 - y1) + 0.5 + x1; in gdImageFilledPolygon()
2785 im->polyInts[ints++] = x2; in gdImageFilledPolygon()
2788 qsort(im->polyInts, ints, sizeof(int), gdCompareInt); in gdImageFilledPolygon()
2791 gdImageLine(im, im->polyInts[i], y, im->polyInts[i + 1], y, fill_color); in gdImageFilledPolygon()
2797 gdImagePolygon(im, p, n, c); in gdImageFilledPolygon()
2806 void gdImageSetStyle (gdImagePtr im, int *style, int noOfPixels) in gdImageSetStyle() argument
2808 if (im->style) { in gdImageSetStyle()
2809 gdFree(im->style); in gdImageSetStyle()
2814 im->style = (int *) gdMalloc(sizeof(int) * noOfPixels); in gdImageSetStyle()
2815 memcpy(im->style, style, sizeof(int) * noOfPixels); in gdImageSetStyle()
2816 im->styleLength = noOfPixels; in gdImageSetStyle()
2817 im->stylePos = 0; in gdImageSetStyle()
2820 void gdImageSetThickness (gdImagePtr im, int thickness) in gdImageSetThickness() argument
2822 im->thick = thickness; in gdImageSetThickness()
2825 void gdImageSetBrush (gdImagePtr im, gdImagePtr brush) in gdImageSetBrush() argument
2828 im->brush = brush; in gdImageSetBrush()
2829 if (!im->trueColor && !im->brush->trueColor) { in gdImageSetBrush()
2832 …index = gdImageColorResolveAlpha(im, gdImageRed(brush, i), gdImageGreen(brush, i), gdImageBlue(bru… in gdImageSetBrush()
2833 im->brushColorMap[i] = index; in gdImageSetBrush()
2838 void gdImageSetTile (gdImagePtr im, gdImagePtr tile) in gdImageSetTile() argument
2841 im->tile = tile; in gdImageSetTile()
2842 if (!im->trueColor && !im->tile->trueColor) { in gdImageSetTile()
2845 …index = gdImageColorResolveAlpha(im, gdImageRed(tile, i), gdImageGreen(tile, i), gdImageBlue(tile,… in gdImageSetTile()
2846 im->tileColorMap[i] = index; in gdImageSetTile()
2851 void gdImageSetAntiAliased (gdImagePtr im, int c) in gdImageSetAntiAliased() argument
2853 im->AA = 1; in gdImageSetAntiAliased()
2854 im->AA_color = c; in gdImageSetAntiAliased()
2855 im->AA_dont_blend = -1; in gdImageSetAntiAliased()
2858 void gdImageSetAntiAliasedDontBlend (gdImagePtr im, int c, int dont_blend) in gdImageSetAntiAliasedDontBlend() argument
2860 im->AA = 1; in gdImageSetAntiAliasedDontBlend()
2861 im->AA_color = c; in gdImageSetAntiAliasedDontBlend()
2862 im->AA_dont_blend = dont_blend; in gdImageSetAntiAliasedDontBlend()
2866 void gdImageInterlace (gdImagePtr im, int interlaceArg) in gdImageInterlace() argument
2868 im->interlace = interlaceArg; in gdImageInterlace()
2988 void gdImageAlphaBlending (gdImagePtr im, int alphaBlendingArg) in gdImageAlphaBlending() argument
2990 im->alphaBlendingFlag = alphaBlendingArg; in gdImageAlphaBlending()
2993 void gdImageSaveAlpha (gdImagePtr im, int saveAlphaArg) in gdImageSaveAlpha() argument
2995 im->saveAlphaFlag = saveAlphaArg; in gdImageSaveAlpha()
3053 void gdImageSetClip (gdImagePtr im, int x1, int y1, int x2, int y2) in gdImageSetClip() argument
3058 if (x1 >= im->sx) { in gdImageSetClip()
3059 x1 = im->sx - 1; in gdImageSetClip()
3064 if (x2 >= im->sx) { in gdImageSetClip()
3065 x2 = im->sx - 1; in gdImageSetClip()
3070 if (y1 >= im->sy) { in gdImageSetClip()
3071 y1 = im->sy - 1; in gdImageSetClip()
3076 if (y2 >= im->sy) { in gdImageSetClip()
3077 y2 = im->sy - 1; in gdImageSetClip()
3079 im->cx1 = x1; in gdImageSetClip()
3080 im->cy1 = y1; in gdImageSetClip()
3081 im->cx2 = x2; in gdImageSetClip()
3082 im->cy2 = y2; in gdImageSetClip()
3085 void gdImageGetClip (gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P) in gdImageGetClip() argument
3087 *x1P = im->cx1; in gdImageGetClip()
3088 *y1P = im->cy1; in gdImageGetClip()
3089 *x2P = im->cx2; in gdImageGetClip()
3090 *y2P = im->cy2; in gdImageGetClip()
3093 void gdImageSetResolution(gdImagePtr im, const unsigned int res_x, const unsigned int res_y) in gdImageSetResolution() argument
3095 if (res_x > 0) im->res_x = res_x; in gdImageSetResolution()
3096 if (res_y > 0) im->res_y = res_y; in gdImageSetResolution()