LUT: do not use LUTs by default
authorØyvind Kolås <pippin@gimp.org>
Sat, 25 Feb 2023 18:46:35 +0000 (19:46 +0100)
committerØyvind Kolås <pippin@gimp.org>
Sat, 25 Feb 2023 18:46:37 +0000 (19:46 +0100)
The code marking LUTs as available for fishes is now protected behind an
environment variable BABL_LUT if it is set, the LUT code is re-enabled.

babl/babl-fish-path.c
babl/babl.c

index 2cfb507e2e15b2fad14c37bea82aceb3f07b95a5..90135c3c28ca0370935ab72c024ed1a8db356ffb 100644 (file)
@@ -32,6 +32,8 @@
 #define MIN(a, b) (((a) > (b)) ? (b) : (a))
 #endif
 
+static int enable_lut = 0;
+
 typedef struct GcContext {
    long time;
 } GcContext;
@@ -605,6 +607,12 @@ _babl_legal_error (void)
   else
     debug_conversions = 0;
 
+  env = getenv ("BABL_LUT");
+  if (env && env[0] != '\0')
+    enable_lut = 1;
+  else
+    enable_lut = 0;
+
   return error;
 }
 
@@ -952,6 +960,7 @@ _babl_fish_prepare_bpp (Babl *babl)
          babl_log ("-eeek{%i}\n", babl_dest->instance.class_type - BABL_MAGIC);
      }
 
+  if (enable_lut)
   {
   int         source_bpp  = babl->fish_path.source_bpp;
   int         dest_bpp    = babl->fish_path.dest_bpp;
index 8a6f29ad663b11f558cb014c001727abde956ec4..23db1a3bd027ef409efd071b57bd3225d627b041 100644 (file)
@@ -113,6 +113,7 @@ babl_init (void)
       babl_type_db ();
       babl_trc_class_init ();
       babl_space_class_init ();
+      _babl_legal_error ();
       babl_component_db ();
       babl_model_db ();
       babl_format_db ();