Lines Matching refs:im

27 static int gdGuessBackgroundColorFromCorners(gdImagePtr im, int *color);
28 static int gdColorMatch(gdImagePtr im, int col1, int col2, float threshold);
114 gdImagePtr gdImageCropAuto(gdImagePtr im, const unsigned int mode) in gdImageCropAuto() argument
116 const int width = gdImageSX(im); in gdImageCropAuto()
117 const int height = gdImageSY(im); in gdImageCropAuto()
130 color = gdImageGetTransparent(im); in gdImageCropAuto()
134 color = gdImageColorClosestAlpha(im, 0, 0, 0, 0); in gdImageCropAuto()
138 color = gdImageColorClosestAlpha(im, 255, 255, 255, 0); in gdImageCropAuto()
142 corners = gdGuessBackgroundColorFromCorners(im, &color); in gdImageCropAuto()
147 color = gdImageGetTransparent(im); in gdImageCropAuto()
149 corners = gdGuessBackgroundColorFromCorners(im, &color); in gdImageCropAuto()
161 int c2 = gdImageGetPixel(im, x, y); in gdImageCropAuto()
176 match = (color == gdImageGetPixel(im, x,y)); in gdImageCropAuto()
184 match = (color == gdImageGetPixel(im, x,y)); in gdImageCropAuto()
192 match = (color == gdImageGetPixel(im, x,y)); in gdImageCropAuto()
200 return gdImageCrop(im, &crop); in gdImageCropAuto()
222 gdImagePtr gdImageCropThreshold(gdImagePtr im, const unsigned int color, const float threshold) in gdImageCropThreshold() argument
224 const int width = gdImageSX(im); in gdImageCropThreshold()
225 const int height = gdImageSY(im); in gdImageCropThreshold()
241 if (!gdImageTrueColor(im) && color >= gdImageColorsTotal(im)) { in gdImageCropThreshold()
252 match = (gdColorMatch(im, color, gdImageGetPixel(im, x,y), threshold)) > 0; in gdImageCropThreshold()
266 match = (gdColorMatch(im, color, gdImageGetPixel(im, x, y), threshold)) > 0; in gdImageCropThreshold()
274 match = (gdColorMatch(im, color, gdImageGetPixel(im, x,y), threshold)) > 0; in gdImageCropThreshold()
282 match = (gdColorMatch(im, color, gdImageGetPixel(im, x,y), threshold)) > 0; in gdImageCropThreshold()
287 return gdImageCrop(im, &crop); in gdImageCropThreshold()
296 static int gdGuessBackgroundColorFromCorners(gdImagePtr im, int *color) in gdGuessBackgroundColorFromCorners() argument
298 const int tl = gdImageGetPixel(im, 0, 0); in gdGuessBackgroundColorFromCorners()
299 const int tr = gdImageGetPixel(im, gdImageSX(im) - 1, 0); in gdGuessBackgroundColorFromCorners()
300 const int bl = gdImageGetPixel(im, 0, gdImageSY(im) -1); in gdGuessBackgroundColorFromCorners()
301 const int br = gdImageGetPixel(im, gdImageSX(im) - 1, gdImageSY(im) -1); in gdGuessBackgroundColorFromCorners()
327 …r = (int)(0.5f + (gdImageRed(im, tl) + gdImageRed(im, tr) + gdImageRed(im, bl) + gdImageRed(im, br… in gdGuessBackgroundColorFromCorners()
328 …g = (int)(0.5f + (gdImageGreen(im, tl) + gdImageGreen(im, tr) + gdImageGreen(im, bl) + gdImageGree… in gdGuessBackgroundColorFromCorners()
329 …b = (int)(0.5f + (gdImageBlue(im, tl) + gdImageBlue(im, tr) + gdImageBlue(im, bl) + gdImageBlue(im in gdGuessBackgroundColorFromCorners()
330 …a = (int)(0.5f + (gdImageAlpha(im, tl) + gdImageAlpha(im, tr) + gdImageAlpha(im, bl) + gdImageAlph… in gdGuessBackgroundColorFromCorners()
331 *color = gdImageColorClosestAlpha(im, r, g, b, a); in gdGuessBackgroundColorFromCorners()
336 static int gdColorMatch(gdImagePtr im, int col1, int col2, float threshold) in gdColorMatch() argument
338 const int dr = gdImageRed(im, col1) - gdImageRed(im, col2); in gdColorMatch()
339 const int dg = gdImageGreen(im, col1) - gdImageGreen(im, col2); in gdColorMatch()
340 const int db = gdImageBlue(im, col1) - gdImageBlue(im, col2); in gdColorMatch()
341 const int da = gdImageAlpha(im, col1) - gdImageAlpha(im, col2); in gdColorMatch()