Lines Matching refs:im

28 static int gdGuessBackgroundColorFromCorners(gdImagePtr im, int *color);
29 static int gdColorMatch(gdImagePtr im, int col1, int col2, float threshold);
79 gdImagePtr gdImageCropAuto(gdImagePtr im, const unsigned int mode) in gdImageCropAuto() argument
81 const int width = gdImageSX(im); in gdImageCropAuto()
82 const int height = gdImageSY(im); in gdImageCropAuto()
95 color = gdImageGetTransparent(im); in gdImageCropAuto()
99 color = gdImageColorClosestAlpha(im, 0, 0, 0, 0); in gdImageCropAuto()
103 color = gdImageColorClosestAlpha(im, 255, 255, 255, 0); in gdImageCropAuto()
107 gdGuessBackgroundColorFromCorners(im, &color); in gdImageCropAuto()
112 color = gdImageGetTransparent(im); in gdImageCropAuto()
123 int c2 = gdImageGetPixel(im, x, y); in gdImageCropAuto()
138 match = (color == gdImageGetPixel(im, x,y)); in gdImageCropAuto()
146 match = (color == gdImageGetPixel(im, x,y)); in gdImageCropAuto()
154 match = (color == gdImageGetPixel(im, x,y)); in gdImageCropAuto()
159 return gdImageCrop(im, &crop); in gdImageCropAuto()
181 gdImagePtr gdImageCropThreshold(gdImagePtr im, const unsigned int color, const float threshold) in gdImageCropThreshold() argument
183 const int width = gdImageSX(im); in gdImageCropThreshold()
184 const int height = gdImageSY(im); in gdImageCropThreshold()
200 if (!gdImageTrueColor(im) && color >= gdImageColorsTotal(im)) { in gdImageCropThreshold()
211 match = (gdColorMatch(im, color, gdImageGetPixel(im, x,y), threshold)) > 0; in gdImageCropThreshold()
225 match = (gdColorMatch(im, color, gdImageGetPixel(im, x, y), threshold)) > 0; in gdImageCropThreshold()
233 match = (gdColorMatch(im, color, gdImageGetPixel(im, x,y), threshold)) > 0; in gdImageCropThreshold()
241 match = (gdColorMatch(im, color, gdImageGetPixel(im, x,y), threshold)) > 0; in gdImageCropThreshold()
246 return gdImageCrop(im, &crop); in gdImageCropThreshold()
255 static int gdGuessBackgroundColorFromCorners(gdImagePtr im, int *color) in gdGuessBackgroundColorFromCorners() argument
257 const int tl = gdImageGetPixel(im, 0, 0); in gdGuessBackgroundColorFromCorners()
258 const int tr = gdImageGetPixel(im, gdImageSX(im) - 1, 0); in gdGuessBackgroundColorFromCorners()
259 const int bl = gdImageGetPixel(im, 0, gdImageSY(im) -1); in gdGuessBackgroundColorFromCorners()
260 const int br = gdImageGetPixel(im, gdImageSX(im) - 1, gdImageSY(im) -1); in gdGuessBackgroundColorFromCorners()
286 …r = (int)(0.5f + (gdImageRed(im, tl) + gdImageRed(im, tr) + gdImageRed(im, bl) + gdImageRed(im, br… in gdGuessBackgroundColorFromCorners()
287 …g = (int)(0.5f + (gdImageGreen(im, tl) + gdImageGreen(im, tr) + gdImageGreen(im, bl) + gdImageGree… in gdGuessBackgroundColorFromCorners()
288 …b = (int)(0.5f + (gdImageBlue(im, tl) + gdImageBlue(im, tr) + gdImageBlue(im, bl) + gdImageBlue(im in gdGuessBackgroundColorFromCorners()
289 …a = (int)(0.5f + (gdImageAlpha(im, tl) + gdImageAlpha(im, tr) + gdImageAlpha(im, bl) + gdImageAlph… in gdGuessBackgroundColorFromCorners()
290 *color = gdImageColorClosestAlpha(im, r, g, b, a); in gdGuessBackgroundColorFromCorners()
295 static int gdColorMatch(gdImagePtr im, int col1, int col2, float threshold) in gdColorMatch() argument
297 const int dr = gdImageRed(im, col1) - gdImageRed(im, col2); in gdColorMatch()
298 const int dg = gdImageGreen(im, col1) - gdImageGreen(im, col2); in gdColorMatch()
299 const int db = gdImageBlue(im, col1) - gdImageBlue(im, col2); in gdColorMatch()
300 const int da = gdImageAlpha(im, col1) - gdImageAlpha(im, col2); in gdColorMatch()