From 5050897fc701829f4d64b42005dc9d207b53a654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=91=E5=B1=91=E5=B1=91?= Date: Wed, 18 Jun 2025 17:09:39 +0800 Subject: [PATCH] sync code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 屑屑屑 --- api/@ohos.multimedia.image.d.ts | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/api/@ohos.multimedia.image.d.ts b/api/@ohos.multimedia.image.d.ts index e28cf177b2..65779cca79 100644 --- a/api/@ohos.multimedia.image.d.ts +++ b/api/@ohos.multimedia.image.d.ts @@ -4765,6 +4765,44 @@ declare namespace image { */ function createPixelMapSync(colors: ArrayBuffer, options: InitializationOptions): PixelMap; + /** + * Create pixelmap by data buffer based on opts, the memory type used by the PixelMap can be specified + * by allocatorType. By default, the system selects the memory type based on the image type, image size, + * platform capability, etc. When processing the PixelMap returned by this interface, please always + * consider the impact of stride. + * + * @param { ArrayBuffer } colors The image color buffer. + * @param { InitializationOptions } options Initialization options for pixelmap. + * @param { AllocatorType } allocatorType Indicate which memory type will be used by the returned PixelMap. + * @returns { Promise } A Promise instance used to return the PixelMap object. + * @throws { BusinessError } 7600201 - Unsupported operation. + * @throws { BusinessError } 7600301 - Memory alloc failed. + * @throws { BusinessError } 7600302 - Memory copy failed. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 20 + */ + function createPixelMapUsingAllocator(colors: ArrayBuffer, options: InitializationOptions, + allocatorType?: AllocatorType): Promise; + + /** + * Create pixelmap by data buffer based on opts, the memory type used by the PixelMap can be specified + * by allocatorType. By default, the system selects the memory type based on the image type, image size, + * platform capability, etc. When processing the PixelMap returned by this interface, please always + * consider the impact of stride. + * + * @param { ArrayBuffer } colors The image color buffer. + * @param { InitializationOptions } options Initialization options for pixelmap. + * @param { AllocatorType } allocatorType Indicate which memory type will be used by the returned PixelMap. + * @returns { PixelMap } Returns the instance if the operation is successful;Otherwise, return undefined. + * @throws { BusinessError } 7600201 - Unsupported operation. + * @throws { BusinessError } 7600301 - Memory alloc failed. + * @throws { BusinessError } 7600302 - Memory copy failed. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 20 + */ + function createPixelMapUsingAllocatorSync(colors: ArrayBuffer, options: InitializationOptions, + allocatorType?: AllocatorType): PixelMap; + /** * Create an empty pixelmap. * @@ -4778,6 +4816,22 @@ declare namespace image { */ function createPixelMapSync(options: InitializationOptions): PixelMap; + /** + * Create an empty pixelmap by data buffer based on opts, the memory type used by the PixelMap can be specified + * by allocatorType. By default, the system selects the memory type based on the image type, image size, + * platform capability, etc. When processing the PixelMap returned by this interface, please always + * consider the impact of stride. + * + * @param { InitializationOptions } options Initialization options for pixelmap. + * @param { AllocatorType } allocatorType Indicate which memory type will be used by the returned PixelMap. + * @returns { PixelMap } Returns the instance if the operation is successful;Otherwise, return undefined. + * @throws { BusinessError } 7600201 - Unsupported operation. + * @throws { BusinessError } 7600301 - Memory alloc failed. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 20 + */ + function createPixelMapUsingAllocatorSync(options: InitializationOptions, allocatorType?: AllocatorType): PixelMap; + /** * Transforms pixelmap from unpremultiplied alpha format to premultiplied alpha format. * -- Gitee