[gegl] workshop/gradient-map: enclose local variables in block
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] workshop/gradient-map: enclose local variables in block
- Date: Fri, 25 Mar 2016 02:07:47 +0000 (UTC)
commit 6534ab4a5ca1bf6354000f3ccca0b0cf59df7945
Author: Øyvind Kolås <pippin gimp org>
Date: Fri Mar 25 01:37:20 2016 +0100
workshop/gradient-map: enclose local variables in block
operations/workshop/gradient-map.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/operations/workshop/gradient-map.c b/operations/workshop/gradient-map.c
index 0f7ffc2..cf5415c 100644
--- a/operations/workshop/gradient-map.c
+++ b/operations/workshop/gradient-map.c
@@ -115,10 +115,12 @@ create_linear_gradient(GeglColor **colors, gdouble *stops, const gint no_stops,
rgba_from_gegl_color(&from, colors[from_stop], format);
rgba_from_gegl_color(&to, colors[to_stop], format);
}
+ {
const float from_pos = (from_stop < 0) ? 0.0 : stops[from_stop];
const float weight = ((to_stop-from_stop) == 0) ? 1.0 : mapf(pos, from_pos, to_pos, 0.0, 1.0);
const size_t offset = px*channels;
pixel_interpolate_gradient(samples, offset, &from, &to, weight);
+ }
}
return samples;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]