for (i=0; i <= (ssize_t) MaxMap; i++)
{
x_map[i].x=0.99999999999914679361f*(float) i;
- y_map[i].x=(1.2188941887145875e-06f)*(float) i;
+ y_map[i].x=(-1.2188941887145875e-06f)*(float) i;
z_map[i].x=0.5f*1.4019995886561440468f*(2.00f*(float) i-MaxMap);
x_map[i].y=0.99999975910502514331f*(float) i;
y_map[i].y=0.5f*(-0.34413567816504303521f)*(2.00f*(float) i-MaxMap);
inverse[7]=determinant*(coeff[6]*coeff[1]-coeff[0]*coeff[7]);
}
-static inline double MagickRound(double x)
-{
- /*
- Round the fraction to nearest integer.
- */
- if (x >= 0.0)
- return((double) ((ssize_t) (x+0.5)));
- return((double) ((ssize_t) (x-0.5)));
-}
-
/*
* Polynomial Term Defining Functions
*
% outside other MagickCore library methods.
*/
+static inline double MagickRound(double x)
+{
+ /*
+ Round the fraction to nearest integer.
+ */
+ if ((x-floor(x)) < (ceil(x)-x)
+ return(floor(x));
+ return(ceil(x));
+}
+
static double *GenerateCoefficients(const Image *image,
DistortImageMethod *method,const size_t number_arguments,
const double *arguments,size_t number_values,ExceptionInfo *exception)
%
*/
-static inline ssize_t MagickRound(double x)
+static inline double MagickRound(double x)
{
/*
Round the fraction to nearest integer.
*/
- if (x >= 0.0)
- return((ssize_t) (x+0.5));
- return((ssize_t) (x-0.5));
+ if ((x-floor(x)) < (ceil(x)-x)
+ return(floor(x));
+ return(ceil(x));
}
MagickExport MagickBooleanType PosterizeImage(Image *image,const size_t levels,
%
*/
-static inline ssize_t MagickRound(double x)
+static inline double MagickRound(double x)
{
/*
Round the fraction to nearest integer.
*/
- if (x >= 0.0)
- return((ssize_t) (x+0.5));
- return((ssize_t) (x-0.5));
+ if ((x-floor(x)) < (ceil(x)-x)
+ return(floor(x));
+ return(ceil(x));
}
MagickExport Image *CropImageToTiles(const Image *image,