2 // Copyright (c) 2016 Intel Corporation
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.
17 #ifndef PUBLIC_HWCDEFS_H_
18 #define PUBLIC_HWCDEFS_H_
25 #include <unordered_map>
28 namespace hwcomposer {
31 using HwcRect = Rect<T>;
33 typedef std::vector<HwcRect<int>> HwcRegion;
35 enum class HWCBlending : int32_t {
36 kBlendingNone = 0x0100,
37 kBlendingPremult = 0x0105,
38 kBlendingCoverage = 0x0405,
41 // Enumerations for content protection.
42 enum HWCContentProtection {
43 kUnSupported = 0, // Content Protection is not supported.
44 kUnDesired = 1, // Content Protection is not required.
45 kDesired = 2 // Content Protection is desired.
49 kInvalid, // Used when disabling HDCP.
50 kCONTENT_TYPE0, // Can support any HDCP specifiction.
51 kCONTENT_TYPE1, // Can support only HDCP 2.2 and higher specification.
54 enum HWCTransform : uint32_t {
58 kTransform90 = 1 << 2,
59 kTransform180 = 1 << 3,
60 kTransform270 = 1 << 4,
61 kTransform45 = kTransform90 | kReflectY,
62 kTransform135 = kTransform90 | kReflectX,
82 enum class HWCDisplayAttribute : int32_t {
90 enum class DisplayType : int32_t {
99 enum DisplayPowerMode {
100 kOff = 0, // Display is off
101 kDoze = 1, // Display is off and used by the app during any inactivity
102 // when the device is on battery
103 kOn = 2, // Display is on
104 kDozeSuspend = 3 // Dispaly in low power mode and stop applying
105 // updates from the client
108 enum HWCColorTransform {
109 // Applies no transform to the output color
111 // Applies an arbitrary transform defined by a 4x4 affine matrix
116 enum class HWCColorControl : int32_t {
118 kColorSaturation = 1,
119 kColorBrightness = 2,
124 enum class HWCDeinterlaceFlag : int32_t {
125 kDeinterlaceFlagNone = 0,
126 kDeinterlaceFlagForce = 1,
127 kDeinterlaceFlagAuto = 2
130 enum class HWCDeinterlaceControl : int32_t {
131 kDeinterlaceNone = 0,
133 kDeinterlaceWeave = 2,
134 kDeinterlaceMotionAdaptive = 3,
135 kDeinterlaceMotionCompensated = 4
138 enum class HWCScalingRunTimeSetting : int32_t {
139 kScalingModeNone = 0, // use default scaling mode.
140 kScalingModeFast = 1, // use fast scaling mode.
141 kScalingModeHighQuality = 2 // use high quality scaling mode.
144 struct EnumClassHash {
145 template <typename T>
146 std::size_t operator()(T t) const {
147 return static_cast<std::size_t>(t);
151 struct HWCColorProp {
153 bool use_default_ = true;
156 struct HWCDeinterlaceProp {
157 HWCDeinterlaceFlag flag_;
158 HWCDeinterlaceControl mode_;
162 std::unordered_map<HWCColorControl, HWCColorProp, EnumClassHash>;
164 } // namespace hwcomposer
165 #endif // __cplusplus
167 #endif // PUBLIC_HWCDEFS_H_