From: Øyvind Kolås Date: Thu, 14 May 2020 15:55:05 +0000 (+0200) Subject: tests: add test that creates the base fishes expected by GIMP X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2~9^2~7 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1a4b549b2bebbc1da20c640075898afe1d40a67d;p=babl.git tests: add test that creates the base fishes expected by GIMP --- diff --git a/tests/conversions.c b/tests/conversions.c new file mode 100644 index 0000000..3074c4f --- /dev/null +++ b/tests/conversions.c @@ -0,0 +1,72 @@ +/* babl - dynamically extendable universal pixel conversion library. + * Copyright (C) 2005, Øyvind KolÃ¥s. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, see + * . + */ + +#include "config.h" +#include "babl-internal.h" + + static const struct + { + const char *from_format; + const char *to_format; + } + fishes[] = + { + { "Y' u8", "RaGaBaA float" }, + { "Y u8", "RaGaBaA float" }, + { "R'G'B'A u8", "RaGaBaA float" }, + { "R'G'B'A float", "R'G'B'A u8" }, + { "R'G'B'A float", "R'G'B' u8" }, + { "R'G'B'A u8", "RGBA float" }, + { "RGBA float", "R'G'B'A u8" }, + { "RGBA float", "R'G'B'A u8" }, + { "RGBA float", "R'G'B'A float" }, + { "Y' u8", "R'G'B' u8" }, + { "Y u8", "Y float" }, + { "R'G'B' u8", "cairo-RGB24" }, + { "R'G'B' u8", "R'G'B'A float" }, + { "R'G'B' u8", "R'G'B'A u8" }, + { "R'G'B'A u8", "R'G'B'A float" }, + { "R'G'B'A u8", "cairo-ARGB32" }, + { "R'G'B'A double", "RGBA float" }, + { "R'G'B'A float", "RGBA double" }, + { "R'G'B' u8", "RGB float" }, + { "RGB float", "R'G'B'A float" }, + { "R'G'B' u8", "RGBA float" }, + { "RaGaBaA float", "R'G'B'A float" }, + { "RaGaBaA float", "RGBA float" }, + { "RGBA float", "RaGaBaA float" }, + { "R'G'B' u8", "RaGaBaA float" }, + { "cairo-ARGB32", "R'G'B'A u8" } + }; + +int +main (int argc, + char **argv) +{ + setenv ("BABL_DEBUG_MISSING", "1", 1); + babl_init (); + + for (int i = 0; i < sizeof (fishes)/sizeof(fishes[0]);i ++) + { + babl_fish (babl_format (fishes[i].from_format), + babl_format (fishes[i].to_format)); + } + + babl_exit (); + return 0; +} diff --git a/tests/meson.build b/tests/meson.build index a656618..4431ed8 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -5,6 +5,7 @@ test_names = [ 'cairo-RGB24', 'cmyk', 'chromaticities', + 'conversions', 'extract', 'floatclamp', 'float-to-8bit',