Back to index

php5  5.3.10
Enumerations | Functions
gd_compat.h File Reference
#include <gd.h>

Go to the source code of this file.

Enumerations

enum  gdPixelateMode { GD_PIXELATE_UPPERLEFT, GD_PIXELATE_AVERAGE, GD_PIXELATE_UPPERLEFT, GD_PIXELATE_AVERAGE }

Functions

const char * gdPngGetVersionString ()
const char * gdJpegGetVersionString ()
int gdJpegGetVersionInt ()
int overflow2 (int a, int b)
int gdImageNegate (gdImagePtr src)
int gdImageGrayScale (gdImagePtr src)
int gdImageBrightness (gdImagePtr src, int brightness)
int gdImageContrast (gdImagePtr src, double contrast)
int gdImageColor (gdImagePtr src, const int red, const int green, const int blue, const int alpha)
int gdImageConvolution (gdImagePtr src, float ft[3][3], float filter_div, float offset)
int gdImageEdgeDetectQuick (gdImagePtr src)
int gdImageGaussianBlur (gdImagePtr im)
int gdImageSelectiveBlur (gdImagePtr src)
int gdImageEmboss (gdImagePtr im)
int gdImageMeanRemoval (gdImagePtr im)
int gdImageSmooth (gdImagePtr im, float weight)
int gdImagePixelate (gdImagePtr im, int block_size, const unsigned int mode)
void gdImageEllipse (gdImagePtr im, int cx, int cy, int w, int h, int c)
 Integer Ellipse functions (gdImageEllipse and gdImageFilledEllipse) Function added by Pierre-Alain Joye 02/08/2003 (paj@p.nosp@m.earf.nosp@m.r.org) See the ellipse function simplification for the equation as well as the midpoint algorithm.
gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack, int ignoretransparent)
int gdImageColorMatch (gdImagePtr im1, gdImagePtr im2)

Enumeration Type Documentation

Enumerator:
GD_PIXELATE_UPPERLEFT 
GD_PIXELATE_AVERAGE 
GD_PIXELATE_UPPERLEFT 
GD_PIXELATE_AVERAGE 

Definition at line 43 of file gd_compat.h.


Function Documentation

int gdImageBrightness ( gdImagePtr  src,
int  brightness 
)

Definition at line 82 of file gd_filter.c.

{
       int x, y;
       int r,g,b,a;
       int new_pxl, pxl;
       typedef int (*FuncPtr)(gdImagePtr, int, int);
       FuncPtr f;
       f = GET_PIXEL_FUNCTION(src);

       if (src==NULL || (brightness < -255 || brightness>255)) {
              return 0;
       }

       if (brightness==0) {
              return 1;
       }

       for (y=0; y<src->sy; ++y) {
              for (x=0; x<src->sx; ++x) {
                     pxl = f (src, x, y);

                     r = gdImageRed(src, pxl);
                     g = gdImageGreen(src, pxl);
                     b = gdImageBlue(src, pxl);
                     a = gdImageAlpha(src, pxl);

                     r = r + brightness;
                     g = g + brightness;
                     b = b + brightness;

                     r = (r > 255)? 255 : ((r < 0)? 0:r);
                     g = (g > 255)? 255 : ((g < 0)? 0:g);
                     b = (b > 255)? 255 : ((b < 0)? 0:b);

                     new_pxl = gdImageColorAllocateAlpha(src, (int)r, (int)g, (int)b, a);
                     if (new_pxl == -1) {
                            new_pxl = gdImageColorClosestAlpha(src, (int)r, (int)g, (int)b, a);
                     }
                     gdImageSetPixel (src, x, y, new_pxl);
              }
       }
       return 1;
}

Here is the call graph for this function:

int gdImageColor ( gdImagePtr  src,
const int  red,
const int  green,
const int  blue,
const int  alpha 
)

Definition at line 187 of file gd_filter.c.

