From e67ebe10414ea2fa8343bd7259e057fe785c40dd Mon Sep 17 00:00:00 2001 From: zhaona45 Date: Tue, 3 Jun 2025 14:43:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=A1=86=E6=9E=B6=E6=94=AF?= =?UTF-8?q?=E6=8C=81ArkTS1.2=E9=9D=99=E6=80=81=E8=AF=AD=E6=B3=95-API?= =?UTF-8?q?=E5=85=A8=E6=8E=A5=E5=8F=A3=E5=BC=80=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhaona45 Change-Id: I165e4ebf980d963f09f621c2d445d378b841953d --- api/@ohos.multimedia.image.d.ts | 336 +++++++++++++++++++------------- 1 file changed, 199 insertions(+), 137 deletions(-) diff --git a/api/@ohos.multimedia.image.d.ts b/api/@ohos.multimedia.image.d.ts index 8d12a3fcd6..562d977a26 100644 --- a/api/@ohos.multimedia.image.d.ts +++ b/api/@ohos.multimedia.image.d.ts @@ -23,7 +23,7 @@ import type colorSpaceManager from './@ohos.graphics.colorSpaceManager'; import type resourceManager from './@ohos.resourceManager'; import type rpc from './@ohos.rpc'; /*** if arkts 1.1 */ -import { int, double, float } from './@ohos.base'; +import { int, double, float, long } from './@ohos.base'; /*** endif */ /** @@ -3792,46 +3792,51 @@ declare namespace image { * * @typedef PackingOptionsForSequence * @syscap SystemCapability.Multimedia.Image.ImagePacker - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ interface PackingOptionsForSequence { /** * Specify the number of frames. * - * @type { number } + * @type { int } * @syscap SystemCapability.Multimedia.Image.ImagePacker - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - frameCount: number; + frameCount: int; /** * Specify the delay time for each frame of the dynamic image. * If the length is less than frameCount, the missing parts will be filling with the last value * - * @type { Array } + * @type { Array } * @syscap SystemCapability.Multimedia.Image.ImagePacker - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - delayTimeList: Array; + delayTimeList: Array; /** * Specify the disposal types of each frame in the image sequence packing. * - * @type { ?Array } + * @type { ?Array } * @syscap SystemCapability.Multimedia.Image.ImagePacker - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - disposalTypes?: Array; + disposalTypes?: Array; /** * Specify the number of times the loop should, the range is [0, 65535] * If this loop is equal to 0, it will be infinite loop. * - * @type { ?number } + * @type { ?int } * @syscap SystemCapability.Multimedia.Image.ImagePacker - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - loopCount?: number; + loopCount?: int; } /** @@ -4748,80 +4753,89 @@ declare namespace image { * * @typedef HdrStaticMetadata * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ interface HdrStaticMetadata { /** * The X-coordinate of the primary colors. The length of the array is three. Store in the order of r, g, b. * - * @type { Array } + * @type { Array } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - displayPrimariesX: Array; + displayPrimariesX: Array; /** * The Y-coordinate of the primary colors. The length of the array is three. Store in the order of r, g, b. * - * @type { Array } + * @type { Array } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - displayPrimariesY: Array; + displayPrimariesY: Array; /** * The X-coordinate of the white point value. * - * @type { number } + * @type { float } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - whitePointX: number; + whitePointX: float; /** * The Y-coordinate of the white point value. * - * @type { number } + * @type { float } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - whitePointY: number; + whitePointY: float; /** * Max luminance. * - * @type { number } + * @type { float } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - maxLuminance: number; + maxLuminance: float; /** * Min luminance. * - * @type { number } + * @type { float } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - minLuminance: number; + minLuminance: float; /** * Maximum brightness of displayed content. * - * @type { number } + * @type { float } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - maxContentLightLevel: number; + maxContentLightLevel: float; /** * Maximum average brightness of displayed content. * - * @type { number } + * @type { float } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - maxFrameAverageLightLevel: number; + maxFrameAverageLightLevel: float; } /** @@ -4829,53 +4843,59 @@ declare namespace image { * * @typedef GainmapChannel * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ interface GainmapChannel { /** * The per-component max gain map values. * - * @type { number } + * @type { float } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - gainmapMax: number; + gainmapMax: float; /** * The per-component min gain map values. * - * @type { number } + * @type { float } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - gainmapMin: number; + gainmapMin: float; /** * The per-component gamma values. * - * @type { number } + * @type { float } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - gamma: number; + gamma: float; /** * The per-component baseline offset. * - * @type { number } + * @type { float } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - baseOffset: number; + baseOffset: float; /** * The per-component alternate offset. * - * @type { number } + * @type { float } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - alternateOffset: number; + alternateOffset: float; } /** @@ -4883,69 +4903,77 @@ declare namespace image { * * @typedef HdrGainmapMetadata * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ interface HdrGainmapMetadata { /** * The version used by the writer. * - * @type { number } + * @type { int } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - writerVersion: number; + writerVersion: int; /** * The minimum version a parser needs to understand. * - * @type { number } + * @type { int } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - miniVersion: number; + miniVersion: int; /** * The number of gain map channels, with a value of 1 or 3. * - * @type { number } + * @type { int } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - gainmapChannelCount: number; + gainmapChannelCount: int; /** * Indicate whether to use the color space of the base image. * * @type { boolean } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ useBaseColorFlag: boolean; /** * The baseline hdr headroom. * - * @type { number } + * @type { float } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - baseHeadroom: number; + baseHeadroom: float; /** * The alternate hdr headroom. * - * @type { number } + * @type { float } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - alternateHeadroom: number; + alternateHeadroom: float; /** * The per-channel metadata. * * @type { Array } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ channels: Array; } @@ -4955,7 +4983,8 @@ declare namespace image { * * @typedef {HdrMetadataType | HdrStaticMetadata | ArrayBuffer | HdrGainmapMetadata} HdrMetadataValue * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ type HdrMetadataValue = HdrMetadataType | HdrStaticMetadata | ArrayBuffer | HdrGainmapMetadata; @@ -4976,8 +5005,7 @@ declare namespace image { * @param { AsyncCallback } callback Callback used to return the PixelMap object. * @syscap SystemCapability.Multimedia.Image.Core * @crossplatform - * @since arkts {'1.1':'10','1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function createPixelMap(colors: ArrayBuffer, options: InitializationOptions, callback: AsyncCallback): void; @@ -4998,8 +5026,7 @@ declare namespace image { * @returns { Promise } A Promise instance used to return the PixelMap object. * @syscap SystemCapability.Multimedia.Image.Core * @crossplatform - * @since arkts {'1.1':'10','1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function createPixelMap(colors: ArrayBuffer, options: InitializationOptions): Promise; @@ -5133,8 +5160,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise; @@ -5448,7 +5474,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise; @@ -6023,7 +6052,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise): void; @@ -6048,7 +6078,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } A Promise instance used to return the operation result. If the operation fails, an error message is returned. * @throws { BusinessError } 62980137 - Invalid image operation. * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ toSdr(): Promise; @@ -7128,7 +7159,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise): void; @@ -7147,7 +7179,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise; @@ -7353,7 +7386,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise; @@ -7361,7 +7395,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise @@ -7412,7 +7450,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise @@ -7564,7 +7603,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } * @syscap SystemCapability.Multimedia.Image.ImageSource - * @since 13 + * @since arkts {'1.1':'13','1.2':'20'} + * @arkts 1.1&1.2 */ desiredAuxiliaryPictures: Array; } @@ -8471,16 +8515,17 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise> } A Promise instance used to return the array. + * @returns { Promise> } A Promise instance used to return the array. * @throws { BusinessError } 62980096 - The operation failed. * @throws { BusinessError } 62980101 - The image data is abnormal. * @throws { BusinessError } 62980137 - Invalid media operation. * @throws { BusinessError } 62980149 - Invalid MIME type for the image source. * @syscap SystemCapability.Multimedia.Image.ImageSource * @crossplatform - * @since 12 + * @since arkts {'1.1':'12','1.2':'20'} + * @arkts 1.1&1.2 */ - getDisposalTypeList(): Promise>; + getDisposalTypeList(): Promise>; /** * Obtains the count of frame in an image. This method uses a promise to return the number. @@ -8503,7 +8548,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } A Promise instance used to return the number. + * @returns { Promise } A Promise instance used to return the number. * @throws { BusinessError } 62980096 - The operation failed. * @throws { BusinessError } 62980110 - The image source data is incorrect. * @throws { BusinessError } 62980111 - The image source data is incomplete. @@ -8516,9 +8561,10 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise; + getFrameCount(): Promise; /** * Obtains the count of frame in an image. This method uses a callback to return the number. @@ -8541,7 +8587,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } callback Callback used to return the number. + * @param { AsyncCallback } callback Callback used to return the number. * @throws { BusinessError } 62980096 - The operation failed. * @throws { BusinessError } 62980110 - The image source data is incorrect. * @throws { BusinessError } 62980111 - The image source data is incomplete. @@ -8554,9 +8600,10 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise): void; + getFrameCount(callback: AsyncCallback): void; /** * Obtains the value of a property in an image with the specified index. This method uses a @@ -8843,14 +8890,15 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } A Promise instance used to return the property value. * @syscap SystemCapability.Multimedia.Image.ImageSource * @crossplatform - * @since 11 + * @since arkts {'1.1':'11','1.2':'20'} + * @arkts 1.1&1.2 */ - updateData(buf: ArrayBuffer, isFinished: boolean, offset: number, length: number): Promise; + updateData(buf: ArrayBuffer, isFinished: boolean, offset: int, length: int): Promise; /** * Update the data in the incremental ImageSource. @@ -8880,18 +8928,19 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } callback Callback to return the operation result. * @syscap SystemCapability.Multimedia.Image.ImageSource * @crossplatform - * @since 11 + * @since arkts {'1.1':'11','1.2':'20'} + * @arkts 1.1&1.2 */ updateData( buf: ArrayBuffer, isFinished: boolean, - offset: number, - length: number, + offset: int, + length: int, callback: AsyncCallback ): void; @@ -8941,7 +8990,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise @@ -9086,7 +9136,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise; @@ -9184,7 +9235,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise; @@ -9199,7 +9251,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise, options: PackingOptionsForSequence): Promise; @@ -9299,7 +9352,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } pixelmapSequence PixelMaps to be encoded. - * @param { number } fd File descriptor of the output encoded file. + * @param { int } fd File descriptor of the output encoded file. * @param { PackingOptionsForSequence } options Options for image packing. * @returns { Promise } void. * @throws { BusinessError } 401 - Parameter error.Possible causes: 1.Mandatory parameters are left unspecified. @@ -9307,9 +9360,10 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise, fd: number, options: PackingOptionsForSequence): Promise; + packToFileFromPixelmapSequence(pixelmapSequence: Array, fd: int, options: PackingOptionsForSequence): Promise; /** * Releases an ImagePacker instance and uses a callback to return the result. @@ -9443,13 +9497,13 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } callback Callback used to return the next image. * @syscap SystemCapability.Multimedia.Image.ImageReceiver - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ readNextImage(callback: AsyncCallback): void; @@ -9592,7 +9647,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } A Promise instance used to return the next image. * @syscap SystemCapability.Multimedia.Image.ImageReceiver - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ readNextImage(): Promise; @@ -9675,7 +9731,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } callback Callback to return the operation result. * @syscap SystemCapability.Multimedia.Image.ImageCreator - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ dequeueImage(callback: AsyncCallback): void; @@ -9684,29 +9741,32 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } A Promise instance used to return the operation result. * @syscap SystemCapability.Multimedia.Image.ImageCreator - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ dequeueImage(): Promise; /** * Queue buffer to dirty queue and uses a callback to return the result. * - * @param { Image } interface + * @param { Image } image * @param { AsyncCallback } callback Callback to return the operation result. * @syscap SystemCapability.Multimedia.Image.ImageCreator - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ - queueImage(interface: Image, callback: AsyncCallback): void; + queueImage(image: Image, callback: AsyncCallback): void; /** * Queue buffer to dirty queue and uses a promise to return the result. * - * @param { Image } interface + * @param { Image } image * @returns { Promise } A Promise instance used to return the operation result. * @syscap SystemCapability.Multimedia.Image.ImageCreator - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ - queueImage(interface: Image): Promise; + queueImage(image: Image): Promise; /** * Subscribe callback when releasing buffer @@ -9714,7 +9774,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } callback Callback used to return the operation result. * @syscap SystemCapability.Multimedia.Image.ImageCreator - * @since 9 + * @since arkts {'1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ on(type: 'imageRelease', callback: AsyncCallback): void; @@ -9724,7 +9785,8 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } callback Callback to be removed. * @syscap SystemCapability.Multimedia.Image.ImageCreator - * @since 13 + * @since arkts {'1.1':'13','1.2':'20'} + * @arkts 1.1&1.2 */ off(type: 'imageRelease', callback?: AsyncCallback): void; -- Gitee