📄 yuvtorgb16.h
字号:
/*------------------------------------------------------------------------------
-- --
-- This software is confidential and proprietary and may be used --
-- only as expressly authorized by a licensing agreement from --
-- --
-- Hantro Products Oy. --
-- --
-- In the event of publication, the following notice is applicable: --
-- --
-- (C) COPYRIGHT 2003 HANTRO PRODUCTS OY --
-- ALL RIGHTS RESERVED --
-- --
-- The entire notice above must be reproduced on all copies. --
-- --
--------------------------------------------------------------------------------
--
-- Abstract : YUV to RGB conversion.
-- Input 4:2:0 sampled YUV in planar IYUV format.
-- Output 16-bit RGB in RGB565 format.
--
-------------------------------------------------------------------------------*/
#ifndef YUVTORGB16_H
#define YUVTORGB16_H
#include "basetype.h"
#include "yuvtorgbinit.h"
#ifdef __cplusplus
extern "C"
{
#endif
/* Color conversion and dithering (optional)
Rotate-function also rotates the image +/- 90 degrees
Input format: planar 4:2:0 YUV: Y0Y1Y2Y3... U0U1... V0V1...
Output format: 16-bit RGB565
u16 u16
+----------------+----------------+---
|RRRRRGGGGGGBBBBB|RRRRRGGGGGGBBBBB|
+----------------+----------------+---
MSB LSB
or if defined YUVTORGB_BGR_OUTPUT
u16 u16
+----------------+----------------+---
|BBBBBGGGGGGRRRRR|BBBBBGGGGGGRRRRR|
+----------------+----------------+---
MSB LSB
or if defined YUVTORGB16_FORMAT_PALM
u16 u16
+----------------+----------------+---
|GGGBBBBBRRRRRGGG|GGGBBBBBRRRRRGGG|
+----------------+----------------+---
MSB LSB
YuvWidth, yuvHeight, xOffset and yOffset must be even.
Processed image dimensions are always even.
Returns: 0 success
-1 error: null input pointer
-2 error: invalid image dimensions
*/
i32 YuvToRgb16(const cct *YUVTable, const u8 *Y, const u8 *U, const u8 *V,
u16 *rgb, u32 yuvWidth, u32 yuvHeight, u32 rgbWidth, i32 rgbHeight,
i32 xOffset, i32 yOffset, u8 dither);
i32 YuvToRgb16Rotate(const cct *YUVTable, const u8 *Y, const u8 *U,
const u8 *V, u16 *rgb, u32 yuvWidth, u32 yuvHeight, u32 rgbWidth,
i32 rgbHeight, i32 xOffset, i32 yOffset, u8 dither, i32 rotateAngle);
/* Color conversion and dithering (optional)
Input format: planar 4:2:0 YUV: Y0Y1Y2Y3... U0U1... V0V1...
Output format: 16-bit RGB555
u16 u16
+----------------+----------------+---
|0RRRRRGGGGGBBBBB|0RRRRRGGGGGBBBBB|
+----------------+----------------+---
MSB LSB
or if defined YUVTORGB_BGR_OUTPUT
u16 u16
+----------------+----------------+---
|0BBBBBGGGGGRRRRR|0BBBBBGGGGGRRRRR|
+----------------+----------------+---
MSB LSB
YuvWidth, yuvHeight, xOffset and yOffset must be even.
Processed image dimensions are always even.
Returns: 0 success
-1 error: null input pointer
-2 error: invalid image dimensions
*/
i32 YuvToRgb15(const cct *YUVTable, const u8 *Y, const u8 *U, const u8 *V,
u16 *rgb, u32 yuvWidth, u32 yuvHeight, u32 rgbWidth, i32 rgbHeight,
i32 xOffset, i32 yOffset, u8 dither);
#ifdef __cplusplus
}
#endif
#endif /* YUVTORGB16_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -