[gegl] operations: minor fixes in remap.c
- From: Téo Mazars <teom src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] operations: minor fixes in remap.c
- Date: Thu, 7 Nov 2013 11:02:16 +0000 (UTC)
commit 4d1e8d1bb1e60b9899146c8c7f864782efc219db
Author: Téo Mazars <teo mazars ensimag fr>
Date: Thu Nov 7 12:00:11 2013 +0100
operations: minor fixes in remap.c
- Indentation
- Move the alpha assignment out of the innermost loop
operations/common/remap.c | 42 ++++++++++++++++++++++--------------------
1 files changed, 22 insertions(+), 20 deletions(-)
---
diff --git a/operations/common/remap.c b/operations/common/remap.c
index acfed14..fc091e8 100644
--- a/operations/common/remap.c
+++ b/operations/common/remap.c
@@ -42,16 +42,16 @@ static void prepare (GeglOperation *operation)
}
static gboolean
-process (GeglOperation *op,
- void *in_buf,
- void *min_buf,
- void *max_buf,
- void *out_buf,
- glong n_pixels,
- const GeglRectangle *roi,
- gint level)
+process (GeglOperation *op,
+ void *in_buf,
+ void *min_buf,
+ void *max_buf,
+ void *out_buf,
+ glong n_pixels,
+ const GeglRectangle *roi,
+ gint level)
{
- gint i;
+ gint i;
gfloat *in = in_buf;
gfloat *min = min_buf;
gfloat *max = max_buf;
@@ -59,17 +59,19 @@ process (GeglOperation *op,
for (i = 0; i < n_pixels; i++)
{
- gint c;
- for (c = 0; c < 3; c++)
- {
- gfloat delta = max[c]-min[c];
-
- if (delta > 0.0001 || delta < -0.0001)
- out[c] = (in[c]-min[c]) / delta;
- else
- out[c] = in[c];
- out[3] = in[3];
- }
+ gint c;
+ for (c = 0; c < 3; c++)
+ {
+ gfloat delta = max[c] - min[c];
+
+ if (delta > 0.0001 || delta < -0.0001)
+ out[c] = (in[c] - min[c]) / delta;
+ else
+ out[c] = in[c];
+ }
+
+ out[3] = in[3];
+
in += 4;
out += 4;
min += 4;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]