"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "operations/common-gpl3+/displace.c" between
gegl-0.4.18.tar.xz and gegl-0.4.20.tar.xz

About: GEGL (Generic Graphics Library) is a graph based image processing framework (mainly developed for GIMP).

displace.c  (gegl-0.4.18.tar.xz):displace.c  (gegl-0.4.20.tar.xz)
skipping to change at line 111 skipping to change at line 111
#include <math.h> #include <math.h>
static gdouble static gdouble
get_base_displacement (gdouble amount, get_base_displacement (gdouble amount,
gfloat *map_pixel) gfloat *map_pixel)
{ {
return 2.0 * amount * (map_pixel[0] - 0.5) * map_pixel[1]; return 2.0 * amount * (map_pixel[0] - 0.5) * map_pixel[1];
} }
static inline void static inline void
get_input_cartesian_coordinates (gint x, get_input_cartesian_coordinates (gdouble x,
gint y, gdouble y,
gdouble x_amount, gdouble x_amount,
gdouble y_amount, gdouble y_amount,
gfloat *xmap_pixel, gfloat *xmap_pixel,
gfloat *ymap_pixel, gfloat *ymap_pixel,
gdouble *x_input, gdouble *x_input,
gdouble *y_input) gdouble *y_input)
{ {
*x_input = x; *x_input = x;
*y_input = y; *y_input = y;
skipping to change at line 135 skipping to change at line 135
*x_input += get_base_displacement (x_amount, xmap_pixel); *x_input += get_base_displacement (x_amount, xmap_pixel);
} }
if (ymap_pixel && y_amount) if (ymap_pixel && y_amount)
{ {
*y_input += get_base_displacement (y_amount, ymap_pixel); *y_input += get_base_displacement (y_amount, ymap_pixel);
} }
} }
static inline void static inline void
get_input_polar_coordinates (gint x, get_input_polar_coordinates (gdouble x,
gint y, gdouble y,
gdouble x_amount, gdouble x_amount,
gdouble y_amount, gdouble y_amount,
gfloat *xmap_pixel, gfloat *xmap_pixel,
gfloat *ymap_pixel, gfloat *ymap_pixel,
gdouble cx, gdouble cx,
gdouble cy, gdouble cy,
gdouble *x_input, gdouble *x_input,
gdouble *y_input) gdouble *y_input)
{ {
gdouble radius, d_alpha; gdouble radius, d_alpha;
skipping to change at line 388 skipping to change at line 388
gfloat *aux2_pixel = aux2 ? iter->items[aux2_index].data : NULL; gfloat *aux2_pixel = aux2 ? iter->items[aux2_index].data : NULL;
gint b; gint b;
for (y = iter->items[0].roi.y; y < iter->items[0].roi.y + iter->items[0].r oi.height; y++) for (y = iter->items[0].roi.y; y < iter->items[0].roi.y + iter->items[0].r oi.height; y++)
for (x = iter->items[0].roi.x; x < iter->items[0].roi.x + iter->items[0] .roi.width; x++) for (x = iter->items[0].roi.x; x < iter->items[0].roi.x + iter->items[0] .roi.width; x++)
{ {
gdouble src_x, src_y; gdouble src_x, src_y;
if (o->displace_mode == GEGL_DISPLACE_MODE_POLAR) if (o->displace_mode == GEGL_DISPLACE_MODE_POLAR)
{ {
get_input_polar_coordinates (x, y, o->amount_x, o->amount_y, get_input_polar_coordinates (x + 0.5, y + 0.5,
o->amount_x, o->amount_y,
aux_pixel, aux2_pixel, cx, cy, aux_pixel, aux2_pixel, cx, cy,
&src_x, &src_y); &src_x, &src_y);
} }
else else
{ {
get_input_cartesian_coordinates (x, y, o->amount_x, o->amount_y, get_input_cartesian_coordinates (x + 0.5, y + 0.5,
o->amount_x, o->amount_y,
aux_pixel, aux2_pixel, aux_pixel, aux2_pixel,
&src_x, &src_y); &src_x, &src_y);
} }
gegl_sampler_get (in_sampler, src_x, src_y, NULL, gegl_sampler_get (in_sampler, src_x, src_y, NULL,
in_pixel, o->abyss_policy); in_pixel, o->abyss_policy);
for (b = 0; b < n_components; b++) for (b = 0; b < n_components; b++)
out_pixel[b] = in_pixel[b]; out_pixel[b] = in_pixel[b];
 End of changes. 4 change blocks. 
6 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)