blob: 35d730d373bdd682778815777ab84eed73a18b6f [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,
33};
34
wangfei6ea22212015-03-23 19:10:26 +080035class CLCscImageKernel
36 : public CLImageKernel
37{
38public:
wangfei1a7d9f32015-03-26 18:30:00 +080039 explicit CLCscImageKernel (SmartPtr<CLContext> &context, const char *name);
wangfei6ea22212015-03-23 19:10:26 +080040
41protected:
42 virtual XCamReturn prepare_arguments (
43 SmartPtr<DrmBoBuffer> &input, SmartPtr<DrmBoBuffer> &output,
44 CLArgument args[], uint32_t &arg_count,
45 CLWorkSize &work_size);
46
47private:
48 XCAM_DEAD_COPY (CLCscImageKernel);
Wind Yuande4c6362015-03-25 17:34:22 +080049
50 uint32_t _vertical_offset;
wangfei6ea22212015-03-23 19:10:26 +080051};
52
wangfei1a7d9f32015-03-26 18:30:00 +080053class CLCscImageHandler
wangfei6ea22212015-03-23 19:10:26 +080054 : public CLImageHandler
55{
56public:
wangfeia1a5ff42015-03-30 11:22:52 +080057 explicit CLCscImageHandler (const char *name, CLCscType type);
wangfei6ea22212015-03-23 19:10:26 +080058
59protected:
60 virtual XCamReturn prepare_buffer_pool_video_info (
61 const VideoBufferInfo &input,
62 VideoBufferInfo &output);
63
64private:
wangfei1a7d9f32015-03-26 18:30:00 +080065 XCAM_DEAD_COPY (CLCscImageHandler);
66
67private:
68 uint32_t _output_format;
69 CLCscType _csc_type;
wangfei6ea22212015-03-23 19:10:26 +080070};
71
72SmartPtr<CLImageHandler>
wangfei1a7d9f32015-03-26 18:30:00 +080073create_cl_csc_image_handler (SmartPtr<CLContext> &context, CLCscType type);
wangfei6ea22212015-03-23 19:10:26 +080074
75};
76
77#endif //XCAM_CL_CSC_HANLDER_H