[gegl] buffer: use babl_fish_get_process in samplers
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] buffer: use babl_fish_get_process in samplers
- Date: Wed, 9 Feb 2022 20:54:46 +0000 (UTC)
commit ebeb0bcbf28f55143df3945c0cac61796f5c2400
Author: Øyvind Kolås <pippin gimp org>
Date: Wed Feb 9 21:54:38 2022 +0100
buffer: use babl_fish_get_process in samplers
gegl/buffer/gegl-sampler-cubic.c | 2 +-
gegl/buffer/gegl-sampler-linear.c | 2 +-
gegl/buffer/gegl-sampler-lohalo.c | 2 +-
gegl/buffer/gegl-sampler-nearest.c | 3 ++-
gegl/buffer/gegl-sampler-nohalo.c | 2 +-
gegl/buffer/gegl-sampler.c | 3 +++
gegl/buffer/gegl-sampler.h | 1 +
7 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/gegl/buffer/gegl-sampler-cubic.c b/gegl/buffer/gegl-sampler-cubic.c
index 2f0c1b31d..8bdce5483 100644
--- a/gegl/buffer/gegl-sampler-cubic.c
+++ b/gegl/buffer/gegl-sampler-cubic.c
@@ -227,7 +227,7 @@ gegl_sampler_cubic_get ( GeglSampler *self,
gegl_sampler_cubic_interpolate (self, absolute_x, absolute_y, result,
repeat_mode);
- babl_process (self->fish, result, output, 1);
+ self->fish_process (self->fish, (void*)result, (void*)output, 1, NULL);
}
}
diff --git a/gegl/buffer/gegl-sampler-linear.c b/gegl/buffer/gegl-sampler-linear.c
index 9222fbb7e..f8a6df8ab 100644
--- a/gegl/buffer/gegl-sampler-linear.c
+++ b/gegl/buffer/gegl-sampler-linear.c
@@ -194,6 +194,6 @@ gegl_sampler_linear_get ( GeglSampler *self,
gegl_sampler_linear_interpolate (self, absolute_x, absolute_y, result,
repeat_mode);
- babl_process (self->fish, result, output, 1);
+ self->fish_process (self->fish, (void*)result, (void*)output, 1, NULL);
}
}
diff --git a/gegl/buffer/gegl-sampler-lohalo.c b/gegl/buffer/gegl-sampler-lohalo.c
index 53d7434d7..0d0ebb41e 100644
--- a/gegl/buffer/gegl-sampler-lohalo.c
+++ b/gegl/buffer/gegl-sampler-lohalo.c
@@ -998,7 +998,7 @@ gegl_sampler_lohalo_get ( GeglSampler* restrict self,
/*
* Ship out the result:
*/
- babl_process (self->fish, newval, output, 1);
+ self->fish_process (self->fish, (void*)newval, (void*)output, 1, NULL);
return;
}
}
diff --git a/gegl/buffer/gegl-sampler-nearest.c b/gegl/buffer/gegl-sampler-nearest.c
index d11eaee44..770ac4a32 100644
--- a/gegl/buffer/gegl-sampler-nearest.c
+++ b/gegl/buffer/gegl-sampler-nearest.c
@@ -195,7 +195,7 @@ gegl_sampler_get_pixel (GeglSampler *sampler,
tp = gegl_tile_get_data (tile) +
(offsety * tile_width + offsetx) * nearest_sampler->buffer_bpp;
- babl_process (sampler->fish, tp, buf, 1);
+ sampler->fish_process (sampler->fish, (void*)tp, (void*)buf, 1, NULL);
}
}
@@ -224,4 +224,5 @@ gegl_sampler_nearest_prepare (GeglSampler* restrict sampler)
GEGL_SAMPLER_NEAREST (sampler)->buffer_bpp = babl_format_get_bytes_per_pixel (sampler->buffer->format);
sampler->fish = babl_fish (sampler->buffer->soft_format, sampler->format);
+ sampler->fish_process = babl_fish_get_process (sampler->fish);
}
diff --git a/gegl/buffer/gegl-sampler-nohalo.c b/gegl/buffer/gegl-sampler-nohalo.c
index c3f430890..7e0262944 100644
--- a/gegl/buffer/gegl-sampler-nohalo.c
+++ b/gegl/buffer/gegl-sampler-nohalo.c
@@ -1920,7 +1920,7 @@ gegl_sampler_nohalo_get ( GeglSampler* restrict self,
/*
* Ship out the result:
*/
- babl_process (self->fish, newval, output, 1);
+ self->fish_process (self->fish, (void*)newval, (void*)output, 1, NULL);
return;
}
}
diff --git a/gegl/buffer/gegl-sampler.c b/gegl/buffer/gegl-sampler.c
index efdab84ef..6489f7b21 100644
--- a/gegl/buffer/gegl-sampler.c
+++ b/gegl/buffer/gegl-sampler.c
@@ -265,7 +265,10 @@ gegl_sampler_prepare (GeglSampler *self)
}
if (!self->fish)
+ {
self->fish = babl_fish (self->interpolate_format, self->format);
+ self->fish_process = babl_fish_get_process (self->fish);
+ }
/*
* This makes the cache rect invalid, in case the data in the buffer
diff --git a/gegl/buffer/gegl-sampler.h b/gegl/buffer/gegl-sampler.h
index d562df9a6..39cd7a93f 100644
--- a/gegl/buffer/gegl-sampler.h
+++ b/gegl/buffer/gegl-sampler.h
@@ -90,6 +90,7 @@ struct _GeglSampler
gint interpolate_components;
GeglSamplerLevel level[GEGL_SAMPLER_MIPMAP_LEVELS];
+ BablFishProcess fish_process;
};
struct _GeglSamplerClass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]