Commit d3a26056 authored by Daniel Sabo's avatar Daniel Sabo

Pass bpp instead of component count for boxfilter

parent 9c3a4988
......@@ -5,13 +5,14 @@ BOXFILTER_FUNCNAME (guchar *dest_buf,
const GeglRectangle *src_rect,
const gint s_rowstride,
const gdouble scale,
const gint components,
const gint bpp,
const gint d_rowstride)
{
gdouble left_weight, center_weight, right_weight;
gdouble top_weight, middle_weight, bottom_weight;
const BOXFILTER_TYPE *src[9];
gint x, y;
gint components = bpp / sizeof(BOXFILTER_TYPE);
for (y = 0; y < dst_rect->height; y++)
{
......
......@@ -92,7 +92,6 @@ void gegl_resample_boxfilter (guchar *dest_buf,
gint d_rowstride)
{
const Babl *comp_type = babl_format_get_type (format, 0);
guint num_componenets;
void (*resample_boxfilter_func) (guchar *dest_buf,
const guchar *source_buf,
......@@ -100,7 +99,7 @@ void gegl_resample_boxfilter (guchar *dest_buf,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint components,
gint bpp,
gint d_rowstride) = NULL;
if (comp_type == babl_type ("u8"))
......@@ -121,26 +120,16 @@ void gegl_resample_boxfilter (guchar *dest_buf,
}
else
{
gegl_resample_nearest (dest_buf,
source_buf,
dst_rect,
src_rect,
s_rowstride,
scale,
babl_format_get_bytes_per_pixel (format),
d_rowstride);
return;
resample_boxfilter_func = gegl_resample_nearest;
}
num_componenets = babl_format_get_n_components (format);
resample_boxfilter_func (dest_buf,
source_buf,
dst_rect,
src_rect,
s_rowstride,
scale,
num_componenets,
babl_format_get_bytes_per_pixel (format),
d_rowstride);
}
......
......@@ -90,7 +90,7 @@ void gegl_resample_boxfilter_float (guchar *dest_buf,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint components,
gint bpp,
gint d_rowstride);
void gegl_resample_boxfilter_u32 (guchar *dest_buf,
......@@ -99,7 +99,7 @@ void gegl_resample_boxfilter_u32 (guchar *dest_buf,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint components,
gint bpp,
gint d_rowstride);
void gegl_resample_boxfilter_u16 (guchar *dest_buf,
......@@ -108,7 +108,7 @@ void gegl_resample_boxfilter_u16 (guchar *dest_buf,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint components,
gint bpp,
gint d_rowstride);
void gegl_resample_boxfilter_u8 (guchar *dest_buf,
......@@ -117,7 +117,7 @@ void gegl_resample_boxfilter_u8 (guchar *dest_buf,
const GeglRectangle *src_rect,
gint s_rowstride,
gdouble scale,
gint components,
gint bpp,
gint d_rowstride);
void gegl_resample_nearest (guchar *dst,
......
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