From 1bea31c05793d204c85bfb778f2feae45cf00d05 Mon Sep 17 00:00:00 2001 From: zhang-xiaobo1997 Date: Thu, 3 Mar 2022 22:07:48 +0800 Subject: [PATCH] Modify for image Signed-off-by: zhang-xiaobo1997 --- api/@ohos.multimedia.image.d.ts | 72 ++++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/api/@ohos.multimedia.image.d.ts b/api/@ohos.multimedia.image.d.ts index 74aef73ea4..cae023286e 100644 --- a/api/@ohos.multimedia.image.d.ts +++ b/api/@ohos.multimedia.image.d.ts @@ -158,6 +158,62 @@ declare namespace image { JPEG = 2000 } + /** + * Enumerates alpha types. + * @since 8 + * @syscap SystemCapability.Multimedia.Image.Core + */ + enum AlphaType { + /** + * Indicates an unknown alpha type. + * @since 8 + * @syscap SystemCapability.Multimedia.Image.Core + */ + UNKNOWN = 0, + + /** + * Indicates that the image has no alpha channel, or all pixels in the image are fully opaque. + * @since 8 + * @syscap SystemCapability.Multimedia.Image.Core + */ + OPAQUE = 1, + + /** + * Indicates that RGB components of each pixel in the image are premultiplied by alpha. + * @since 8 + * @syscap SystemCapability.Multimedia.Image.Core + */ + PREMUL = 2, + + /** + * Indicates that RGB components of each pixel in the image are independent of alpha and are not premultiplied by alpha. + * @since 8 + * @syscap SystemCapability.Multimedia.Image.Core + */ + UNPREMUL = 3 + } + + /** + * Enum for image scale mode. + * @since 8 + * @syscap SystemCapability.Multimedia.Image.Core + */ + enum ScaleMode { + /** + * Indicates the effect that scales an image to fill the target image area and center-crops the part outside the area. + * @since 8 + * @syscap SystemCapability.Multimedia.Image.Core + */ + CENTER_CROP = 1, // Indicates the effect that scales an image to fill the target image area and center-crops the part outside the area. + + /** + * Indicates the effect that fits the image into the target size. + * @since 8 + * @syscap SystemCapability.Multimedia.Image.Core + */ + FIT_TARGET_SIZE = 2, + } + /** * The componet type of image. * @since 8 @@ -265,7 +321,7 @@ declare namespace image { interface ImageInfo { /** * Indicates image dimensions specified by a {@link Size} interface. - * @since 7 + * @since 6 * @syscap SystemCapability.Multimedia.Image.Core */ size: Size; @@ -433,6 +489,20 @@ declare namespace image { * @syscap SystemCapability.Multimedia.Image.Core */ editable?: boolean; + + /** + * PixelMap expected alpha type. + * @since 8 + * @syscap SystemCapability.Multimedia.Image.Core + */ + alphaType: AlphaType; + + /** + * PixelMap expected scaling effect. + * @since 8 + * @syscap SystemCapability.Multimedia.Image.Core + */ + scaleMode: ScaleMode; } /** -- Gitee