1/*
2   (C) 2000 Nemosoft Unv.    nemosoft@smcc.demon.nl
3
4   This program is free software; you can redistribute it and/or modify
5   it under the terms of the GNU General Public License as published by
6   the Free Software Foundation; either version 2 of the License, or
7   (at your option) any later version.
8
9   This program 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
12   GNU General Public License for more details.
13
14   You should have received a copy of the GNU General Public License
15   along with this program; if not, write to the Free Software
16   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18*/
19
20#ifndef CCVT_H
21#define CCVT_H
22
23#include <stdio.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/* Colour ConVerT: going from one colour space to another
30
31   Format descriptions:
32   420i = "4:2:0 interlaced"
33           YYYY UU YYYY UU   even lines
34           YYYY VV YYYY VV   odd lines
35           U/V data is subsampled by 2 both in horizontal
36           and vertical directions, and intermixed with the Y values.
37
38   420p = "4:2:0 planar"
39           YYYYYYYY      N lines
40           UUUU          N/2 lines
41           VVVV          N/2 lines
42           U/V is again subsampled, but all the Ys, Us and Vs are placed
43           together in separate buffers. The buffers may be placed in
44           one piece of contiguous memory though, with Y buffer first,
45           followed by U, followed by V.
46
47   yuyv = "4:2:2 interlaced"
48           YUYV YUYV YUYV ...   N lines
49           The U/V data is subsampled by 2 in horizontal direction only.
50
51   bgr24 = 3 bytes per pixel, in the order Blue Green Red (whoever came up
52           with that idea...)
53   rgb24 = 3 bytes per pixel, in the order Red Green Blue (which is sensible)
54   rgb32 = 4 bytes per pixel, in the order Red Green Blue Alpha, with
55           Alpha really being a filler byte (0)
56   bgr32 = last but not least, 4 bytes per pixel, in the order Blue Green Red
57           Alpha, Alpha again a filler byte (0)
58 */
59
60/* Functions in ccvt_c.c */
61/* 4:2:0 YUV interlaced to RGB/BGR */
62void ccvt_420i_bgr24(int width, int height, void *src, void *dst);
63void ccvt_420i_rgb24(int width, int height, void *src, void *dst);
64void ccvt_420i_bgr32(int width, int height, void *src, void *dst);
65void ccvt_420i_rgb32(int width, int height, void *src, void *dst);
66
67/* 4:2:0 YUV planar to RGB/BGR */
68void ccvt_420p_bgr24(int width, int height, void *src, void *srcu, void *srcv, void *dst);
69void ccvt_420p_rgb24(int width, int height, void *src, void *srcu, void *srcv, void *dst);
70void ccvt_420p_bgr32(int width, int height, void *src, void *srcu, void *srcv, void *dst);
71void ccvt_420p_rgb32(int width, int height, void *src, void *srcu, void *srcv, void *dst);
72
73/* 4:2:2 YUYV interlaced to RGB/BGR */
74void ccvt_yuyv_rgb32(int width, int height, void *src, void *dst);
75void ccvt_yuyv_bgr32(int width, int height, void *src, void *dst);
76void ccvt_yuyv_rgb24(int width, int height, void *src, void *dst);
77void ccvt_yuyv_bgr24(int width, int height, void *src, void *dst);
78
79/* 4:2:0 YUV planar to RGB/BGR     */
80//void ccvt_420p_rgb32(int width, int height, void *srcy, void *srcu, void *srcv, void *dst);
81//void ccvt_420p_bgr32(int width, int height, void *srcy, void *srcu, void *srcv, void *dst);
82
83/* RGB/BGR to 4:2:0 YUV interlaced */
84
85/* RGB/BGR to 4:2:0 YUV planar     */
86void ccvt_rgb24_420p(int width, int height, void *src, void *dsty, void *dstu, void *dstv);
87void ccvt_bgr24_420p(int width, int height, void *src, void *dsty, void *dstu, void *dstv);
88
89/* Go from 420i to other yuv formats */
90void ccvt_420i_420p(int width, int height, void *src, void *dsty, void *dstu, void *dstv);
91void ccvt_420i_yuyv(int width, int height, void *src, void *dst);
92
93#ifdef __cplusplus
94}
95#endif
96
97#endif
98