{
       int x, y;
       int new_pxl, pxl;
       typedef int (*FuncPtr)(gdImagePtr, int, int);
       FuncPtr f;

       if (src == NULL) {
              return 0;
       }

       f = GET_PIXEL_FUNCTION(src);

       for (y=0; y<src->sy; ++y) {
              for (x=0; x<src->sx; ++x) {
                     int r,g,b,a;

                     pxl = f(src, x, y);
                     r = gdImageRed(src, pxl);
                     g = gdImageGreen(src, pxl);
                     b = gdImageBlue(src, pxl);
                     a = gdImageAlpha(src, pxl);

                     r = r + red;
                     g = g + green;
                     b = b + blue;
                     a = a + alpha;

                     r = (r > 255)? 255 : ((r < 0)? 0 : r);
                     g = (g > 255)? 255 : ((g < 0)? 0 : g);
                     b = (b > 255)? 255 : ((b < 0)? 0 : b);
                     a = (a > 127)? 127 : ((a < 0)? 0 : a);

                     new_pxl = gdImageColorAllocateAlpha(src, r, g, b, a);
                     if (new_pxl == -1) {
                            new_pxl = gdImageColorClosestAlpha(src, r, g, b, a);
                     }
                     gdImageSetPixel (src, x, y, new_pxl);
              }
       }
       return 1;
}

Here is the call graph for this function:

Definition at line 15 of file gd_color.c.

{
       unsigned long *buf; /* stores our calculations */
       unsigned long *bp; /* buf ptr */
       int color, rgb;
       int x,y;
       int count;

       if( !im1->trueColor ) {
              return -1; /* im1 must be True Color */
       }
       if( im2->trueColor ) {
              return -2; /* im2 must be indexed */
       }
       if( (im1->sx != im2->sx) || (im1->sy != im2->sy) ) {
              return -3; /* the images are meant to be the same dimensions */
       }
       if (im2->colorsTotal<1) {
              return -4; /* At least 1 color must be allocated */
       }

       buf = (unsigned long *)safe_emalloc(sizeof(unsigned long), 5 * im2->colorsTotal, 0);
       memset( buf, 0, sizeof(unsigned long) * 5 * im2->colorsTotal );

       for (x=0; x<im1->sx; x++) {
              for( y=0; y<im1->sy; y++ ) {
                     color = im2->pixels[y][x];
                     rgb = im1->tpixels[y][x];
                     bp = buf + (color * 5);
                     (*(bp++))++;
                     *(bp++) += gdTrueColorGetRed(rgb);
                     *(bp++) += gdTrueColorGetGreen(rgb);
                     *(bp++) += gdTrueColorGetBlue(rgb);
                     *(bp++) += gdTrueColorGetAlpha(rgb);
              }
       }
       bp = buf;
       for (color=0; color<im2->colorsTotal; color++) {
              count = *(bp++);
              if( count > 0 ) {
                     im2->red[color]             = *(bp++) / count;
                     im2->green[color]    = *(bp++) / count;
                     im2->blue[color]     = *(bp++) / count;
                     im2->alpha[color]    = *(bp++) / count;
              } else {
                     bp += 4;
              }
       }
       gdFree(buf);
       return 0;
}

Here is the call graph for this function:

int gdImageContrast ( gdImagePtr  src,
double  contrast 
)

Definition at line 127 of file gd_filter.c.

{
       int x, y;
       int r,g,b,a;
       double rf,gf,bf;
       int new_pxl, pxl;
       typedef int (*FuncPtr)(gdImagePtr, int, int);

       FuncPtr f;
       f = GET_PIXEL_FUNCTION(src);

       if (src==NULL) {
              return 0;
       }

       contrast = (double)(100.0-contrast)/100.0;
       contrast = contrast*contrast;

       for (y=0; y<src->sy; ++y) {
              for (x=0; x<src->sx; ++x) {
                     pxl = f(src, x, y);

                     r = gdImageRed(src, pxl);
                     g = gdImageGreen(src, pxl);
                     b = gdImageBlue(src, pxl);
                     a = gdImageAlpha(src, pxl);

                     rf = (double)r/255.0;
                     rf = rf-0.5;
                     rf = rf*contrast;
                     rf = rf+0.5;
                     rf = rf*255.0;

                     bf = (double)b/255.0;
                     bf = bf-0.5;
                     bf = bf*contrast;
                     bf = bf+0.5;
                     bf = bf*255.0;

                     gf = (double)g/255.0;
                     gf = gf-0.5;
                     gf = gf*contrast;
                     gf = gf+0.5;
                     gf = gf*255.0;

                     rf = (rf > 255.0)? 255.0 : ((rf < 0.0)? 0.0:rf);
                     gf = (gf > 255.0)? 255.0 : ((gf < 0.0)? 0.0:gf);
                     bf = (bf > 255.0)? 255.0 : ((bf < 0.0)? 0.0:bf);

                     new_pxl = gdImageColorAllocateAlpha(src, (int)rf, (int)gf, (int)bf, a);
                     if (new_pxl == -1) {
                            new_pxl = gdImageColorClosestAlpha(src, (int)rf, (int)gf, (int)bf, a);
                     }
                     gdImageSetPixel (src, x, y, new_pxl);
              }
       }
       return 1;
}

