blob: d5f210353750c2b74c3355433cdf545adcd77d99 [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
Peiyong Lincbc184f2018-08-22 13:24:10 -070017#include <renderengine/Description.h>
18
Mathias Agopian3f844832013-08-07 21:24:32 -070019#include <stdint.h>
20#include <string.h>
21
22#include <utils/TypeHelpers.h>
23
Mathias Agopian3f844832013-08-07 21:24:32 -070024namespace android {
25
Mathias Agopian3f844832013-08-07 21:24:32 -070026void Description::setPremultipliedAlpha(bool premultipliedAlpha) {
Romain Guy88d37dd2017-05-26 17:57:05 -070027 mPremultipliedAlpha = premultipliedAlpha;
Mathias Agopian3f844832013-08-07 21:24:32 -070028}
29
30void Description::setOpaque(bool opaque) {
Romain Guy88d37dd2017-05-26 17:57:05 -070031 mOpaque = opaque;
Mathias Agopian3f844832013-08-07 21:24:32 -070032}
33
Mathias Agopian49457ac2013-08-14 18:20:17 -070034void Description::setTexture(const Texture& texture) {
35 mTexture = texture;
36 mTextureEnabled = true;
Mathias Agopian3f844832013-08-07 21:24:32 -070037}
38
39void Description::disableTexture() {
Mathias Agopian49457ac2013-08-14 18:20:17 -070040 mTextureEnabled = false;
Mathias Agopian3f844832013-08-07 21:24:32 -070041}
42
chaviw13fdc492017-06-27 12:40:18 -070043void Description::setColor(const half4& color) {
44 mColor = color;
Mathias Agopian3f844832013-08-07 21:24:32 -070045}
46
Mathias Agopiana8c386f2013-08-26 20:42:07 -070047void Description::setProjectionMatrix(const mat4& mtx) {
48 mProjectionMatrix = mtx;
Mathias Agopian3f844832013-08-07 21:24:32 -070049}
50
Mathias Agopianff2ed702013-09-01 21:36:12 -070051void Description::setColorMatrix(const mat4& mtx) {
Mathias Agopianff2ed702013-09-01 21:36:12 -070052 mColorMatrix = mtx;
Peiyong Lina296b0c2018-04-30 16:55:29 -070053}
54
55void Description::setInputTransformMatrix(const mat3& matrix) {
56 mInputTransformMatrix = matrix;
57}
58
59void Description::setOutputTransformMatrix(const mat4& matrix) {
60 mOutputTransformMatrix = matrix;
61}
62
63bool Description::hasInputTransformMatrix() const {
64 const mat3 identity;
65 return mInputTransformMatrix != identity;
66}
67
68bool Description::hasOutputTransformMatrix() const {
69 const mat4 identity;
70 return mOutputTransformMatrix != identity;
71}
72
73bool Description::hasColorMatrix() const {
74 const mat4 identity;
75 return mColorMatrix != identity;
Mathias Agopianff2ed702013-09-01 21:36:12 -070076}
77
Dan Stozaf0087992014-10-20 15:46:09 -070078const mat4& Description::getColorMatrix() const {
79 return mColorMatrix;
80}
81
Chia-I Wu131d3762018-01-11 14:35:27 -080082void Description::setY410BT2020(bool enable) {
83 mY410BT2020 = enable;
84}
85
Chia-I Wu7e65bc02018-01-11 14:31:38 -080086void Description::setInputTransferFunction(TransferFunction transferFunction) {
87 mInputTransferFunction = transferFunction;
88}
89
90void Description::setOutputTransferFunction(TransferFunction transferFunction) {
91 mOutputTransferFunction = transferFunction;
Romain Guy88d37dd2017-05-26 17:57:05 -070092}
Mathias Agopianff2ed702013-09-01 21:36:12 -070093
Peiyong Linfb069302018-04-25 14:34:31 -070094void Description::setDisplayMaxLuminance(const float maxLuminance) {
95 mDisplayMaxLuminance = maxLuminance;
96}
97
Mathias Agopian3f844832013-08-07 21:24:32 -070098} /* namespace android */