diff --git a/api/@ohos.multimedia.image.d.ts b/api/@ohos.multimedia.image.d.ts index e9e9f3662902313e735311e2a4f0a2c577fc3968..4a13cfca804e220d93a9058edba6838ae64c99b3 100644 --- a/api/@ohos.multimedia.image.d.ts +++ b/api/@ohos.multimedia.image.d.ts @@ -5348,11 +5348,22 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise; + /** + * Obtains the hdr pixel map. This method uses a promise to return the PixelMap object. + * + * @returns { Promise } A Promise instance used to return the PixelMap object. + * @throws { BusinessError } 7600901 - Unknown error. + * @throws { BusinessError } 7600201 - Unsupported operation. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 22 + * @arkts 1.2 + */ + getHdrComposedPixelmap(): Promise; + /** * Obtains the gain map pixel map. * @returns { PixelMap | null } Returns the pixel map if the operation is successful; returns null otherwise. @@ -7590,10 +7729,21 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise + getMetadata(metadataType: MetadataType): Promise; + + /** + * Obtains the metadata of main picture. + * + * @param { MetadataType } metadataType The type of metadata. + * @returns { Promise } Return the metadata of main picture. + * @throws { BusinessError } 7600202 - Unsupported metadata. Possible causes: Unsupported metadata type. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 22 + * @arkts 1.2 + */ + getMetadata(metadataType: MetadataType): Promise; /** * Marshalling picture and write into MessageSequence. @@ -7709,21 +7859,40 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } A Promise instance used to return the pixel map data. * @syscap SystemCapability.Multimedia.Image.Core - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ readPixelsToBuffer(): Promise; + /** + * Reads image pixel map data and writes the data to an ArrayBuffer. This method uses + * a promise to return the result. + * + * @returns { Promise } A Promise instance used to return the pixel map data. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 22 + * @arkts 1.2 + */ + readPixelsToBuffer(): Promise; + /** * Obtains the type of auxiliary picture. * * @returns { AuxiliaryPictureType } Returns the type of auxiliary picture. * @syscap SystemCapability.Multimedia.Image.Core - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ getType(): AuxiliaryPictureType; + /** + * Obtains the type of auxiliary picture. + * + * @returns { AuxiliaryPictureType | undefined } Returns the type of auxiliary picture. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 22 + * @arkts 1.2 + */ + getType(): AuxiliaryPictureType | undefined; + /** * Set the metadata of auxiliary picture. * @@ -7750,10 +7919,22 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise; + + /** + * Obtains the metadata of auxiliary picture. + * + * @param { MetadataType } metadataType The type of metadata. + * @returns { Promise } Return the metadata of auxiliary picture. + * @throws { BusinessError } 7600202 - Unsupported metadata. Possible causes: 1. Unsupported metadata type. 2. The + * metadata type does not match the auxiliary picture type. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 22 + * @arkts 1.2 */ - getMetadata(metadataType: MetadataType): Promise + getMetadata(metadataType: MetadataType): Promise; /** * Obtains the information about this auxiliary picture. @@ -7761,11 +7942,21 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise> } Array of Records instance used to return the property values. * @syscap SystemCapability.Multimedia.Image.Core - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 + */ + getAllProperties(): Promise>; + + /** + * Obtains the value of all properties in an image. This method uses a promise to return the property values + * in array of records. + * + * @returns { Promise | undefined> } Array of Records instance used to + * return the property values. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 22 + * @arkts 1.2 */ - getAllProperties(): Promise> + getAllProperties(): Promise | undefined>; /** * Obtains a clone of metadata. This method uses a promise to return the metadata. * * @returns { Promise } A Promise instance used to return the metadata. * @syscap SystemCapability.Multimedia.Image.Core - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ - clone(): Promise + clone(): Promise; + + /** + * Obtains a clone of metadata. This method uses a promise to return the metadata. + * + * @returns { Promise } A Promise instance used to return the metadata. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 22 + * @arkts 1.2 + */ + clone(): Promise; } /** @@ -8183,11 +8394,22 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise): void; + /** + * Obtains information about an image with the specified sequence number and uses a callback + * to return the result. + * + * @param { int } index Sequence number of an image. + * @param { AsyncCallback } callback Callback used to return the image information. + * @syscap SystemCapability.Multimedia.Image.ImageSource + * @since 22 + * @arkts 1.2 + */ + getImageInfo(index: int, callback: AsyncCallback): void; + /** * Obtains information about this image and uses a callback to return the result. * @@ -8220,11 +8442,20 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise): void; + /** + * Obtains information about this image and uses a callback to return the result. + * + * @param { AsyncCallback } callback Callback used to return the image information. + * @syscap SystemCapability.Multimedia.Image.ImageSource + * @since 22 + * @arkts 1.2 + */ + getImageInfo(callback: AsyncCallback): void; + /** * Get image information from image source. * @@ -8269,11 +8500,22 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise; + /** + * Get image information from image source. + * + * @param { int } [index] Sequence number of an image. + * If this parameter is not specified, the default value 0 is used. + * @returns { Promise } A Promise instance used to return the image information. + * @syscap SystemCapability.Multimedia.Image.ImageSource + * @since 22 + * @arkts 1.2 + */ + getImageInfo(index?: int): Promise; + /** * Get image information from image source synchronously. * @@ -8283,11 +8525,21 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise; + /** + * Creates a PixelMap object based on image decoding parameters. This method uses a promise to + * return the object. + * + * @param { DecodingOptions } [options] Image decoding parameters. + * @returns { Promise } A Promise instance used to return the PixelMap object. + * @syscap SystemCapability.Multimedia.Image.ImageSource + * @since 22 + * @arkts 1.2 + */ + createPixelMap(options?: DecodingOptions): Promise; + /** * Creates a PixelMap object. This method uses a callback to return the object. * @@ -8365,11 +8628,20 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise): void; + /** + * Creates a PixelMap object. This method uses a callback to return the object. + * + * @param { AsyncCallback } callback Callback used to return the PixelMap object. + * @syscap SystemCapability.Multimedia.Image.ImageSource + * @since 22 + * @arkts 1.2 + */ + createPixelMap(callback: AsyncCallback): void; + /** * Creates a PixelMap object based on image decoding parameters. This method uses a callback to * return the object. @@ -8410,11 +8682,22 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise): void; + /** + * Creates a PixelMap object based on image decoding parameters. This method uses a callback to + * return the object. + * + * @param { DecodingOptions } options Image decoding parameters. + * @param { AsyncCallback } callback Callback used to return the PixelMap object. + * @syscap SystemCapability.Multimedia.Image.ImageSource + * @since 22 + * @arkts 1.2 + */ + createPixelMap(options: DecodingOptions, callback: AsyncCallback): void; + /** * Creates a PixelMap based on decoding parameters, 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 @@ -8437,11 +8720,35 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise; + /** + * Creates a PixelMap based on decoding parameters, 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 { DecodingOptions } [options] Image decoding parameters. + * @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 } 7700101 - Bad source. + * @throws { BusinessError } 7700102 - Unsupported mimetype. + * @throws { BusinessError } 7700103 - Image too large. + * @throws { BusinessError } 7700201 - Unsupported allocator type. For example, use share memory to decode + * HDR image as only DMA supported HDR metadata. + * @throws { BusinessError } 7700203 - Unsupported options, For example, unsupported desiredPixelFormat causes + * a failure in converting an imagge into the desired pixel format. + * @throws { BusinessError } 7700301 - Failed to decode image. + * @throws { BusinessError } 7700302 - Failed to allocate memory. + * @syscap SystemCapability.Multimedia.Image.ImageSource + * @since 22 + * @arkts 1.2 + */ + createPixelMapUsingAllocator(options?: DecodingOptions, allocatorType?: AllocatorType) + : Promise; + /** * Create a PixelMap object based on image decoding parameters synchronously. * @@ -8449,11 +8756,21 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise + /** + * Creates a Picture object based on image decoding parameters. This method uses a promise to + * return the object. + * + * @param { DecodingOptionsForPicture } [options] Image decoding parameters. + * @returns { Promise } A Promise instance used to return the Picture object. + * @throws { BusinessError } 7700301 - Failed to decode image. + * @syscap SystemCapability.Multimedia.Image.ImageSource + * @since 22 + * @arkts 1.2 + */ + createPicture(options?: DecodingOptionsForPicture): Promise + /** * Decodes an image at the specified index into a Picture object. *