{ "Bohman", BohmanFilter, UndefinedOptionFlag, MagickFalse },
{ "Box", BoxFilter, UndefinedOptionFlag, MagickFalse },
{ "Catrom", CatromFilter, UndefinedOptionFlag, MagickFalse },
+ { "Cosine", CosineFilter, UndefinedOptionFlag, MagickFalse },
{ "Cubic", CubicFilter, UndefinedOptionFlag, MagickFalse },
{ "Gaussian", GaussianFilter, UndefinedOptionFlag, MagickFalse },
{ "Hamming", HammingFilter, UndefinedOptionFlag, MagickFalse },
%
*/
-#define MagickPIL ((MagickRealType) 3.14159265358979323846264338327950288420L)
-
static MagickRealType Blackman(const MagickRealType x,
const ResizeFilter *magick_unused(resize_filter))
{
Refactored by Chantal Racette and Nicolas Robidoux to one trig call and
five flops.
*/
- const MagickRealType cosine=cos((double) (MagickPIL*x));
+ const MagickRealType cosine=cos((double) (MagickPI*x));
return(0.34+cosine*(0.5+cosine*0.16));
}
taking advantage of the fact that the support of Bohman is 1.0 (so that we
know that sin(pi x) >= 0).
*/
- const MagickRealType cosine=cos((double) (MagickPIL*x));
+ const MagickRealType cosine=cos((double) (MagickPI*x));
const MagickRealType sine=sqrt(1.0-cosine*cosine);
- return((1.0-x)*cosine+(1.0/MagickPIL)*sine);
+ return((1.0-x)*cosine+(1.0/MagickPI)*sine);
}
static MagickRealType Box(const MagickRealType magick_unused(x),
return(1.0);
}
+static MagickRealType Cosine(const MagickRealType x,
+ const ResizeFilter *magick_unused(resize_filter))
+{
+ /*
+ Cosine window function:
+ cos((pi/2)*x).
+ */
+ return((MagickRealType)cos((double) (MagickPI2*x)));
+}
+
static MagickRealType CubicBC(const MagickRealType x,
const ResizeFilter *resize_filter)
{
Cosine window function:
0.5+0.5*cos(pi*x).
*/
- const MagickRealType cosine=cos((double) (MagickPIL*x));
+ const MagickRealType cosine=cos((double) (MagickPI*x));
return(0.5+0.5*cosine);
}
Offset cosine window function:
.54 + .46 cos(pi x).
*/
- const MagickRealType cosine=cos((double) (MagickPIL*x));
+ const MagickRealType cosine=cos((double) (MagickPI*x));
return(0.54+0.46*cosine);
}
really it is more accurately named "Jinc".
*/
if (x == 0.0)
- return(0.5*MagickPIL);
- return(BesselOrderOne(MagickPIL*x)/x);
+ return(0.5*MagickPI);
+ return(BesselOrderOne(MagickPI*x)/x);
}
static MagickRealType Kaiser(const MagickRealType x,
*/
if (x != 0.0)
{
- const MagickRealType alpha=(MagickRealType) (MagickPIL*x);
+ const MagickRealType alpha=(MagickRealType) (MagickPI*x);
return(sin((double) alpha)/alpha);
}
return((MagickRealType) 1.0);
*/
if (x > 4.0)
{
- const MagickRealType alpha=(MagickRealType) (MagickPIL*x);
+ const MagickRealType alpha=(MagickRealType) (MagickPI*x);
return(sin((double) alpha)/alpha);
}
{
{ Lanczos2SharpFilter, Lanczos2SharpFilter },
{ RobidouxFilter, BoxFilter }, /* Cubic Keys tuned for EWA */
{ RobidouxSharpFilter, BoxFilter }, /* Sharper Cubic Keys for EWA */
+ { SincFastFilter, CosineFilter }, /* low level cosine window */
};
/*
Table mapping the filter/window from the above table to an actual function.
0.37821575509399867, 0.31089212245300067 },
/* RobidouxSharp: Sharper version of Robidoux */
{ CubicBC, 2.0, 1.105822933719019,
- 0.2620145123990142, 0.3689927438004929 }
+ 0.2620145123990142, 0.3689927438004929 },
+ { Cosine, 1.0, 1.0, 0.0, 0.0 } /* Low level cosine window */
};
/*
The known zero crossings of the Jinc() or more accurately the Jinc(x*PI)