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#include <fvutils/ipc/shm_image.h>
29
30#include <iostream>
31
32using namespace std;
33using namespace firevision;
34
35#define WIDTH 748
36#define HEIGHT 572
37
38int
39main(int argc, char **argv)
40{
41 unsigned char *yuv422_packed = malloc_buffer(YUV422_PACKED, WIDTH, HEIGHT);
42
43 // unsigned char *yuv422_planar = malloc_buffer(YUV422_PLANAR, WIDTH, HEIGHT);
45 new SharedMemoryImageBuffer("fv_qa_yuvconv", YUV422_PLANAR, WIDTH, HEIGHT);
46 unsigned char *yuv422_planar = shm->buffer();
47
48 yuv422packed_to_yuv422planar(yuv422_packed, yuv422_planar, WIDTH, HEIGHT);
49
50 delete shm;
51
52 return 0;
53}
54
55/// @endcond
Shared memory image buffer.
Definition: shm_image.h:184
unsigned char * buffer() const
Get image buffer.
Definition: shm_image.cpp:228