Here is the call graph for this function:

int gdImageConvolution ( gdImagePtr  src,
float  ft[3][3],
float  filter_div,
float  offset 
)

Definition at line 230 of file gd_filter.c.

{
       int         x, y, i, j, new_a;
       float       new_r, new_g, new_b;
       int         new_pxl, pxl=0;
       gdImagePtr  srcback;
       typedef int (*FuncPtr)(gdImagePtr, int, int);
       FuncPtr f;

       if (src==NULL) {
              return 0;
       }

       /* We need the orinal image with each safe neoghb. pixel */
       srcback = gdImageCreateTrueColor (src->sx, src->sy);
       if (srcback==NULL) {
              return 0;
       }

       gdImageSaveAlpha(srcback, 1);
       new_pxl = gdImageColorAllocateAlpha(srcback, 0, 0, 0, 127);
       gdImageFill(srcback, 0, 0, new_pxl);

       gdImageCopy(srcback, src,0,0,0,0,src->sx,src->sy);

       f = GET_PIXEL_FUNCTION(src);

       for ( y=0; y<src->sy; y++) {
              for(x=0; x<src->sx; x++) {
                     new_r = new_g = new_b = 0;
                     new_a = gdImageAlpha(srcback, pxl);

                     for (j=0; j<3; j++) {
                            int yv = MIN(MAX(y - 1 + j, 0), src->sy - 1);
                            for (i=0; i<3; i++) {
                                    pxl = f(srcback, MIN(MAX(x - 1 + i, 0), src->sx - 1), yv);
                                   new_r += (float)gdImageRed(srcback, pxl) * filter[j][i];
                                   new_g += (float)gdImageGreen(srcback, pxl) * filter[j][i];
                                   new_b += (float)gdImageBlue(srcback, pxl) * filter[j][i];
                            }
                     }

                     new_r = (new_r/filter_div)+offset;
                     new_g = (new_g/filter_div)+offset;
                     new_b = (new_b/filter_div)+offset;

                     new_r = (new_r > 255.0f)? 255.0f : ((new_r < 0.0f)? 0.0f:new_r);
                     new_g = (new_g > 255.0f)? 255.0f : ((new_g < 0.0f)? 0.0f:new_g);
                     new_b = (new_b > 255.0f)? 255.0f : ((new_b < 0.0f)? 0.0f:new_b);

                     new_pxl = gdImageColorAllocateAlpha(src, (int)new_r, (int)new_g, (int)new_b, new_a);
                     if (new_pxl == -1) {
                            new_pxl = gdImageColorClosestAlpha(src, (int)new_r, (int)new_g, (int)new_b, new_a);
                     }
                     gdImageSetPixel (src, x, y, new_pxl);
              }
       }
       gdImageDestroy(srcback);
       return 1;
}

Here is the call graph for this function:

Definition at line 410 of file gd_filter.c.

{
       float filter[3][3] = {{-1.0,0.0,-1.0},
                            {0.0,4.0,0.0},
                            {-1.0,0.0,-1.0}};

       return gdImageConvolution(src, filter, 1, 127);
}

Here is the call graph for this function:

void gdImageEllipse ( gdImagePtr  im,
int  cx,
int  cy,
int  w,
int  h,
int  c 
)

Integer Ellipse functions (gdImageEllipse and gdImageFilledEllipse) Function added by Pierre-Alain Joye 02/08/2003 (paj@p.nosp@m.earf.nosp@m.r.org) See the ellipse function simplification for the equation as well as the midpoint algorithm.

Definition at line 17 of file gd_arc.c.

