161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci* Copyright (c) 2022 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci* Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci* you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci* You may obtain a copy of the License at 661847f8eSopenharmony_ci* 761847f8eSopenharmony_ci* http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci* 961847f8eSopenharmony_ci* Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci* distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci* See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci* limitations under the License. 1461847f8eSopenharmony_ci*/ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit ArkGraphics2D 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport { AsyncCallback } from './@ohos.base'; 2261847f8eSopenharmony_ciimport image from './@ohos.multimedia.image'; 2361847f8eSopenharmony_ci 2461847f8eSopenharmony_ci/** 2561847f8eSopenharmony_ci * @namespace effectKit 2661847f8eSopenharmony_ci * @since 9 2761847f8eSopenharmony_ci */ 2861847f8eSopenharmony_ci/** 2961847f8eSopenharmony_ci * @namespace effectKit 3061847f8eSopenharmony_ci * @form 3161847f8eSopenharmony_ci * @atomicservice 3261847f8eSopenharmony_ci * @since 12 3361847f8eSopenharmony_ci */ 3461847f8eSopenharmony_ci/** 3561847f8eSopenharmony_ci * @namespace effectKit 3661847f8eSopenharmony_ci * @crossplatform 3761847f8eSopenharmony_ci * @form 3861847f8eSopenharmony_ci * @atomicservice 3961847f8eSopenharmony_ci * @since 14 4061847f8eSopenharmony_ci */ 4161847f8eSopenharmony_ci 4261847f8eSopenharmony_cideclare namespace effectKit { 4361847f8eSopenharmony_ci 4461847f8eSopenharmony_ci /** 4561847f8eSopenharmony_ci * The Filter of FilterChain. 4661847f8eSopenharmony_ci * @typedef Filter 4761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 4861847f8eSopenharmony_ci * @since 9 4961847f8eSopenharmony_ci */ 5061847f8eSopenharmony_ci /** 5161847f8eSopenharmony_ci * The Filter of FilterChain. 5261847f8eSopenharmony_ci * @typedef Filter 5361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 5461847f8eSopenharmony_ci * @form 5561847f8eSopenharmony_ci * @atomicservice 5661847f8eSopenharmony_ci * @since 12 5761847f8eSopenharmony_ci */ 5861847f8eSopenharmony_ci /** 5961847f8eSopenharmony_ci * The Filter of FilterChain. 6061847f8eSopenharmony_ci * @typedef Filter 6161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 6261847f8eSopenharmony_ci * @crossplatform 6361847f8eSopenharmony_ci * @form 6461847f8eSopenharmony_ci * @atomicservice 6561847f8eSopenharmony_ci * @since 14 6661847f8eSopenharmony_ci */ 6761847f8eSopenharmony_ci interface Filter { 6861847f8eSopenharmony_ci 6961847f8eSopenharmony_ci /** 7061847f8eSopenharmony_ci * A blur effect is added to the image. 7161847f8eSopenharmony_ci * @param { number } radius - The degree of blur, the value is measured in pixels. 7261847f8eSopenharmony_ci * @returns { Filter } Filters for the current effect have been added. 7361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 7461847f8eSopenharmony_ci * @since 9 7561847f8eSopenharmony_ci */ 7661847f8eSopenharmony_ci /** 7761847f8eSopenharmony_ci * A blur effect is added to the image. 7861847f8eSopenharmony_ci * @param { number } radius - The degree of blur, the value is measured in pixels. 7961847f8eSopenharmony_ci * @returns { Filter } Filters for the current effect have been added. 8061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 8161847f8eSopenharmony_ci * @form 8261847f8eSopenharmony_ci * @atomicservice 8361847f8eSopenharmony_ci * @since 12 8461847f8eSopenharmony_ci */ 8561847f8eSopenharmony_ci /** 8661847f8eSopenharmony_ci * A blur effect is added to the image. 8761847f8eSopenharmony_ci * @param { number } radius - The degree of blur, the value is measured in pixels. 8861847f8eSopenharmony_ci * @returns { Filter } Filters for the current effect have been added. 8961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 9061847f8eSopenharmony_ci * @crossplatform 9161847f8eSopenharmony_ci * @form 9261847f8eSopenharmony_ci * @atomicservice 9361847f8eSopenharmony_ci * @since 14 9461847f8eSopenharmony_ci */ 9561847f8eSopenharmony_ci blur(radius: number): Filter; 9661847f8eSopenharmony_ci 9761847f8eSopenharmony_ci /** 9861847f8eSopenharmony_ci * A Brightness effect is added to the image. 9961847f8eSopenharmony_ci * @param { number } bright - The degree of light and darkness,the value range is 0 to 1. 10061847f8eSopenharmony_ci * @returns { Filter } Filters for the current effect have been added. 10161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 10261847f8eSopenharmony_ci * @since 9 10361847f8eSopenharmony_ci */ 10461847f8eSopenharmony_ci /** 10561847f8eSopenharmony_ci * A Brightness effect is added to the image. 10661847f8eSopenharmony_ci * @param { number } bright - The degree of light and darkness,the value range is 0 to 1. 10761847f8eSopenharmony_ci * @returns { Filter } Filters for the current effect have been added. 10861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 10961847f8eSopenharmony_ci * @form 11061847f8eSopenharmony_ci * @atomicservice 11161847f8eSopenharmony_ci * @since 12 11261847f8eSopenharmony_ci */ 11361847f8eSopenharmony_ci /** 11461847f8eSopenharmony_ci * A Brightness effect is added to the image. 11561847f8eSopenharmony_ci * @param { number } bright - The degree of light and darkness,the value range is 0 to 1. 11661847f8eSopenharmony_ci * @returns { Filter } Filters for the current effect have been added. 11761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 11861847f8eSopenharmony_ci * @crossplatform 11961847f8eSopenharmony_ci * @form 12061847f8eSopenharmony_ci * @atomicservice 12161847f8eSopenharmony_ci * @since 14 12261847f8eSopenharmony_ci */ 12361847f8eSopenharmony_ci brightness(bright: number): Filter; 12461847f8eSopenharmony_ci 12561847f8eSopenharmony_ci /** 12661847f8eSopenharmony_ci * A Grayscale effect is added to the image. 12761847f8eSopenharmony_ci * @returns { Filter } Filters for the current effect have been added. 12861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 12961847f8eSopenharmony_ci * @since 9 13061847f8eSopenharmony_ci */ 13161847f8eSopenharmony_ci /** 13261847f8eSopenharmony_ci * A Grayscale effect is added to the image. 13361847f8eSopenharmony_ci * @returns { Filter } Filters for the current effect have been added. 13461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 13561847f8eSopenharmony_ci * @form 13661847f8eSopenharmony_ci * @atomicservice 13761847f8eSopenharmony_ci * @since 12 13861847f8eSopenharmony_ci */ 13961847f8eSopenharmony_ci /** 14061847f8eSopenharmony_ci * A Grayscale effect is added to the image. 14161847f8eSopenharmony_ci * @returns { Filter } Filters for the current effect have been added. 14261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 14361847f8eSopenharmony_ci * @crossplatform 14461847f8eSopenharmony_ci * @form 14561847f8eSopenharmony_ci * @atomicservice 14661847f8eSopenharmony_ci * @since 14 14761847f8eSopenharmony_ci */ 14861847f8eSopenharmony_ci grayscale(): Filter; 14961847f8eSopenharmony_ci 15061847f8eSopenharmony_ci /** 15161847f8eSopenharmony_ci * A invert effect is added to the image. 15261847f8eSopenharmony_ci * @returns { Filter } Filters for the current effect have been added. 15361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 15461847f8eSopenharmony_ci * @since 12 15561847f8eSopenharmony_ci */ 15661847f8eSopenharmony_ci /** 15761847f8eSopenharmony_ci * A invert effect is added to the image. 15861847f8eSopenharmony_ci * @returns { Filter } Filters for the current effect have been added. 15961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 16061847f8eSopenharmony_ci * @crossplatform 16161847f8eSopenharmony_ci * @since 14 16261847f8eSopenharmony_ci */ 16361847f8eSopenharmony_ci invert(): Filter; 16461847f8eSopenharmony_ci 16561847f8eSopenharmony_ci /** 16661847f8eSopenharmony_ci * A custom effect is added to the image. 16761847f8eSopenharmony_ci * 16861847f8eSopenharmony_ci * @param { Array<number> } colorMatrix - A matrix of 5x4 size for create effect filter. 16961847f8eSopenharmony_ci * @returns { Filter } Filters for the current effect have been added. 17061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Input parameter error. 17161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 17261847f8eSopenharmony_ci * @since 12 17361847f8eSopenharmony_ci */ 17461847f8eSopenharmony_ci /** 17561847f8eSopenharmony_ci * A custom effect is added to the image. 17661847f8eSopenharmony_ci * 17761847f8eSopenharmony_ci * @param { Array<number> } colorMatrix - A matrix of 5x4 size for create effect filter. 17861847f8eSopenharmony_ci * @returns { Filter } Filters for the current effect have been added. 17961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Input parameter error. 18061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 18161847f8eSopenharmony_ci * @crossplatform 18261847f8eSopenharmony_ci * @since 14 18361847f8eSopenharmony_ci */ 18461847f8eSopenharmony_ci setColorMatrix(colorMatrix: Array<number>): Filter; 18561847f8eSopenharmony_ci 18661847f8eSopenharmony_ci /** 18761847f8eSopenharmony_ci * Gets the PixelMap where all filter effects have been added to the image. 18861847f8eSopenharmony_ci * @returns { image.PixelMap } image.PixelMap. 18961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 19061847f8eSopenharmony_ci * @since 9 19161847f8eSopenharmony_ci * @deprecated since 11 19261847f8eSopenharmony_ci * @useinstead effectKit.Filter#getEffectPixelMap 19361847f8eSopenharmony_ci */ 19461847f8eSopenharmony_ci getPixelMap(): image.PixelMap; 19561847f8eSopenharmony_ci 19661847f8eSopenharmony_ci /** 19761847f8eSopenharmony_ci * Gets the PixelMap where all filter effects have been added to the image. 19861847f8eSopenharmony_ci * @returns { Promise<image.PixelMap> } - returns the PixelMap generated. 19961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 20061847f8eSopenharmony_ci * @since 11 20161847f8eSopenharmony_ci */ 20261847f8eSopenharmony_ci /** 20361847f8eSopenharmony_ci * Gets the PixelMap where all filter effects have been added to the image. 20461847f8eSopenharmony_ci * @returns { Promise<image.PixelMap> } - returns the PixelMap generated. 20561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 20661847f8eSopenharmony_ci * @form 20761847f8eSopenharmony_ci * @atomicservice 20861847f8eSopenharmony_ci * @since 12 20961847f8eSopenharmony_ci */ 21061847f8eSopenharmony_ci /** 21161847f8eSopenharmony_ci * Gets the PixelMap where all filter effects have been added to the image. 21261847f8eSopenharmony_ci * @returns { Promise<image.PixelMap> } - returns the PixelMap generated. 21361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 21461847f8eSopenharmony_ci * @crossplatform 21561847f8eSopenharmony_ci * @form 21661847f8eSopenharmony_ci * @atomicservice 21761847f8eSopenharmony_ci * @since 14 21861847f8eSopenharmony_ci */ 21961847f8eSopenharmony_ci getEffectPixelMap(): Promise<image.PixelMap>; 22061847f8eSopenharmony_ci } 22161847f8eSopenharmony_ci 22261847f8eSopenharmony_ci /** 22361847f8eSopenharmony_ci * The color picker of an image. 22461847f8eSopenharmony_ci * @typedef ColorPicker 22561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 22661847f8eSopenharmony_ci * @since 9 22761847f8eSopenharmony_ci */ 22861847f8eSopenharmony_ci /** 22961847f8eSopenharmony_ci * The color picker of an image. 23061847f8eSopenharmony_ci * @typedef ColorPicker 23161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 23261847f8eSopenharmony_ci * @form 23361847f8eSopenharmony_ci * @atomicservice 23461847f8eSopenharmony_ci * @since 12 23561847f8eSopenharmony_ci */ 23661847f8eSopenharmony_ci /** 23761847f8eSopenharmony_ci * The color picker of an image. 23861847f8eSopenharmony_ci * @typedef ColorPicker 23961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 24061847f8eSopenharmony_ci * @crossplatform 24161847f8eSopenharmony_ci * @form 24261847f8eSopenharmony_ci * @atomicservice 24361847f8eSopenharmony_ci * @since 14 24461847f8eSopenharmony_ci */ 24561847f8eSopenharmony_ci interface ColorPicker { 24661847f8eSopenharmony_ci 24761847f8eSopenharmony_ci /** 24861847f8eSopenharmony_ci * get main color of an image 24961847f8eSopenharmony_ci * @returns { Promise<Color> } returns the MainColor generated. 25061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 25161847f8eSopenharmony_ci * @since 9 25261847f8eSopenharmony_ci */ 25361847f8eSopenharmony_ci /** 25461847f8eSopenharmony_ci * get main color of an image 25561847f8eSopenharmony_ci * @returns { Promise<Color> } returns the MainColor generated. 25661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 25761847f8eSopenharmony_ci * @form 25861847f8eSopenharmony_ci * @atomicservice 25961847f8eSopenharmony_ci * @since 12 26061847f8eSopenharmony_ci */ 26161847f8eSopenharmony_ci /** 26261847f8eSopenharmony_ci * get main color of an image 26361847f8eSopenharmony_ci * @returns { Promise<Color> } returns the MainColor generated. 26461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 26561847f8eSopenharmony_ci * @crossplatform 26661847f8eSopenharmony_ci * @form 26761847f8eSopenharmony_ci * @atomicservice 26861847f8eSopenharmony_ci * @since 14 26961847f8eSopenharmony_ci */ 27061847f8eSopenharmony_ci getMainColor(): Promise<Color>; 27161847f8eSopenharmony_ci 27261847f8eSopenharmony_ci /** 27361847f8eSopenharmony_ci * get main color of an image 27461847f8eSopenharmony_ci * @returns { Color } Main color picked in the image. 27561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 27661847f8eSopenharmony_ci * @since 9 27761847f8eSopenharmony_ci */ 27861847f8eSopenharmony_ci /** 27961847f8eSopenharmony_ci * get main color of an image 28061847f8eSopenharmony_ci * @returns { Color } Main color picked in the image. 28161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 28261847f8eSopenharmony_ci * @form 28361847f8eSopenharmony_ci * @atomicservice 28461847f8eSopenharmony_ci * @since 12 28561847f8eSopenharmony_ci */ 28661847f8eSopenharmony_ci /** 28761847f8eSopenharmony_ci * get main color of an image 28861847f8eSopenharmony_ci * @returns { Color } Main color picked in the image. 28961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 29061847f8eSopenharmony_ci * @crossplatform 29161847f8eSopenharmony_ci * @form 29261847f8eSopenharmony_ci * @atomicservice 29361847f8eSopenharmony_ci * @since 14 29461847f8eSopenharmony_ci */ 29561847f8eSopenharmony_ci getMainColorSync(): Color; 29661847f8eSopenharmony_ci 29761847f8eSopenharmony_ci /** 29861847f8eSopenharmony_ci * Get largest proportion color of an image 29961847f8eSopenharmony_ci * @returns { Color } Largest proportion color picked in the image. 30061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 30161847f8eSopenharmony_ci * @since 10 30261847f8eSopenharmony_ci */ 30361847f8eSopenharmony_ci /** 30461847f8eSopenharmony_ci * Get largest proportion color of an image 30561847f8eSopenharmony_ci * @returns { Color } Largest proportion color picked in the image. 30661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 30761847f8eSopenharmony_ci * @form 30861847f8eSopenharmony_ci * @atomicservice 30961847f8eSopenharmony_ci * @since 12 31061847f8eSopenharmony_ci */ 31161847f8eSopenharmony_ci /** 31261847f8eSopenharmony_ci * Get largest proportion color of an image 31361847f8eSopenharmony_ci * @returns { Color } Largest proportion color picked in the image. 31461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 31561847f8eSopenharmony_ci * @crossplatform 31661847f8eSopenharmony_ci * @form 31761847f8eSopenharmony_ci * @atomicservice 31861847f8eSopenharmony_ci * @since 14 31961847f8eSopenharmony_ci */ 32061847f8eSopenharmony_ci getLargestProportionColor(): Color; 32161847f8eSopenharmony_ci 32261847f8eSopenharmony_ci /** 32361847f8eSopenharmony_ci * Get top proportion color of an image 32461847f8eSopenharmony_ci * @param { number } colorCount - The number of colors to require, the value is 1 to 10. 32561847f8eSopenharmony_ci * @returns { Array<Color | null> } An array of feature colors sorted by proportion, with a size equal to 32661847f8eSopenharmony_ci * the minimum of colorCount and the actual number of extracted feature colors. 32761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 32861847f8eSopenharmony_ci * @form 32961847f8eSopenharmony_ci * @atomicservice 33061847f8eSopenharmony_ci * @since 12 33161847f8eSopenharmony_ci */ 33261847f8eSopenharmony_ci /** 33361847f8eSopenharmony_ci * Get top proportion color of an image 33461847f8eSopenharmony_ci * @param { number } colorCount - The number of colors to require, the value is 1 to 10. 33561847f8eSopenharmony_ci * @returns { Array<Color | null> } An array of feature colors sorted by proportion, with a size equal to 33661847f8eSopenharmony_ci * the minimum of colorCount and the actual number of extracted feature colors. 33761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 33861847f8eSopenharmony_ci * @crossplatform 33961847f8eSopenharmony_ci * @form 34061847f8eSopenharmony_ci * @atomicservice 34161847f8eSopenharmony_ci * @since 14 34261847f8eSopenharmony_ci */ 34361847f8eSopenharmony_ci getTopProportionColors(colorCount: number): Array<Color | null>; 34461847f8eSopenharmony_ci 34561847f8eSopenharmony_ci /** 34661847f8eSopenharmony_ci * Get highest saturation color of an image 34761847f8eSopenharmony_ci * @returns { Color } Highest saturation color picked in the image. 34861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 34961847f8eSopenharmony_ci * @since 10 35061847f8eSopenharmony_ci */ 35161847f8eSopenharmony_ci /** 35261847f8eSopenharmony_ci * Get highest saturation color of an image 35361847f8eSopenharmony_ci * @returns { Color } Highest saturation color picked in the image. 35461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 35561847f8eSopenharmony_ci * @form 35661847f8eSopenharmony_ci * @atomicservice 35761847f8eSopenharmony_ci * @since 12 35861847f8eSopenharmony_ci */ 35961847f8eSopenharmony_ci /** 36061847f8eSopenharmony_ci * Get highest saturation color of an image 36161847f8eSopenharmony_ci * @returns { Color } Highest saturation color picked in the image. 36261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 36361847f8eSopenharmony_ci * @crossplatform 36461847f8eSopenharmony_ci * @form 36561847f8eSopenharmony_ci * @atomicservice 36661847f8eSopenharmony_ci * @since 14 36761847f8eSopenharmony_ci */ 36861847f8eSopenharmony_ci getHighestSaturationColor(): Color; 36961847f8eSopenharmony_ci 37061847f8eSopenharmony_ci /** 37161847f8eSopenharmony_ci * Get average color of an image 37261847f8eSopenharmony_ci * @returns { Color } Average color calculated in the image. 37361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 37461847f8eSopenharmony_ci * @since 10 37561847f8eSopenharmony_ci */ 37661847f8eSopenharmony_ci /** 37761847f8eSopenharmony_ci * Get average color of an image 37861847f8eSopenharmony_ci * @returns { Color } Average color calculated in the image. 37961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 38061847f8eSopenharmony_ci * @form 38161847f8eSopenharmony_ci * @atomicservice 38261847f8eSopenharmony_ci * @since 12 38361847f8eSopenharmony_ci */ 38461847f8eSopenharmony_ci /** 38561847f8eSopenharmony_ci * Get average color of an image 38661847f8eSopenharmony_ci * @returns { Color } Average color calculated in the image. 38761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 38861847f8eSopenharmony_ci * @crossplatform 38961847f8eSopenharmony_ci * @form 39061847f8eSopenharmony_ci * @atomicservice 39161847f8eSopenharmony_ci * @since 14 39261847f8eSopenharmony_ci */ 39361847f8eSopenharmony_ci getAverageColor(): Color; 39461847f8eSopenharmony_ci 39561847f8eSopenharmony_ci /** 39661847f8eSopenharmony_ci * Determine whether the color is black or white or gray 39761847f8eSopenharmony_ci * @param { number } color - The 32 bit ARGB color to discriminate. 39861847f8eSopenharmony_ci * @returns { boolean } Result of judging black, white and gray. 39961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 40061847f8eSopenharmony_ci * @since 10 40161847f8eSopenharmony_ci */ 40261847f8eSopenharmony_ci /** 40361847f8eSopenharmony_ci * Determine whether the color is black or white or gray 40461847f8eSopenharmony_ci * @param { number } color - The 32 bit ARGB color to discriminate. 40561847f8eSopenharmony_ci * @returns { boolean } Result of judging black, white and gray. 40661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 40761847f8eSopenharmony_ci * @form 40861847f8eSopenharmony_ci * @atomicservice 40961847f8eSopenharmony_ci * @since 12 41061847f8eSopenharmony_ci */ 41161847f8eSopenharmony_ci /** 41261847f8eSopenharmony_ci * Determine whether the color is black or white or gray 41361847f8eSopenharmony_ci * @param { number } color - The 32 bit ARGB color to discriminate. 41461847f8eSopenharmony_ci * @returns { boolean } Result of judging black, white and gray. 41561847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 41661847f8eSopenharmony_ci * @crossplatform 41761847f8eSopenharmony_ci * @form 41861847f8eSopenharmony_ci * @atomicservice 41961847f8eSopenharmony_ci * @since 14 42061847f8eSopenharmony_ci */ 42161847f8eSopenharmony_ci isBlackOrWhiteOrGrayColor(color: number): boolean; 42261847f8eSopenharmony_ci } 42361847f8eSopenharmony_ci 42461847f8eSopenharmony_ci /** 42561847f8eSopenharmony_ci * The color param. 42661847f8eSopenharmony_ci * @typedef Color 42761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 42861847f8eSopenharmony_ci * @since 9 42961847f8eSopenharmony_ci */ 43061847f8eSopenharmony_ci /** 43161847f8eSopenharmony_ci * The color param. 43261847f8eSopenharmony_ci * @typedef Color 43361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 43461847f8eSopenharmony_ci * @form 43561847f8eSopenharmony_ci * @atomicservice 43661847f8eSopenharmony_ci * @since 12 43761847f8eSopenharmony_ci */ 43861847f8eSopenharmony_ci /** 43961847f8eSopenharmony_ci * The color param. 44061847f8eSopenharmony_ci * @typedef Color 44161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 44261847f8eSopenharmony_ci * @crossplatform 44361847f8eSopenharmony_ci * @form 44461847f8eSopenharmony_ci * @atomicservice 44561847f8eSopenharmony_ci * @since 14 44661847f8eSopenharmony_ci */ 44761847f8eSopenharmony_ci interface Color { 44861847f8eSopenharmony_ci 44961847f8eSopenharmony_ci /** 45061847f8eSopenharmony_ci * Red 45161847f8eSopenharmony_ci * @type { number } 45261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 45361847f8eSopenharmony_ci * @since 9 45461847f8eSopenharmony_ci */ 45561847f8eSopenharmony_ci /** 45661847f8eSopenharmony_ci * Red 45761847f8eSopenharmony_ci * @type { number } 45861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 45961847f8eSopenharmony_ci * @form 46061847f8eSopenharmony_ci * @atomicservice 46161847f8eSopenharmony_ci * @since 12 46261847f8eSopenharmony_ci */ 46361847f8eSopenharmony_ci /** 46461847f8eSopenharmony_ci * Red 46561847f8eSopenharmony_ci * @type { number } 46661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 46761847f8eSopenharmony_ci * @crossplatform 46861847f8eSopenharmony_ci * @form 46961847f8eSopenharmony_ci * @atomicservice 47061847f8eSopenharmony_ci * @since 14 47161847f8eSopenharmony_ci */ 47261847f8eSopenharmony_ci red: number; 47361847f8eSopenharmony_ci 47461847f8eSopenharmony_ci /** 47561847f8eSopenharmony_ci * Green 47661847f8eSopenharmony_ci * @type { number } 47761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 47861847f8eSopenharmony_ci * @since 9 47961847f8eSopenharmony_ci */ 48061847f8eSopenharmony_ci /** 48161847f8eSopenharmony_ci * Green 48261847f8eSopenharmony_ci * @type { number } 48361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 48461847f8eSopenharmony_ci * @form 48561847f8eSopenharmony_ci * @atomicservice 48661847f8eSopenharmony_ci * @since 12 48761847f8eSopenharmony_ci */ 48861847f8eSopenharmony_ci /** 48961847f8eSopenharmony_ci * Green 49061847f8eSopenharmony_ci * @type { number } 49161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 49261847f8eSopenharmony_ci * @crossplatform 49361847f8eSopenharmony_ci * @form 49461847f8eSopenharmony_ci * @atomicservice 49561847f8eSopenharmony_ci * @since 14 49661847f8eSopenharmony_ci */ 49761847f8eSopenharmony_ci green: number; 49861847f8eSopenharmony_ci 49961847f8eSopenharmony_ci /** 50061847f8eSopenharmony_ci * Blue 50161847f8eSopenharmony_ci * @type { number } 50261847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 50361847f8eSopenharmony_ci * @since 9 50461847f8eSopenharmony_ci */ 50561847f8eSopenharmony_ci /** 50661847f8eSopenharmony_ci * Blue 50761847f8eSopenharmony_ci * @type { number } 50861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 50961847f8eSopenharmony_ci * @form 51061847f8eSopenharmony_ci * @atomicservice 51161847f8eSopenharmony_ci * @since 12 51261847f8eSopenharmony_ci */ 51361847f8eSopenharmony_ci /** 51461847f8eSopenharmony_ci * Blue 51561847f8eSopenharmony_ci * @type { number } 51661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 51761847f8eSopenharmony_ci * @crossplatform 51861847f8eSopenharmony_ci * @form 51961847f8eSopenharmony_ci * @atomicservice 52061847f8eSopenharmony_ci * @since 14 52161847f8eSopenharmony_ci */ 52261847f8eSopenharmony_ci blue: number; 52361847f8eSopenharmony_ci 52461847f8eSopenharmony_ci /** 52561847f8eSopenharmony_ci * Alpha 52661847f8eSopenharmony_ci * @type { number } 52761847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 52861847f8eSopenharmony_ci * @since 9 52961847f8eSopenharmony_ci */ 53061847f8eSopenharmony_ci /** 53161847f8eSopenharmony_ci * Alpha 53261847f8eSopenharmony_ci * @type { number } 53361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 53461847f8eSopenharmony_ci * @form 53561847f8eSopenharmony_ci * @atomicservice 53661847f8eSopenharmony_ci * @since 12 53761847f8eSopenharmony_ci */ 53861847f8eSopenharmony_ci /** 53961847f8eSopenharmony_ci * Alpha 54061847f8eSopenharmony_ci * @type { number } 54161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 54261847f8eSopenharmony_ci * @crossplatform 54361847f8eSopenharmony_ci * @form 54461847f8eSopenharmony_ci * @atomicservice 54561847f8eSopenharmony_ci * @since 14 54661847f8eSopenharmony_ci */ 54761847f8eSopenharmony_ci alpha: number; 54861847f8eSopenharmony_ci } 54961847f8eSopenharmony_ci 55061847f8eSopenharmony_ci /** 55161847f8eSopenharmony_ci * Create a FilterChain to add multiple effects to an image. 55261847f8eSopenharmony_ci * @param { image.PixelMap } source - the source pixelmap. 55361847f8eSopenharmony_ci * @returns { Filter } Returns the head node of FilterChain. 55461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 55561847f8eSopenharmony_ci * @since 9 55661847f8eSopenharmony_ci */ 55761847f8eSopenharmony_ci /** 55861847f8eSopenharmony_ci * Create a FilterChain to add multiple effects to an image. 55961847f8eSopenharmony_ci * @param { image.PixelMap } source - the source pixelmap. 56061847f8eSopenharmony_ci * @returns { Filter } Returns the head node of FilterChain. 56161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 56261847f8eSopenharmony_ci * @form 56361847f8eSopenharmony_ci * @atomicservice 56461847f8eSopenharmony_ci * @since 12 56561847f8eSopenharmony_ci */ 56661847f8eSopenharmony_ci /** 56761847f8eSopenharmony_ci * Create a FilterChain to add multiple effects to an image. 56861847f8eSopenharmony_ci * @param { image.PixelMap } source - the source pixelmap. 56961847f8eSopenharmony_ci * @returns { Filter } Returns the head node of FilterChain. 57061847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 57161847f8eSopenharmony_ci * @crossplatform 57261847f8eSopenharmony_ci * @form 57361847f8eSopenharmony_ci * @atomicservice 57461847f8eSopenharmony_ci * @since 14 57561847f8eSopenharmony_ci */ 57661847f8eSopenharmony_ci function createEffect(source: image.PixelMap): Filter; 57761847f8eSopenharmony_ci 57861847f8eSopenharmony_ci /** 57961847f8eSopenharmony_ci * Create a color picker to get color of an image. 58061847f8eSopenharmony_ci * @param { image.PixelMap } source - the source pixelmap. 58161847f8eSopenharmony_ci * @returns { Promise<ColorPicker> } - returns the ColorPicker generated. 58261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Input parameter error. 58361847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 58461847f8eSopenharmony_ci * @since 9 58561847f8eSopenharmony_ci */ 58661847f8eSopenharmony_ci /** 58761847f8eSopenharmony_ci * Create a color picker to get color of an image. 58861847f8eSopenharmony_ci * @param { image.PixelMap } source - the source pixelmap. 58961847f8eSopenharmony_ci * @returns { Promise<ColorPicker> } - returns the ColorPicker generated. 59061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Input parameter error. 59161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 59261847f8eSopenharmony_ci * @form 59361847f8eSopenharmony_ci * @atomicservice 59461847f8eSopenharmony_ci * @since 12 59561847f8eSopenharmony_ci */ 59661847f8eSopenharmony_ci /** 59761847f8eSopenharmony_ci * Create a color picker to get color of an image. 59861847f8eSopenharmony_ci * @param { image.PixelMap } source - the source pixelmap. 59961847f8eSopenharmony_ci * @returns { Promise<ColorPicker> } - returns the ColorPicker generated. 60061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Input parameter error. 60161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 60261847f8eSopenharmony_ci * @crossplatform 60361847f8eSopenharmony_ci * @form 60461847f8eSopenharmony_ci * @atomicservice 60561847f8eSopenharmony_ci * @since 14 60661847f8eSopenharmony_ci */ 60761847f8eSopenharmony_ci function createColorPicker(source: image.PixelMap): Promise<ColorPicker>; 60861847f8eSopenharmony_ci 60961847f8eSopenharmony_ci /** 61061847f8eSopenharmony_ci * Create a color picker to get color of an image. 61161847f8eSopenharmony_ci * @param { image.PixelMap } source - the source pixelmap. 61261847f8eSopenharmony_ci * @param { Array<number> } region - contains 4 elements, represents the region's left, top, right, bottom coordinates, 61361847f8eSopenharmony_ci * default is [0, 0, 1, 1], represents the region of color picker is the whole pixelMap. 61461847f8eSopenharmony_ci * @returns { Promise<ColorPicker> } - returns the ColorPicker generated. 61561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Input parameter error. 61661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 61761847f8eSopenharmony_ci * @since 10 61861847f8eSopenharmony_ci */ 61961847f8eSopenharmony_ci /** 62061847f8eSopenharmony_ci * Create a color picker to get color of an image. 62161847f8eSopenharmony_ci * @param { image.PixelMap } source - the source pixelmap. 62261847f8eSopenharmony_ci * @param { Array<number> } region - contains 4 elements, represents the region's left, top, right, bottom coordinates, 62361847f8eSopenharmony_ci * default is [0, 0, 1, 1], represents the region of color picker is the whole pixelMap. 62461847f8eSopenharmony_ci * @returns { Promise<ColorPicker> } - returns the ColorPicker generated. 62561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Input parameter error. 62661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 62761847f8eSopenharmony_ci * @form 62861847f8eSopenharmony_ci * @atomicservice 62961847f8eSopenharmony_ci * @since 12 63061847f8eSopenharmony_ci */ 63161847f8eSopenharmony_ci /** 63261847f8eSopenharmony_ci * Create a color picker to get color of an image. 63361847f8eSopenharmony_ci * @param { image.PixelMap } source - the source pixelmap. 63461847f8eSopenharmony_ci * @param { Array<number> } region - contains 4 elements, represents the region's left, top, right, bottom coordinates, 63561847f8eSopenharmony_ci * default is [0, 0, 1, 1], represents the region of color picker is the whole pixelMap. 63661847f8eSopenharmony_ci * @returns { Promise<ColorPicker> } - returns the ColorPicker generated. 63761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Input parameter error. 63861847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 63961847f8eSopenharmony_ci * @crossplatform 64061847f8eSopenharmony_ci * @form 64161847f8eSopenharmony_ci * @atomicservice 64261847f8eSopenharmony_ci * @since 14 64361847f8eSopenharmony_ci */ 64461847f8eSopenharmony_ci function createColorPicker(source: image.PixelMap, region: Array<number>): Promise<ColorPicker>; 64561847f8eSopenharmony_ci 64661847f8eSopenharmony_ci /** 64761847f8eSopenharmony_ci * Create a color picker to get color of an image. 64861847f8eSopenharmony_ci * @param { image.PixelMap } source - the source pixelmap. 64961847f8eSopenharmony_ci * @param { AsyncCallback<ColorPicker> } callback - the callback of createColorPicker. 65061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Input parameter error. 65161847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 65261847f8eSopenharmony_ci * @since 9 65361847f8eSopenharmony_ci */ 65461847f8eSopenharmony_ci /** 65561847f8eSopenharmony_ci * Create a color picker to get color of an image. 65661847f8eSopenharmony_ci * @param { image.PixelMap } source - the source pixelmap. 65761847f8eSopenharmony_ci * @param { AsyncCallback<ColorPicker> } callback - the callback of createColorPicker. 65861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Input parameter error. 65961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 66061847f8eSopenharmony_ci * @form 66161847f8eSopenharmony_ci * @atomicservice 66261847f8eSopenharmony_ci * @since 12 66361847f8eSopenharmony_ci */ 66461847f8eSopenharmony_ci /** 66561847f8eSopenharmony_ci * Create a color picker to get color of an image. 66661847f8eSopenharmony_ci * @param { image.PixelMap } source - the source pixelmap. 66761847f8eSopenharmony_ci * @param { AsyncCallback<ColorPicker> } callback - the callback of createColorPicker. 66861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Input parameter error. 66961847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 67061847f8eSopenharmony_ci * @crossplatform 67161847f8eSopenharmony_ci * @form 67261847f8eSopenharmony_ci * @atomicservice 67361847f8eSopenharmony_ci * @since 14 67461847f8eSopenharmony_ci */ 67561847f8eSopenharmony_ci function createColorPicker(source: image.PixelMap, callback: AsyncCallback<ColorPicker>): void; 67661847f8eSopenharmony_ci 67761847f8eSopenharmony_ci /** 67861847f8eSopenharmony_ci * Create a color picker to get color of an image. 67961847f8eSopenharmony_ci * @param { image.PixelMap } source - the source pixelmap. 68061847f8eSopenharmony_ci * @param { Array<number> } region - contains 4 elements, represents the region's left, top, right, bottom coordinates, 68161847f8eSopenharmony_ci * default is [0, 0, 1, 1], represents the region of color picker is the whole pixelMap. 68261847f8eSopenharmony_ci * @param { AsyncCallback<ColorPicker> } callback - the callback of createColorPicker. 68361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Input parameter error. 68461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 68561847f8eSopenharmony_ci * @since 10 68661847f8eSopenharmony_ci */ 68761847f8eSopenharmony_ci /** 68861847f8eSopenharmony_ci * Create a color picker to get color of an image. 68961847f8eSopenharmony_ci * @param { image.PixelMap } source - the source pixelmap. 69061847f8eSopenharmony_ci * @param { Array<number> } region - contains 4 elements, represents the region's left, top, right, bottom coordinates, 69161847f8eSopenharmony_ci * default is [0, 0, 1, 1], represents the region of color picker is the whole pixelMap. 69261847f8eSopenharmony_ci * @param { AsyncCallback<ColorPicker> } callback - the callback of createColorPicker. 69361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Input parameter error. 69461847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 69561847f8eSopenharmony_ci * @form 69661847f8eSopenharmony_ci * @atomicservice 69761847f8eSopenharmony_ci * @since 12 69861847f8eSopenharmony_ci */ 69961847f8eSopenharmony_ci /** 70061847f8eSopenharmony_ci * Create a color picker to get color of an image. 70161847f8eSopenharmony_ci * @param { image.PixelMap } source - the source pixelmap. 70261847f8eSopenharmony_ci * @param { Array<number> } region - contains 4 elements, represents the region's left, top, right, bottom coordinates, 70361847f8eSopenharmony_ci * default is [0, 0, 1, 1], represents the region of color picker is the whole pixelMap. 70461847f8eSopenharmony_ci * @param { AsyncCallback<ColorPicker> } callback - the callback of createColorPicker. 70561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Input parameter error. 70661847f8eSopenharmony_ci * @syscap SystemCapability.Multimedia.Image.Core 70761847f8eSopenharmony_ci * @crossplatform 70861847f8eSopenharmony_ci * @form 70961847f8eSopenharmony_ci * @atomicservice 71061847f8eSopenharmony_ci * @since 14 71161847f8eSopenharmony_ci */ 71261847f8eSopenharmony_ci function createColorPicker(source: image.PixelMap, region: Array<number>, callback: AsyncCallback<ColorPicker>): void; 71361847f8eSopenharmony_ci} 71461847f8eSopenharmony_ci 71561847f8eSopenharmony_ciexport default effectKit; 716