aboutsummaryrefslogtreecommitdiffstats
path: root/color.h
blob: a5c1a882930b3875cacd9f4632a7b8392bf09cbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* @file			color.h
* @brief		color utility function definition
* @author		Patrick Roth - roth@stettbacher.ch
* @copyright	Stettbacher Signal Processing AG
* 
* @remarks
*
* <PRE>
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* </PRE>
*
*/


#ifndef _COLOR_H
#define _COLOR_H

#include "color_pipe.h"


#define RGB2YUV_COEFF_Y_RED				0.299			///< RGB to YUV conversion coefficient for Y-Channel: red
#define RGB2YUV_COEFF_Y_GREEN			0.587			///< RGB to YUV conversion coefficient for Y-Channel: green
#define RGB2YUV_COEFF_Y_BLUE			0.114			///< RGB to YUV conversion coefficient for Y-Channel: blue

#define RGB2YUV_COEFF_U_RED				(-0.299)		///< RGB to YUV conversion coefficient for U-Channel: red
#define RGB2YUV_COEFF_U_GREEN			(-0.587)		///< RGB to YUV conversion coefficient for U-Channel: green
#define RGB2YUV_COEFF_U_BLUE			0.886			///< RGB to YUV conversion coefficient for U-Channel: blue
	
#define RGB2YUV_COEFF_V_RED				0.701			///< RGB to YUV conversion coefficient for V-Channel: red
#define RGB2YUV_COEFF_V_GREEN			(-0.587)		///< RGB to YUV conversion coefficient for V-Channel: green
#define RGB2YUV_COEFF_V_BLUE			(-0.114)		///< RGB to YUV conversion coefficient for V-Channel: blue



#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif

int color_rgb_to_yuv(int16_t *img_yuv, const void *img_rgb, const int height, const int width, const int bit_channel);
int color_yuv_to_rgb(void *img_rgb, const int16_t *img_yuv, const int height, const int width, const int bit_channel);

int color_calib(struct color_calib_data_t *color_calib);
	
#if defined(__cplusplus) || defined(c_plusplus)
} // extern "C"
#endif


#endif // _COLOR_H