From fe02d8082630c45ba5055efd2846505b2826e394 Mon Sep 17 00:00:00 2001 From: Tombaugh Date: Tue, 24 Oct 2023 11:09:42 +0800 Subject: [PATCH 1/3] add packing to file interface Signed-off-by: Tombaugh --- api/@ohos.multimedia.image.d.ts | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/api/@ohos.multimedia.image.d.ts b/api/@ohos.multimedia.image.d.ts index 84d633477d..7327462ddb 100644 --- a/api/@ohos.multimedia.image.d.ts +++ b/api/@ohos.multimedia.image.d.ts @@ -3022,6 +3022,58 @@ declare namespace image { packing(source: PixelMap, option: PackingOption): Promise; /** + * Compresses or packs an image into a file and uses a callback to return the result. + * + * @param { ImageSource } source Image to be processed. + * @param { number } fd ID of a file descriptor. + * @param { PackingOption } options Options for image packing. + * @param { AsyncCallback } callback Callback used to return the operation result. + * @syscap SystemCapability.Multimedia.Image.ImagePacker + * @crossplatform + * @since 11 + */ + packingToFile(source: ImageSource, fd: number, options: PackingOption, callback: AsyncCallback): void; + + /** + * Compresses or packs an image into a file and uses a promise to return the result. + * + * @param { ImageSource } source Image to be processed. + * @param { number } fd ID of a file descriptor. + * @param { PackingOption } options Options for image packing. + * @returns { Promise } A Promise instance used to return the operation result. + * @syscap SystemCapability.Multimedia.Image.ImagePacker + * @crossplatform + * @since 11 + */ + packingToFile(source: ImageSource, fd: number, options: PackingOption): Promise; + + /** + * Compresses or packs an image into a file and uses a callback to return the result. + * + * @param { PixelMap } source PixelMap to be processed. + * @param { number } fd ID of a file descriptor. + * @param { PackingOption } options Options for image packing. + * @param { AsyncCallback } callback Callback used to return the operation result. + * @syscap SystemCapability.Multimedia.Image.ImagePacker + * @crossplatform + * @since 11 + */ + packingToFile(source: PixelMap, fd: number, options: PackingOption, callback: AsyncCallback): void; + + /** + * Compresses or packs an image into a file and uses a promise to return the result. + * + * @param { PixelMap } source PixelMap to be processed. + * @param { number } fd ID of a file descriptor. + * @param { PackingOption } options Options for image packing. + * @returns { Promise } A Promise instance used to return the operation result. + * @syscap SystemCapability.Multimedia.Image.ImagePacker + * @crossplatform + * @since 11 + */ + packingToFile(source: PixelMap, fd: number, options: PackingOption): Promise; + + /** * Releases an ImagePacker instance and uses a callback to return the result. * * @param { AsyncCallback } callback Callback to return the operation result. -- Gitee From 9c7da1cd75c434b2ebed3292412f1867542c0dc7 Mon Sep 17 00:00:00 2001 From: Tombaugh Date: Thu, 26 Oct 2023 19:37:06 +0800 Subject: [PATCH 2/3] modify packing to pack Signed-off-by: Tombaugh --- api/@ohos.multimedia.image.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/@ohos.multimedia.image.d.ts b/api/@ohos.multimedia.image.d.ts index 7327462ddb..a39fa3c322 100644 --- a/api/@ohos.multimedia.image.d.ts +++ b/api/@ohos.multimedia.image.d.ts @@ -3032,7 +3032,7 @@ declare namespace image { * @crossplatform * @since 11 */ - packingToFile(source: ImageSource, fd: number, options: PackingOption, callback: AsyncCallback): void; + packToFile(source: ImageSource, fd: number, options: PackingOption, callback: AsyncCallback): void; /** * Compresses or packs an image into a file and uses a promise to return the result. @@ -3045,7 +3045,7 @@ declare namespace image { * @crossplatform * @since 11 */ - packingToFile(source: ImageSource, fd: number, options: PackingOption): Promise; + packToFile(source: ImageSource, fd: number, options: PackingOption): Promise; /** * Compresses or packs an image into a file and uses a callback to return the result. @@ -3058,7 +3058,7 @@ declare namespace image { * @crossplatform * @since 11 */ - packingToFile(source: PixelMap, fd: number, options: PackingOption, callback: AsyncCallback): void; + packToFile(source: PixelMap, fd: number, options: PackingOption, callback: AsyncCallback): void; /** * Compresses or packs an image into a file and uses a promise to return the result. @@ -3071,7 +3071,7 @@ declare namespace image { * @crossplatform * @since 11 */ - packingToFile(source: PixelMap, fd: number, options: PackingOption): Promise; + packToFile(source: PixelMap, fd: number, options: PackingOption): Promise; /** * Releases an ImagePacker instance and uses a callback to return the result. -- Gitee From 82d6896d2b518c0198a2c14aa93167c749b2fb8b Mon Sep 17 00:00:00 2001 From: Tombaugh Date: Tue, 31 Oct 2023 11:32:49 +0800 Subject: [PATCH 3/3] remove space Signed-off-by: Tombaugh --- api/@ohos.multimedia.image.d.ts | 52 ++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/api/@ohos.multimedia.image.d.ts b/api/@ohos.multimedia.image.d.ts index a39fa3c322..c9f0c40401 100644 --- a/api/@ohos.multimedia.image.d.ts +++ b/api/@ohos.multimedia.image.d.ts @@ -3032,7 +3032,7 @@ declare namespace image { * @crossplatform * @since 11 */ - packToFile(source: ImageSource, fd: number, options: PackingOption, callback: AsyncCallback): void; + packToFile(source: ImageSource, fd: number, options: PackingOption, callback: AsyncCallback): void; /** * Compresses or packs an image into a file and uses a promise to return the result. @@ -3045,33 +3045,33 @@ declare namespace image { * @crossplatform * @since 11 */ - packToFile(source: ImageSource, fd: number, options: PackingOption): Promise; + packToFile(source: ImageSource, fd: number, options: PackingOption): Promise; - /** - * Compresses or packs an image into a file and uses a callback to return the result. - * - * @param { PixelMap } source PixelMap to be processed. - * @param { number } fd ID of a file descriptor. - * @param { PackingOption } options Options for image packing. - * @param { AsyncCallback } callback Callback used to return the operation result. - * @syscap SystemCapability.Multimedia.Image.ImagePacker - * @crossplatform - * @since 11 - */ - packToFile(source: PixelMap, fd: number, options: PackingOption, callback: AsyncCallback): void; + /** + * Compresses or packs an image into a file and uses a callback to return the result. + * + * @param { PixelMap } source PixelMap to be processed. + * @param { number } fd ID of a file descriptor. + * @param { PackingOption } options Options for image packing. + * @param { AsyncCallback } callback Callback used to return the operation result. + * @syscap SystemCapability.Multimedia.Image.ImagePacker + * @crossplatform + * @since 11 + */ + packToFile(source: PixelMap, fd: number, options: PackingOption, callback: AsyncCallback): void; - /** - * Compresses or packs an image into a file and uses a promise to return the result. - * - * @param { PixelMap } source PixelMap to be processed. - * @param { number } fd ID of a file descriptor. - * @param { PackingOption } options Options for image packing. - * @returns { Promise } A Promise instance used to return the operation result. - * @syscap SystemCapability.Multimedia.Image.ImagePacker - * @crossplatform - * @since 11 - */ - packToFile(source: PixelMap, fd: number, options: PackingOption): Promise; + /** + * Compresses or packs an image into a file and uses a promise to return the result. + * + * @param { PixelMap } source PixelMap to be processed. + * @param { number } fd ID of a file descriptor. + * @param { PackingOption } options Options for image packing. + * @returns { Promise } A Promise instance used to return the operation result. + * @syscap SystemCapability.Multimedia.Image.ImagePacker + * @crossplatform + * @since 11 + */ + packToFile(source: PixelMap, fd: number, options: PackingOption): Promise; /** * Releases an ImagePacker instance and uses a callback to return the result. -- Gitee