diff --git a/zh-cn/application-dev/reference/apis-image-kit/js-apis-videoProcessingEngine.md b/zh-cn/application-dev/reference/apis-image-kit/js-apis-videoProcessingEngine.md index 22c0604d9ab1b03201cd1d770ef4f15de5010c1e..6be0afb4365a29e40f5e18c75615943a3050c927 100644 --- a/zh-cn/application-dev/reference/apis-image-kit/js-apis-videoProcessingEngine.md +++ b/zh-cn/application-dev/reference/apis-image-kit/js-apis-videoProcessingEngine.md @@ -9,21 +9,19 @@ > 本模块首批接口从API version 18开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 ## 导入模块 - ```ts import videoProcessingEngine from '@ohos.multimedia.videoProcessingEngine'; ``` - -## videoProcessingEngine.initializeEnvironment - +## initializeEnvironment initializeEnvironment(): Promise\ 初始化环境。使用Promise异步回调。 +**卡片能力**:从API version 18开始,该接口支持在ArkTS卡片中使用。 + **系统能力:** SystemCapability.Multimedia.VideoProcessingEngine **返回值:** - | 类型 | 说明 | | ------------ | ------------ | | Promise\ | Promise对象。无返回结果的Promise对象。 | @@ -41,7 +39,6 @@ initializeEnvironment(): Promise\ | 29200007 | Out of memory. | **示例:** - ```ts import videoProcessingEngine from '@ohos.multimedia.videoProcessingEngine'; async function initializeEnvironment() { @@ -49,16 +46,16 @@ videoProcessingEngine.initializeEnvironment(); } ``` -## videoProcessingEngine.deinitializeEnvironment - +## deinitializeEnvironment deinitializeEnvironment(): Promise\ 释放处理资源。使用Promise异步回调。 +**卡片能力**:从API version 18开始,该接口支持在ArkTS卡片中使用。 + **系统能力:** SystemCapability.Multimedia.VideoProcessingEngine **返回值:** - | 类型 | 说明 | | ------------ | ------------ | | Promise\ | Promise对象。无返回结果的Promise对象。 | @@ -72,7 +69,6 @@ deinitializeEnvironment(): Promise\ | 29200006 | The operation is not permitted. This may be caused by incorrect status. | **示例:** - ```ts import videoProcessingEngine from '@ohos.multimedia.videoProcessingEngine'; async function deinitializeEnvironment() { @@ -81,16 +77,16 @@ async function deinitializeEnvironment() { } ``` -## videoProcessingEngine.create - +## create create(): ImageProcessor 如果操作成功,创建图片处理模块实例,否则返回null。 +**卡片能力**:从API version 18开始,该接口支持在ArkTS卡片中使用。 + **系统能力:** SystemCapability.Multimedia.VideoProcessingEngine **返回值:** - | 类型 | 说明 | | ------------ | ------------ | | [ImageProcessor](#imageprocessor) | 图片处理模块实例。 | @@ -106,7 +102,6 @@ create(): ImageProcessor | 29200007 | Out of memory. | **示例:** - ```ts import videoProcessingEngine from '@ohos.multimedia.videoProcessingEngine'; async function create() { @@ -116,36 +111,33 @@ let imageProcessor = videoProcessingEngine.create() as videoProcessingEngine.Ima ``` ## ImageProcessor - -图像处理类,提供图片内容的清晰度增强及缩放能力。根据源图像的宽度和高度进行必要的缩放操作,生成目标图像。提供不同级别的缩放方法以平衡性能和图像质量。 - +图像处理类,提供图片内容的清晰度增强及缩放能力。根据源图像的宽度和高度进行必要的缩放操作,生成目标图像。提供不同级别的缩放方法以平衡性能和图像质量。
规格约束如下: - - 当前仅支持处理SDR(Standard dynamic range)图片。 - 当前支持处理RGBA、BGRA、NV12、NV21像素格式的图片,输出格式与输入格式一致。 ### enhanceDetail - enhanceDetail(sourceImage: image.PixelMap, width: number, height: number, level?: QualityLevel): Promise\ 细节增强处理异步方法。使用Promise异步回调。 +**卡片能力**:从API version 18开始,该接口支持在ArkTS卡片中使用。 + **系统能力:** SystemCapability.Multimedia.VideoProcessingEngine **参数:** | 参数名 | 类型 | 必填 | 说明 | | :------------ | :------------ | :------------ | :------------ | -| sourceImage | [image.PixelMap](arkts-apis-image-PixelMap.md) | 是 | 输入图像。 | +| sourceImage | [image.PixelMap](js-apis-image.md#pixelmap7) | 是 | 输入图像。 | | width | number | 是 | 目标宽度(单位为像素,px)。 | | height | number | 是 | 目标高度(单位为像素,px)。 | | level | [QualityLevel](#qualitylevel)| 否 | 算法档位(HIGH、MEDIUM、LOW、NONE),默认为NONE。 | **返回值:** - | 类型 | 说明 | | ------------ | ------------ | -| Promise\<[image.PixelMap](arkts-apis-image-PixelMap.md)\> | 异步方法返回PixelMap的Promise实例。 | +| Promise\<[image.PixelMap](js-apis-image.md#pixelmap7)\> | 异步方法返回PixelMap的Promise实例。 | **错误码:** @@ -158,7 +150,6 @@ enhanceDetail(sourceImage: image.PixelMap, width: number, height: number, level? | 29200009 | Input value is invalid. This error is returned for all of the following error conditions:
1 - Invalid input or output image buffer - The image buffer width(height) is too large or colorspace is incorrect.
2 - Invalid parameter - The parameter does not contain valid information, such as detail enhancer level is incorrect. | **示例:** - ```ts import videoProcessingEngine from '@ohos.multimedia.videoProcessingEngine'; async function enhanceDetail(sourceImage: image.PixelMap, width: number, height: number) { @@ -169,26 +160,26 @@ async function enhanceDetail(sourceImage: image.PixelMap, width: number, height: ``` ### enhanceDetail - enhanceDetail(sourceImage: image.PixelMap, scale: number, level?: QualityLevel): Promise\ 细节增强处理异步方法。使用Promise异步回调。 +**卡片能力**:从API version 18开始,该接口支持在ArkTS卡片中使用。 + **系统能力:** SystemCapability.Multimedia.VideoProcessingEngine **参数:** | 参数名 | 类型 | 必填 | 说明 | | :------------ | :------------ | :------------ | :------------ | -| sourceImage | [image.PixelMap](arkts-apis-image-PixelMap.md) | 是 | 输入图像。 | +| sourceImage | [image.PixelMap](js-apis-image.md#pixelmap7) | 是 | 输入图像。 | | scale | number | 是 | 目标缩放比例。 | | level | [QualityLevel](#qualitylevel)| 否 | 算法档位(HIGH、MEDIUM、LOW、NONE),默认为NONE。 | **返回值:** - | 类型 | 说明 | | ------------ | ------------ | -| Promise\<[image.PixelMap](arkts-apis-image-PixelMap.md)\> | 异步方法返回PixelMap的Promise实例。 | +| Promise\<[image.PixelMap](js-apis-image.md#pixelmap7)\> | 异步方法返回PixelMap的Promise实例。 | **错误码:** @@ -201,7 +192,6 @@ enhanceDetail(sourceImage: image.PixelMap, scale: number, level?: QualityLevel): | 29200009 | Input value is invalid. This error is returned for all of the following error conditions:
1 - Invalid input or output image buffer - The image buffer width(height) is too large or colorspace is incorrect.
2 - Invalid parameter - The parameter does not contain valid information, such as detail enhancer level is incorrect. | **示例:** - ```ts import videoProcessingEngine from '@ohos.multimedia.videoProcessingEngine'; async function enhanceDetail(sourceImage: image.PixelMap, scale: number) { @@ -212,27 +202,27 @@ async function enhanceDetail(sourceImage: image.PixelMap, scale: number) { ``` ### enhanceDetailSync - enhanceDetailSync(sourceImage: image.PixelMap, width: number, height: number, level?: QualityLevel): image.PixelMap 细节增强处理同步方法。 +**卡片能力**:从API version 18开始,该接口支持在ArkTS卡片中使用。 + **系统能力:** SystemCapability.Multimedia.VideoProcessingEngine **参数:** | 参数名 | 类型 | 必填 | 说明 | | :------------ | :------------ | :------------ | :------------ | -| sourceImage | [image.PixelMap](arkts-apis-image-PixelMap.md) | 是 | 输入图像。 | +| sourceImage | [image.PixelMap](js-apis-image.md#pixelmap7) | 是 | 输入图像。 | | width | number | 是 | 目标宽度(单位为像素,px)。 | | height | number | 是 | 目标高度(单位为像素,px)。 | | level | [QualityLevel](#qualitylevel)| 否 | 算法档位(HIGH、MEDIUM、LOW、NONE),默认为NONE。 | **返回值:** - | 类型 | 说明 | | ------------ | ------------ | -| [image.PixelMap](arkts-apis-image-PixelMap.md) | 成功同步返回PixelMap对象。 | +| [image.PixelMap](js-apis-image.md#pixelmap7) | 成功同步返回PixelMap对象。 | **错误码:** @@ -246,7 +236,6 @@ enhanceDetailSync(sourceImage: image.PixelMap, width: number, height: number, le | 29200009 | Input value is invalid. This error is returned for all of the following error conditions:
1 - Invalid input or output image buffer - The image buffer width(height) is too large or colorspace is incorrect.
2 - Invalid parameter - The parameter does not contain valid information, such as detail enhancer level is incorrect. | **示例:** - ```ts import videoProcessingEngine from '@ohos.multimedia.videoProcessingEngine'; async function enhanceDetailSync(sourceImage:image.PixelMap, width: number, height: number) { @@ -258,26 +247,26 @@ sourceImage, width, height, videoProcessingEngine.QualityLevel.HIGH); ``` ### enhanceDetailSync - enhanceDetailSync(sourceImage: image.PixelMap, scale: number, level?: QualityLevel): image.PixelMap 细节增强处理同步方法。 +**卡片能力**:从API version 18开始,该接口支持在ArkTS卡片中使用。 + **系统能力:** SystemCapability.Multimedia.VideoProcessingEngine **参数:** | 参数名 | 类型 | 必填 | 说明 | | :------------ | :------------ | :------------ | :------------ | -| sourceImage | [image.PixelMap](arkts-apis-image-PixelMap.md) | 是 | 输入图像。 | +| sourceImage | [image.PixelMap](js-apis-image.md#pixelmap7) | 是 | 输入图像。 | | scale | number | 是 | 目标缩放比例。 | | level | [QualityLevel](#qualitylevel)| 否 | 算法档位(HIGH、MEDIUM、LOW、NONE),默认为NONE。 | **返回值:** - | 类型 | 说明 | | ------------ | ------------ | -| [image.PixelMap](arkts-apis-image-PixelMap.md) | 成功同步返回PixelMap对象。 | +| [image.PixelMap](js-apis-image.md#pixelmap7) | 成功同步返回PixelMap对象。 | **错误码:** @@ -291,7 +280,6 @@ enhanceDetailSync(sourceImage: image.PixelMap, scale: number, level?: QualityLev | 29200009 | Input value is invalid. This error is returned for all of the following error conditions:
1 - Invalid input or output image buffer - The image buffer width(height) is too large or colorspace is incorrect.
2 - Invalid parameter - The parameter does not contain valid information, such as detail enhancer level is incorrect. | **示例:** - ```ts import videoProcessingEngine from '@ohos.multimedia.videoProcessingEngine'; async function enhanceDetailSync(sourceImage:image.PixelMap, scale: number) { @@ -306,11 +294,14 @@ sourceImage, scale, videoProcessingEngine.QualityLevel.HIGH); 枚举,算法档位。 +**卡片能力**:从API version 18开始,该接口支持在ArkTS卡片中使用。 + **系统能力:** SystemCapability.Multimedia.VideoProcessingEngine + | 名称 | 值 | 说明 | | ------------ | ------------ | ------------ | -| NONE | 0 | 仅适用于缩放场景,支持改变宽高比例。
- 输入分辨率要求(单位为像素,px):宽:[32,3000],高:[32,3000]。
- 输出分辨率要求(单位为像素,px):宽:[32,3000],高:[32,3000]。 | -| LOW | 1 | 仅适用于缩放场景,支持改变宽高比例。
- 输入分辨率要求(单位为像素,px):宽:[32,3000],高:[32,3000]。
- 输出分辨率要求(单位为像素,px):宽:[32,3000],高:[32,3000]。 | -| MEDIUM | 2 | 仅适用于缩放场景,支持改变宽高比例。
- 输入分辨率要求(单位为像素,px):宽:[32,3000],高:[32,3000]。
- 输出分辨率要求(单位为像素,px):宽:[32,3000],高:[32,3000]。 | -| HIGH | 3 | 1. 缩放场景,不支持改变宽高比例。
- 输入分辨率要求(单位为像素,px):宽:(32,512) (2000,8192],高:(32,512) (2000,8192]。
- 输出分辨率要求(单位为像素,px):宽:(32,512) (2000,8192],高:(32,512) (2000,8192]。
2. 清晰度增强、缩放场景,支持改变宽高比例。
- 输入分辨率要求(单位为像素,px):宽:[512,2000],高:[512,2000]。
- 输出分辨率要求(单位为像素,px):宽:[512,2000],高:[512,2000]。 | +| NONE | 0 | 仅适用于缩放场景,支持改变宽高比例。
- 输入分辨率要求(单位为像素,px):宽:[32,3000],高:[32,3000]。
- 输出分辨率要求(单位为像素,px):宽:[32,3000],高:[32,3000]。 | +| LOW | 1 | 仅适用于缩放场景,支持改变宽高比例。
- 输入分辨率要求(单位为像素,px):宽:[32,3000],高:[32,3000]。
- 输出分辨率要求(单位为像素,px):宽:[32,3000],高:[32,3000]。 | +| MEDIUM | 2 | 仅适用于缩放场景,支持改变宽高比例。
- 输入分辨率要求(单位为像素,px):宽:[32,3000],高:[32,3000]。
- 输出分辨率要求(单位为像素,px):宽:[32,3000],高:[32,3000]。 | +| HIGH | 3 | 1. 缩放场景,不支持改变宽高比例。
- 输入分辨率要求(单位为像素,px):宽:(32,512) (2000,8192],高:(32,512) (2000,8192]。
- 输出分辨率要求(单位为像素,px):宽:(32,512) (2000,8192],高:(32,512) (2000,8192]。
2. 清晰度增强、缩放场景,支持改变宽高比例。
- 输入分辨率要求(单位为像素,px):宽:[512,2000],高:[512,2000]。
- 输出分辨率要求(单位为像素,px):宽:[512,2000],高:[512,2000]。 |