{
       int x=0,mx1=0,mx2=0,my1=0,my2=0;
       long aq,bq,dx,dy,r,rx,ry,a,b;

       a=w>>1;
       b=h>>1;
       gdImageSetPixel(im,mx+a, my, c);
       gdImageSetPixel(im,mx-a, my, c);
       mx1 = mx-a;my1 = my;
       mx2 = mx+a;my2 = my;

       aq = a * a;
       bq = b * b;
       dx = aq << 1;
       dy = bq << 1;
       r  = a * bq;
       rx = r << 1;
       ry = 0;
       x = a;
       while (x > 0){
              if (r > 0) {
                     my1++;my2--;
                     ry +=dx;
                     r  -=ry;
              }
              if (r <= 0){
                     x--;
                     mx1++;mx2--;
                     rx -=dy;
                     r  +=rx;
              }
              gdImageSetPixel(im,mx1, my1, c);
              gdImageSetPixel(im,mx1, my2, c);
              gdImageSetPixel(im,mx2, my1, c);
              gdImageSetPixel(im,mx2, my2, c);
       }
}

Here is the call graph for this function:

Definition at line 428 of file gd_filter.c.

{
/*
       float filter[3][3] = {{1.0,1.0,1.0},
                            {0.0,0.0,0.0},
                            {-1.0,-1.0,-1.0}};
*/
       float filter[3][3] = {{ 1.5, 0.0, 0.0},
                             { 0.0, 0.0, 0.0},
                             { 0.0, 0.0,-1.5}};

       return gdImageConvolution(im, filter, 1, 127);
}

Here is the call graph for this function:

Definition at line 419 of file gd_filter.c.

{
       float filter[3][3] = {{1.0,2.0,1.0},
                            {2.0,4.0,2.0},
                            {1.0,2.0,1.0}};

       return gdImageConvolution(im, filter, 16, 0);
}

Here is the call graph for this function:

Definition at line 49 of file gd_filter.c.

{
       int x, y;
       int r,g,b,a;
       int new_pxl, pxl;
       typedef int (*FuncPtr)(gdImagePtr, int, int);
       FuncPtr f;
       f = GET_PIXEL_FUNCTION(src);

       if (src==NULL) {
              return 0;
       }

       for (y=0; y<src->sy; ++y) {
              for (x=0; x<src->sx; ++x) {
                     pxl = f (src, x, y);
                     r = gdImageRed(src, pxl);
                     g = gdImageGreen(src, pxl);
                     b = gdImageBlue(src, pxl);
                     a = gdImageAlpha(src, pxl);
                     r = g = b = (int) (.299 * r + .587 * g + .114 * b);

                     new_pxl = gdImageColorAllocateAlpha(src, r, g, b, a);
                     if (new_pxl == -1) {
                            new_pxl = gdImageColorClosestAlpha(src, r, g, b, a);
                     }
                     gdImageSetPixel (src, x, y, new_pxl);
              }
       }
       return 1;
}

Here is the call graph for this function:

Definition at line 442 of file gd_filter.c.

{
       float filter[3][3] = {{-1.0,-1.0,-1.0},
                            {-1.0,9.0,-1.0},
                            {-1.0,-1.0,-1.0}};

       return gdImageConvolution(im, filter, 1, 0);
}

Here is the call graph for this function:

Definition at line 16 of file gd_filter.c.

{
       int x, y;
       int r,g,b,a;
       int new_pxl, pxl;
       typedef int (*FuncPtr)(gdImagePtr, int, int);
       FuncPtr f;

       if (src==NULL) {
              return 0;
       }

       f = GET_PIXEL_FUNCTION(src);

       for (y=0; y<src->sy; ++y) {
              for (x=0; x<src->sx; ++x) {
                     pxl = f (src, x, y);
                     r = gdImageRed(src, pxl);
                     g = gdImageGreen(src, pxl);
                     b = gdImageBlue(src, pxl);
                     a = gdImageAlpha(src, pxl);

                     new_pxl = gdImageColorAllocateAlpha(src, 255-r, 255-g, 255-b, a);
                     if (new_pxl == -1) {
                            new_pxl = gdImageColorClosestAlpha(src, 255-r, 255-g, 255-b, a);
                     }
                     gdImageSetPixel (src, x, y, new_pxl);
              }
       }
       return 1;
}

Here is the call graph for this function:

int gdImagePixelate ( gdImagePtr  im,
int  block_size,
const unsigned int  mode 
)

Definition at line 3 of file gd_pixelate.c.

