wangfei | 6ea2221 | 2015-03-23 19:10:26 +0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 27 | namespace XCam { |
| 28 | |
wangfei | 1a7d9f3 | 2015-03-26 18:30:00 +0800 | [diff] [blame] | 29 | enum CLCscType { |
| 30 | CL_CSC_TYPE_NONE = 0, |
| 31 | CL_CSC_TYPE_RGBATONV12, |
| 32 | CL_CSC_TYPE_RGBATOLAB, |
wangfei | 227ba27 | 2015-04-16 20:58:45 +0800 | [diff] [blame] | 33 | CL_CSC_TYPE_RGBA64TORGBA, |
wangfei | 1a7d9f3 | 2015-03-26 18:30:00 +0800 | [diff] [blame] | 34 | }; |
| 35 | |
wangfei | 6ea2221 | 2015-03-23 19:10:26 +0800 | [diff] [blame] | 36 | class CLCscImageKernel |
| 37 | : public CLImageKernel |
| 38 | { |
| 39 | public: |
wangfei | 1a7d9f3 | 2015-03-26 18:30:00 +0800 | [diff] [blame] | 40 | explicit CLCscImageKernel (SmartPtr<CLContext> &context, const char *name); |
wangfei | 6ea2221 | 2015-03-23 19:10:26 +0800 | [diff] [blame] | 41 | |
| 42 | protected: |
| 43 | virtual XCamReturn prepare_arguments ( |
| 44 | SmartPtr<DrmBoBuffer> &input, SmartPtr<DrmBoBuffer> &output, |
| 45 | CLArgument args[], uint32_t &arg_count, |
| 46 | CLWorkSize &work_size); |
| 47 | |
| 48 | private: |
| 49 | XCAM_DEAD_COPY (CLCscImageKernel); |
Wind Yuan | de4c636 | 2015-03-25 17:34:22 +0800 | [diff] [blame] | 50 | |
| 51 | uint32_t _vertical_offset; |
wangfei | 6ea2221 | 2015-03-23 19:10:26 +0800 | [diff] [blame] | 52 | }; |
| 53 | |
wangfei | 1a7d9f3 | 2015-03-26 18:30:00 +0800 | [diff] [blame] | 54 | class CLCscImageHandler |
wangfei | 6ea2221 | 2015-03-23 19:10:26 +0800 | [diff] [blame] | 55 | : public CLImageHandler |
| 56 | { |
| 57 | public: |
wangfei | a1a5ff4 | 2015-03-30 11:22:52 +0800 | [diff] [blame] | 58 | explicit CLCscImageHandler (const char *name, CLCscType type); |
wangfei | 6ea2221 | 2015-03-23 19:10:26 +0800 | [diff] [blame] | 59 | |
| 60 | protected: |
| 61 | virtual XCamReturn prepare_buffer_pool_video_info ( |
| 62 | const VideoBufferInfo &input, |
| 63 | VideoBufferInfo &output); |
| 64 | |
| 65 | private: |
wangfei | 1a7d9f3 | 2015-03-26 18:30:00 +0800 | [diff] [blame] | 66 | XCAM_DEAD_COPY (CLCscImageHandler); |
| 67 | |
| 68 | private: |
| 69 | uint32_t _output_format; |
| 70 | CLCscType _csc_type; |
wangfei | 6ea2221 | 2015-03-23 19:10:26 +0800 | [diff] [blame] | 71 | }; |
| 72 | |
| 73 | SmartPtr<CLImageHandler> |
wangfei | 1a7d9f3 | 2015-03-26 18:30:00 +0800 | [diff] [blame] | 74 | create_cl_csc_image_handler (SmartPtr<CLContext> &context, CLCscType type); |
wangfei | 6ea2221 | 2015-03-23 19:10:26 +0800 | [diff] [blame] | 75 | |
| 76 | }; |
| 77 | |
| 78 | #endif //XCAM_CL_CSC_HANLDER_H |