From: cristy Date: Mon, 16 Jan 2012 00:43:18 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6375 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78f3de24d5a98b632adaddf470ec049a637638d6;p=imagemagick --- diff --git a/MagickCore/effect.c b/MagickCore/effect.c index c1a949a5b..9d5152802 100644 --- a/MagickCore/effect.c +++ b/MagickCore/effect.c @@ -1466,32 +1466,39 @@ MagickExport Image *ConvolveImage(const Image *image, % */ -static void Hull(const ssize_t x,const ssize_t y,const int polarity, +static void inline Hull(const ssize_t x,const ssize_t y,const int polarity, Quantum *pixels) { double - a, - b, - c; + pixel; - b=(double) pixels[4]; - a=(double) pixels[4-(y*3)-x]; - c=(double) pixels[4+(y*3)+x]; + Quantum + *a, + *b, + *c; + + b=pixels+4; + a=b-(y*3)-x; + c=b+(y*3)+x; + pixel=(double) *b; if (polarity > 0) { - if (c >= (b+ScaleCharToQuantum(2))) - b+=ScaleCharToQuantum(1); - if (a >= (b+ScaleCharToQuantum(2)) && (c > b)) - b+=ScaleCharToQuantum(1); + if ((double) *c >= (pixel+ScaleCharToQuantum(2))) + pixel+=ScaleCharToQuantum(1); } else + if ((double) *c <= (pixel-ScaleCharToQuantum(2))) + pixel-=ScaleCharToQuantum(1); + if (polarity > 0) { - if (c <= (b-ScaleCharToQuantum(2))) - b-=ScaleCharToQuantum(1); - if (a <= (b-ScaleCharToQuantum(2)) && (c < b)) - b-=ScaleCharToQuantum(1); + if (((double) *a >= (pixel+ScaleCharToQuantum(2))) && + ((double) *c > pixel)) + pixel+=ScaleCharToQuantum(1); } - pixels[4]=ClampToQuantum(b); + else + if (((double) *a <= (pixel-ScaleCharToQuantum(2))) && ((double) *c < pixel)) + pixel-=ScaleCharToQuantum(1); + pixels[4]=ClampToQuantum(pixel); } MagickExport Image *DespeckleImage(const Image *image,ExceptionInfo *exception)