{
       int x, y;

       if (block_size <= 0) {
              return 0;
       } else if (block_size == 1) {
              return 1;
       }
       switch (mode) {
       case GD_PIXELATE_UPPERLEFT:
              for (y = 0; y < im->sy; y += block_size) {
                     for (x = 0; x < im->sx; x += block_size) {
                            if (gdImageBoundsSafe(im, x, y)) {
                                   int c = gdImageGetPixel(im, x, y);
                                   gdImageFilledRectangle(im, x, y, x + block_size - 1, y + block_size - 1, c);
                            }
                     }
              }
              break;
       case GD_PIXELATE_AVERAGE:
              for (y = 0; y < im->sy; y += block_size) {
                     for (x = 0; x < im->sx; x += block_size) {
                            int a, r, g, b, c;
                            int total;
                            int cx, cy;

                            a = r = g = b = c = total = 0;
                            /* sampling */
                            for (cy = 0; cy < block_size; cy++) {
                                   for (cx = 0; cx < block_size; cx++) {
                                          if (!gdImageBoundsSafe(im, x + cx, y + cy)) {
                                                 continue;
                                          }
                                          c = gdImageGetPixel(im, x + cx, y + cy);
                                          a += gdImageAlpha(im, c);
                                          r += gdImageRed(im, c);
                                          g += gdImageGreen(im, c);
                                          b += gdImageBlue(im, c);
                                          total++;
                                   }
                            }
                            /* drawing */
                            if (total > 0) {
                                   c = gdImageColorResolveAlpha(im, r / total, g / total, b / total, a / total);
                                   gdImageFilledRectangle(im, x, y, x + block_size - 1, y + block_size - 1, c);
                            }
                     }
              }
              break;
       default:
              return 0;
       }
       return 1;
}

Here is the call graph for this function:

gdImagePtr gdImageRotate ( gdImagePtr  src,
double  dAngle,
int  clrBack,
int  ignoretransparent 
)

Definition at line 502 of file gd_rotate.c.

{
       gdImagePtr pMidImg;
       gdImagePtr rotatedImg;

       if (src == NULL) {
              return NULL;
       }

       if (!gdImageTrueColor(src) && (clrBack < 0 || clrBack>=gdImageColorsTotal(src))) {
              return NULL;
       }

       while (dAngle >= 360.0) {
              dAngle -= 360.0;
       }

       while (dAngle < 0) {
              dAngle += 360.0;
       }

       if (dAngle == 90.00) {
              return gdImageRotate90(src, ignoretransparent);
       }
       if (dAngle == 180.00) {
              return gdImageRotate180(src, ignoretransparent);
       }
       if(dAngle == 270.00) {
              return gdImageRotate270 (src, ignoretransparent);
       }

       if ((dAngle > 45.0) && (dAngle <= 135.0)) {
              pMidImg = gdImageRotate90 (src, ignoretransparent);
              dAngle -= 90.0;
       } else if ((dAngle > 135.0) && (dAngle <= 225.0)) {
              pMidImg = gdImageRotate180 (src, ignoretransparent);
              dAngle -= 180.0;
       } else if ((dAngle > 225.0) && (dAngle <= 315.0)) {
              pMidImg = gdImageRotate270 (src, ignoretransparent);
              dAngle -= 270.0;
       } else {
              return gdImageRotate45 (src, dAngle, clrBack, ignoretransparent);
       }

       if (pMidImg == NULL) {
              return NULL;
       }

       rotatedImg = gdImageRotate45 (pMidImg, dAngle, clrBack, ignoretransparent);
       gdImageDestroy(pMidImg);

       return rotatedImg;
}

Here is the call graph for this function:

Definition at line 291 of file gd_filter.c.

