From 495a390932c4cb2a828da23ec73f462641df597e Mon Sep 17 00:00:00 2001 From: xuhangqi Date: Wed, 23 Jul 2025 16:50:28 +0800 Subject: [PATCH] Refactor overload ohos.effectKit Issue: https://gitee.com/openharmony/interface_sdk-js/issues/ICOBQM Signed-off-by: xuhangqi Change-Id: If0a166aacbb6ba6df35a9bae4c3611ba15e8582e --- api/@ohos.effectKit.d.ts | 100 ++++++++++++++++++++++++++++++++++----- 1 file changed, 88 insertions(+), 12 deletions(-) diff --git a/api/@ohos.effectKit.d.ts b/api/@ohos.effectKit.d.ts index 507f0c73b8..56cf776f75 100644 --- a/api/@ohos.effectKit.d.ts +++ b/api/@ohos.effectKit.d.ts @@ -94,22 +94,47 @@ declare namespace effectKit { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ blur(radius: number): Filter; + /** + * A blur effect is added to the image. + * @param { number } radius - The degree of blur, the value is measured in pixels. + * @returns { Filter } Filters for the current effect have been added. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 20 + * @arkts 1.2 + */ + blurWithRadius(radius: number): Filter; + /** * A blur effect is added to the image. * @param { number } radius - The degree of blur, the value is measured in pixels. * @param { TileMode } tileMode - The tile mode of blur. * @returns { Filter } Filters for the current effect have been added. * @syscap SystemCapability.Multimedia.Image.Core - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ blur(radius: number, tileMode: TileMode): Filter; + /** + * A blur effect is added to the image. + * @param { number } radius - The degree of blur, the value is measured in pixels. + * @param { TileMode } tileMode - The tile mode of blur. + * @returns { Filter } Filters for the current effect have been added. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 20 + * @arkts 1.2 + */ + blurWithRadiusTileMode(radius: number, tileMode: TileMode): Filter; + + /** + * @since 20 + * @arkts 1.2 + */ + overload blur { blurWithRadius, blurWithRadiusTileMode }; + /** * A Brightness effect is added to the image. * @param { number } bright - The degree of light and darkness,the value range is 0 to 1. @@ -637,11 +662,20 @@ declare namespace effectKit { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function createColorPicker(source: image.PixelMap): Promise; + /** + * Create a color picker to get color of an image. + * @param { image.PixelMap } source - the source pixelmap. + * @returns { Promise } - returns the ColorPicker generated. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 20 + * @arkts 1.2 + */ + function createColorPickerReturnPromise(source: image.PixelMap): Promise; + /** * Create a color picker to get color of an image. * @param { image.PixelMap } source - the source pixelmap. @@ -675,11 +709,22 @@ declare namespace effectKit { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ function createColorPicker(source: image.PixelMap, region: Array): Promise; + /** + * Create a color picker to get color of an image. + * @param { image.PixelMap } source - the source pixelmap. + * @param { Array } region - contains 4 elements, represents the region's left, top, right, bottom coordinates, + * default is [0, 0, 1, 1], represents the region of color picker is the whole pixelMap. + * @returns { Promise } - returns the ColorPicker generated. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 20 + * @arkts 1.2 + */ + function createColorPickerWithRegionReturnPromise(source: image.PixelMap, region: Array): Promise; + /** * Create a color picker to get color of an image. * @param { image.PixelMap } source - the source pixelmap. @@ -707,10 +752,19 @@ declare namespace effectKit { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ function createColorPicker(source: image.PixelMap, callback: AsyncCallback): void; + + /** + * Create a color picker to get color of an image. + * @param { image.PixelMap } source - the source pixelmap. + * @param { AsyncCallback } callback - the callback of createColorPicker. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 20 + * @arkts 1.2 + */ + function createColorPickerWithCallback(source: image.PixelMap, callback: AsyncCallback): void; /** * Create a color picker to get color of an image. @@ -745,11 +799,33 @@ declare namespace effectKit { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'14', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ function createColorPicker(source: image.PixelMap, region: Array, callback: AsyncCallback): void; + /** + * Create a color picker to get color of an image. + * @param { image.PixelMap } source - the source pixelmap. + * @param { Array } region - contains 4 elements, represents the region's left, top, right, bottom coordinates, + * default is [0, 0, 1, 1], represents the region of color picker is the whole pixelMap. + * @param { AsyncCallback } callback - the callback of createColorPicker. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 20 + * @arkts 1.2 + */ + function createColorPickerWithRegionCallback(source: image.PixelMap, region: Array, callback: AsyncCallback): void; + + /** + * @since 20 + * @arkts 1.2 + */ + overload createColorPicker { + createColorPickerReturnPromise, + createColorPickerWithRegionReturnPromise, + createColorPickerWithCallback, + createColorPickerWithRegionCallback + }; + /** * TileMode enumeration description * -- Gitee