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
1478 gdImageSetPixel(im, px, py, color); in gdImageChar()
1487 void gdImageCharUp (gdImagePtr im, gdFontPtr f, int x, int y, int c, int color) in gdImageCharUp() argument
1504 gdImageSetPixel(im, px, py, color); in gdImageCharUp()
1513 void gdImageString (gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color) in gdImageString() argument
1519 gdImageChar(im, f, x, y, s[i], color); in gdImageString()
1524 void gdImageStringUp (gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color) in gdImageStringUp() argument
1530 gdImageCharUp(im, f, x, y, s[i], color); in gdImageStringUp()
1537 void gdImageString16 (gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color) in gdImageString16() argument
1543 gdImageChar(im, f, x, y, s[i], color); in gdImageString16()
1548 void gdImageStringUp16 (gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color) in gdImageStringUp16() argument
1554 gdImageCharUp(im, f, x, y, s[i], color); in gdImageStringUp16()
1585 void gdImageArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color) in gdImageArc() argument
1587 gdImageFilledArc(im, cx, cy, w, h, s, e, color, gdNoFill); in gdImageArc()
1590 void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int st… in gdImageFilledArc() argument
1628 gdImageLine(im, lx, ly, x, y, color); in gdImageFilledArc()
1659 gdImageLine(im, cx, cy, lx, ly, color); in gdImageFilledArc()
1660 gdImageLine(im, cx, cy, fx, fy, color); in gdImageFilledArc()
1662 gdImageLine(im, fx, fy, lx, ly, color); in gdImageFilledArc()
1670 gdImageFilledPolygon(im, pts, 3, color); in gdImageFilledArc()
1675 gdImageLine(im, cx, cy, lx, ly, color); in gdImageFilledArc()
1676 gdImageLine(im, cx, cy, fx, fy, color); in gdImageFilledArc()
1699 gdImageFilledPolygon(im, pts, pti+1, color); in gdImageFilledArc()
1711 void gdImageEllipse(gdImagePtr im, int mx, int my, int w, int h, int c) in gdImageEllipse() argument
1718 gdImageSetPixel(im,mx+a, my, c); in gdImageEllipse()
1719 gdImageSetPixel(im,mx-a, my, c); in gdImageEllipse()
1743 gdImageSetPixel(im,mx1, my1, c); in gdImageEllipse()
1744 gdImageSetPixel(im,mx1, my2, c); in gdImageEllipse()
1745 gdImageSetPixel(im,mx2, my1, c); in gdImageEllipse()
1746 gdImageSetPixel(im,mx2, my2, c); in gdImageEllipse()
1750 void gdImageFilledEllipse (gdImagePtr im, int mx, int my, int w, int h, int c) in gdImageFilledEllipse() argument
1761 gdImageSetPixel(im, x, my, c); in gdImageFilledEllipse()
1790 gdImageSetPixel(im,i,my1,c); in gdImageFilledEllipse()
1791 gdImageSetPixel(im,i,my2,c); in gdImageFilledEllipse()
1798 void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color) in gdImageFillToBorder() argument
1810 if (!im->trueColor) { in gdImageFillToBorder()
1811 if ((color > (im->colorsTotal - 1)) || (border > (im->colorsTotal - 1)) || (color < 0)) { in gdImageFillToBorder()
1816 restoreAlphaBlending = im->alphaBlendingFlag; in gdImageFillToBorder()
1817 im->alphaBlendingFlag = 0; in gdImageFillToBorder()
1819 if (x >= im->sx) { in gdImageFillToBorder()
1820 x = im->sx - 1; in gdImageFillToBorder()
1824 if (y >= im->sy) { in gdImageFillToBorder()
1825 y = im->sy - 1; in gdImageFillToBorder()
1831 if (gdImageGetPixel(im, i, y) == border) { in gdImageFillToBorder()
1834 gdImageSetPixel(im, i, y, color); in gdImageFillToBorder()
1838 im->alphaBlendingFlag = restoreAlphaBlending; in gdImageFillToBorder()
1843 for (i = (x + 1); i < im->sx; i++) { in gdImageFillToBorder()
1844 if (gdImageGetPixel(im, i, y) == border) { in gdImageFillToBorder()
1847 gdImageSetPixel(im, i, y, color); in gdImageFillToBorder()
1855 int c = gdImageGetPixel(im, i, y - 1); in gdImageFillToBorder()
1858 gdImageFillToBorder(im, i, y - 1, border, color); in gdImageFillToBorder()
1868 if (y < ((im->sy) - 1)) { in gdImageFillToBorder()
1871 int c = gdImageGetPixel(im, i, y + 1); in gdImageFillToBorder()
1875 gdImageFillToBorder(im, i, y + 1, border, color); in gdImageFillToBorder()
1883 im->alphaBlendingFlag = restoreAlphaBlending; in gdImageFillToBorder()
1900 #define FILL_MAX ((int)(im->sy*im->sx)/4)
1908 static void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc);
1910 void gdImageFill(gdImagePtr im, int x, int y, int nc) in gdImageFill() argument
1923 if (!im->trueColor && nc > (im->colorsTotal -1)) { in gdImageFill()
1927 alphablending_bak = im->alphaBlendingFlag; in gdImageFill()
1928 im->alphaBlendingFlag = 0; in gdImageFill()
1931 _gdImageFillTiled(im,x,y,nc); in gdImageFill()
1932 im->alphaBlendingFlag = alphablending_bak; in gdImageFill()
1936 wx2=im->sx;wy2=im->sy; in gdImageFill()
1937 oc = gdImageGetPixel(im, x, y); in gdImageFill()
1939 im->alphaBlendingFlag = alphablending_bak; in gdImageFill()
1946 if (im->sx < 4) { in gdImageFill()
1950 c = gdImageGetPixel(im, ix, iy); in gdImageFill()
1954 gdImageSetPixel(im, ix, iy, nc); in gdImageFill()
1955 } while(ix++ < (im->sx -1)); in gdImageFill()
1957 } while(iy++ < (im->sy -1)); in gdImageFill()
1961 stack = (struct seg *)safe_emalloc(sizeof(struct seg), ((int)(im->sy*im->sx)/4), 1); in gdImageFill()
1971 for (x=x1; x>=0 && gdImageGetPixel(im,x, y)==oc; x--) { in gdImageFill()
1972 gdImageSetPixel(im,x, y, nc); in gdImageFill()
1985 for (; x<=wx2 && gdImageGetPixel(im,x, y)==oc; x++) { in gdImageFill()
1986 gdImageSetPixel(im, x, y, nc); in gdImageFill()
1993 skip: for (x++; x<=x2 && (gdImageGetPixel(im, x, y)!=oc); x++); in gdImageFill()
2002 im->alphaBlendingFlag = alphablending_bak; in gdImageFill()
2005 static void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc) in _gdImageFillTiled() argument
2015 if (!im->tile) { in _gdImageFillTiled()
2019 wx2=im->sx;wy2=im->sy; in _gdImageFillTiled()
2021 nc = gdImageTileGet(im,x,y); in _gdImageFillTiled()
2023 pts = (char **) ecalloc(im->sy + 1, sizeof(char *)); in _gdImageFillTiled()
2024 for (i = 0; i < im->sy + 1; i++) { in _gdImageFillTiled()
2025 pts[i] = (char *) ecalloc(im->sx + 1, sizeof(char)); in _gdImageFillTiled()
2028 stack = (struct seg *)safe_emalloc(sizeof(struct seg), ((int)(im->sy*im->sx)/4), 1); in _gdImageFillTiled()
2031 oc = gdImageGetPixel(im, x, y); in _gdImageFillTiled()
2039 for (x=x1; x>=0 && (!pts[y][x] && gdImageGetPixel(im,x,y)==oc); x--) { in _gdImageFillTiled()
2040 nc = gdImageTileGet(im,x,y); in _gdImageFillTiled()
2042 gdImageSetPixel(im,x, y, nc); in _gdImageFillTiled()
2055 for(; x<wx2 && (!pts[y][x] && gdImageGetPixel(im,x, y)==oc); x++) { in _gdImageFillTiled()
2056 nc = gdImageTileGet(im,x,y); in _gdImageFillTiled()
2058 gdImageSetPixel(im, x, y, nc); in _gdImageFillTiled()
2065 skip: for(x++; x<=x2 && (pts[y][x] || gdImageGetPixel(im,x, y)!=oc); x++); in _gdImageFillTiled()
2070 for(i = 0; i < im->sy + 1; i++) { in _gdImageFillTiled()
2080 void gdImageRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) in gdImageRectangle() argument
2082 int thick = im->thick; in gdImageRectangle()
2086 gdImageSetPixel(im, x1, y1, color); in gdImageRectangle()
2116 gdImageSetPixel(im, cx, cy, color); in gdImageRectangle()
2124 gdImageSetPixel(im, cx, cy, color); in gdImageRectangle()
2132 gdImageSetPixel(im, cx, cy, color); in gdImageRectangle()
2140 gdImageSetPixel(im, cx, cy, color); in gdImageRectangle()
2147 gdImageLine(im, x1, y1, x2, y2, color); in gdImageRectangle()
2149 gdImageLine(im, x1, y1, x2, y1, color); in gdImageRectangle()
2150 gdImageLine(im, x1, y2, x2, y2, color); in gdImageRectangle()
2151 gdImageLine(im, x1, y1 + 1, x1, y2 - 1, color); in gdImageRectangle()
2152 gdImageLine(im, x2, y1 + 1, x2, y2 - 1, color); in gdImageRectangle()
2157 static void _gdImageFilledHRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) in _gdImageFilledHRectangle() argument
2162 gdImageSetPixel(im, x1, y1, color); in _gdImageFilledHRectangle()
2182 if (x2 >= gdImageSX(im)) { in _gdImageFilledHRectangle()
2183 x2 = gdImageSX(im) - 1; in _gdImageFilledHRectangle()
2190 if (y2 >= gdImageSY(im)) { in _gdImageFilledHRectangle()
2191 y2 = gdImageSY(im) - 1; in _gdImageFilledHRectangle()
2196 gdImageSetPixel (im, x, y, color); in _gdImageFilledHRectangle()
2201 static void _gdImageFilledVRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) in _gdImageFilledVRectangle() argument
2206 gdImageSetPixel(im, x1, y1, color); in _gdImageFilledVRectangle()
2226 if (x2 >= gdImageSX(im)) { in _gdImageFilledVRectangle()
2227 x2 = gdImageSX(im) - 1; in _gdImageFilledVRectangle()
2234 if (y2 >= gdImageSY(im)) { in _gdImageFilledVRectangle()
2235 y2 = gdImageSY(im) - 1; in _gdImageFilledVRectangle()
2240 gdImageSetPixel (im, x, y, color); in _gdImageFilledVRectangle()
2245 void gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) in gdImageFilledRectangle() argument
2247 _gdImageFilledVRectangle(im, x1, y1, x2, y2, color); in gdImageFilledRectangle()
2637 void gdImagePolygon (gdImagePtr im, gdPointPtr p, int n, int c) in gdImagePolygon() argument
2644 gdImageLine (im, p->x, p->y, p[n - 1].x, p[n - 1].y, c); in gdImagePolygon()
2645 gdImageOpenPolygon (im, p, n, c); in gdImagePolygon()
2648 void gdImageOpenPolygon (gdImagePtr im, gdPointPtr p, int n, int c) in gdImageOpenPolygon() argument
2661 gdImageLine(im, lx, ly, p->x, p->y, c); in gdImageOpenPolygon()
2677 void gdImageFilledPolygon (gdImagePtr im, gdPointPtr p, int n, int c) in gdImageFilledPolygon() argument
2697 fill_color = im->AA_color; in gdImageFilledPolygon()
2702 if (!im->polyAllocated) { in gdImageFilledPolygon()
2703 im->polyInts = (int *) gdMalloc(sizeof(int) * n); in gdImageFilledPolygon()
2704 im->polyAllocated = n; in gdImageFilledPolygon()
2706 if (im->polyAllocated < n) { in gdImageFilledPolygon()
2707 while (im->polyAllocated < n) { in gdImageFilledPolygon()
2708 im->polyAllocated *= 2; in gdImageFilledPolygon()
2710 if (overflow2(sizeof(int), im->polyAllocated)) { in gdImageFilledPolygon()
2713 im->polyInts = (int *) gdRealloc(im->polyInts, sizeof(int) * im->polyAllocated); in gdImageFilledPolygon()
2735 gdImageLine(im, x1, miny, x2, miny, c); in gdImageFilledPolygon()
2743 if (maxy >= gdImageSY(im)) { in gdImageFilledPolygon()
2744 maxy = gdImageSY(im) - 1; in gdImageFilledPolygon()
2779 im->polyInts[ints++] = (float) ((y - y1) * (x2 - x1)) / (float) (y2 - y1) + 0.5 + x1; in gdImageFilledPolygon()
2781 im->polyInts[ints++] = x2; in gdImageFilledPolygon()
2784 qsort(im->polyInts, ints, sizeof(int), gdCompareInt); in gdImageFilledPolygon()
2787 gdImageLine(im, im->polyInts[i], y, im->polyInts[i + 1], y, fill_color); in gdImageFilledPolygon()
2793 gdImagePolygon(im, p, n, c); in gdImageFilledPolygon()
2802 void gdImageSetStyle (gdImagePtr im, int *style, int noOfPixels) in gdImageSetStyle() argument
2804 if (im->style) { in gdImageSetStyle()
2805 gdFree(im->style); in gdImageSetStyle()
2810 im->style = (int *) gdMalloc(sizeof(int) * noOfPixels); in gdImageSetStyle()
2811 memcpy(im->style, style, sizeof(int) * noOfPixels); in gdImageSetStyle()
2812 im->styleLength = noOfPixels; in gdImageSetStyle()
2813 im->stylePos = 0; in gdImageSetStyle()
2816 void gdImageSetThickness (gdImagePtr im, int thickness) in gdImageSetThickness() argument
2818 im->thick = thickness; in gdImageSetThickness()
2821 void gdImageSetBrush (gdImagePtr im, gdImagePtr brush) in gdImageSetBrush() argument
2824 im->brush = brush; in gdImageSetBrush()
2825 if (!im->trueColor && !im->brush->trueColor) { in gdImageSetBrush()
2828 …index = gdImageColorResolveAlpha(im, gdImageRed(brush, i), gdImageGreen(brush, i), gdImageBlue(bru… in gdImageSetBrush()
2829 im->brushColorMap[i] = index; in gdImageSetBrush()
2834 void gdImageSetTile (gdImagePtr im, gdImagePtr tile) in gdImageSetTile() argument
2837 im->tile = tile; in gdImageSetTile()
2838 if (!im->trueColor && !im->tile->trueColor) { in gdImageSetTile()
2841 …index = gdImageColorResolveAlpha(im, gdImageRed(tile, i), gdImageGreen(tile, i), gdImageBlue(tile,… in gdImageSetTile()
2842 im->tileColorMap[i] = index; in gdImageSetTile()
2847 void gdImageSetAntiAliased (gdImagePtr im, int c) in gdImageSetAntiAliased() argument
2849 im->AA = 1; in gdImageSetAntiAliased()
2850 im->AA_color = c; in gdImageSetAntiAliased()
2851 im->AA_dont_blend = -1; in gdImageSetAntiAliased()
2854 void gdImageSetAntiAliasedDontBlend (gdImagePtr im, int c, int dont_blend) in gdImageSetAntiAliasedDontBlend() argument
2856 im->AA = 1; in gdImageSetAntiAliasedDontBlend()
2857 im->AA_color = c; in gdImageSetAntiAliasedDontBlend()
2858 im->AA_dont_blend = dont_blend; in gdImageSetAntiAliasedDontBlend()
2862 void gdImageInterlace (gdImagePtr im, int interlaceArg) in gdImageInterlace() argument
2864 im->interlace = interlaceArg; in gdImageInterlace()
2984 void gdImageAlphaBlending (gdImagePtr im, int alphaBlendingArg) in gdImageAlphaBlending() argument
2986 im->alphaBlendingFlag = alphaBlendingArg; in gdImageAlphaBlending()
2989 void gdImageSaveAlpha (gdImagePtr im, int saveAlphaArg) in gdImageSaveAlpha() argument
2991 im->saveAlphaFlag = saveAlphaArg; in gdImageSaveAlpha()
3049 void gdImageSetClip (gdImagePtr im, int x1, int y1, int x2, int y2) in gdImageSetClip() argument
3054 if (x1 >= im->sx) { in gdImageSetClip()
3055 x1 = im->sx - 1; in gdImageSetClip()
3060 if (x2 >= im->sx) { in gdImageSetClip()
3061 x2 = im->sx - 1; in gdImageSetClip()
3066 if (y1 >= im->sy) { in gdImageSetClip()
3067 y1 = im->sy - 1; in gdImageSetClip()
3072 if (y2 >= im->sy) { in gdImageSetClip()
3073 y2 = im->sy - 1; in gdImageSetClip()
3075 im->cx1 = x1; in gdImageSetClip()
3076 im->cy1 = y1; in gdImageSetClip()
3077 im->cx2 = x2; in gdImageSetClip()
3078 im->cy2 = y2; in gdImageSetClip()
3081 void gdImageGetClip (gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P) in gdImageGetClip() argument
3083 *x1P = im->cx1; in gdImageGetClip()
3084 *y1P = im->cy1; in gdImageGetClip()
3085 *x2P = im->cx2; in gdImageGetClip()
3086 *y2P = im->cy2; in gdImageGetClip()
3089 void gdImageSetResolution(gdImagePtr im, const unsigned int res_x, const unsigned int res_y) in gdImageSetResolution() argument
3091 if (res_x > 0) im->res_x = res_x; in gdImageSetResolution()
3092 if (res_y > 0) im->res_y = res_y; in gdImageSetResolution()