1 /* babl - dynamically extendable universal pixel conversion library.
2 * Copyright (C) 2005, Øyvind Kolås.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 3 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General
15 * Public License along with this library; if not, see
16 * <https://www.gnu.org/licenses/>.
17 */
18
19 #include "config.h"
20 #include "babl-internal.h"
21
22 static const struct
23 {
24 const char *from_format;
25 const char *to_format;
26 }
27 fishes[] =
28 {
29 { "Y' u8", "RaGaBaA float" },
30 { "Y u8", "RaGaBaA float" },
31 { "R'G'B'A u8", "RaGaBaA float" },
32 { "R'G'B'A float", "R'G'B'A u8" },
33 { "R'G'B'A float", "R'G'B' u8" },
34 { "R'G'B'A u8", "RGBA float" },
35 { "RGBA float", "R'G'B'A u8" },
36 { "RGBA float", "R'G'B'A u8" },
37 { "RGBA float", "R'G'B'A float" },
38 { "Y' u8", "R'G'B' u8" },
39 { "Y u8", "Y float" },
40 { "R'G'B' u8", "cairo-RGB24" },
41 { "R'G'B' u8", "R'G'B'A float" },
42 { "R'G'B' u8", "R'G'B'A u8" },
43 { "R'G'B'A u8", "R'G'B'A float" },
44 { "R'G'B'A u8", "cairo-ARGB32" },
45 { "R'G'B'A double", "RGBA float" },
46 { "R'G'B'A float", "RGBA double" },
47 { "R'G'B' u8", "RGB float" },
48 { "RGB float", "R'G'B'A float" },
49 { "R'G'B' u8", "RGBA float" },
50 { "RaGaBaA float", "R'G'B'A float" },
51 { "RaGaBaA float", "RGBA float" },
52 { "RGBA float", "RaGaBaA float" },
53 { "R'G'B' u8", "RaGaBaA float" },
54 { "cairo-ARGB32", "R'G'B'A u8" }
55 };
56
57 int
main(int argc,char ** argv)58 main (int argc,
59 char **argv)
60 {
61 putenv ("BABL_DEBUG_CONVERSIONS" "=" "1");
62 putenv ("BABL_DEBUG_MISSING" "=" "1");
63 babl_init ();
64
65 for (int i = 0; i < sizeof (fishes)/sizeof(fishes[0]);i ++)
66 {
67 babl_fish (babl_format (fishes[i].from_format),
68 babl_format (fishes[i].to_format));
69 }
70
71 babl_exit ();
72 return 0;
73 }
74