2 * @file vp_stages_yuv2rgb.h
3 * @brief VP Stages. YUV to RGB converter stage declaration
6 ///////////////////////////////////////////////
9 #ifndef _VP_STAGES_YUV2RGB_INCLUDE_
10 #define _VP_STAGES_YUV2RGB_INCLUDE_
13 * @addtogroup VP_Stages
17 * @defgroup vp_stages_yuv2rgb YUV-4:2:0p to RGB converter stage
21 Gets in input a frame which type is vp_api_picture_t and format is planar YUV-4:2:0.
22 Converts it into RGB format : RGB-565 (16 bits), RGB24 or Alpha-RGB (32 bits)
23 Stores the result frame into the output buffer.
30 #include <VP_Api/vp_api.h>
31 #include <VP_Api/vp_api_picture.h>
33 ///////////////////////////////////////////////
38 typedef enum _VP_STAGES_RGB_FORMAT
40 VP_STAGES_RGB_FORMAT_MARKER_BEGIN = -1,
41 VP_STAGES_RGB_FORMAT_RGB565 = 0,
42 VP_STAGES_RGB_FORMAT_RGB24,
43 VP_STAGES_RGB_FORMAT_ARGB32,
44 VP_STAGES_RGB_FORMAT_MARKER_END
45 } VP_STAGES_RGB_FORMAT;
47 typedef enum _VP_STAGES_YUV2RGB_CONVERSION_MODE
49 VP_STAGES_YUV2RGB_MODE_NORMAL = 0,
50 VP_STAGES_YUV2RGB_MODE_UPSIDE_DOWN,
51 } VP_STAGES_YUV2RGB_CONVERSION_MODE;
55 * @brief Configuration structure for the YUV-4:2:0p to RGB-Alpha converter stage
57 typedef struct _vp_stages_yuv2rgb_config_
59 VP_STAGES_RGB_FORMAT rgb_format; //!< Select RGB format
61 #ifdef USE_YUV2RGB_STRETCH
65 #endif // < USE_YUV2RGB_STRETCH
67 VP_STAGES_YUV2RGB_CONVERSION_MODE mode;
69 } vp_stages_yuv2rgb_config_t;
73 * @var vp_stages_YUV_to_RGB_t
74 * @brief Define pointer type to a YUV to RGB conversion function
76 typedef void (*vp_stages_YUV_to_RGB_t)(vp_stages_yuv2rgb_config_t *cfg, vp_api_picture_t *picture, uint8_t *dst, uint32_t dst_rbytes);
78 ///////////////////////////////////////////////
81 void asm_yuvrgb565(uint8_t* dst, int32_t dst_rbytes, uint32_t* src, int y);
84 * @fn vp_stages_yuv2rgb_stage_open(vp_stages_yuv2rgb_config_t *)
85 * @brief Open the YUV to RGB converter stage.
86 * @param cfg Stage configuration
87 * @return C_RESULT : VP_SUCCESS
89 C_RESULT vp_stages_yuv2rgb_stage_open(vp_stages_yuv2rgb_config_t *cfg);
93 * @fn vp_stages_yuv2rgb_stage_transform(vp_stages_yuv2rgb_config_t *, vp_api_io_data_t *, vp_api_io_data_t *)
94 * @brief Apply a transform over the YUV to RGB converter stage.
96 * Gets in input a vp_api_picture_t frame which contains the Y, U, and V arrays.\n
97 * Calls internal generic function vp_stages_YUV_to_RGB.
98 * @param cfg Stage configuration
99 * @param in Input buffer : contains a vp_api_picture_t *
100 * @param out Output buffer
101 * @return C_RESULT : VP_SUCCESS
102 * @author Julien Floret <julien.floret.ext\@parrot.com>
103 * @date Last modification 30/04/2007
105 C_RESULT vp_stages_yuv2rgb_stage_transform(vp_stages_yuv2rgb_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out);
109 * @fn vp_stages_yuv2rgb_stage_close(vp_stages_yuv2rgb_config_t *)
110 * @brief Close the YUV to RGB converter stage.
111 * @param cfg Stage configuration
112 * @return C_RESULT : VP_SUCCESS
114 C_RESULT vp_stages_yuv2rgb_stage_close(vp_stages_yuv2rgb_config_t *cfg);
121 #endif // ! _VP_STAGES_YUV2RGB_INCLUDE_