[gegl] gegl-algorithms: deal with float earlier in if/else chains
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] gegl-algorithms: deal with float earlier in if/else chains
- Date: Fri, 23 Dec 2016 17:11:24 +0000 (UTC)
commit f88ec3751bb6469869d6cd8b4afbe4622627155a
Author: Øyvind Kolås <pippin gimp org>
Date: Fri Dec 23 18:00:42 2016 +0100
gegl-algorithms: deal with float earlier in if/else chains
gegl/gegl-algorithms.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gegl/gegl-algorithms.c b/gegl/gegl-algorithms.c
index cbd11d5..89740f5 100644
--- a/gegl/gegl-algorithms.c
+++ b/gegl/gegl-algorithms.c
@@ -102,7 +102,10 @@ void gegl_resample_boxfilter (guchar *dest_buf,
const Babl *comp_type = babl_format_get_type (format, 0);
const gint bpp = babl_format_get_bytes_per_pixel (format);
- if (comp_type == babl_type_u8())
+ if (comp_type == babl_type_float())
+ gegl_resample_boxfilter_float (dest_buf, source_buf, dst_rect, src_rect,
+ s_rowstride, scale, bpp, d_rowstride);
+ else if (comp_type == babl_type_u8())
gegl_resample_boxfilter_u8 (dest_buf, source_buf, dst_rect, src_rect,
s_rowstride, scale, bpp, d_rowstride);
else if (comp_type == babl_type_u16())
@@ -111,9 +114,6 @@ void gegl_resample_boxfilter (guchar *dest_buf,
else if (comp_type == babl_type_u32())
gegl_resample_boxfilter_u32 (dest_buf, source_buf, dst_rect, src_rect,
s_rowstride, scale, bpp, d_rowstride);
- else if (comp_type == babl_type_float())
- gegl_resample_boxfilter_float (dest_buf, source_buf, dst_rect, src_rect,
- s_rowstride, scale, bpp, d_rowstride);
else if (comp_type == babl_type_double())
gegl_resample_boxfilter_double (dest_buf, source_buf, dst_rect, src_rect,
s_rowstride, scale, bpp, d_rowstride);
@@ -134,7 +134,10 @@ void gegl_resample_bilinear (guchar *dest_buf,
const Babl *comp_type = babl_format_get_type (format, 0);
const gint bpp = babl_format_get_bytes_per_pixel (format);
- if (comp_type == babl_type_u8 ())
+ if (comp_type == babl_type_float ())
+ gegl_resample_bilinear_float (dest_buf, source_buf, dst_rect, src_rect,
+ s_rowstride, scale, bpp, d_rowstride);
+ else if (comp_type == babl_type_u8 ())
gegl_resample_bilinear_u8 (dest_buf, source_buf, dst_rect, src_rect,
s_rowstride, scale, bpp, d_rowstride);
else if (comp_type == babl_type_u16 ())
@@ -143,9 +146,6 @@ void gegl_resample_bilinear (guchar *dest_buf,
else if (comp_type == babl_type_u32 ())
gegl_resample_bilinear_u32 (dest_buf, source_buf, dst_rect, src_rect,
s_rowstride, scale, bpp, d_rowstride);
- else if (comp_type == babl_type_float ())
- gegl_resample_bilinear_float (dest_buf, source_buf, dst_rect, src_rect,
- s_rowstride, scale, bpp, d_rowstride);
else if (comp_type == babl_type_double ())
gegl_resample_bilinear_double (dest_buf, source_buf, dst_rect, src_rect,
s_rowstride, scale, bpp, d_rowstride);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]