解码提供同步接口

Signed-off-by: yangfan <yangfan174@huawei.com>
This commit is contained in:
yangfan 2024-03-27 12:03:20 +08:00
parent 90d0b2d3b2
commit 99fa8bffae

View File

@ -3959,6 +3959,17 @@ declare namespace image {
*/
getImageInfo(index?: number): Promise<ImageInfo>;
/**
* Get image information from image source synchronously.
*
* @param { number } index - Index of sequence images. If this parameter is not specified, default value is 0.
* @returns { ImageInfo } The image information.
* @syscap SystemCapability.Multimedia.Image.ImageSource
* @crossplatform
* @since 12
*/
getImageInfoSync(index?: number): ImageInfo;
/**
* Creates a PixelMap object based on image decoding parameters. This method uses a promise to
* return the object.
@ -4049,6 +4060,17 @@ declare namespace image {
*/
createPixelMap(options: DecodingOptions, callback: AsyncCallback<PixelMap>): void;
/**
* Create a PixelMap object based on image decoding parameters synchronously.
*
* @param { DecodingOptions } options - Image decoding parameters.
* @returns { PixelMap } Return the PixelMap. If decoding fails, return undefined.
* @syscap SystemCapability.Multimedia.Image.ImageSource
* @crossplatform
* @since 12
*/
createPixelMapSync(options?: DecodingOptions): PixelMap;
/**
* Creates a PixelMap array based on image decoding parameters. This method uses a promise to
* return the array.