Lines Matching refs:im

136 static void gdImageBrushApply(gdImagePtr im, int x, int y);
137 static void gdImageTileApply(gdImagePtr im, int x, int y);
139 int gdImageGetTrueColorPixel(gdImagePtr im, int x, int y);
144 gdImagePtr im; in gdImageCreate() local
156 im = (gdImage *) gdCalloc(1, sizeof(gdImage)); in gdImageCreate()
159 im->pixels = (unsigned char **) gdMalloc(sizeof(unsigned char *) * sy); in gdImageCreate()
160 im->polyInts = 0; in gdImageCreate()
161 im->polyAllocated = 0; in gdImageCreate()
162 im->brush = 0; in gdImageCreate()
163 im->tile = 0; in gdImageCreate()
164 im->style = 0; in gdImageCreate()
167 im->pixels[i] = (unsigned char *) gdCalloc(sx, sizeof(unsigned char)); in gdImageCreate()
169 im->sx = sx; in gdImageCreate()
170 im->sy = sy; in gdImageCreate()
171 im->colorsTotal = 0; in gdImageCreate()
172 im->transparent = (-1); in gdImageCreate()
173 im->interlace = 0; in gdImageCreate()
174 im->thick = 1; in gdImageCreate()
175 im->AA = 0; in gdImageCreate()
177 im->open[i] = 1; in gdImageCreate()
178 im->red[i] = 0; in gdImageCreate()
179 im->green[i] = 0; in gdImageCreate()
180 im->blue[i] = 0; in gdImageCreate()
182 im->trueColor = 0; in gdImageCreate()
183 im->tpixels = 0; in gdImageCreate()
184 im->cx1 = 0; in gdImageCreate()
185 im->cy1 = 0; in gdImageCreate()
186 im->cx2 = im->sx - 1; in gdImageCreate()
187 im->cy2 = im->sy - 1; in gdImageCreate()
188 im->res_x = GD_RESOLUTION; in gdImageCreate()
189 im->res_y = GD_RESOLUTION; in gdImageCreate()
190 im->interpolation = NULL; in gdImageCreate()
191 im->interpolation_id = GD_BILINEAR_FIXED; in gdImageCreate()
192 return im; in gdImageCreate()
198 gdImagePtr im; in gdImageCreateTrueColor() local
210 im = (gdImage *) gdMalloc(sizeof(gdImage)); in gdImageCreateTrueColor()
211 memset(im, 0, sizeof(gdImage)); in gdImageCreateTrueColor()
212 im->tpixels = (int **) gdMalloc(sizeof(int *) * sy); in gdImageCreateTrueColor()
213 im->polyInts = 0; in gdImageCreateTrueColor()
214 im->polyAllocated = 0; in gdImageCreateTrueColor()
215 im->brush = 0; in gdImageCreateTrueColor()
216 im->tile = 0; in gdImageCreateTrueColor()
217 im->style = 0; in gdImageCreateTrueColor()
219 im->tpixels[i] = (int *) gdCalloc(sx, sizeof(int)); in gdImageCreateTrueColor()
221 im->sx = sx; in gdImageCreateTrueColor()
222 im->sy = sy; in gdImageCreateTrueColor()
223 im->transparent = (-1); in gdImageCreateTrueColor()
224 im->interlace = 0; in gdImageCreateTrueColor()
225 im->trueColor = 1; in gdImageCreateTrueColor()
232 im->saveAlphaFlag = 0; in gdImageCreateTrueColor()
233 im->alphaBlendingFlag = 1; in gdImageCreateTrueColor()
234 im->thick = 1; in gdImageCreateTrueColor()
235 im->AA = 0; in gdImageCreateTrueColor()
236 im->cx1 = 0; in gdImageCreateTrueColor()
237 im->cy1 = 0; in gdImageCreateTrueColor()
238 im->cx2 = im->sx - 1; in gdImageCreateTrueColor()
239 im->cy2 = im->sy - 1; in gdImageCreateTrueColor()
240 im->res_x = GD_RESOLUTION; in gdImageCreateTrueColor()
241 im->res_y = GD_RESOLUTION; in gdImageCreateTrueColor()
242 im->interpolation = NULL; in gdImageCreateTrueColor()
243 im->interpolation_id = GD_BILINEAR_FIXED; in gdImageCreateTrueColor()
244 return im; in gdImageCreateTrueColor()
247 void gdImageDestroy (gdImagePtr im) in gdImageDestroy() argument
250 if (im->pixels) { in gdImageDestroy()
251 for (i = 0; i < im->sy; i++) { in gdImageDestroy()
252 gdFree(im->pixels[i]); in gdImageDestroy()
254 gdFree(im->pixels); in gdImageDestroy()
256 if (im->tpixels) { in gdImageDestroy()
257 for (i = 0; i < im->sy; i++) { in gdImageDestroy()
258 gdFree(im->tpixels[i]); in gdImageDestroy()
260 gdFree(im->tpixels); in gdImageDestroy()
262 if (im->polyInts) { in gdImageDestroy()
263 gdFree(im->polyInts); in gdImageDestroy()
265 if (im->style) { in gdImageDestroy()
266 gdFree(im->style); in gdImageDestroy()
268 gdFree(im); in gdImageDestroy()
271 int gdImageColorClosest (gdImagePtr im, int r, int g, int b) in gdImageColorClosest() argument
273 return gdImageColorClosestAlpha (im, r, g, b, gdAlphaOpaque); in gdImageColorClosest()
276 int gdImageColorClosestAlpha (gdImagePtr im, int r, int g, int b, int a) in gdImageColorClosestAlpha() argument
284 if (im->trueColor) { in gdImageColorClosestAlpha()
287 for (i = 0; i < im->colorsTotal; i++) { in gdImageColorClosestAlpha()
289 if (im->open[i]) { in gdImageColorClosestAlpha()
292 rd = im->red[i] - r; in gdImageColorClosestAlpha()
293 gd = im->green[i] - g; in gdImageColorClosestAlpha()
294 bd = im->blue[i] - b; in gdImageColorClosestAlpha()
296 ad = im->alpha[i] - a; in gdImageColorClosestAlpha()
442 int gdImageColorClosestHWB (gdImagePtr im, int r, int g, int b) in gdImageColorClosestHWB() argument
449 if (im->trueColor) { in gdImageColorClosestHWB()
452 for (i = 0; i < im->colorsTotal; i++) { in gdImageColorClosestHWB()
454 if (im->open[i]) { in gdImageColorClosestHWB()
457 dist = HWB_Diff(im->red[i], im->green[i], im->blue[i], r, g, b); in gdImageColorClosestHWB()
467 int gdImageColorExact (gdImagePtr im, int r, int g, int b) in gdImageColorExact() argument
469 return gdImageColorExactAlpha (im, r, g, b, gdAlphaOpaque); in gdImageColorExact()
472 int gdImageColorExactAlpha (gdImagePtr im, int r, int g, int b, int a) in gdImageColorExactAlpha() argument
475 if (im->trueColor) { in gdImageColorExactAlpha()
478 for (i = 0; i < im->colorsTotal; i++) { in gdImageColorExactAlpha()
479 if (im->open[i]) { in gdImageColorExactAlpha()
482 if ((im->red[i] == r) && (im->green[i] == g) && (im->blue[i] == b) && (im->alpha[i] == a)) { in gdImageColorExactAlpha()
489 int gdImageColorAllocate (gdImagePtr im, int r, int g, int b) in gdImageColorAllocate() argument
491 return gdImageColorAllocateAlpha (im, r, g, b, gdAlphaOpaque); in gdImageColorAllocate()
494 int gdImageColorAllocateAlpha (gdImagePtr im, int r, int g, int b, int a) in gdImageColorAllocateAlpha() argument
498 if (im->trueColor) { in gdImageColorAllocateAlpha()
501 for (i = 0; i < im->colorsTotal; i++) { in gdImageColorAllocateAlpha()
502 if (im->open[i]) { in gdImageColorAllocateAlpha()
508 ct = im->colorsTotal; in gdImageColorAllocateAlpha()
512 im->colorsTotal++; in gdImageColorAllocateAlpha()
514 im->red[ct] = r; in gdImageColorAllocateAlpha()
515 im->green[ct] = g; in gdImageColorAllocateAlpha()
516 im->blue[ct] = b; in gdImageColorAllocateAlpha()
517 im->alpha[ct] = a; in gdImageColorAllocateAlpha()
518 im->open[ct] = 0; in gdImageColorAllocateAlpha()
534 int gdImageColorResolve (gdImagePtr im, int r, int g, int b) in gdImageColorResolve() argument
536 return gdImageColorResolveAlpha(im, r, g, b, gdAlphaOpaque); in gdImageColorResolve()
539 int gdImageColorResolveAlpha (gdImagePtr im, int r, int g, int b, int a) in gdImageColorResolveAlpha() argument
546 if (im->trueColor) in gdImageColorResolveAlpha()
551 for (c = 0; c < im->colorsTotal; c++) in gdImageColorResolveAlpha()
553 if (im->open[c]) in gdImageColorResolveAlpha()
558 if (c == im->transparent) in gdImageColorResolveAlpha()
564 rd = (long) (im->red[c] - r); in gdImageColorResolveAlpha()
565 gd = (long) (im->green[c] - g); in gdImageColorResolveAlpha()
566 bd = (long) (im->blue[c] - b); in gdImageColorResolveAlpha()
567 ad = (long) (im->alpha[c] - a); in gdImageColorResolveAlpha()
582 op = im->colorsTotal; in gdImageColorResolveAlpha()
587 im->colorsTotal++; in gdImageColorResolveAlpha()
589 im->red[op] = r; in gdImageColorResolveAlpha()
590 im->green[op] = g; in gdImageColorResolveAlpha()
591 im->blue[op] = b; in gdImageColorResolveAlpha()
592 im->alpha[op] = a; in gdImageColorResolveAlpha()
593 im->open[op] = 0; in gdImageColorResolveAlpha()
597 void gdImageColorDeallocate (gdImagePtr im, int color) in gdImageColorDeallocate() argument
599 if (im->trueColor) { in gdImageColorDeallocate()
603 im->open[color] = 1; in gdImageColorDeallocate()
606 void gdImageColorTransparent (gdImagePtr im, int color) in gdImageColorTransparent() argument
611 if (!im->trueColor) { in gdImageColorTransparent()
612 if((color >= im->colorsTotal)) { in gdImageColorTransparent()
616 if (im->transparent != -1) { in gdImageColorTransparent()
617 im->alpha[im->transparent] = gdAlphaOpaque; in gdImageColorTransparent()
619 im->alpha[color] = gdAlphaTransparent; in gdImageColorTransparent()
621 im->transparent = color; in gdImageColorTransparent()
735 void gdImageSetPixel (gdImagePtr im, int x, int y, int color) in gdImageSetPixel() argument
740 if (!im->style) { in gdImageSetPixel()
744 p = im->style[im->stylePos++]; in gdImageSetPixel()
747 gdImageSetPixel(im, x, y, p); in gdImageSetPixel()
749 im->stylePos = im->stylePos % im->styleLength; in gdImageSetPixel()
752 if (!im->style) { in gdImageSetPixel()
756 p = im->style[im->stylePos++]; in gdImageSetPixel()
758 gdImageSetPixel(im, x, y, gdBrushed); in gdImageSetPixel()
760 im->stylePos = im->stylePos % im->styleLength; in gdImageSetPixel()
763 gdImageBrushApply(im, x, y); in gdImageSetPixel()
766 gdImageTileApply(im, x, y); in gdImageSetPixel()
771 gdImageSetPixel(im, x, y, im->AA_color); in gdImageSetPixel()
774 if (gdImageBoundsSafe(im, x, y)) { in gdImageSetPixel()
775 if (im->trueColor) { in gdImageSetPixel()
776 switch (im->alphaBlendingFlag) { in gdImageSetPixel()
779 im->tpixels[y][x] = color; in gdImageSetPixel()
783 im->tpixels[y][x] = gdAlphaBlend(im->tpixels[y][x], color); in gdImageSetPixel()
786 im->tpixels[y][x] = gdLayerOverlay(im->tpixels[y][x], color); in gdImageSetPixel()
789 im->tpixels[y][x] = gdLayerMultiply(im->tpixels[y][x], color); in gdImageSetPixel()
793 im->pixels[y][x] = color; in gdImageSetPixel()
800 int gdImageGetTrueColorPixel (gdImagePtr im, int x, int y) in gdImageGetTrueColorPixel() argument
802 int p = gdImageGetPixel(im, x, y); in gdImageGetTrueColorPixel()
804 if (!im->trueColor) { in gdImageGetTrueColorPixel()
805 …return gdTrueColorAlpha(im->red[p], im->green[p], im->blue[p], (im->transparent == p) ? gdAlphaTra… in gdImageGetTrueColorPixel()
811 static void gdImageBrushApply (gdImagePtr im, int x, int y) in gdImageBrushApply() argument
818 if (!im->brush) { in gdImageBrushApply()
822 hy = gdImageSY(im->brush) / 2; in gdImageBrushApply()
824 y2 = y1 + gdImageSY(im->brush); in gdImageBrushApply()
825 hx = gdImageSX(im->brush) / 2; in gdImageBrushApply()
827 x2 = x1 + gdImageSX(im->brush); in gdImageBrushApply()
830 if (im->trueColor) { in gdImageBrushApply()
831 if (im->brush->trueColor) { in gdImageBrushApply()
836 p = gdImageGetTrueColorPixel(im->brush, srcx, srcy); in gdImageBrushApply()
838 if (p != gdImageGetTransparent(im->brush)) { in gdImageBrushApply()
839 gdImageSetPixel(im, lx, ly, p); in gdImageBrushApply()
851 p = gdImageGetPixel(im->brush, srcx, srcy); in gdImageBrushApply()
852 tc = gdImageGetTrueColorPixel(im->brush, srcx, srcy); in gdImageBrushApply()
854 if (p != gdImageGetTransparent(im->brush)) { in gdImageBrushApply()
855 gdImageSetPixel(im, lx, ly, tc); in gdImageBrushApply()
867 p = gdImageGetPixel(im->brush, srcx, srcy); in gdImageBrushApply()
869 if (p != gdImageGetTransparent(im->brush)) { in gdImageBrushApply()
871 if (im->brush->trueColor) { in gdImageBrushApply()
872 gdImageSetPixel(im, lx, ly, gdImageColorResolveAlpha(im, gdTrueColorGetRed(p), in gdImageBrushApply()
877 gdImageSetPixel(im, lx, ly, im->brushColorMap[p]); in gdImageBrushApply()
887 static void gdImageTileApply (gdImagePtr im, int x, int y) in gdImageTileApply() argument
889 gdImagePtr tile = im->tile; in gdImageTileApply()
897 if (im->trueColor) { in gdImageTileApply()
903 gdImageSetPixel(im, x, y, p); in gdImageTileApply()
911 gdImageSetPixel(im, x, y, gdImageColorResolveAlpha(im, in gdImageTileApply()
917 gdImageSetPixel(im, x, y, im->tileColorMap[p]); in gdImageTileApply()
924 static int gdImageTileGet (gdImagePtr im, int x, int y) in gdImageTileGet() argument
928 if (!im->tile) { in gdImageTileGet()
931 srcx = x % gdImageSX(im->tile); in gdImageTileGet()
932 srcy = y % gdImageSY(im->tile); in gdImageTileGet()
933 p = gdImageGetPixel(im->tile, srcx, srcy); in gdImageTileGet()
935 if (p == im->tile->transparent) { in gdImageTileGet()
936 tileColor = im->transparent; in gdImageTileGet()
937 } else if (im->trueColor) { in gdImageTileGet()
938 if (im->tile->trueColor) { in gdImageTileGet()
941 …olor = gdTrueColorAlpha( gdImageRed(im->tile,p), gdImageGreen(im->tile,p), gdImageBlue (im->tile,p… in gdImageTileGet()
944 if (im->tile->trueColor) { in gdImageTileGet()
945 …tileColor = gdImageColorResolveAlpha(im, gdTrueColorGetRed (p), gdTrueColorGetGreen (p), gdTrueCol… in gdImageTileGet()
948 …= gdImageColorResolveAlpha(im, gdImageRed (im->tile,p), gdImageGreen (im->tile,p), gdImageBlue (im in gdImageTileGet()
955 int gdImageGetPixel (gdImagePtr im, int x, int y) in gdImageGetPixel() argument
957 if (gdImageBoundsSafe(im, x, y)) { in gdImageGetPixel()
958 if (im->trueColor) { in gdImageGetPixel()
959 return im->tpixels[y][x]; in gdImageGetPixel()
961 return im->pixels[y][x]; in gdImageGetPixel()
968 void gdImageAABlend (gdImagePtr im) in gdImageAABlend() argument
970 (void)im; in gdImageAABlend()
973 static void _gdImageFilledHRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color);
1059 static void gdImageHLine(gdImagePtr im, int y, int x1, int x2, int col) in gdImageHLine() argument
1061 if (im->thick > 1) { in gdImageHLine()
1062 int thickhalf = im->thick >> 1; in gdImageHLine()
1063 _gdImageFilledHRectangle(im, x1, y - thickhalf, x2, y + im->thick - thickhalf - 1, col); in gdImageHLine()
1072 gdImageSetPixel(im, x1, y, col); in gdImageHLine()
1078 static void gdImageVLine(gdImagePtr im, int x, int y1, int y2, int col) in gdImageVLine() argument
1080 if (im->thick > 1) { in gdImageVLine()
1081 int thickhalf = im->thick >> 1; in gdImageVLine()
1082 gdImageFilledRectangle(im, x - thickhalf, y1, x + im->thick - thickhalf - 1, y2, col); in gdImageVLine()
1091 gdImageSetPixel(im, x, y1, col); in gdImageVLine()
1098 void gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color) in gdImageLine() argument
1103 int thick = im->thick; in gdImageLine()
1111 gdImageAALine(im, x1, y1, x2, y2, im->AA_color); in gdImageLine()
1120 if (clip_1d (&x1, &y1, &x2, &y2, im->cx1, im->cx2) == 0) in gdImageLine()
1122 if (clip_1d (&y1, &x1, &y2, &x2, im->cy1, im->cy2) == 0) in gdImageLine()
1129 gdImageVLine(im, x1, y1, y2, color); in gdImageLine()
1132 gdImageHLine(im, y1, x1, x2, color); in gdImageLine()
1172 gdImageSetPixel(im, x, w, color); in gdImageLine()
1186 gdImageSetPixel (im, x, w, color); in gdImageLine()
1200 gdImageSetPixel (im, x, w, color); in gdImageLine()
1236 gdImageSetPixel (im, w, y, color); in gdImageLine()
1250 gdImageSetPixel (im, w, y, color); in gdImageLine()
1264 gdImageSetPixel (im, w, y, color); in gdImageLine()
1278 inline static void gdImageSetAAPixelColor(gdImagePtr im, int x, int y, int color, int t) in gdImageSetAAPixelColor() argument
1285 p = gdImageGetPixel(im,x,y); in gdImageSetAAPixelColor()
1293 im->tpixels[y][x]=gdTrueColorAlpha(dr, dg, db, gdAlphaOpaque); in gdImageSetAAPixelColor()
1299 void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col) in gdImageAALine() argument
1305 if (!im->trueColor) { in gdImageAALine()
1307 gdImageLine(im, x1, y1, x2, y2, col); in gdImageAALine()
1312 if (clip_1d (&x1, &y1, &x2, &y2, im->cx1, im->cx2) == 0) in gdImageAALine()
1314 if (clip_1d (&y1, &x1, &y2, &x2, im->cy1, im->cy2) == 0) in gdImageAALine()
1338 gdImageSetAAPixelColor(im, x, y, col, (frac >> 8) & 0xFF); in gdImageAALine()
1339 if (y + 1 < im->sy) { in gdImageAALine()
1340 gdImageSetAAPixelColor(im, x, y + 1, col, (~frac >> 8) & 0xFF); in gdImageAALine()
1366 gdImageSetAAPixelColor(im, x, y, col, (frac >> 8) & 0xFF); in gdImageAALine()
1367 if (x + 1 < im->sx) { in gdImageAALine()
1368 gdImageSetAAPixelColor(im, x + 1, y, col, (~frac >> 8) & 0xFF); in gdImageAALine()
1382 static void dashedSet (gdImagePtr im, int x, int y, int color, int *onP, int *dashStepP, int wid, i…
1384 void gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color) in gdImageDashedLine() argument
1391 int thick = im->thick; in gdImageDashedLine()
1421 dashedSet(im, x, y, color, &on, &dashStep, wid, vert); in gdImageDashedLine()
1431 dashedSet(im, x, y, color, &on, &dashStep, wid, vert); in gdImageDashedLine()
1442 dashedSet(im, x, y, color, &on, &dashStep, wid, vert); in gdImageDashedLine()
1470 dashedSet(im, x, y, color, &on, &dashStep, wid, vert); in gdImageDashedLine()
1480 dashedSet(im, x, y, color, &on, &dashStep, wid, vert); in gdImageDashedLine()
1491 dashedSet(im, x, y, color, &on, &dashStep, wid, vert); in gdImageDashedLine()
1497 static void dashedSet (gdImagePtr im, int x, int y, int color, int *onP, int *dashStepP, int wid, i… in dashedSet() argument
1512 gdImageSetPixel(im, x, w, color); in dashedSet()
1517 gdImageSetPixel(im, w, y, color); in dashedSet()
1525 void gdImageChar (gdImagePtr im, gdFontPtr f, int x, int y, int c, int color) in gdImageChar() argument
1544 gdImageSetPixel(im, px, py, color); in gdImageChar()
1553 void gdImageCharUp (gdImagePtr im, gdFontPtr f, int x, int y, int c, int color) in gdImageCharUp() argument
1572 gdImageSetPixel(im, px, py, color); in gdImageCharUp()
1581 void gdImageString (gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color) in gdImageString() argument
1587 gdImageChar(im, f, x, y, s[i], color); in gdImageString()
1592 void gdImageStringUp (gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color) in gdImageStringUp() argument
1598 gdImageCharUp(im, f, x, y, s[i], color); in gdImageStringUp()
1605 void gdImageString16 (gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color) in gdImageString16() argument
1611 gdImageChar(im, f, x, y, s[i], color); in gdImageString16()
1616 void gdImageStringUp16 (gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color) in gdImageStringUp16() argument
1622 gdImageCharUp(im, f, x, y, s[i], color); in gdImageStringUp16()
1653 void gdImageArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color) in gdImageArc() argument
1655 gdImageFilledArc(im, cx, cy, w, h, s, e, color, gdNoFill); in gdImageArc()
1658 void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int st… in gdImageFilledArc() argument
1696 gdImageLine(im, lx, ly, x, y, color); in gdImageFilledArc()
1727 gdImageLine(im, cx, cy, lx, ly, color); in gdImageFilledArc()
1728 gdImageLine(im, cx, cy, fx, fy, color); in gdImageFilledArc()
1730 gdImageLine(im, fx, fy, lx, ly, color); in gdImageFilledArc()
1738 gdImageFilledPolygon(im, pts, 3, color); in gdImageFilledArc()
1743 gdImageLine(im, cx, cy, lx, ly, color); in gdImageFilledArc()
1744 gdImageLine(im, cx, cy, fx, fy, color); in gdImageFilledArc()
1767 gdImageFilledPolygon(im, pts, pti+1, color); in gdImageFilledArc()
1779 void gdImageEllipse(gdImagePtr im, int mx, int my, int w, int h, int c) in gdImageEllipse() argument
1786 gdImageSetPixel(im,mx+a, my, c); in gdImageEllipse()
1787 gdImageSetPixel(im,mx-a, my, c); in gdImageEllipse()
1811 gdImageSetPixel(im,mx1, my1, c); in gdImageEllipse()
1812 gdImageSetPixel(im,mx1, my2, c); in gdImageEllipse()
1813 gdImageSetPixel(im,mx2, my1, c); in gdImageEllipse()
1814 gdImageSetPixel(im,mx2, my2, c); in gdImageEllipse()
1818 void gdImageFilledEllipse (gdImagePtr im, int mx, int my, int w, int h, int c) in gdImageFilledEllipse() argument
1829 gdImageSetPixel(im, x, my, c); in gdImageFilledEllipse()
1858 gdImageSetPixel(im,i,my1,c); in gdImageFilledEllipse()
1859 gdImageSetPixel(im,i,my2,c); in gdImageFilledEllipse()
1866 void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color) in gdImageFillToBorder() argument
1878 if (!im->trueColor) { in gdImageFillToBorder()
1879 if ((color > (im->colorsTotal - 1)) || (border > (im->colorsTotal - 1)) || (color < 0)) { in gdImageFillToBorder()
1884 restoreAlphaBlending = im->alphaBlendingFlag; in gdImageFillToBorder()
1885 im->alphaBlendingFlag = 0; in gdImageFillToBorder()
1887 if (x >= im->sx) { in gdImageFillToBorder()
1888 x = im->sx - 1; in gdImageFillToBorder()
1892 if (y >= im->sy) { in gdImageFillToBorder()
1893 y = im->sy - 1; in gdImageFillToBorder()
1899 if (gdImageGetPixel(im, i, y) == border) { in gdImageFillToBorder()
1902 gdImageSetPixel(im, i, y, color); in gdImageFillToBorder()
1906 im->alphaBlendingFlag = restoreAlphaBlending; in gdImageFillToBorder()
1911 for (i = (x + 1); i < im->sx; i++) { in gdImageFillToBorder()
1912 if (gdImageGetPixel(im, i, y) == border) { in gdImageFillToBorder()
1915 gdImageSetPixel(im, i, y, color); in gdImageFillToBorder()
1923 int c = gdImageGetPixel(im, i, y - 1); in gdImageFillToBorder()
1926 gdImageFillToBorder(im, i, y - 1, border, color); in gdImageFillToBorder()
1936 if (y < ((im->sy) - 1)) { in gdImageFillToBorder()
1939 int c = gdImageGetPixel(im, i, y + 1); in gdImageFillToBorder()
1943 gdImageFillToBorder(im, i, y + 1, border, color); in gdImageFillToBorder()
1951 im->alphaBlendingFlag = restoreAlphaBlending; in gdImageFillToBorder()
1968 #define FILL_MAX ((int)(im->sy*im->sx)/4)
1976 static void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc);
1978 void gdImageFill(gdImagePtr im, int x, int y, int nc) in gdImageFill() argument
1991 if (!im->trueColor && nc > (im->colorsTotal -1)) { in gdImageFill()
1995 alphablending_bak = im->alphaBlendingFlag; in gdImageFill()
1996 im->alphaBlendingFlag = 0; in gdImageFill()
1999 _gdImageFillTiled(im,x,y,nc); in gdImageFill()
2000 im->alphaBlendingFlag = alphablending_bak; in gdImageFill()
2004 wx2=im->sx;wy2=im->sy; in gdImageFill()
2005 oc = gdImageGetPixel(im, x, y); in gdImageFill()
2007 im->alphaBlendingFlag = alphablending_bak; in gdImageFill()
2014 if (im->sx < 4) { in gdImageFill()
2018 c = gdImageGetPixel(im, ix, iy); in gdImageFill()
2022 gdImageSetPixel(im, ix, iy, nc); in gdImageFill()
2023 } while(ix++ < (im->sx -1)); in gdImageFill()
2025 } while(iy++ < (im->sy -1)); in gdImageFill()
2029 if(overflow2(im->sy, im->sx)) { in gdImageFill()
2033 if(overflow2(sizeof(struct seg), ((im->sy * im->sx) / 4))) { in gdImageFill()
2037 stack = (struct seg *)safe_emalloc(sizeof(struct seg), ((int)(im->sy*im->sx)/4), 1); in gdImageFill()
2047 for (x=x1; x>=0 && gdImageGetPixel(im,x, y)==oc; x--) { in gdImageFill()
2048 gdImageSetPixel(im,x, y, nc); in gdImageFill()
2061 for (; x<=wx2 && gdImageGetPixel(im,x, y)==oc; x++) { in gdImageFill()
2062 gdImageSetPixel(im, x, y, nc); in gdImageFill()
2070 for (x++; x<=x2 && (gdImageGetPixel(im, x, y)!=oc); x++); in gdImageFill()
2079 im->alphaBlendingFlag = alphablending_bak; in gdImageFill()
2082 static void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc) in _gdImageFillTiled() argument
2092 if (!im->tile) { in _gdImageFillTiled()
2096 wx2=im->sx;wy2=im->sy; in _gdImageFillTiled()
2098 nc = gdImageTileGet(im,x,y); in _gdImageFillTiled()
2100 if(overflow2(im->sy, im->sx)) { in _gdImageFillTiled()
2104 if(overflow2(sizeof(struct seg), ((im->sy * im->sx) / 4))) { in _gdImageFillTiled()
2108 pts = (char *) ecalloc(im->sy * im->sx, sizeof(char)); in _gdImageFillTiled()
2110 stack = (struct seg *)safe_emalloc(sizeof(struct seg), ((int)(im->sy*im->sx)/4), 1); in _gdImageFillTiled()
2113 oc = gdImageGetPixel(im, x, y); in _gdImageFillTiled()
2121 for (x=x1; x>=0 && (!pts[y + x*wy2] && gdImageGetPixel(im,x,y)==oc); x--) { in _gdImageFillTiled()
2122 nc = gdImageTileGet(im,x,y); in _gdImageFillTiled()
2124 gdImageSetPixel(im,x, y, nc); in _gdImageFillTiled()
2137 for(; x<wx2 && (!pts[y + x*wy2] && gdImageGetPixel(im,x, y)==oc); x++) { in _gdImageFillTiled()
2138 nc = gdImageTileGet(im,x,y); in _gdImageFillTiled()
2140 gdImageSetPixel(im, x, y, nc); in _gdImageFillTiled()
2148 for(x++; x<=x2 && (pts[y + x*wy2] || gdImageGetPixel(im,x, y)!=oc); x++); in _gdImageFillTiled()
2159 void gdImageRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) in gdImageRectangle() argument
2161 int thick = im->thick; in gdImageRectangle()
2165 gdImageSetPixel(im, x1, y1, color); in gdImageRectangle()
2195 gdImageSetPixel(im, cx, cy, color); in gdImageRectangle()
2203 gdImageSetPixel(im, cx, cy, color); in gdImageRectangle()
2211 gdImageSetPixel(im, cx, cy, color); in gdImageRectangle()
2219 gdImageSetPixel(im, cx, cy, color); in gdImageRectangle()
2226 gdImageLine(im, x1, y1, x2, y2, color); in gdImageRectangle()
2228 gdImageLine(im, x1, y1, x2, y1, color); in gdImageRectangle()
2229 gdImageLine(im, x1, y2, x2, y2, color); in gdImageRectangle()
2230 gdImageLine(im, x1, y1 + 1, x1, y2 - 1, color); in gdImageRectangle()
2231 gdImageLine(im, x2, y1 + 1, x2, y2 - 1, color); in gdImageRectangle()
2236 static void _gdImageFilledHRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) in _gdImageFilledHRectangle() argument
2241 gdImageSetPixel(im, x1, y1, color); in _gdImageFilledHRectangle()
2261 if (x2 >= gdImageSX(im)) { in _gdImageFilledHRectangle()
2262 x2 = gdImageSX(im) - 1; in _gdImageFilledHRectangle()
2269 if (y2 >= gdImageSY(im)) { in _gdImageFilledHRectangle()
2270 y2 = gdImageSY(im) - 1; in _gdImageFilledHRectangle()
2275 gdImageSetPixel (im, x, y, color); in _gdImageFilledHRectangle()
2280 static void _gdImageFilledVRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) in _gdImageFilledVRectangle() argument
2285 gdImageSetPixel(im, x1, y1, color); in _gdImageFilledVRectangle()
2305 if (x2 >= gdImageSX(im)) { in _gdImageFilledVRectangle()
2306 x2 = gdImageSX(im) - 1; in _gdImageFilledVRectangle()
2313 if (y2 >= gdImageSY(im)) { in _gdImageFilledVRectangle()
2314 y2 = gdImageSY(im) - 1; in _gdImageFilledVRectangle()
2319 gdImageSetPixel (im, x, y, color); in _gdImageFilledVRectangle()
2324 void gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) in gdImageFilledRectangle() argument
2326 _gdImageFilledVRectangle(im, x1, y1, x2, y2, color); in gdImageFilledRectangle()
2707 void gdImagePolygon (gdImagePtr im, gdPointPtr p, int n, int c) in gdImagePolygon() argument
2714 gdImageLine (im, p->x, p->y, p[n - 1].x, p[n - 1].y, c); in gdImagePolygon()
2715 gdImageOpenPolygon (im, p, n, c); in gdImagePolygon()
2718 void gdImageOpenPolygon (gdImagePtr im, gdPointPtr p, int n, int c) in gdImageOpenPolygon() argument
2731 gdImageLine(im, lx, ly, p->x, p->y, c); in gdImageOpenPolygon()
2745 void gdImageFilledPolygon (gdImagePtr im, gdPointPtr p, int n, int c) in gdImageFilledPolygon() argument
2767 fill_color = im->AA_color; in gdImageFilledPolygon()
2772 if (!im->polyAllocated) { in gdImageFilledPolygon()
2773 im->polyInts = (int *) gdMalloc(sizeof(int) * n); in gdImageFilledPolygon()
2774 im->polyAllocated = n; in gdImageFilledPolygon()
2776 if (im->polyAllocated < n) { in gdImageFilledPolygon()
2777 while (im->polyAllocated < n) { in gdImageFilledPolygon()
2778 im->polyAllocated *= 2; in gdImageFilledPolygon()
2780 if (overflow2(sizeof(int), im->polyAllocated)) { in gdImageFilledPolygon()
2783 im->polyInts = (int *) gdRealloc(im->polyInts, sizeof(int) * im->polyAllocated); in gdImageFilledPolygon()
2805 gdImageLine(im, x1, miny, x2, miny, c); in gdImageFilledPolygon()
2811 if (miny < im->cy1) { in gdImageFilledPolygon()
2812 miny = im->cy1; in gdImageFilledPolygon()
2814 if (maxy > im->cy2) { in gdImageFilledPolygon()
2815 maxy = im->cy2; in gdImageFilledPolygon()
2849 im->polyInts[ints++] = (float) ((y - y1) * (x2 - x1)) / (float) (y2 - y1) + 0.5 + x1; in gdImageFilledPolygon()
2851 im->polyInts[ints++] = x2; in gdImageFilledPolygon()
2861 index = im->polyInts[i]; in gdImageFilledPolygon()
2863 while ((j > 0) && (im->polyInts[j - 1] > index)) { in gdImageFilledPolygon()
2864 im->polyInts[j] = im->polyInts[j - 1]; in gdImageFilledPolygon()
2867 im->polyInts[j] = index; in gdImageFilledPolygon()
2870 gdImageLine(im, im->polyInts[i], y, im->polyInts[i + 1], y, fill_color); in gdImageFilledPolygon()
2876 gdImagePolygon(im, p, n, c); in gdImageFilledPolygon()
2880 void gdImageSetStyle (gdImagePtr im, int *style, int noOfPixels) in gdImageSetStyle() argument
2882 if (im->style) { in gdImageSetStyle()
2883 gdFree(im->style); in gdImageSetStyle()
2888 im->style = (int *) gdMalloc(sizeof(int) * noOfPixels); in gdImageSetStyle()
2889 memcpy(im->style, style, sizeof(int) * noOfPixels); in gdImageSetStyle()
2890 im->styleLength = noOfPixels; in gdImageSetStyle()
2891 im->stylePos = 0; in gdImageSetStyle()
2894 void gdImageSetThickness (gdImagePtr im, int thickness) in gdImageSetThickness() argument
2896 im->thick = thickness; in gdImageSetThickness()
2899 void gdImageSetBrush (gdImagePtr im, gdImagePtr brush) in gdImageSetBrush() argument
2902 im->brush = brush; in gdImageSetBrush()
2903 if (!im->trueColor && !im->brush->trueColor) { in gdImageSetBrush()
2906 …index = gdImageColorResolveAlpha(im, gdImageRed(brush, i), gdImageGreen(brush, i), gdImageBlue(bru… in gdImageSetBrush()
2907 im->brushColorMap[i] = index; in gdImageSetBrush()
2912 void gdImageSetTile (gdImagePtr im, gdImagePtr tile) in gdImageSetTile() argument
2915 im->tile = tile; in gdImageSetTile()
2916 if (!im->trueColor && !im->tile->trueColor) { in gdImageSetTile()
2919 …index = gdImageColorResolveAlpha(im, gdImageRed(tile, i), gdImageGreen(tile, i), gdImageBlue(tile,… in gdImageSetTile()
2920 im->tileColorMap[i] = index; in gdImageSetTile()
2925 void gdImageSetAntiAliased (gdImagePtr im, int c) in gdImageSetAntiAliased() argument
2927 im->AA = 1; in gdImageSetAntiAliased()
2928 im->AA_color = c; in gdImageSetAntiAliased()
2929 im->AA_dont_blend = -1; in gdImageSetAntiAliased()
2932 void gdImageSetAntiAliasedDontBlend (gdImagePtr im, int c, int dont_blend) in gdImageSetAntiAliasedDontBlend() argument
2934 im->AA = 1; in gdImageSetAntiAliasedDontBlend()
2935 im->AA_color = c; in gdImageSetAntiAliasedDontBlend()
2936 im->AA_dont_blend = dont_blend; in gdImageSetAntiAliasedDontBlend()
2940 void gdImageInterlace (gdImagePtr im, int interlaceArg) in gdImageInterlace() argument
2942 im->interlace = interlaceArg; in gdImageInterlace()
3062 void gdImageAlphaBlending (gdImagePtr im, int alphaBlendingArg) in gdImageAlphaBlending() argument
3064 im->alphaBlendingFlag = alphaBlendingArg; in gdImageAlphaBlending()
3067 void gdImageSaveAlpha (gdImagePtr im, int saveAlphaArg) in gdImageSaveAlpha() argument
3069 im->saveAlphaFlag = saveAlphaArg; in gdImageSaveAlpha()
3127 void gdImageSetClip (gdImagePtr im, int x1, int y1, int x2, int y2) in gdImageSetClip() argument
3132 if (x1 >= im->sx) { in gdImageSetClip()
3133 x1 = im->sx - 1; in gdImageSetClip()
3138 if (x2 >= im->sx) { in gdImageSetClip()
3139 x2 = im->sx - 1; in gdImageSetClip()
3144 if (y1 >= im->sy) { in gdImageSetClip()
3145 y1 = im->sy - 1; in gdImageSetClip()
3150 if (y2 >= im->sy) { in gdImageSetClip()
3151 y2 = im->sy - 1; in gdImageSetClip()
3153 im->cx1 = x1; in gdImageSetClip()
3154 im->cy1 = y1; in gdImageSetClip()
3155 im->cx2 = x2; in gdImageSetClip()
3156 im->cy2 = y2; in gdImageSetClip()
3159 void gdImageGetClip (gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P) in gdImageGetClip() argument
3161 *x1P = im->cx1; in gdImageGetClip()
3162 *y1P = im->cy1; in gdImageGetClip()
3163 *x2P = im->cx2; in gdImageGetClip()
3164 *y2P = im->cy2; in gdImageGetClip()
3167 void gdImageSetResolution(gdImagePtr im, const unsigned int res_x, const unsigned int res_y) in gdImageSetResolution() argument
3169 if (res_x > 0) im->res_x = res_x; in gdImageSetResolution()
3170 if (res_y > 0) im->res_y = res_y; in gdImageSetResolution()