diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h
index fccadfd990a27688157db057e8cbf40443fdf4e4..8fd521e0d197d0401ef49e42f99cda6f15c1992f 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 level.
+ *
+ * @since 12
+ */
+typedef enum {
+ /**
+ * Nearest-neighbor interpolation
+ */
+ OH_PixelmapNative_AntiAliasing_NONE = 0,
+ /**
+ * Bilinear interpolation
+ */
+ OH_PixelmapNative_AntiAliasing_LOW = 1,
+ /**
+ * Bilinear interpolation with mipmap linear filtering
+ */
+ OH_PixelmapNative_AntiAliasing_MEDIUM = 2,
+ /**
+ * Cubic interpolation
+ */
+ OH_PixelmapNative_AntiAliasing_HIGH = 3,
+} OH_PixelmapNative_AntiAliasingLevel;
+
/**
* @brief Defines the options used for creating a pixel map.
*
@@ -239,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.
*
@@ -413,6 +463,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 level The anti-aliasing method to be used.
+ * @return Returns {@link Image_ErrorCode}
+ * @see OH_PixelmapNative
+ * @since 12
+ */
+Image_ErrorCode OH_PixelmapNative_ScaleWithAntiAliasing(OH_PixelmapNative *pixelmap, float scaleX, float scaleY,
+ 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 b5cf58c3a993432a666fd1cab7b7126e44b73723..9d405956bd60ec9b00dcf37990e04d15fae834e3 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 level.
+ *
+ * @since 12
+ * @version 1.0
+ */
+typedef enum {
+ /**
+ * Nearest-neighbor interpolation.
+ */
+ OH_PixelMap_AntiAliasing_NONE = 0,
+ /**
+ * Bilinear interpolation.
+ */
+ OH_PixelMap_AntiAliasing_LOW = 1,
+ /**
+ * Bilinear interpolation with mipmap linear filtering.
+ */
+ OH_PixelMap_AntiAliasing_MEDIUM = 2,
+ /**
+ * Cubic interpolation.
+ */
+ OH_PixelMap_AntiAliasing_HIGH = 3,
+} OH_PixelMap_AntiAliasingLevel;
+
/**
* @brief Defines the options used for creating a pixel map.
*
@@ -182,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.
*
@@ -387,6 +437,40 @@ 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 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.
+ * 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 Scale
+ * @since 12
+ * @version 1.0
+ */
+int32_t OH_PixelMap_ScaleWithAntiAliasing(const NativePixelMap* native, float x, float y,
+ OH_PixelMap_AntiAliasingLevel level);
+
/**
* @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 64800fe826282f2c62c68ee354f432af18ea4fed..a6e75d0dc348955eae8b6c694fa7f7072e53252d 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"
},
@@ -42,6 +45,9 @@
{
"name": "OH_PixelMap_Scale"
},
+ {
+ "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 c2b1ca51855a39578a673daca166aa73395ac735..bb8d8852c4f3adbdd8454420bfb73a7de0c1aec1 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"
@@ -107,6 +115,10 @@
"first_introduced": "12",
"name": "OH_PixelmapNative_Scale"
},
+ {
+ "first_introduced": "12",
+ "name": "OH_PixelmapNative_ScaleWithAntiAliasing"
+ },
{
"first_introduced": "12",
"name": "OH_PixelmapNative_Translate"