{
       int         x, y, i, j;
       float       new_r, new_g, new_b;
       int         new_pxl, cpxl, pxl, new_a=0;
       float flt_r [3][3];
       float flt_g [3][3];
       float flt_b [3][3];
       float flt_r_sum, flt_g_sum, flt_b_sum;

       gdImagePtr srcback;
       typedef int (*FuncPtr)(gdImagePtr, int, int);
       FuncPtr f;

       if (src==NULL) {
              return 0;
       }

       /* We need the orinal image with each safe neoghb. pixel */
       srcback = gdImageCreateTrueColor (src->sx, src->sy);
       if (srcback==NULL) {
              return 0;
       }
       gdImageCopy(srcback, src,0,0,0,0,src->sx,src->sy);

       f = GET_PIXEL_FUNCTION(src);

       for(y = 0; y<src->sy; y++) {
              for (x=0; x<src->sx; x++) {
                    flt_r_sum = flt_g_sum = flt_b_sum = 0.0;
                     cpxl = f(src, x, y);

                     for (j=0; j<3; j++) {
                            for (i=0; i<3; i++) {
                                   if ((j == 1) && (i == 1)) {
                                          flt_r[1][1] = flt_g[1][1] = flt_b[1][1] = 0.5;
                                   } else {
                                          pxl = f(src, x-(3>>1)+i, y-(3>>1)+j);
                                          new_a = gdImageAlpha(srcback, pxl);

                                          new_r = ((float)gdImageRed(srcback, cpxl)) - ((float)gdImageRed (srcback, pxl));

                                          if (new_r < 0.0f) {
                                                 new_r = -new_r;
                                          }
                                          if (new_r != 0) {
                                                 flt_r[j][i] = 1.0f/new_r;
                                          } else {
                                                 flt_r[j][i] = 1.0f;
                                          }

                                          new_g = ((float)gdImageGreen(srcback, cpxl)) - ((float)gdImageGreen(srcback, pxl));

                                          if (new_g < 0.0f) {
                                                 new_g = -new_g;
                                          }
                                          if (new_g != 0) {
                                                 flt_g[j][i] = 1.0f/new_g;
                                          } else {
                                                 flt_g[j][i] = 1.0f;
                                          }

                                          new_b = ((float)gdImageBlue(srcback, cpxl)) - ((float)gdImageBlue(srcback, pxl));

                                          if (new_b < 0.0f) {
                                                 new_b = -new_b;
                                          }
                                          if (new_b != 0) {
                                                 flt_b[j][i] = 1.0f/new_b;
                                          } else {
                                                 flt_b[j][i] = 1.0f;
                                          }
                                   }

                                   flt_r_sum += flt_r[j][i];
                                   flt_g_sum += flt_g[j][i];
                                   flt_b_sum += flt_b [j][i];
                            }
                     }

                     for (j=0; j<3; j++) {
                            for (i=0; i<3; i++) {
                                   if (flt_r_sum != 0.0) {
                                          flt_r[j][i] /= flt_r_sum;
                                   }
                                   if (flt_g_sum != 0.0) {
                                          flt_g[j][i] /= flt_g_sum;
                                   }
                                   if (flt_b_sum != 0.0) {
                                          flt_b [j][i] /= flt_b_sum;
                                   }
                            }
                     }

                     new_r = new_g = new_b = 0.0;

                     for (j=0; j<3; j++) {
                            for (i=0; i<3; i++) {
                                   pxl = f(src, x-(3>>1)+i, y-(3>>1)+j);
                                   new_r += (float)gdImageRed(srcback, pxl) * flt_r[j][i];
                                   new_g += (float)gdImageGreen(srcback, pxl) * flt_g[j][i];
                                   new_b += (float)gdImageBlue(srcback, pxl) * flt_b[j][i];
                            }
                     }

                     new_r = (new_r > 255.0f)? 255.0f : ((new_r < 0.0f)? 0.0f:new_r);
                     new_g = (new_g > 255.0f)? 255.0f : ((new_g < 0.0f)? 0.0f:new_g);
                     new_b = (new_b > 255.0f)? 255.0f : ((new_b < 0.0f)? 0.0f:new_b);
                     new_pxl = gdImageColorAllocateAlpha(src, (int)new_r, (int)new_g, (int)new_b, new_a);
                     if (new_pxl == -1) {
                            new_pxl = gdImageColorClosestAlpha(src, (int)new_r, (int)new_g, (int)new_b, new_a);
                     }
                     gdImageSetPixel (src, x, y, new_pxl);
              }
       }
       gdImageDestroy(srcback);
       return 1;
}

Here is the call graph for this function:

int gdImageSmooth ( gdImagePtr  im,
float  weight 
)

Definition at line 451 of file gd_filter.c.

{
       float filter[3][3] = {{1.0,1.0,1.0},
                            {1.0,0.0,1.0},
                            {1.0,1.0,1.0}};

       filter[1][1] = weight;

       return gdImageConvolution(im, filter, weight+8, 0);
}

Here is the call graph for this function:

const char* gdJpegGetVersionString ( )
const char* gdPngGetVersionString ( )
int overflow2 ( int  a,
int  b 
)

Definition at line 20 of file gd_security.c.

{
       if(a <= 0 || b <= 0) {
              php_gd_error("gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully\n");
              return 1;
       }
       if(a > INT_MAX / b) {
              php_gd_error("gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n");
              return 1;
       }
       return 0;
}

Here is the caller graph for this function: