1 /*
2  *  libacryl_plugins/plugin/g2d_hdr.h
3  *
4  *   Copyright 2018 Samsung Electronics Co., Ltd.
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 
19 #ifndef __LIBACRYL_PLUGIN_G2D_HDR_H__
20 #define __LIBACRYL_PLUGIN_G2D_HDR_H__
21 
22 #include <uapi/g2d.h>
23 
24 struct g2d_commandlist {
25     struct g2d_reg *layer_hdr_mode;
26     struct g2d_reg *commands;
27     unsigned int layer_count;
28     unsigned int command_count;
29 };
30 
31 class IG2DHdr10CommandWriter {
32 public:
~IG2DHdr10CommandWriter()33     virtual ~IG2DHdr10CommandWriter() { };
34     static IG2DHdr10CommandWriter *createInstance();
35     virtual bool setLayerStaticMetadata(int layer_index, int dataspace, unsigned int min_luminance, unsigned int max_luminance) = 0;
setLayerOpaqueData(int __unused layer_index,void __unused * data,size_t __unused len)36     virtual bool setLayerOpaqueData(int __unused layer_index, void __unused *data, size_t __unused len) { return true; }
setLayerImageInfo(int __unused layer_index,unsigned int __unused pixfmt,bool __unused alpha_premult)37     virtual bool setLayerImageInfo(int __unused layer_index, unsigned int __unused pixfmt, bool __unused alpha_premult) { return true; }
38     virtual bool setTargetInfo(int dataspace, void *data) = 0;
setTargetDisplayLuminance(unsigned int __unused min,unsigned int __unused max)39     virtual void setTargetDisplayLuminance(unsigned int __unused min, unsigned int __unused max) { };
40     virtual struct g2d_commandlist *getCommands() = 0;
putCommands(struct g2d_commandlist __unused * commands)41     virtual void putCommands(struct g2d_commandlist __unused *commands) { };
42 };
43 
44 #endif/* __LIBACRYL_PLUGIN_G2D_HDR_H__ */
45