2 * Copyright 2012 Samsung Electronics S.LSI Co. LTD
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 * @brief color space convertion abstract header
22 * @author Pyoungjae Jung (pjet.jung@samsung.com)
37 typedef enum _CSC_ERRORCODE {
41 CSC_ErrorInvalidAddress,
42 CSC_ErrorUnsupportFormat,
43 CSC_ErrorNotImplemented
46 typedef enum _CSC_METHOD {
51 typedef enum _CSC_HW_PROPERTY_TYPE {
52 CSC_HW_PROPERTY_FIXED_NODE = 0,
53 CSC_HW_PROPERTY_MODE_DRM,
54 } CSC_HW_PROPERTY_TYPE;
57 * change hal pixel format to omx pixel format
60 * hal pixel format[in]
65 unsigned int hal_2_omx_pixel_format(
66 unsigned int hal_format);
69 * change omx pixel format to hal pixel format
72 * omx pixel format[in]
77 unsigned int omx_2_hal_pixel_format(
78 unsigned int omx_format);
98 CSC_ERRORCODE csc_deinit(
102 * get color space converter method
113 CSC_ERRORCODE csc_get_method(
124 * csc hw property[in]
127 * csc hw property value[in]
132 CSC_ERRORCODE csc_set_hw_property(
134 CSC_HW_PROPERTY_TYPE property,
144 * address of image width[out]
147 * address of image height[out]
150 * address of image left crop size[out]
153 * address of image top crop size[out]
156 * address of cropped image width[out]
159 * address of cropped image height[out]
161 * @param color_format
162 * address of source color format(HAL format)[out]
167 CSC_ERRORCODE csc_get_src_format(
170 unsigned int *height,
171 unsigned int *crop_left,
172 unsigned int *crop_top,
173 unsigned int *crop_width,
174 unsigned int *crop_height,
175 unsigned int *color_format,
176 unsigned int *cacheable);
180 * Don't call each converting time.
181 * Pls call this function as below.
182 * 1. first converting time
183 * 2. format is changed
195 * image left crop size[in]
198 * image top crop size[in]
201 * cropped image width[in]
204 * cropped image height[in]
206 * @param color_format
207 * source color format(HAL format)[in]
212 CSC_ERRORCODE csc_set_src_format(
216 unsigned int crop_left,
217 unsigned int crop_top,
218 unsigned int crop_width,
219 unsigned int crop_height,
220 unsigned int color_format,
221 unsigned int cacheable);
224 * Get destination format.
230 * address of image width[out]
233 * address of image height[out]
236 * address of image left crop size[out]
239 * address of image top crop size[out]
242 * address of cropped image width[out]
245 * address of cropped image height[out]
247 * @param color_format
248 * address of color format(HAL format)[out]
253 CSC_ERRORCODE csc_get_dst_format(
256 unsigned int *height,
257 unsigned int *crop_left,
258 unsigned int *crop_top,
259 unsigned int *crop_width,
260 unsigned int *crop_height,
261 unsigned int *color_format,
262 unsigned int *cacheable);
265 * Set destination format
266 * Don't call each converting time.
267 * Pls call this function as below.
268 * 1. first converting time
269 * 2. format is changed
281 * image left crop size[in]
284 * image top crop size[in]
287 * cropped image width[in]
290 * cropped image height[in]
292 * @param color_format
293 * destination color format(HAL format)[in]
298 CSC_ERRORCODE csc_set_dst_format(
302 unsigned int crop_left,
303 unsigned int crop_top,
304 unsigned int crop_width,
305 unsigned int crop_height,
306 unsigned int color_format,
307 unsigned int cacheable);
310 * Setup source buffer
311 * set_format func should be called before this this func.
317 * source buffer pointer array[in]
320 * y or RGB destination pointer[in]
323 * u or uv destination pointer[in]
326 * v or none destination pointer[in]
331 CSC_ERRORCODE csc_set_src_buffer(
339 * Setup destination buffer
345 * y or RGB destination pointer[in]
348 * u or uv destination pointer[in]
351 * v or none destination pointer[in]
356 CSC_ERRORCODE csc_set_dst_buffer(
364 * Convert color space with presetup color format
372 CSC_ERRORCODE csc_convert(