blob: c218e4da50336974b57e4c71b69219b4d571e8a3 [file] [log] [blame]
Mathias Agopian3f844832013-08-07 21:24:32 -07001/*
2 * Copyright 2013 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17#include <stdint.h>
18#include <string.h>
19
20#include <utils/TypeHelpers.h>
21
22#include <GLES2/gl2.h>
23#include <GLES2/gl2ext.h>
24
25#include "Description.h"
26
27namespace android {
28
Mathias Agopian3f844832013-08-07 21:24:32 -070029void Description::setPremultipliedAlpha(bool premultipliedAlpha) {
Romain Guy88d37dd2017-05-26 17:57:05 -070030 mPremultipliedAlpha = premultipliedAlpha;
Mathias Agopian3f844832013-08-07 21:24:32 -070031}
32
33void Description::setOpaque(bool opaque) {
Romain Guy88d37dd2017-05-26 17:57:05 -070034 mOpaque = opaque;
Mathias Agopian3f844832013-08-07 21:24:32 -070035}
36
Mathias Agopian49457ac2013-08-14 18:20:17 -070037void Description::setTexture(const Texture& texture) {
38 mTexture = texture;
39 mTextureEnabled = true;
Mathias Agopian3f844832013-08-07 21:24:32 -070040}
41
42void Description::disableTexture() {
Mathias Agopian49457ac2013-08-14 18:20:17 -070043 mTextureEnabled = false;
Mathias Agopian3f844832013-08-07 21:24:32 -070044}
45
chaviw13fdc492017-06-27 12:40:18 -070046void Description::setColor(const half4& color) {
47 mColor = color;
Mathias Agopian3f844832013-08-07 21:24:32 -070048}
49
Mathias Agopiana8c386f2013-08-26 20:42:07 -070050void Description::setProjectionMatrix(const mat4& mtx) {
51 mProjectionMatrix = mtx;
Mathias Agopian3f844832013-08-07 21:24:32 -070052}
53
Mathias Agopianff2ed702013-09-01 21:36:12 -070054void Description::setColorMatrix(const mat4& mtx) {
Mathias Agopianff2ed702013-09-01 21:36:12 -070055 mColorMatrix = mtx;
Peiyong Lina296b0c2018-04-30 16:55:29 -070056}
57
58void Description::setInputTransformMatrix(const mat3& matrix) {
59 mInputTransformMatrix = matrix;
60}
61
62void Description::setOutputTransformMatrix(const mat4& matrix) {
63 mOutputTransformMatrix = matrix;
64}
65
66bool Description::hasInputTransformMatrix() const {
67 const mat3 identity;
68 return mInputTransformMatrix != identity;
69}
70
71bool Description::hasOutputTransformMatrix() const {
72 const mat4 identity;
73 return mOutputTransformMatrix != identity;
74}
75
76bool Description::hasColorMatrix() const {
77 const mat4 identity;
78 return mColorMatrix != identity;
Mathias Agopianff2ed702013-09-01 21:36:12 -070079}
80
Dan Stozaf0087992014-10-20 15:46:09 -070081const mat4& Description::getColorMatrix() const {
82 return mColorMatrix;
83}
84
Chia-I Wu131d3762018-01-11 14:35:27 -080085void Description::setY410BT2020(bool enable) {
86 mY410BT2020 = enable;
87}
88
Chia-I Wu7e65bc02018-01-11 14:31:38 -080089void Description::setInputTransferFunction(TransferFunction transferFunction) {
90 mInputTransferFunction = transferFunction;
91}
92
93void Description::setOutputTransferFunction(TransferFunction transferFunction) {
94 mOutputTransferFunction = transferFunction;
Romain Guy88d37dd2017-05-26 17:57:05 -070095}
Mathias Agopianff2ed702013-09-01 21:36:12 -070096
Peiyong Linfb069302018-04-25 14:34:31 -070097void Description::setDisplayMaxLuminance(const float maxLuminance) {
98 mDisplayMaxLuminance = maxLuminance;
99}
100
Mathias Agopian3f844832013-08-07 21:24:32 -0700101} /* namespace android */