29static int gdColorMatch(
gdImagePtr im,
int col1,
int col2,
float threshold);
47 int alphaBlendingFlag;
54 if (!dst)
return NULL;
107 gdGuessBackgroundColorFromCorners(im, &
color);
121 for (y = 0;
match && y < height; y++) {
122 for (x = 0;
match && x < width; x++) {
136 for (y = height - 1;
match && y >= 0; y--) {
137 for (x = 0;
match && x < width; x++) {
144 for (x = 0;
match && x < width; x++) {
152 for (x = width - 1;
match && x >= 0; x--) {
157 crop.
width = x - crop.
x + 2;
196 if (threshold > 100.0) {
209 for (y = 0;
match && y < height; y++) {
210 for (x = 0;
match && x < width; x++) {
223 for (y = height - 1;
match && y >= 0; y--) {
224 for (x = 0;
match && x < width; x++) {
231 for (x = 0;
match && x < width; x++) {
239 for (x = width - 1;
match && x >= 0; x--) {
244 crop.
width = x - crop.
x + 2;
262 if (tr == bl && tr == br) {
265 }
else if (tl == bl && tl == br) {
268 }
else if (tl == tr && tl == br) {
271 }
else if (tl == tr && tl == bl) {
274 }
else if (tl == tr || tl == bl || tl == br) {
277 }
else if (tr == bl || tr == br) {
280 }
else if (br == bl) {
284 register int r,b,g,
a;
295static int gdColorMatch(
gdImagePtr im,
int col1,
int col2,
float threshold)
301 const int dist = dr * dr + dg * dg + db * db + da * da;
303 return (100.0 * dist / 195075) < threshold;
313static int colors_equal (
const int col1,
const in col2)
#define gdImageBlue(im, c)
struct gdRect * gdRectPtr
#define gdImageTrueColor(im)
#define gdImageGetTransparent(im)
#define gdImageColorsTotal(im)
#define gdImageGreen(im, c)
#define gdImageAlpha(im, c)
#define gdImageRed(im, c)
gdImagePtr gdImageCropAuto(gdImagePtr im, const unsigned int mode)
gdImagePtr gdImageCrop(gdImagePtr src, const gdRectPtr crop)
gdImagePtr gdImageCropThreshold(gdImagePtr im, const unsigned int color, const float threshold)
gdImagePtr gdImageCreate(int sx, int sy)
void gdImageAlphaBlending(gdImagePtr im, int alphaBlendingArg)
int gdImageGetPixel(gdImagePtr im, int x, int y)
void gdImageCopy(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h)
gdImagePtr gdImageCreateTrueColor(int sx, int sy)
int gdImageColorClosestAlpha(gdImagePtr im, int r, int g, int b, int a)
file_private int match(struct magic_set *, struct magic *, size_t, const struct buffer *, size_t, int, int, int, uint16_t *, uint16_t *, int *, int *, int *, int *, int *)