[gegl] buffer: make babl_fish_get_process optional
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] buffer: make babl_fish_get_process optional
- Date: Mon, 25 Apr 2022 22:04:48 +0000 (UTC)
commit e1a365be36c8fb9fe74382a417ef1c6f2521093e
Author: Øyvind Kolås <pippin gimp org>
Date: Tue Apr 26 00:00:45 2022 +0200
buffer: make babl_fish_get_process optional
This to easier permit building GIMP-2.10 on some older distros.
gegl/buffer/gegl-sampler-cubic.c | 7 ++++++-
gegl/buffer/gegl-sampler-linear.c | 7 ++++++-
gegl/buffer/gegl-sampler-lohalo.c | 7 ++++++-
gegl/buffer/gegl-sampler-nearest.c | 9 ++++++++-
gegl/buffer/gegl-sampler-nohalo.c | 7 ++++++-
gegl/buffer/gegl-sampler.c | 2 ++
gegl/buffer/gegl-sampler.h | 2 ++
7 files changed, 36 insertions(+), 5 deletions(-)
---
diff --git a/gegl/buffer/gegl-sampler-cubic.c b/gegl/buffer/gegl-sampler-cubic.c
index 8bdce5483..d1847865b 100644
--- a/gegl/buffer/gegl-sampler-cubic.c
+++ b/gegl/buffer/gegl-sampler-cubic.c
@@ -227,7 +227,12 @@ gegl_sampler_cubic_get ( GeglSampler *self,
gegl_sampler_cubic_interpolate (self, absolute_x, absolute_y, result,
repeat_mode);
- self->fish_process (self->fish, (void*)result, (void*)output, 1, NULL);
+#if (BABL_MINOR_VERSION >=1) && (BABL_MICRO_VERSION >= 90)
+ self->fish_process
+#else
+ babl_process
+#endif
+ (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 f8a6df8ab..e17d308d9 100644
--- a/gegl/buffer/gegl-sampler-linear.c
+++ b/gegl/buffer/gegl-sampler-linear.c
@@ -194,6 +194,11 @@ gegl_sampler_linear_get ( GeglSampler *self,
gegl_sampler_linear_interpolate (self, absolute_x, absolute_y, result,
repeat_mode);
- self->fish_process (self->fish, (void*)result, (void*)output, 1, NULL);
+#if (BABL_MINOR_VERSION >=1) && (BABL_MICRO_VERSION >= 90)
+ self->fish_process
+#else
+ babl_process
+#endif
+ (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 0d0ebb41e..7fa944dd0 100644
--- a/gegl/buffer/gegl-sampler-lohalo.c
+++ b/gegl/buffer/gegl-sampler-lohalo.c
@@ -998,7 +998,12 @@ gegl_sampler_lohalo_get ( GeglSampler* restrict self,
/*
* Ship out the result:
*/
- self->fish_process (self->fish, (void*)newval, (void*)output, 1, NULL);
+#if (BABL_MINOR_VERSION >=1) && (BABL_MICRO_VERSION >= 90)
+ self->fish_process
+#else
+ babl_process
+#endif
+ (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 770ac4a32..552efc33a 100644
--- a/gegl/buffer/gegl-sampler-nearest.c
+++ b/gegl/buffer/gegl-sampler-nearest.c
@@ -195,7 +195,12 @@ gegl_sampler_get_pixel (GeglSampler *sampler,
tp = gegl_tile_get_data (tile) +
(offsety * tile_width + offsetx) * nearest_sampler->buffer_bpp;
- sampler->fish_process (sampler->fish, (void*)tp, (void*)buf, 1, NULL);
+#if (BABL_MINOR_VERSION >=1) && (BABL_MICRO_VERSION >= 90)
+ sampler->fish_process
+#else
+ babl_proces
+#endif
+ (sampler->fish, (void*)tp, (void*)buf, 1, NULL);
}
}
@@ -224,5 +229,7 @@ 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);
+#if (BABL_MINOR_VERSION >=1) && (BABL_MICRO_VERSION >= 90)
sampler->fish_process = babl_fish_get_process (sampler->fish);
+#endif
}
diff --git a/gegl/buffer/gegl-sampler-nohalo.c b/gegl/buffer/gegl-sampler-nohalo.c
index 7e0262944..f21ff2a79 100644
--- a/gegl/buffer/gegl-sampler-nohalo.c
+++ b/gegl/buffer/gegl-sampler-nohalo.c
@@ -1920,7 +1920,12 @@ gegl_sampler_nohalo_get ( GeglSampler* restrict self,
/*
* Ship out the result:
*/
- self->fish_process (self->fish, (void*)newval, (void*)output, 1, NULL);
+#if (BABL_MINOR_VERSION >=1) && (BABL_MICRO_VERSION >= 90)
+ self->fish_process
+#else
+ babl_process
+#endif
+ (self->fish, (void*)newval, (void*)output, 1, NULL);
return;
}
}
diff --git a/gegl/buffer/gegl-sampler.c b/gegl/buffer/gegl-sampler.c
index 6489f7b21..df7ca8260 100644
--- a/gegl/buffer/gegl-sampler.c
+++ b/gegl/buffer/gegl-sampler.c
@@ -267,7 +267,9 @@ gegl_sampler_prepare (GeglSampler *self)
if (!self->fish)
{
self->fish = babl_fish (self->interpolate_format, self->format);
+#if (BABL_MINOR_VERSION >=1) && (BABL_MICRO_VERSION >= 90)
self->fish_process = babl_fish_get_process (self->fish);
+#endif
}
/*
diff --git a/gegl/buffer/gegl-sampler.h b/gegl/buffer/gegl-sampler.h
index 39cd7a93f..e070a0869 100644
--- a/gegl/buffer/gegl-sampler.h
+++ b/gegl/buffer/gegl-sampler.h
@@ -90,7 +90,9 @@ struct _GeglSampler
gint interpolate_components;
GeglSamplerLevel level[GEGL_SAMPLER_MIPMAP_LEVELS];
+#if (BABL_MINOR_VERSION >=1) && (BABL_MICRO_VERSION >= 90)
BablFishProcess fish_process;
+#endif
};
struct _GeglSamplerClass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]