From 9672a4781f53dc582de3cb24609ba97008c39bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Thu, 4 Jul 2024 16:44:02 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=20Scale=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../include/image_pixel_map_mdk.h | 58 +++++++++++++++++++ .../libimage_pixelmap_napi.ndk.json | 3 + 2 files changed, 61 insertions(+) diff --git a/multimedia/image_framework/include/image_pixel_map_mdk.h b/multimedia/image_framework/include/image_pixel_map_mdk.h index b5cf58c3a..e4d2eb30c 100644 --- a/multimedia/image_framework/include/image_pixel_map_mdk.h +++ b/multimedia/image_framework/include/image_pixel_map_mdk.h @@ -117,6 +117,31 @@ enum { OHOS_PIXEL_MAP_EDITABLE = 1, }; +/** + * @brief Enumerates the anti-aliasing options. + * + * @since 12 + * @version 1.0 + */ +typedef enum { + /** + * Nearest-neighbor interpolation. + */ + OHOS_ANTI_ALIASING_NONE = 0, + /** + * Bilinear interpolation, without mipmap linear filtering. + */ + OHOS_ANTI_ALIASING_LOW = 1, + /** + * Bilinear interpolation, with mipmap linear filtering. + */ + OHOS_ANTI_ALIASING_MEDIUM = 2, + /** + * Cubic interpolation. + */ + OHOS_ANTI_ALIASING_HIGH = 3, +} OHOS_ANTI_ALIASING_OPTION; + /** * @brief Defines the options used for creating a pixel map. * @@ -387,6 +412,39 @@ int32_t OH_PixelMap_SetOpacity(const NativePixelMap* native, float opacity); */ int32_t OH_PixelMap_Scale(const NativePixelMap* native, float x, float y); +/** + * @brief Scales a PixelMap object with anti-aliasing. + * + * @param native Indicates the pointer to a NativePixelMap object. + * @param x Indicates the scaling ratio of the width. + * @param y Indicates the scaling ratio of the height. + * @param antiAliasing Indicates the anti-aliasing method used for the scaling. + * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. + * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. + * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. + * returns {@link IRNdkErrCode} IMAGE_RESULT_INVALID_PARAMETER - if invalid parameter. + * returns {@link IRNdkErrCode} IMAGE_RESULT_GET_DATA_ABNORMAL - if image get data error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_DECODE_FAILED - if decode fail. + * returns {@link IRNdkErrCode} IMAGE_RESULT_CHECK_FORMAT_ERROR - if check format failed. + * returns {@link IRNdkErrCode} IMAGE_RESULT_THIRDPART_SKIA_ERROR - if skia error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_ABNORMAL - if image input data error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST - if sharememory error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL - if sharememory data abnormal. + * returns {@link IRNdkErrCode} IMAGE_RESULT_MALLOC_ABNORMAL - if image malloc error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_UNSUPPORT - if image init error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_CROP - if crop error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_UNKNOWN_FORMAT - if image unknown format. + * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_REGISTER_FAILED - if register plugin fail. + * returns {@link IRNdkErrCode} IMAGE_RESULT_PLUGIN_CREATE_FAILED - if create plugin fail. + * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. + * returns {@link IRNdkErrCode} IMAGE_RESULT_ALPHA_TYPE_ERROR - if hard decode failed. + * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. + * @see SmoothScale + * @since 12 + * @version 1.0 + */ +int32_t OH_PixelMap_SmoothScale(const NativePixelMap* native, float x, float y, OHOS_ANTI_ALIASING_OPTION antiAliasing); + /** * @brief Translates a PixelMap object. * diff --git a/multimedia/image_framework/libimage_pixelmap_napi.ndk.json b/multimedia/image_framework/libimage_pixelmap_napi.ndk.json index 64800fe82..a5c65ce4d 100644 --- a/multimedia/image_framework/libimage_pixelmap_napi.ndk.json +++ b/multimedia/image_framework/libimage_pixelmap_napi.ndk.json @@ -42,6 +42,9 @@ { "name": "OH_PixelMap_Scale" }, + { + "name": "OH_PixelMap_SmoothScale" + }, { "name": "OH_PixelMap_Translate" }, -- Gitee From f23e1c34ef12ce681af2ab234706c7eb66843eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Fri, 5 Jul 2024 10:24:25 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../include/image_pixel_map_mdk.h | 17 +++++++++-------- .../libimage_pixelmap_napi.ndk.json | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/multimedia/image_framework/include/image_pixel_map_mdk.h b/multimedia/image_framework/include/image_pixel_map_mdk.h index e4d2eb30c..0e09e54fd 100644 --- a/multimedia/image_framework/include/image_pixel_map_mdk.h +++ b/multimedia/image_framework/include/image_pixel_map_mdk.h @@ -127,20 +127,20 @@ typedef enum { /** * Nearest-neighbor interpolation. */ - OHOS_ANTI_ALIASING_NONE = 0, + OH_PixelmapNative_AntiAliasingOption_NONE = 0, /** * Bilinear interpolation, without mipmap linear filtering. */ - OHOS_ANTI_ALIASING_LOW = 1, + OH_PixelmapNative_AntiAliasingOption_LOW = 1, /** * Bilinear interpolation, with mipmap linear filtering. */ - OHOS_ANTI_ALIASING_MEDIUM = 2, + OH_PixelmapNative_AntiAliasingOption_MEDIUM = 2, /** * Cubic interpolation. */ - OHOS_ANTI_ALIASING_HIGH = 3, -} OHOS_ANTI_ALIASING_OPTION; + OH_PixelmapNative_AntiAliasingOption_HIGH = 3, +} OH_PixelmapNative_AntiAliasingOption; /** * @brief Defines the options used for creating a pixel map. @@ -418,7 +418,7 @@ int32_t OH_PixelMap_Scale(const NativePixelMap* native, float x, float y); * @param native Indicates the pointer to a NativePixelMap object. * @param x Indicates the scaling ratio of the width. * @param y Indicates the scaling ratio of the height. - * @param antiAliasing Indicates the anti-aliasing method used for the scaling. + * @param opts Indicates the anti-aliasing algorithm to be used. * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. @@ -439,11 +439,12 @@ int32_t OH_PixelMap_Scale(const NativePixelMap* native, float x, float y); * returns {@link IRNdkErrCode} IMAGE_RESULT_INDEX_INVALID - if invalid index. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALPHA_TYPE_ERROR - if hard decode failed. * returns {@link IRNdkErrCode} IMAGE_RESULT_ALLOCATER_TYPE_ERROR - if hard decode failed. - * @see SmoothScale + * @see Scale * @since 12 * @version 1.0 */ -int32_t OH_PixelMap_SmoothScale(const NativePixelMap* native, float x, float y, OHOS_ANTI_ALIASING_OPTION antiAliasing); +int32_t OH_PixelMap_Scale_AntiAliasing(const NativePixelMap* native, float x, float y, + OH_PixelmapNative_AntiAliasingOption opts); /** * @brief Translates a PixelMap object. diff --git a/multimedia/image_framework/libimage_pixelmap_napi.ndk.json b/multimedia/image_framework/libimage_pixelmap_napi.ndk.json index a5c65ce4d..0338a55a0 100644 --- a/multimedia/image_framework/libimage_pixelmap_napi.ndk.json +++ b/multimedia/image_framework/libimage_pixelmap_napi.ndk.json @@ -43,7 +43,7 @@ "name": "OH_PixelMap_Scale" }, { - "name": "OH_PixelMap_SmoothScale" + "name": "OH_PixelMap_Scale_AntiAliasing" }, { "name": "OH_PixelMap_Translate" -- Gitee From 6f07c86176b663883ad7b448642343fb3d84795c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Fri, 5 Jul 2024 11:54:01 +0800 Subject: [PATCH 3/8] =?UTF-8?q?NDK=20=E6=96=B0=E6=8E=A5=E5=8F=A3=E6=8E=A5?= =?UTF-8?q?=E5=85=A5=20Scale=20=E6=8A=97=E9=94=AF=E9=BD=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../include/image/pixelmap_native.h | 38 +++++++++++++++++++ .../image_framework/libpixelmap.ndk.json | 4 ++ 2 files changed, 42 insertions(+) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index fccadfd99..a196d4713 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -112,6 +112,30 @@ typedef enum { PIXEL_FORMAT_NV12 = 9, } PIXEL_FORMAT; +/** + * @brief Defines the anti-aliasing options. + * + * @since 12 + */ +typedef enum { + /** + * Nearest-neighbor interpolation algorithm + */ + OH_PixelmapNative_AntiAliasingOption_NONE = 0, + /** + * Bilinear interpolation algorithm + */ + OH_PixelmapNative_AntiAliasingOption_LOW = 1, + /** + * Bilinear interpolation algorithm with mipmap linear filtering + */ + OH_PixelmapNative_AntiAliasingOption_MEDIUM = 2, + /** + * Cubic interpolation algorithm + */ + OH_PixelmapNative_AntiAliasingOption_HIGH = 3, +} OH_PixelmapNative_AntiAliasingOption; + /** * @brief Defines the options used for creating a pixel map. * @@ -413,6 +437,20 @@ Image_ErrorCode OH_PixelmapNative_Opacity(OH_PixelmapNative *pixelmap, float rat */ Image_ErrorCode OH_PixelmapNative_Scale(OH_PixelmapNative *pixelmap, float scaleX, float scaleY); +/** + * @brief Scales this image based on the input width and height with anti-aliasing. + * + * @param pixelmap The Pixelmap pointer will be operated. + * @param scaleX Scaling ratio of the width. + * @param scaleY Scaling ratio of the height. + * @param opts The anti-aliasing algorithm to be used. + * @return Returns {@link Image_ErrorCode} + * @see OH_PixelmapNative + * @since 12 + */ +Image_ErrorCode OH_PixelmapNative_Scale_AntiAliasing(OH_PixelmapNative *pixelmap, float scaleX, float scaleY, + OH_PixelmapNative_AntiAliasingOption *opts); + /** * @brief Translates this image based on the input coordinates. * diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index c2b1ca518..1538fdb30 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -107,6 +107,10 @@ "first_introduced": "12", "name": "OH_PixelmapNative_Scale" }, + { + "first_introduced": "12", + "name": "OH_PixelmapNative_Scale_AntiAliasing" + }, { "first_introduced": "12", "name": "OH_PixelmapNative_Translate" -- Gitee From 1b3dfaa16042167e2a62c4dea8a4571eaae82a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Fri, 5 Jul 2024 14:40:44 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../include/image_pixel_map_mdk.h | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/multimedia/image_framework/include/image_pixel_map_mdk.h b/multimedia/image_framework/include/image_pixel_map_mdk.h index 0e09e54fd..834f52872 100644 --- a/multimedia/image_framework/include/image_pixel_map_mdk.h +++ b/multimedia/image_framework/include/image_pixel_map_mdk.h @@ -117,31 +117,6 @@ enum { OHOS_PIXEL_MAP_EDITABLE = 1, }; -/** - * @brief Enumerates the anti-aliasing options. - * - * @since 12 - * @version 1.0 - */ -typedef enum { - /** - * Nearest-neighbor interpolation. - */ - OH_PixelmapNative_AntiAliasingOption_NONE = 0, - /** - * Bilinear interpolation, without mipmap linear filtering. - */ - OH_PixelmapNative_AntiAliasingOption_LOW = 1, - /** - * Bilinear interpolation, with mipmap linear filtering. - */ - OH_PixelmapNative_AntiAliasingOption_MEDIUM = 2, - /** - * Cubic interpolation. - */ - OH_PixelmapNative_AntiAliasingOption_HIGH = 3, -} OH_PixelmapNative_AntiAliasingOption; - /** * @brief Defines the options used for creating a pixel map. * -- Gitee From ec929f4f8bf8983e19ed12ef8a4973c631f71371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Fri, 5 Jul 2024 16:03:41 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../include/image_pixel_map_mdk.h | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/multimedia/image_framework/include/image_pixel_map_mdk.h b/multimedia/image_framework/include/image_pixel_map_mdk.h index 834f52872..9ae4c7738 100644 --- a/multimedia/image_framework/include/image_pixel_map_mdk.h +++ b/multimedia/image_framework/include/image_pixel_map_mdk.h @@ -117,6 +117,31 @@ enum { OHOS_PIXEL_MAP_EDITABLE = 1, }; +/** + * @brief Enumerates the anti-aliasing options. + * + * @since 12 + * @version 1.0 + */ +typedef enum { + /** + * Nearest-neighbor interpolation. + */ + OH_PixelMap_AntiAliasingOption_NONE = 0, + /** + * Bilinear interpolation, without mipmap linear filtering. + */ + OH_PixelMap_AntiAliasingOption_LOW = 1, + /** + * Bilinear interpolation, with mipmap linear filtering. + */ + OH_PixelMap_AntiAliasingOption_MEDIUM = 2, + /** + * Cubic interpolation. + */ + OH_PixelMap_AntiAliasingOption_HIGH = 3, +} OH_PixelMap_AntiAliasingOption; + /** * @brief Defines the options used for creating a pixel map. * @@ -419,7 +444,7 @@ int32_t OH_PixelMap_Scale(const NativePixelMap* native, float x, float y); * @version 1.0 */ int32_t OH_PixelMap_Scale_AntiAliasing(const NativePixelMap* native, float x, float y, - OH_PixelmapNative_AntiAliasingOption opts); + OH_PixelMap_AntiAliasingOption* opts); /** * @brief Translates a PixelMap object. -- Gitee From 0d63ebf8867c267e8775518e04dc2b2a78f18b41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Mon, 15 Jul 2024 10:23:26 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../include/image/pixelmap_native.h | 16 ++++++------- .../include/image_pixel_map_mdk.h | 24 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index a196d4713..24ad0f858 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -113,7 +113,7 @@ typedef enum { } PIXEL_FORMAT; /** - * @brief Defines the anti-aliasing options. + * @brief Defines the anti-aliasing level. * * @since 12 */ @@ -121,20 +121,20 @@ typedef enum { /** * Nearest-neighbor interpolation algorithm */ - OH_PixelmapNative_AntiAliasingOption_NONE = 0, + OH_PixelmapNative_AntiAliasing_NONE = 0, /** * Bilinear interpolation algorithm */ - OH_PixelmapNative_AntiAliasingOption_LOW = 1, + OH_PixelmapNative_AntiAliasing_LOW = 1, /** * Bilinear interpolation algorithm with mipmap linear filtering */ - OH_PixelmapNative_AntiAliasingOption_MEDIUM = 2, + OH_PixelmapNative_AntiAliasing_MEDIUM = 2, /** * Cubic interpolation algorithm */ - OH_PixelmapNative_AntiAliasingOption_HIGH = 3, -} OH_PixelmapNative_AntiAliasingOption; + OH_PixelmapNative_AntiAliasing_HIGH = 3, +} OH_PixelmapNative_AntiAliasingLevel; /** * @brief Defines the options used for creating a pixel map. @@ -443,13 +443,13 @@ Image_ErrorCode OH_PixelmapNative_Scale(OH_PixelmapNative *pixelmap, float scale * @param pixelmap The Pixelmap pointer will be operated. * @param scaleX Scaling ratio of the width. * @param scaleY Scaling ratio of the height. - * @param opts The anti-aliasing algorithm to be used. + * @param level The anti-aliasing algorithm to be used. * @return Returns {@link Image_ErrorCode} * @see OH_PixelmapNative * @since 12 */ Image_ErrorCode OH_PixelmapNative_Scale_AntiAliasing(OH_PixelmapNative *pixelmap, float scaleX, float scaleY, - OH_PixelmapNative_AntiAliasingOption *opts); + OH_PixelmapNative_AntiAliasingLevel level); /** * @brief Translates this image based on the input coordinates. diff --git a/multimedia/image_framework/include/image_pixel_map_mdk.h b/multimedia/image_framework/include/image_pixel_map_mdk.h index 9ae4c7738..e9a8df364 100644 --- a/multimedia/image_framework/include/image_pixel_map_mdk.h +++ b/multimedia/image_framework/include/image_pixel_map_mdk.h @@ -118,29 +118,29 @@ enum { }; /** - * @brief Enumerates the anti-aliasing options. + * @brief Enumerates the anti-aliasing level. * * @since 12 * @version 1.0 */ typedef enum { /** - * Nearest-neighbor interpolation. + * Nearest-neighbor interpolation algorithm */ - OH_PixelMap_AntiAliasingOption_NONE = 0, + OH_PixelMap_AntiAliasing_NONE = 0, /** - * Bilinear interpolation, without mipmap linear filtering. + * Bilinear interpolation algorithm */ - OH_PixelMap_AntiAliasingOption_LOW = 1, + OH_PixelMap_AntiAliasing_LOW = 1, /** - * Bilinear interpolation, with mipmap linear filtering. + * Bilinear interpolation algorithm with mipmap linear filtering */ - OH_PixelMap_AntiAliasingOption_MEDIUM = 2, + OH_PixelMap_AntiAliasing_MEDIUM = 2, /** - * Cubic interpolation. + * Cubic interpolation algorithm */ - OH_PixelMap_AntiAliasingOption_HIGH = 3, -} OH_PixelMap_AntiAliasingOption; + OH_PixelMap_AntiAliasing_HIGH = 3, +} OH_PixelMap_AntiAliasingLevel; /** * @brief Defines the options used for creating a pixel map. @@ -418,7 +418,7 @@ int32_t OH_PixelMap_Scale(const NativePixelMap* native, float x, float y); * @param native Indicates the pointer to a NativePixelMap object. * @param x Indicates the scaling ratio of the width. * @param y Indicates the scaling ratio of the height. - * @param opts Indicates the anti-aliasing algorithm to be used. + * @param level Indicates the anti-aliasing algorithm to be used. * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. @@ -444,7 +444,7 @@ int32_t OH_PixelMap_Scale(const NativePixelMap* native, float x, float y); * @version 1.0 */ int32_t OH_PixelMap_Scale_AntiAliasing(const NativePixelMap* native, float x, float y, - OH_PixelMap_AntiAliasingOption* opts); + OH_PixelMap_AntiAliasingLevel level); /** * @brief Translates a PixelMap object. -- Gitee From 9162c02c5c04559b8d2aa590bfa5f1aacaf20578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Tue, 16 Jul 2024 18:16:07 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../image_framework/include/image/pixelmap_native.h | 12 ++++++------ .../image_framework/include/image_pixel_map_mdk.h | 12 ++++++------ .../image_framework/libimage_pixelmap_napi.ndk.json | 2 +- multimedia/image_framework/libpixelmap.ndk.json | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 24ad0f858..d8441946b 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -119,19 +119,19 @@ typedef enum { */ typedef enum { /** - * Nearest-neighbor interpolation algorithm + * Nearest-neighbor interpolation */ OH_PixelmapNative_AntiAliasing_NONE = 0, /** - * Bilinear interpolation algorithm + * Bilinear interpolation */ OH_PixelmapNative_AntiAliasing_LOW = 1, /** - * Bilinear interpolation algorithm with mipmap linear filtering + * Bilinear interpolation with mipmap linear filtering */ OH_PixelmapNative_AntiAliasing_MEDIUM = 2, /** - * Cubic interpolation algorithm + * Cubic interpolation */ OH_PixelmapNative_AntiAliasing_HIGH = 3, } OH_PixelmapNative_AntiAliasingLevel; @@ -443,12 +443,12 @@ Image_ErrorCode OH_PixelmapNative_Scale(OH_PixelmapNative *pixelmap, float scale * @param pixelmap The Pixelmap pointer will be operated. * @param scaleX Scaling ratio of the width. * @param scaleY Scaling ratio of the height. - * @param level The anti-aliasing algorithm to be used. + * @param level The anti-aliasing method to be used. * @return Returns {@link Image_ErrorCode} * @see OH_PixelmapNative * @since 12 */ -Image_ErrorCode OH_PixelmapNative_Scale_AntiAliasing(OH_PixelmapNative *pixelmap, float scaleX, float scaleY, +Image_ErrorCode OH_PixelmapNative_ScaleWithAntiAliasing(OH_PixelmapNative *pixelmap, float scaleX, float scaleY, OH_PixelmapNative_AntiAliasingLevel level); /** diff --git a/multimedia/image_framework/include/image_pixel_map_mdk.h b/multimedia/image_framework/include/image_pixel_map_mdk.h index e9a8df364..71d147a32 100644 --- a/multimedia/image_framework/include/image_pixel_map_mdk.h +++ b/multimedia/image_framework/include/image_pixel_map_mdk.h @@ -125,19 +125,19 @@ enum { */ typedef enum { /** - * Nearest-neighbor interpolation algorithm + * Nearest-neighbor interpolation. */ OH_PixelMap_AntiAliasing_NONE = 0, /** - * Bilinear interpolation algorithm + * Bilinear interpolation. */ OH_PixelMap_AntiAliasing_LOW = 1, /** - * Bilinear interpolation algorithm with mipmap linear filtering + * Bilinear interpolation with mipmap linear filtering. */ OH_PixelMap_AntiAliasing_MEDIUM = 2, /** - * Cubic interpolation algorithm + * Cubic interpolation. */ OH_PixelMap_AntiAliasing_HIGH = 3, } OH_PixelMap_AntiAliasingLevel; @@ -418,7 +418,7 @@ int32_t OH_PixelMap_Scale(const NativePixelMap* native, float x, float y); * @param native Indicates the pointer to a NativePixelMap object. * @param x Indicates the scaling ratio of the width. * @param y Indicates the scaling ratio of the height. - * @param level Indicates the anti-aliasing algorithm to be used. + * @param level Indicates the anti-aliasing method to be used. * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if bad parameter. * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. @@ -443,7 +443,7 @@ int32_t OH_PixelMap_Scale(const NativePixelMap* native, float x, float y); * @since 12 * @version 1.0 */ -int32_t OH_PixelMap_Scale_AntiAliasing(const NativePixelMap* native, float x, float y, +int32_t OH_PixelMap_ScaleWithAntiAliasing(const NativePixelMap* native, float x, float y, OH_PixelMap_AntiAliasingLevel level); /** diff --git a/multimedia/image_framework/libimage_pixelmap_napi.ndk.json b/multimedia/image_framework/libimage_pixelmap_napi.ndk.json index 0338a55a0..472d50c5e 100644 --- a/multimedia/image_framework/libimage_pixelmap_napi.ndk.json +++ b/multimedia/image_framework/libimage_pixelmap_napi.ndk.json @@ -43,7 +43,7 @@ "name": "OH_PixelMap_Scale" }, { - "name": "OH_PixelMap_Scale_AntiAliasing" + "name": "OH_PixelMap_ScaleWithAntiAliasing" }, { "name": "OH_PixelMap_Translate" diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index 1538fdb30..f54a82fe4 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -109,7 +109,7 @@ }, { "first_introduced": "12", - "name": "OH_PixelmapNative_Scale_AntiAliasing" + "name": "OH_PixelmapNative_ScaleWithAntiAliasing" }, { "first_introduced": "12", -- Gitee From aa908ad980ed80aae57838e89a0a56e90038cbcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=94=E5=BC=82?= Date: Tue, 16 Jul 2024 18:29:56 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20stride=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈乔异 --- .../include/image/pixelmap_native.h | 26 +++++++++++++++++++ .../include/image_pixel_map_mdk.h | 25 ++++++++++++++++++ .../libimage_pixelmap_napi.ndk.json | 3 +++ .../image_framework/libpixelmap.ndk.json | 8 ++++++ 4 files changed, 62 insertions(+) diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index d8441946b..8fd521e0d 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -263,6 +263,32 @@ Image_ErrorCode OH_PixelmapInitializationOptions_GetAlphaType(OH_Pixelmap_Initia Image_ErrorCode OH_PixelmapInitializationOptions_SetAlphaType(OH_Pixelmap_InitializationOptions *options, int32_t alphaType); +/** + * @brief Get rowStride number for InitializationOtions struct. + * + * @param options The InitializationOtions pointer will be operated. + * @param rowStride the rowStride of image buffer. + * @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is sucessful. + * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if rowStride is null. + * returns {@link Image_ErrorCode} IMAGE_UNKNOWN_ERROR - inner unknown error. + * @since 12 + */ +Image_ErrorCode OH_PixelmapInitializationOptions_GetRowStride(OH_Pixelmap_InitializationOptions *options, + int32_t *rowStride); + +/** + * @brief Set rowStride number for InitializationOtions struct. + * + * @param options The InitializationOtions pointer will be operated. + * @param rowStride the rowStride of image buffer. + * @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - if the operation is sucessful. + * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - if rowStride does not match width. + * returns {@link Image_ErrorCode} IMAGE_UNKNOWN_ERROR - inner unknown error. + * @since 12 + */ +Image_ErrorCode OH_PixelmapInitializationOptions_SetRowStride(OH_Pixelmap_InitializationOptions *options, + int32_t rowStride); + /** * @brief delete InitializationOtions pointer. * diff --git a/multimedia/image_framework/include/image_pixel_map_mdk.h b/multimedia/image_framework/include/image_pixel_map_mdk.h index 71d147a32..9d405956b 100644 --- a/multimedia/image_framework/include/image_pixel_map_mdk.h +++ b/multimedia/image_framework/include/image_pixel_map_mdk.h @@ -207,6 +207,31 @@ struct OhosPixelMapCreateOps { int32_t OH_PixelMap_CreatePixelMap(napi_env env, OhosPixelMapCreateOps info, void* buf, size_t len, napi_value* res); +/** + * @brief Creates a PixelMap object with stride. + * + * @param env Indicates the NAPI environment pointer. + * @param info Indicates the options for setting the PixelMap object. + * @param buf Indicates the pointer to the buffer of the image. + * @param len Indicates the image size. + * @param rowStride Indicates the stride of the image buffer. + * @param res Indicates the pointer to the PixelMap object at the application layer. + * @return Returns {@link IRNdkErrCode} IMAGE_RESULT_SUCCESS - if the operation is successful. + * returns {@link IRNdkErrCode} IMAGE_RESULT_BAD_PARAMETER - if info, len and rowStride do not match. + * returns {@link IRNdkErrCode} IMAGE_RESULT_JNI_ENV_ABNORMAL - if Abnormal JNI environment. + * returns {@link IRNdkErrCode} IMAGE_RESULT_GET_DATA_ABNORMAL - if image get data error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_CHECK_FORMAT_ERROR - if check format failed. + * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_ABNORMAL - if image input data error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL - if sharememory data abnormal. + * returns {@link IRNdkErrCode} IMAGE_RESULT_DATA_UNSUPPORT - if image init error. + * returns {@link IRNdkErrCode} IMAGE_RESULT_UNKNOWN_FORMAT - if image unknown format. + * @see OH_PixelMap_CreatePixelMapWithStride + * @since 12 + * @version 1.0 + */ +int32_t OH_PixelMap_CreatePixelMapWithStride(napi_env env, OhosPixelMapCreateOps info, + void* buf, size_t len, int32_t rowStride, napi_value* res); + /** * @brief Creates a PixelMap object that contains only alpha channel information. * diff --git a/multimedia/image_framework/libimage_pixelmap_napi.ndk.json b/multimedia/image_framework/libimage_pixelmap_napi.ndk.json index 472d50c5e..a6e75d0dc 100644 --- a/multimedia/image_framework/libimage_pixelmap_napi.ndk.json +++ b/multimedia/image_framework/libimage_pixelmap_napi.ndk.json @@ -12,6 +12,9 @@ { "name": "OH_PixelMap_CreatePixelMap" }, + { + "name": "OH_PixelMap_CreatePixelMapWithStride" + }, { "name": "OH_PixelMap_CreateAlphaPixelMap" }, diff --git a/multimedia/image_framework/libpixelmap.ndk.json b/multimedia/image_framework/libpixelmap.ndk.json index f54a82fe4..bb8d8852c 100644 --- a/multimedia/image_framework/libpixelmap.ndk.json +++ b/multimedia/image_framework/libpixelmap.ndk.json @@ -43,6 +43,14 @@ "first_introduced": "12", "name": "OH_PixelmapInitializationOptions_SetAlphaType" }, + { + "first_introduced": "12", + "name": "OH_PixelmapInitializationOptions_GetRowStride" + }, + { + "first_introduced": "12", + "name": "OH_PixelmapInitializationOptions_SetRowStride" + }, { "first_introduced": "12", "name": "OH_PixelmapInitializationOptions_Release" -- Gitee