blob: fbbdd239cc4126959b7deadc306f7292f2186cae [file] [log] [blame]
wangfei6ea22212015-03-23 19:10:26 +08001/*
2 * cl_csc_handler.h - CL csc handler
3 *
4 * Copyright (c) 2015 Intel Corporation
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 * Author: wangfei <feix.w.wang@intel.com>
19 */
20
21#ifndef XCAM_CL_CSC_HANLDER_H
22#define XCAM_CL_CSC_HANLDER_H
23
24#include "xcam_utils.h"
25#include "cl_image_handler.h"
26
27namespace XCam {
28
wangfei1a7d9f32015-03-26 18:30:00 +080029enum CLCscType {
30 CL_CSC_TYPE_NONE = 0,
31 CL_CSC_TYPE_RGBATONV12,
32 CL_CSC_TYPE_RGBATOLAB,
wangfei227ba272015-04-16 20:58:45 +080033 CL_CSC_TYPE_RGBA64TORGBA,
wangfei1a7d9f32015-03-26 18:30:00 +080034};
35
wangfei6ea22212015-03-23 19:10:26 +080036class CLCscImageKernel
37 : public CLImageKernel
38{
39public:
wangfei1a7d9f32015-03-26 18:30:00 +080040 explicit CLCscImageKernel (SmartPtr<CLContext> &context, const char *name);
wangfei6ea22212015-03-23 19:10:26 +080041
42protected:
43 virtual XCamReturn prepare_arguments (
44 SmartPtr<DrmBoBuffer> &input, SmartPtr<DrmBoBuffer> &output,
45 CLArgument args[], uint32_t &arg_count,
46 CLWorkSize &work_size);
47
48private:
49 XCAM_DEAD_COPY (CLCscImageKernel);
Wind Yuande4c6362015-03-25 17:34:22 +080050
51 uint32_t _vertical_offset;
wangfei6ea22212015-03-23 19:10:26 +080052};
53
wangfei1a7d9f32015-03-26 18:30:00 +080054class CLCscImageHandler
wangfei6ea22212015-03-23 19:10:26 +080055 : public CLImageHandler
56{
57public:
wangfeia1a5ff42015-03-30 11:22:52 +080058 explicit CLCscImageHandler (const char *name, CLCscType type);
wangfei6ea22212015-03-23 19:10:26 +080059
60protected:
61 virtual XCamReturn prepare_buffer_pool_video_info (
62 const VideoBufferInfo &input,
63 VideoBufferInfo &output);
64
65private:
wangfei1a7d9f32015-03-26 18:30:00 +080066 XCAM_DEAD_COPY (CLCscImageHandler);
67
68private:
69 uint32_t _output_format;
70 CLCscType _csc_type;
wangfei6ea22212015-03-23 19:10:26 +080071};
72
73SmartPtr<CLImageHandler>
wangfei1a7d9f32015-03-26 18:30:00 +080074create_cl_csc_image_handler (SmartPtr<CLContext> &context, CLCscType type);
wangfei6ea22212015-03-23 19:10:26 +080075
76};
77
78#endif //XCAM_CL_CSC_HANLDER_H