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 <stdlib.h>
21 #include <stdio.h>
22 #include <assert.h>
23 #include "babl.h"
24 #include "common.inc"
25 
26 int
main(int argc,char ** argv)27 main (int    argc,
28       char **argv)
29 {
30   int OK = 1;
31   babl_init ();
32   {
33     unsigned char in[][4]   = {{0,1,2,3  },{4,5,6,7    },{8,9,10,11  }};
34     unsigned char out[][1]  = {    {2    },    {6}      ,    {10}     };
35 
36     CHECK_CONV("extract B'", unsigned char,
37         babl_format("R'G'B'A u8"),
38         babl_format_new ("name", "B' u8",
39                           babl_model ("R'G'B'A"),
40                           babl_type ("u8"),
41                           babl_component ("B'"),
42                           NULL),
43         in, out);
44   }
45 
46   babl_exit ();
47   return !OK;
48 }
49