const char *expression,size_t *depth,double *beta,ExceptionInfo *exception)
{
#define FxMaxParenthesisDepth 58
+#define FxResult(x) \
+{ \
+ subexpression=DestroyString(subexpression); \
+ return(x); \
+}
char
*q,
- subexpression[MagickPathExtent];
+ *subexpression;
double
alpha,
*p;
*beta=0.0;
+ subexpression=AcquireString((const char *) NULL);
if (*depth > MagickMaxRecursionDepth)
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"UnableToParseExpression","`%s'",expression);
- return(0.0);
+ FxResult(0.0);
}
if (exception->severity >= ErrorException)
- return(0.0);
+ FxResult(0.0);
while (isspace((int) ((unsigned char) *expression)) != 0)
expression++;
if (*expression == '\0')
- return(0.0);
+ FxResult(0.0);
*subexpression='\0';
p=FxOperatorPrecedence(expression,exception);
if (p != (const char *) NULL)
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,beta,
exception);
*beta=(double) (~(size_t) *beta);
- return(*beta);
+ FxResult(*beta);
}
case '!':
{
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,beta,
exception);
- return(*beta == 0.0 ? 1.0 : 0.0);
+ FxResult(*beta == 0.0 ? 1.0 : 0.0);
}
case '^':
{
*beta=pow(alpha,FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,
beta,exception));
- return(*beta);
+ FxResult(*beta);
}
case '*':
case ExponentialNotation:
{
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,beta,
exception);
- return(alpha*(*beta));
+ FxResult(alpha*(*beta));
}
case '/':
{
{
(void) ThrowMagickException(exception,GetMagickModule(),
OptionError,"DivideByZero","`%s'",expression);
- return(0.0);
+ FxResult(0.0);
}
- return(alpha/(*beta));
+ FxResult(alpha/(*beta));
}
case '%':
{
{
(void) ThrowMagickException(exception,GetMagickModule(),
OptionError,"DivideByZero","`%s'",expression);
- return(0.0);
+ FxResult(0.0);
}
- return(fmod(alpha,*beta));
+ FxResult(fmod(alpha,*beta));
}
case '+':
{
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,beta,
exception);
- return(alpha+(*beta));
+ FxResult(alpha+(*beta));
}
case '-':
{
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,beta,
exception);
- return(alpha-(*beta));
+ FxResult(alpha-(*beta));
}
case LeftShiftOperator:
{
{
(void) ThrowMagickException(exception,GetMagickModule(),
OptionError,"ShiftCountOverflow","`%s'",subexpression);
- return(0.0);
+ FxResult(0.0);
}
*beta=(double) ((size_t) (alpha+0.5) << (size_t) (gamma+0.5));
- return(*beta);
+ FxResult(*beta);
}
case RightShiftOperator:
{
{
(void) ThrowMagickException(exception,GetMagickModule(),
OptionError,"ShiftCountOverflow","`%s'",subexpression);
- return(0.0);
+ FxResult(0.0);
}
*beta=(double) ((size_t) (alpha+0.5) >> (size_t) (gamma+0.5));
- return(*beta);
+ FxResult(*beta);
}
case '<':
{
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,beta,
exception);
- return(alpha < *beta ? 1.0 : 0.0);
+ FxResult(alpha < *beta ? 1.0 : 0.0);
}
case LessThanEqualOperator:
{
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,beta,
exception);
- return(alpha <= *beta ? 1.0 : 0.0);
+ FxResult(alpha <= *beta ? 1.0 : 0.0);
}
case '>':
{
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,beta,
exception);
- return(alpha > *beta ? 1.0 : 0.0);
+ FxResult(alpha > *beta ? 1.0 : 0.0);
}
case GreaterThanEqualOperator:
{
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,beta,
exception);
- return(alpha >= *beta ? 1.0 : 0.0);
+ FxResult(alpha >= *beta ? 1.0 : 0.0);
}
case EqualOperator:
{
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,beta,
exception);
- return(fabs(alpha-(*beta)) < MagickEpsilon ? 1.0 : 0.0);
+ FxResult(fabs(alpha-(*beta)) < MagickEpsilon ? 1.0 : 0.0);
}
case NotEqualOperator:
{
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,beta,
exception);
- return(fabs(alpha-(*beta)) >= MagickEpsilon ? 1.0 : 0.0);
+ FxResult(fabs(alpha-(*beta)) >= MagickEpsilon ? 1.0 : 0.0);
}
case '&':
{
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,beta,
exception);
*beta=(double) ((size_t) (alpha+0.5) & (size_t) (gamma+0.5));
- return(*beta);
+ FxResult(*beta);
}
case '|':
{
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,beta,
exception);
*beta=(double) ((size_t) (alpha+0.5) | (size_t) (gamma+0.5));
- return(*beta);
+ FxResult(*beta);
}
case LogicalAndOperator:
{
if (alpha <= 0.0)
{
*beta=0.0;
- return(*beta);
+ FxResult(*beta);
}
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,p,depth,beta,
exception);
*beta=(gamma > 0.0) ? 1.0 : 0.0;
- return(*beta);
+ FxResult(*beta);
}
case LogicalOrOperator:
{
if (alpha > 0.0)
{
*beta=1.0;
- return(*beta);
+ FxResult(*beta);
}
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,p,depth,beta,
exception);
*beta=(gamma > 0.0) ? 1.0 : 0.0;
- return(*beta);
+ FxResult(*beta);
}
case '?':
{
{
(void) ThrowMagickException(exception,GetMagickModule(),
OptionError,"UnableToParseExpression","`%s'",subexpression);
- return(0.0);
+ FxResult(0.0);
}
if (fabs(alpha) >= MagickEpsilon)
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,p,depth,beta,
else
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,q,depth,beta,
exception);
- return(gamma);
+ FxResult(gamma);
}
case '=':
{
{
(void) ThrowMagickException(exception,GetMagickModule(),
OptionError,"UnableToParseExpression","`%s'",subexpression);
- return(0.0);
+ FxResult(0.0);
}
ClearMagickException(exception);
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,beta,
(void) DeleteNodeFromSplayTree(fx_info->symbols,subexpression);
(void) AddValueToSplayTree(fx_info->symbols,ConstantString(
subexpression),ConstantString(numeric));
- return(*beta);
+ FxResult(*beta);
}
case ',':
{
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,beta,
exception);
- return(alpha);
+ FxResult(alpha);
}
case ';':
{
*beta=FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,beta,
exception);
- return(*beta);
+ FxResult(*beta);
}
default:
{
gamma=alpha*FxEvaluateSubexpression(fx_info,channel,x,y,++p,depth,
beta,exception);
- return(gamma);
+ FxResult(gamma);
}
}
}
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,subexpression,depth,
beta,exception);
(*depth)--;
- return(gamma);
+ FxResult(gamma);
}
switch (*expression)
{
{
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,expression+1,depth,beta,
exception);
- return(1.0*gamma);
+ FxResult(1.0*gamma);
}
case '-':
{
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,expression+1,depth,beta,
exception);
- return(-1.0*gamma);
+ FxResult(-1.0*gamma);
}
case '~':
{
gamma=FxEvaluateSubexpression(fx_info,channel,x,y,expression+1,depth,beta,
exception);
- return((double) (~(size_t) (gamma+0.5)));
+ FxResult((double) (~(size_t) (gamma+0.5)));
}
case 'A':
case 'a':
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,depth,
beta,exception);
- return(fabs(alpha));
+ FxResult(fabs(alpha));
}
#if defined(MAGICKCORE_HAVE_ACOSH)
if (LocaleNCompare(expression,"acosh",5) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,depth,
beta,exception);
- return(acosh(alpha));
+ FxResult(acosh(alpha));
}
#endif
if (LocaleNCompare(expression,"acos",4) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,depth,
beta,exception);
- return(acos(alpha));
+ FxResult(acos(alpha));
}
#if defined(MAGICKCORE_HAVE_J1)
if (LocaleNCompare(expression,"airy",4) == 0)
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,depth,
beta,exception);
if (alpha == 0.0)
- return(1.0);
+ FxResult(1.0);
gamma=2.0*j1((MagickPI*alpha))/(MagickPI*alpha);
- return(gamma*gamma);
+ FxResult(gamma*gamma);
}
#endif
#if defined(MAGICKCORE_HAVE_ASINH)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,depth,
beta,exception);
- return(asinh(alpha));
+ FxResult(asinh(alpha));
}
#endif
if (LocaleNCompare(expression,"asin",4) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,depth,
beta,exception);
- return(asin(alpha));
+ FxResult(asin(alpha));
}
if (LocaleNCompare(expression,"alt",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,depth,
beta,exception);
- return(((ssize_t) alpha) & 0x01 ? -1.0 : 1.0);
+ FxResult(((ssize_t) alpha) & 0x01 ? -1.0 : 1.0);
}
if (LocaleNCompare(expression,"atan2",5) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,depth,
beta,exception);
- return(atan2(alpha,*beta));
+ FxResult(atan2(alpha,*beta));
}
#if defined(MAGICKCORE_HAVE_ATANH)
if (LocaleNCompare(expression,"atanh",5) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,depth,
beta,exception);
- return(atanh(alpha));
+ FxResult(atanh(alpha));
}
#endif
if (LocaleNCompare(expression,"atan",4) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,depth,
beta,exception);
- return(atan(alpha));
+ FxResult(atan(alpha));
}
if (LocaleCompare(expression,"a") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'B':
case 'b':
{
if (LocaleCompare(expression,"b") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'C':
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,depth,
beta,exception);
- return(ceil(alpha));
+ FxResult(ceil(alpha));
}
if (LocaleNCompare(expression,"clamp",5) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,depth,
beta,exception);
if (alpha < 0.0)
- return(0.0);
+ FxResult(0.0);
if (alpha > 1.0)
- return(1.0);
- return(alpha);
+ FxResult(1.0);
+ FxResult(alpha);
}
if (LocaleNCompare(expression,"cosh",4) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,depth,
beta,exception);
- return(cosh(alpha));
+ FxResult(cosh(alpha));
}
if (LocaleNCompare(expression,"cos",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,depth,
beta,exception);
- return(cos(alpha));
+ FxResult(cos(alpha));
}
if (LocaleCompare(expression,"c") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'D':
(void) FormatLocaleFile(fx_info->file,"%s[%.20g,%.20g].%s: "
"%s=%.*g\n",fx_info->images->filename,(double) x,(double) y,type,
subexpression,GetMagickPrecision(),alpha);
- return(0.0);
+ FxResult(0.0);
}
if (LocaleNCompare(expression,"drc",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,depth,
beta,exception);
- return((alpha/(*beta*(alpha-1.0)+1.0)));
+ FxResult((alpha/(*beta*(alpha-1.0)+1.0)));
}
break;
}
case 'e':
{
if (LocaleCompare(expression,"epsilon") == 0)
- return(MagickEpsilon);
+ FxResult(MagickEpsilon);
#if defined(MAGICKCORE_HAVE_ERF)
if (LocaleNCompare(expression,"erf",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,depth,
beta,exception);
- return(erf(alpha));
+ FxResult(erf(alpha));
}
#endif
if (LocaleNCompare(expression,"exp",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,depth,
beta,exception);
- return(exp(alpha));
+ FxResult(exp(alpha));
}
if (LocaleCompare(expression,"e") == 0)
- return(2.7182818284590452354);
+ FxResult(2.7182818284590452354);
break;
}
case 'F':
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,depth,
beta,exception);
- return(floor(alpha));
+ FxResult(floor(alpha));
}
break;
}
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,depth,
beta,exception);
gamma=exp((-alpha*alpha/2.0))/sqrt(2.0*MagickPI);
- return(gamma);
+ FxResult(gamma);
}
if (LocaleNCompare(expression,"gcd",3) == 0)
{
beta,exception);
gcd=FxGCD((MagickOffsetType) (alpha+0.5),(MagickOffsetType) (*beta+
0.5));
- return((double) gcd);
+ FxResult((double) gcd);
}
if (LocaleCompare(expression,"g") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'H':
case 'h':
{
if (LocaleCompare(expression,"h") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
if (LocaleCompare(expression,"hue") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
if (LocaleNCompare(expression,"hypot",5) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,depth,
beta,exception);
- return(hypot(alpha,*beta));
+ FxResult(hypot(alpha,*beta));
}
break;
}
case 'k':
{
if (LocaleCompare(expression,"k") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'I':
case 'i':
{
if (LocaleCompare(expression,"intensity") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
if (LocaleNCompare(expression,"int",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,depth,
beta,exception);
- return(floor(alpha));
+ FxResult(floor(alpha));
}
if (LocaleNCompare(expression,"isnan",5) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,depth,
beta,exception);
- return((double) !!IsNaN(alpha));
+ FxResult((double) !!IsNaN(alpha));
}
if (LocaleCompare(expression,"i") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'J':
case 'j':
{
if (LocaleCompare(expression,"j") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
#if defined(MAGICKCORE_HAVE_J0)
if (LocaleNCompare(expression,"j0",2) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+2,depth,
beta,exception);
- return(j0(alpha));
+ FxResult(j0(alpha));
}
#endif
#if defined(MAGICKCORE_HAVE_J1)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+2,depth,
beta,exception);
- return(j1(alpha));
+ FxResult(j1(alpha));
}
#endif
#if defined(MAGICKCORE_HAVE_J1)
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,depth,
beta,exception);
if (alpha == 0.0)
- return(1.0);
+ FxResult(1.0);
gamma=(2.0*j1((MagickPI*alpha))/(MagickPI*alpha));
- return(gamma);
+ FxResult(gamma);
}
#endif
break;
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+2,depth,
beta,exception);
- return(log(alpha));
+ FxResult(log(alpha));
}
if (LocaleNCompare(expression,"logtwo",6) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+6,depth,
beta,exception);
- return(log10(alpha))/log10(2.0);
+ FxResult(log10(alpha)/log10(2.0));
}
if (LocaleNCompare(expression,"log",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,depth,
beta,exception);
- return(log10(alpha));
+ FxResult(log10(alpha));
}
if (LocaleCompare(expression,"lightness") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'M':
case 'm':
{
if (LocaleCompare(expression,"MaxRGB") == 0)
- return(QuantumRange);
+ FxResult(QuantumRange);
if (LocaleNCompare(expression,"maxima",6) == 0)
break;
if (LocaleNCompare(expression,"max",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,depth,
beta,exception);
- return(alpha > *beta ? alpha : *beta);
+ FxResult(alpha > *beta ? alpha : *beta);
}
if (LocaleNCompare(expression,"minima",6) == 0)
break;
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,depth,
beta,exception);
- return(alpha < *beta ? alpha : *beta);
+ FxResult(alpha < *beta ? alpha : *beta);
}
if (LocaleNCompare(expression,"mod",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,depth,
beta,exception);
gamma=alpha-floor((alpha/(*beta)))*(*beta);
- return(gamma);
+ FxResult(gamma);
}
if (LocaleCompare(expression,"m") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'N':
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,depth,
beta,exception);
- return((double) (alpha < MagickEpsilon));
+ FxResult((double) (alpha < MagickEpsilon));
}
if (LocaleCompare(expression,"n") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'O':
case 'o':
{
if (LocaleCompare(expression,"Opaque") == 0)
- return(1.0);
+ FxResult(1.0);
if (LocaleCompare(expression,"o") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'P':
case 'p':
{
if (LocaleCompare(expression,"phi") == 0)
- return(MagickPHI);
+ FxResult(MagickPHI);
if (LocaleCompare(expression,"pi") == 0)
- return(MagickPI);
+ FxResult(MagickPI);
if (LocaleNCompare(expression,"pow",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,depth,
beta,exception);
- return(pow(alpha,*beta));
+ FxResult(pow(alpha,*beta));
}
if (LocaleCompare(expression,"p") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'Q':
case 'q':
{
if (LocaleCompare(expression,"QuantumRange") == 0)
- return(QuantumRange);
+ FxResult(QuantumRange);
if (LocaleCompare(expression,"QuantumScale") == 0)
- return(QuantumScale);
+ FxResult(QuantumScale);
break;
}
case 'R':
#pragma omp critical (MagickCore_FxEvaluateSubexpression)
#endif
alpha=GetPseudoRandomValue(fx_info->random_info);
- return(alpha);
+ FxResult(alpha);
}
if (LocaleNCompare(expression,"round",5) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,depth,
beta,exception);
- return(floor(alpha+0.5));
+ FxResult(floor(alpha+0.5));
}
if (LocaleCompare(expression,"r") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'S':
case 's':
{
if (LocaleCompare(expression,"saturation") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
if (LocaleNCompare(expression,"sign",4) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,depth,
beta,exception);
- return(alpha < 0.0 ? -1.0 : 1.0);
+ FxResult(alpha < 0.0 ? -1.0 : 1.0);
}
if (LocaleNCompare(expression,"sinc",4) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,depth,
beta,exception);
if (alpha == 0)
- return(1.0);
+ FxResult(1.0);
gamma=sin((MagickPI*alpha))/(MagickPI*alpha);
- return(gamma);
+ FxResult(gamma);
}
if (LocaleNCompare(expression,"sinh",4) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,depth,
beta,exception);
- return(sinh(alpha));
+ FxResult(sinh(alpha));
}
if (LocaleNCompare(expression,"sin",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,depth,
beta,exception);
- return(sin(alpha));
+ FxResult(sin(alpha));
}
if (LocaleNCompare(expression,"sqrt",4) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,depth,
beta,exception);
- return(sqrt(alpha));
+ FxResult(sqrt(alpha));
}
if (LocaleNCompare(expression,"squish",6) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+6,depth,
beta,exception);
- return((1.0/(1.0+exp(-alpha))));
+ FxResult((1.0/(1.0+exp(-alpha))));
}
if (LocaleCompare(expression,"s") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'T':
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+4,depth,
beta,exception);
- return(tanh(alpha));
+ FxResult(tanh(alpha));
}
if (LocaleNCompare(expression,"tan",3) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+3,depth,
beta,exception);
- return(tan(alpha));
+ FxResult(tan(alpha));
}
if (LocaleCompare(expression,"Transparent") == 0)
- return(0.0);
+ FxResult(0.0);
if (LocaleNCompare(expression,"trunc",5) == 0)
{
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,depth,
beta,exception);
if (alpha >= 0.0)
- return(floor(alpha));
- return(ceil(alpha));
+ FxResult(floor(alpha));
+ FxResult(ceil(alpha));
}
if (LocaleCompare(expression,"t") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'U':
case 'u':
{
if (LocaleCompare(expression,"u") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'V':
case 'v':
{
if (LocaleCompare(expression,"v") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'W':
alpha=FxEvaluateSubexpression(fx_info,channel,x,y,expression+5,
depth,beta,exception);
} while (fabs(alpha) >= MagickEpsilon);
- return(*beta);
+ FxResult(*beta);
}
if (LocaleCompare(expression,"w") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'Y':
case 'y':
{
if (LocaleCompare(expression,"y") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
case 'Z':
case 'z':
{
if (LocaleCompare(expression,"z") == 0)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
break;
}
default:
q=(char *) expression;
alpha=InterpretSiPrefixValue(expression,&q);
if (q == expression)
- return(FxGetSymbol(fx_info,channel,x,y,expression,exception));
- return(alpha);
+ FxResult(FxGetSymbol(fx_info,channel,x,y,expression,exception));
+ FxResult(alpha);
}
MagickPrivate MagickBooleanType FxEvaluateExpression(FxInfo *fx_info,