1/* 2* Copyright (C) 2024 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/** 17 * @file 18 * @kit ArkGraphics2D 19 */ 20 21import lang from '../arkts/@arkts.lang'; 22import collections from '../arkts/@arkts.collections'; 23import colorSpaceManager from '@ohos.graphics.colorSpaceManager'; 24 25/** 26 * Color space manager. 27 * 28 * @namespace sendableColorSpaceManager 29 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core 30 * @crossplatform 31 * @since 12 32 */ 33declare namespace sendableColorSpaceManager { 34 /** 35 * Redefines ISendable for convenience. 36 * 37 * @typedef { lang.ISendable } ISendable 38 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core 39 * @crossplatform 40 * @since 12 41 */ 42 type ISendable = lang.ISendable; 43 /** 44 * Defines a color space object and manages its key information 45 * @interface ColorSpaceManager 46 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core 47 * @crossplatform 48 * @since 12 49 */ 50 interface ColorSpaceManager extends ISendable { 51 /** 52 * Get the name of color space type. 53 * @returns { colorSpaceManager.ColorSpace } Returns the name of color space type. 54 * @throws { BusinessError } 18600001 - Parameter value is abnormal. 55 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core 56 * @crossplatform 57 * @since 12 58 */ 59 getColorSpaceName(): colorSpaceManager.ColorSpace; 60 61 /** 62 * Get white point(x, y) of color space. 63 * @returns { collections.Array<number> } Returns the white point value of color space. 64 * @throws { BusinessError } 18600001 - Parameter value is abnormal. 65 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core 66 * @crossplatform 67 * @since 12 68 */ 69 getWhitePoint(): collections.Array<number>; 70 71 /** 72 * Get gamma value of color space. 73 * @returns { number } Returns the gamma value of color space. 74 * @throws { BusinessError } 18600001 - Parameter value is abnormal. 75 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core 76 * @crossplatform 77 * @since 12 78 */ 79 getGamma(): number; 80 } 81 82 /** 83 * Create a color space manager by provided color space type. 84 * @param { colorSpaceManager.ColorSpace } colorSpaceName - Indicates the type of color space 85 * @returns { ColorSpaceManager } Returns a color space manager object created by provided type. 86 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1.Incorrect parameter type. 87 * 2.Parameter verification failed. 88 * @throws { BusinessError } 18600001 - Parameter value is abnormal. 89 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core 90 * @crossplatform 91 * @since 12 92 */ 93 function create(colorSpaceName: colorSpaceManager.ColorSpace): ColorSpaceManager; 94 95 /** 96 * Create a customized color space manager by its color primaries and gamma value 97 * @param { colorSpaceManager.ColorSpacePrimaries } primaries - Indicates the customized color primaries 98 * @param { number } gamma - Indicates display gamma value 99 * @returns { ColorSpaceManager } Returns a color space manager object created by customized parameters. 100 * @throws { BusinessError } 401 - Parameter error. Possible cause: 1.Incorrect parameter type. 101 * 2.Parameter verification failed. 102 * @throws { BusinessError } 18600001 - Parameter value is abnormal. 103 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core 104 * @crossplatform 105 * @since 12 106 */ 107 function create(primaries: colorSpaceManager.ColorSpacePrimaries, gamma: number): ColorSpaceManager; 108} 109 110export default sendableColorSpaceManager;