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()
246 if (!gdImageTrueColor(im) && color >= gdImageColorsTotal(im)) { in gdImageCropThreshold()
257 match = (gdColorMatch(im, color, gdImageGetPixel(im, x,y), threshold)) > 0; in gdImageCropThreshold()
273 match = (gdColorMatch(im, color, gdImageGetPixel(im, x, y), threshold)) > 0; in gdImageCropThreshold()
286 match = (gdColorMatch(im, color, gdImageGetPixel(im, x,y), threshold)) > 0; in gdImageCropThreshold()
294 match = (gdColorMatch(im, color, gdImageGetPixel(im, x,y), threshold)) > 0; in gdImageCropThreshold()
299 return gdImageCrop(im, &crop); in gdImageCropThreshold()
308 static int gdGuessBackgroundColorFromCorners(gdImagePtr im, int *color) in gdGuessBackgroundColorFromCorners() argument
310 const int tl = gdImageGetPixel(im, 0, 0); in gdGuessBackgroundColorFromCorners()
311 const int tr = gdImageGetPixel(im, gdImageSX(im) - 1, 0); in gdGuessBackgroundColorFromCorners()
312 const int bl = gdImageGetPixel(im, 0, gdImageSY(im) -1); in gdGuessBackgroundColorFromCorners()
313 const int br = gdImageGetPixel(im, gdImageSX(im) - 1, gdImageSY(im) -1); in gdGuessBackgroundColorFromCorners()
339 …r = (int)(0.5f + (gdImageRed(im, tl) + gdImageRed(im, tr) + gdImageRed(im, bl) + gdImageRed(im, br… in gdGuessBackgroundColorFromCorners()
340 …g = (int)(0.5f + (gdImageGreen(im, tl) + gdImageGreen(im, tr) + gdImageGreen(im, bl) + gdImageGree… in gdGuessBackgroundColorFromCorners()
341 …b = (int)(0.5f + (gdImageBlue(im, tl) + gdImageBlue(im, tr) + gdImageBlue(im, bl) + gdImageBlue(im in gdGuessBackgroundColorFromCorners()
342 …a = (int)(0.5f + (gdImageAlpha(im, tl) + gdImageAlpha(im, tr) + gdImageAlpha(im, bl) + gdImageAlph… in gdGuessBackgroundColorFromCorners()
343 *color = gdImageColorClosestAlpha(im, r, g, b, a); in gdGuessBackgroundColorFromCorners()
348 static int gdColorMatch(gdImagePtr im, int col1, int col2, float threshold) in gdColorMatch() argument
350 const int dr = gdImageRed(im, col1) - gdImageRed(im, col2); in gdColorMatch()
351 const int dg = gdImageGreen(im, col1) - gdImageGreen(im, col2); in gdColorMatch()
352 const int db = gdImageBlue(im, col1) - gdImageBlue(im, col2); in gdColorMatch()
353 const int da = gdImageAlpha(im, col1) - gdImageAlpha(im, col2); in gdColorMatch()