1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef COLORSPACECONVERTOR 17 #define COLORSPACECONVERTOR 18 19 #include "color_space.h" 20 21 namespace OHOS { 22 namespace ColorManager { 23 class ColorSpaceConvertor { 24 public: 25 ColorSpaceConvertor(const ColorSpace &src, const ColorSpace &dst, GamutMappingMode mappingMode); 26 GetSrcColorSpace()27 ColorSpace GetSrcColorSpace() const 28 { 29 return srcColorSpace; 30 } 31 GetDstColorSpace()32 ColorSpace GetDstColorSpace() const 33 { 34 return dstColorSpace; 35 } 36 GetTransform()37 Matrix3x3 GetTransform() const 38 { 39 return transferMatrix; 40 } 41 42 Vector3 Convert(const Vector3& v) const; 43 Vector3 ConvertLinear(const Vector3& v) const; 44 45 private: 46 ColorSpace srcColorSpace; 47 ColorSpace dstColorSpace; 48 [[maybe_unused]]GamutMappingMode mappingMode; 49 Matrix3x3 transferMatrix; 50 }; 51 } // namespace ColorManager 52 } // namespace OHOS 53 #endif