conversions.h
1/*
2 * Copyright (C) 2000-2003 Damien Douxchamps <ddouxchamps@users.sf.net>
3 * Dan Dennedy <dan@dennedy.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20#ifndef __CONVERSIONS_H__
21#define __CONVERSIONS_H__
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#include <stdlib.h>
28#include <stdio.h>
29
30typedef enum
31{
32 NO_BAYER_DECODING,
33 BAYER_DECODING_NEAREST,
34 BAYER_DECODING_EDGE_SENSE,
35 BAYER_DECODING_DOWNSAMPLE
36} bayer_decoding_t;
37
38typedef enum
39{
40 NO_STEREO_DECODING,
41 STEREO_DECODING_INTERLACED,
42 STEREO_DECODING_FIELD
43} stereo_decoding_t;
44
45typedef enum
46{
47 BAYER_PATTERN_BGGR,
48 BAYER_PATTERN_GRBG,
49 BAYER_PATTERN_RGGB,
50 BAYER_PATTERN_GBRG
51} bayer_pattern_t;
52
53// UYVY <-> YUYV
54void
55uyvy2yuyv (unsigned char *src, unsigned char *dest, unsigned long long int NumPixels);
56
57void
58yuyv2uyvy (unsigned char *src, unsigned char *dest, unsigned long long int NumPixels);
59
60// XXX -> UYVY
61void
62uyyvyy2uyvy (unsigned char *src, unsigned char *dest, unsigned long long int NumPixels);
63
64void
65uyv2uyvy (unsigned char *src, unsigned char *dest, unsigned long long int NumPixels);
66
67void
68y2uyvy (unsigned char *src, unsigned char *dest, unsigned long long int NumPixels);
69
70void
71y162uyvy (unsigned char *src, unsigned char *dest, unsigned long long int NumPixels, int bits);
72
73void
74y162y (unsigned char *src, unsigned char *dest, unsigned long long int NumPixels, int bits);
75
76void
77rgb2uyvy (unsigned char *src, unsigned char *dest, unsigned long long int NumPixels);
78
79void
80rgb482uyvy (unsigned char *src, unsigned char *dest, unsigned long long int NumPixels);
81
82// XXX -> RGB
83void
84rgb482rgb (unsigned char *src, unsigned char *dest, unsigned long long int NumPixels);
85
86void
87uyv2rgb (unsigned char *src, unsigned char *dest, unsigned long long int NumPixels);
88
89void
90uyvy2rgb (unsigned char *src, unsigned char *dest, unsigned long long int NumPixels);
91
92void
93uyyvyy2rgb (unsigned char *src, unsigned char *dest, unsigned long long int NumPixels);
94
95void
96y2rgb (unsigned char *src, unsigned char *dest, unsigned long long int NumPixels);
97
98void
99y162rgb (unsigned char *src, unsigned char *dest, unsigned long long int NumPixels, int bits);
100
101// BAYER -> RGB
102void
103BayerNearestNeighbor(unsigned char *src, unsigned char *dest, int sx, int sy, bayer_pattern_t type);
104
105void
106BayerEdgeSense(unsigned char *src, unsigned char *dest, int sx, int sy, bayer_pattern_t type);
107
108void
109BayerDownsample(unsigned char *src, unsigned char *dest, int sx, int sy, bayer_pattern_t type);
110
111void
112StereoDecode(unsigned char *src, unsigned char *dest, unsigned long long int NumPixels);
113
114#ifdef __cplusplus
115}
116#endif
117
118#endif