aboutsummaryrefslogtreecommitdiffstats
path: root/color.h
diff options
context:
space:
mode:
authorPatrick Roth <roth@stettbacher.ch>2019-10-04 11:51:48 +0200
committerPatrick Roth <roth@stettbacher.ch>2019-10-04 11:51:48 +0200
commita0f501fa5650d0b6062cc8f26b34bce11137643d (patch)
tree8e31c5ac3409d4ce48887d88d4530b88a02c2660 /color.h
downloado3000-color-pipe-a0f501fa5650d0b6062cc8f26b34bce11137643d.tar.gz
o3000-color-pipe-a0f501fa5650d0b6062cc8f26b34bce11137643d.zip
initial commit
import from github
Diffstat (limited to 'color.h')
-rw-r--r--color.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/color.h b/color.h
new file mode 100644
index 0000000..73bff58
--- /dev/null
+++ b/color.h
@@ -0,0 +1,64 @@
+/**
+* @file color.h
+* @brief color utility function definition
+* @author Patrick Roth - roth@stettbacher.ch
+* @version 1.0
+* @date 2015-08-20
+* @copyright 2012-2016 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