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()
177 match = (color == gdImageGetPixel(im, x,y)); in gdImageCropAuto()
190 match = (color == gdImageGetPixel(im, x,y)); in gdImageCropAuto()
198 match = (color == gdImageGetPixel(im, x,y)); in gdImageCropAuto()
205 return gdImageCrop(im, &crop); in gdImageCropAuto()
227 gdImagePtr gdImageCropThreshold(gdImagePtr im, const unsigned int color, const float threshold) in gdImageCropThreshold() argument
229 const int width = gdImageSX(im); in gdImageCropThreshold()
230 const int height = gdImageSY(im); in gdImageCropThreshold()
253 match = (gdColorMatch(im, color, gdImageGetPixel(im, x,y), threshold)) > 0; in gdImageCropThreshold()
269 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()
290 match = (gdColorMatch(im, color, gdImageGetPixel(im, x,y), threshold)) > 0; in gdImageCropThreshold()
295 return gdImageCrop(im, &crop); in gdImageCropThreshold()
304 static int gdGuessBackgroundColorFromCorners(gdImagePtr im, int *color) in gdGuessBackgroundColorFromCorners() argument
306 const int tl = gdImageGetPixel(im, 0, 0); in gdGuessBackgroundColorFromCorners()
307 const int tr = gdImageGetPixel(im, gdImageSX(im) - 1, 0); in gdGuessBackgroundColorFromCorners()
308 const int bl = gdImageGetPixel(im, 0, gdImageSY(im) -1); in gdGuessBackgroundColorFromCorners()
309 const int br = gdImageGetPixel(im, gdImageSX(im) - 1, gdImageSY(im) -1); in gdGuessBackgroundColorFromCorners()
335 …r = (int)(0.5f + (gdImageRed(im, tl) + gdImageRed(im, tr) + gdImageRed(im, bl) + gdImageRed(im, br… in gdGuessBackgroundColorFromCorners()
336 …g = (int)(0.5f + (gdImageGreen(im, tl) + gdImageGreen(im, tr) + gdImageGreen(im, bl) + gdImageGree… in gdGuessBackgroundColorFromCorners()
337 …b = (int)(0.5f + (gdImageBlue(im, tl) + gdImageBlue(im, tr) + gdImageBlue(im, bl) + gdImageBlue(im in gdGuessBackgroundColorFromCorners()
338 …a = (int)(0.5f + (gdImageAlpha(im, tl) + gdImageAlpha(im, tr) + gdImageAlpha(im, bl) + gdImageAlph… in gdGuessBackgroundColorFromCorners()
339 *color = gdImageColorClosestAlpha(im, r, g, b, a); in gdGuessBackgroundColorFromCorners()
344 static int gdColorMatch(gdImagePtr im, int col1, int col2, float threshold) in gdColorMatch() argument
346 const int dr = gdImageRed(im, col1) - gdImageRed(im, col2); in gdColorMatch()
347 const int dg = gdImageGreen(im, col1) - gdImageGreen(im, col2); in gdColorMatch()
348 const int db = gdImageBlue(im, col1) - gdImageBlue(im, col2); in gdColorMatch()
349 const int da = gdImageAlpha(im, col1) - gdImageAlpha(im, col2); in gdColorMatch()