From: cristy Date: Thu, 3 Nov 2011 18:34:58 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6690 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=984049ca617ba4e3881c36ea7228a25f6b5ae802;p=imagemagick --- diff --git a/MagickCore/fx.c b/MagickCore/fx.c index fcc585ae7..bab0cf5eb 100644 --- a/MagickCore/fx.c +++ b/MagickCore/fx.c @@ -1256,30 +1256,6 @@ static MagickOffsetType FxGCD(MagickOffsetType alpha,MagickOffsetType beta) return(alpha); } -static inline MagickRealType FxMax(FxInfo *fx_info,const PixelChannel channel, - const ssize_t x,const ssize_t y,const char *expression, - ExceptionInfo *exception) -{ - MagickRealType - alpha, - beta; - - alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression,&beta,exception); - return((MagickRealType) MagickMax((double) alpha,(double) beta)); -} - -static inline MagickRealType FxMin(FxInfo *fx_info,PixelChannel channel, - const ssize_t x,const ssize_t y,const char *expression, - ExceptionInfo *exception) -{ - MagickRealType - alpha, - beta; - - alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression,&beta,exception); - return((MagickRealType) MagickMin((double) alpha,(double) beta)); -} - static inline const char *FxSubexpression(const char *expression, ExceptionInfo *exception) { @@ -2681,16 +2657,25 @@ static MagickRealType FxEvaluateSubexpression(FxInfo *fx_info, if (LocaleNCompare(expression,"maxima",6) == 0) break; if (LocaleNCompare(expression,"max",3) == 0) - return(FxMax(fx_info,channel,x,y,expression+3,exception)); + { + alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,beta, + exception); + return(alpha > *beta ? alpha : *beta); + } if (LocaleNCompare(expression,"minima",6) == 0) break; if (LocaleNCompare(expression,"min",3) == 0) - return(FxMin(fx_info,channel,x,y,expression+3,exception)); + { + alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,beta, + exception); + return(alpha < *beta ? alpha : *beta); + } if (LocaleNCompare(expression,"mod",3) == 0) { alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,beta, exception); - return((MagickRealType) fmod((double) alpha,(double) *beta)); + gamma=alpha-floor((double) (alpha/(*beta)))*(*beta); + return(gamma); } if (LocaleCompare(expression,"m") == 0) return(FxGetSymbol(fx_info,channel,x,y,expression,exception));