[babl] new symbol babl_fish_get_process



commit e71b7e9054edb527f78ea2d91328b3b53e9e7eb6
Author: Øyvind Kolås <pippin gimp org>
Date:   Wed Jan 26 04:38:53 2022 +0100

    new symbol babl_fish_get_process
    
    This permits some APIs to avoid a function call per dispatch,
    specifically the samplers in GeglBuffer.

 babl/babl-fish.c |  6 ++++++
 babl/babl.h      | 11 +++++++++++
 export-symbols   |  1 +
 3 files changed, 18 insertions(+)
---
diff --git a/babl/babl-fish.c b/babl/babl-fish.c
index ce22b6be0..aece33b8c 100644
--- a/babl/babl-fish.c
+++ b/babl/babl-fish.c
@@ -359,4 +359,10 @@ babl_fish (const void *source,
   }
 }
 
+
+BablFishProcess babl_fish_get_process (const Babl *babl)
+{
+  return babl->fish.dispatch;
+}
+
 BABL_CLASS_MINIMAL_IMPLEMENT (fish);
diff --git a/babl/babl.h b/babl/babl.h
index 4032faaef..04bc00a0c 100644
--- a/babl/babl.h
+++ b/babl/babl.h
@@ -713,6 +713,17 @@ const char * babl_format_get_encoding (const Babl *babl);
 int babl_space_is_cmyk (const Babl *space);
 int babl_space_is_gray (const Babl *space);
 
+typedef void (*BablFishProcess) (const Babl *babl, const char *src, char *dst, long n, void *data);
+/**
+ * babl_fish_get_dispatch: (skip)
+ *
+ * get the dispatch function of a fish, this allows faster use of a fish
+ * in a loop than the more indirect method of babl_process, this also avoids
+ * base-level instrumentation.
+ */
+BablFishProcess babl_fish_get_process (const Babl *babl);
+
+
 /* values below this are stored associated with this value, it should also be
  * used as a generic alpha zero epsilon in GEGL to keep the threshold effects
  * on one known value.
diff --git a/export-symbols b/export-symbols
index 420ef87b2..07b4e95d7 100644
--- a/export-symbols
+++ b/export-symbols
@@ -78,6 +78,7 @@ babl_conversion_class_for_each
 babl_set_extender
 babl_extension_quiet_log
 babl_fish_path
+babl_fish_get_process
 babl_extender
 babl_class_name
 babl_sanity


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]