Lines Matching refs:im

27 static int gdGuessBackgroundColorFromCorners(gdImagePtr im, int *color);
28 static int gdColorMatch(gdImagePtr im, int col1, int col2, float threshold);
78 gdImagePtr gdImageCropAuto(gdImagePtr im, const unsigned int mode) in gdImageCropAuto() argument
80 const int width = gdImageSX(im); in gdImageCropAuto()
81 const int height = gdImageSY(im); in gdImageCropAuto()
94 color = gdImageGetTransparent(im); in gdImageCropAuto()
98 color = gdImageColorClosestAlpha(im, 0, 0, 0, 0); in gdImageCropAuto()
102 color = gdImageColorClosestAlpha(im, 255, 255, 255, 0); in gdImageCropAuto()
106 gdGuessBackgroundColorFromCorners(im, &color); in gdImageCropAuto()
111 color = gdImageGetTransparent(im); in gdImageCropAuto()
113 gdGuessBackgroundColorFromCorners(im, &color); in gdImageCropAuto()
125 int c2 = gdImageGetPixel(im, x, y); in gdImageCropAuto()
140 match = (color == gdImageGetPixel(im, x,y)); in gdImageCropAuto()
148 match = (color == gdImageGetPixel(im, x,y)); in gdImageCropAuto()
156 match = (color == gdImageGetPixel(im, x,y)); in gdImageCropAuto()
164 return gdImageCrop(im, &crop); in gdImageCropAuto()
186 gdImagePtr gdImageCropThreshold(gdImagePtr im, const unsigned int color, const float threshold) in gdImageCropThreshold() argument
188 const int width = gdImageSX(im); in gdImageCropThreshold()
189 const int height = gdImageSY(im); in gdImageCropThreshold()
205 if (!gdImageTrueColor(im) && color >= gdImageColorsTotal(im)) { in gdImageCropThreshold()
216 match = (gdColorMatch(im, color, gdImageGetPixel(im, x,y), threshold)) > 0; in gdImageCropThreshold()
230 match = (gdColorMatch(im, color, gdImageGetPixel(im, x, y), threshold)) > 0; in gdImageCropThreshold()
238 match = (gdColorMatch(im, color, gdImageGetPixel(im, x,y), threshold)) > 0; in gdImageCropThreshold()
246 match = (gdColorMatch(im, color, gdImageGetPixel(im, x,y), threshold)) > 0; in gdImageCropThreshold()
251 return gdImageCrop(im, &crop); in gdImageCropThreshold()
260 static int gdGuessBackgroundColorFromCorners(gdImagePtr im, int *color) in gdGuessBackgroundColorFromCorners() argument
262 const int tl = gdImageGetPixel(im, 0, 0); in gdGuessBackgroundColorFromCorners()
263 const int tr = gdImageGetPixel(im, gdImageSX(im) - 1, 0); in gdGuessBackgroundColorFromCorners()
264 const int bl = gdImageGetPixel(im, 0, gdImageSY(im) -1); in gdGuessBackgroundColorFromCorners()
265 const int br = gdImageGetPixel(im, gdImageSX(im) - 1, gdImageSY(im) -1); in gdGuessBackgroundColorFromCorners()
291 …r = (int)(0.5f + (gdImageRed(im, tl) + gdImageRed(im, tr) + gdImageRed(im, bl) + gdImageRed(im, br… in gdGuessBackgroundColorFromCorners()
292 …g = (int)(0.5f + (gdImageGreen(im, tl) + gdImageGreen(im, tr) + gdImageGreen(im, bl) + gdImageGree… in gdGuessBackgroundColorFromCorners()
293 …b = (int)(0.5f + (gdImageBlue(im, tl) + gdImageBlue(im, tr) + gdImageBlue(im, bl) + gdImageBlue(im in gdGuessBackgroundColorFromCorners()
294 …a = (int)(0.5f + (gdImageAlpha(im, tl) + gdImageAlpha(im, tr) + gdImageAlpha(im, bl) + gdImageAlph… in gdGuessBackgroundColorFromCorners()
295 *color = gdImageColorClosestAlpha(im, r, g, b, a); in gdGuessBackgroundColorFromCorners()
300 static int gdColorMatch(gdImagePtr im, int col1, int col2, float threshold) in gdColorMatch() argument
302 const int dr = gdImageRed(im, col1) - gdImageRed(im, col2); in gdColorMatch()
303 const int dg = gdImageGreen(im, col1) - gdImageGreen(im, col2); in gdColorMatch()
304 const int db = gdImageBlue(im, col1) - gdImageBlue(im, col2); in gdColorMatch()
305 const int da = gdImageAlpha(im, col1) - gdImageAlpha(im, col2); in gdColorMatch()