gegl: include math.h in headers used by ops

It needs to be included before gegl-math.h on some platforms, since many
operations do use such functions for -lm including it is boilerplate
reduction.
parent 216d5ad4
Pipeline #183202 passed with stages
in 27 minutes and 25 seconds
......@@ -24,6 +24,7 @@
#include "config.h"
#endif
#include <math.h>
#include <string.h>
#include <glib-object.h>
#include <gmodule.h>
......
......@@ -77,7 +77,7 @@ process (GeglOperation *operation,
alpha_c = 1.0f - color[3];
if (fabs (alpha_c) <= EPSILON)
if (fabsf (alpha_c) <= EPSILON)
{
while (samples--)
{
......
......@@ -1095,7 +1095,7 @@ gegl_expcombine_process (GeglOperation *operation,
*/
if (e->pixels[PIXELS_FULL][i] <= 0.0f)
{
under += fabs (e->pixels[PIXELS_FULL][i]);
under += fabsf (e->pixels[PIXELS_FULL][i]);
e->pixels[PIXELS_FULL][i] = 0.0f;
}
else if (e->pixels[PIXELS_FULL][i] > 1.0f)
......
......@@ -211,8 +211,8 @@ static void prepare_transform (Transform *transform,
xoffset = ((orig_width - height)/height) / 2 + 0.5f;
}
transform->do_spin = fabs (spin) > 0.000001 ? 1 : 0;
transform->do_zoom = fabs (zoom-1.0) > 0.000001 ? 1 : 0;
transform->do_spin = fabsf (spin) > 0.000001 ? 1 : 0;
transform->do_zoom = fabsf (zoom-1.0f) > 0.000001 ? 1 : 0;
transform->pan = pan;
transform->tilt = tilt;
......
......@@ -376,7 +376,7 @@ init_geometry (Context *ctx)
{
ctx->shadow_proj = cos (ctx->options.angle) * ctx->options.length;
ctx->shadow_height = ceil (ctx->shadow_proj);
ctx->shadow_height = ceilf (ctx->shadow_proj);
ctx->shadow_remainder = 1.0 - (ctx->shadow_height - ctx->shadow_proj);
}
}
......
......@@ -66,7 +66,7 @@ process (GeglOperation *op,
gfloat green = o->green;
gfloat blue = o->blue;
gboolean normalize = o->preserve_luminosity;
gfloat norm_factor = 1.0;
gfloat norm_factor = 1.0f;
gfloat * GEGL_ALIGNED in_pixel;
gfloat * GEGL_ALIGNED out_pixel;
glong i;
......@@ -78,10 +78,10 @@ process (GeglOperation *op,
{
gdouble sum = red + green + blue;
if (sum == 0.0)
norm_factor = 1.0;
if (sum == 0.0f)
norm_factor = 1.0f;
else
norm_factor = fabs (1 / sum);
norm_factor = fabsf (1.0 / sum);
}
for (i=0; i<n_pixels; i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment