| Mathias Agopian | 3f84483 | 2013-08-07 21:24:32 -0700 | [diff] [blame] | 1 | /* | 
 | 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 |  | 
 | 27 | namespace android { | 
 | 28 |  | 
| Mathias Agopian | 3f84483 | 2013-08-07 21:24:32 -0700 | [diff] [blame] | 29 | void Description::setPremultipliedAlpha(bool premultipliedAlpha) { | 
| Romain Guy | 88d37dd | 2017-05-26 17:57:05 -0700 | [diff] [blame] | 30 |     mPremultipliedAlpha = premultipliedAlpha; | 
| Mathias Agopian | 3f84483 | 2013-08-07 21:24:32 -0700 | [diff] [blame] | 31 | } | 
 | 32 |  | 
 | 33 | void Description::setOpaque(bool opaque) { | 
| Romain Guy | 88d37dd | 2017-05-26 17:57:05 -0700 | [diff] [blame] | 34 |     mOpaque = opaque; | 
| Mathias Agopian | 3f84483 | 2013-08-07 21:24:32 -0700 | [diff] [blame] | 35 | } | 
 | 36 |  | 
| Mathias Agopian | 49457ac | 2013-08-14 18:20:17 -0700 | [diff] [blame] | 37 | void Description::setTexture(const Texture& texture) { | 
 | 38 |     mTexture = texture; | 
 | 39 |     mTextureEnabled = true; | 
| Mathias Agopian | 3f84483 | 2013-08-07 21:24:32 -0700 | [diff] [blame] | 40 | } | 
 | 41 |  | 
 | 42 | void Description::disableTexture() { | 
| Mathias Agopian | 49457ac | 2013-08-14 18:20:17 -0700 | [diff] [blame] | 43 |     mTextureEnabled = false; | 
| Mathias Agopian | 3f84483 | 2013-08-07 21:24:32 -0700 | [diff] [blame] | 44 | } | 
 | 45 |  | 
| chaviw | 13fdc49 | 2017-06-27 12:40:18 -0700 | [diff] [blame] | 46 | void Description::setColor(const half4& color) { | 
 | 47 |     mColor = color; | 
| Mathias Agopian | 3f84483 | 2013-08-07 21:24:32 -0700 | [diff] [blame] | 48 | } | 
 | 49 |  | 
| Mathias Agopian | a8c386f | 2013-08-26 20:42:07 -0700 | [diff] [blame] | 50 | void Description::setProjectionMatrix(const mat4& mtx) { | 
 | 51 |     mProjectionMatrix = mtx; | 
| Mathias Agopian | 3f84483 | 2013-08-07 21:24:32 -0700 | [diff] [blame] | 52 | } | 
 | 53 |  | 
| Peiyong Lin | 76dd77a | 2018-05-09 15:35:33 -0700 | [diff] [blame] | 54 | void Description::setSaturationMatrix(const mat4& mtx) { | 
 | 55 |     mSaturationMatrix = mtx; | 
 | 56 | } | 
 | 57 |  | 
| Mathias Agopian | ff2ed70 | 2013-09-01 21:36:12 -0700 | [diff] [blame] | 58 | void Description::setColorMatrix(const mat4& mtx) { | 
| Mathias Agopian | ff2ed70 | 2013-09-01 21:36:12 -0700 | [diff] [blame] | 59 |     mColorMatrix = mtx; | 
| Peiyong Lin | a296b0c | 2018-04-30 16:55:29 -0700 | [diff] [blame] | 60 | } | 
 | 61 |  | 
 | 62 | void Description::setInputTransformMatrix(const mat3& matrix) { | 
 | 63 |     mInputTransformMatrix = matrix; | 
 | 64 | } | 
 | 65 |  | 
 | 66 | void Description::setOutputTransformMatrix(const mat4& matrix) { | 
 | 67 |     mOutputTransformMatrix = matrix; | 
 | 68 | } | 
 | 69 |  | 
 | 70 | bool Description::hasInputTransformMatrix() const { | 
 | 71 |     const mat3 identity; | 
 | 72 |     return mInputTransformMatrix != identity; | 
 | 73 | } | 
 | 74 |  | 
 | 75 | bool Description::hasOutputTransformMatrix() const { | 
 | 76 |     const mat4 identity; | 
 | 77 |     return mOutputTransformMatrix != identity; | 
 | 78 | } | 
 | 79 |  | 
 | 80 | bool Description::hasColorMatrix() const { | 
 | 81 |     const mat4 identity; | 
 | 82 |     return mColorMatrix != identity; | 
| Mathias Agopian | ff2ed70 | 2013-09-01 21:36:12 -0700 | [diff] [blame] | 83 | } | 
 | 84 |  | 
| Peiyong Lin | 76dd77a | 2018-05-09 15:35:33 -0700 | [diff] [blame] | 85 | bool Description::hasSaturationMatrix() const { | 
 | 86 |     const mat4 identity; | 
 | 87 |     return mSaturationMatrix != identity; | 
 | 88 | } | 
 | 89 |  | 
| Dan Stoza | f008799 | 2014-10-20 15:46:09 -0700 | [diff] [blame] | 90 | const mat4& Description::getColorMatrix() const { | 
 | 91 |     return mColorMatrix; | 
 | 92 | } | 
 | 93 |  | 
| Chia-I Wu | 131d376 | 2018-01-11 14:35:27 -0800 | [diff] [blame] | 94 | void Description::setY410BT2020(bool enable) { | 
 | 95 |     mY410BT2020 = enable; | 
 | 96 | } | 
 | 97 |  | 
| Chia-I Wu | 7e65bc0 | 2018-01-11 14:31:38 -0800 | [diff] [blame] | 98 | void Description::setInputTransferFunction(TransferFunction transferFunction) { | 
 | 99 |     mInputTransferFunction = transferFunction; | 
 | 100 | } | 
 | 101 |  | 
 | 102 | void Description::setOutputTransferFunction(TransferFunction transferFunction) { | 
 | 103 |     mOutputTransferFunction = transferFunction; | 
| Romain Guy | 88d37dd | 2017-05-26 17:57:05 -0700 | [diff] [blame] | 104 | } | 
| Mathias Agopian | ff2ed70 | 2013-09-01 21:36:12 -0700 | [diff] [blame] | 105 |  | 
| Peiyong Lin | fb06930 | 2018-04-25 14:34:31 -0700 | [diff] [blame] | 106 | void Description::setDisplayMaxLuminance(const float maxLuminance) { | 
 | 107 |     mDisplayMaxLuminance = maxLuminance; | 
 | 108 | } | 
 | 109 |  | 
| Mathias Agopian | 3f84483 | 2013-08-07 21:24:32 -0700 | [diff] [blame] | 110 | } /* namespace android */ |