Fawkes API  Fawkes Development Version
qa_yuvconv.cpp
1 
2 /***************************************************************************
3  * qa_yuvconv.h - QA for YUV conversion
4  *
5  * Created: Wed Jun 27 13:49:25 2007
6  * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 /// @cond QA
25 
26 #include <fvutils/color/colorspaces.h>
27 #include <fvutils/color/yuv.h>
28 
29 #include <fvutils/ipc/shm_image.h>
30 
31 #include <iostream>
32 
33 using namespace std;
34 using namespace firevision;
35 
36 #define WIDTH 748
37 #define HEIGHT 572
38 
39 int
40 main(int argc, char **argv)
41 {
42  unsigned char *yuv422_packed = malloc_buffer(YUV422_PACKED, WIDTH, HEIGHT);
43 
44  // unsigned char *yuv422_planar = malloc_buffer(YUV422_PLANAR, WIDTH, HEIGHT);
45  SharedMemoryImageBuffer *shm = new SharedMemoryImageBuffer("fv_qa_yuvconv", YUV422_PLANAR, WIDTH, HEIGHT);
46  unsigned char *yuv422_planar = shm->buffer();
47 
48 
49  yuv422packed_to_yuv422planar(yuv422_packed, yuv422_planar, WIDTH, HEIGHT);
50 
51  delete shm;
52 
53  return 0;
54 }
55 
56 
57 
58 /// @endcond
STL namespace.
unsigned char * buffer() const
Get image buffer.
Definition: shm_image.cpp:235
Shared memory image buffer.
Definition: shm_image.h:181