diff --git a/multimedia/image_framework/include/image/image_common.h b/multimedia/image_framework/include/image/image_common.h index d17f95a5d5ebb8adbf2609da5e29731e87dc3840..753fddaeba45809fb3796b67982f2193c46bab0a 100644 --- a/multimedia/image_framework/include/image/image_common.h +++ b/multimedia/image_framework/include/image/image_common.h @@ -203,6 +203,11 @@ typedef enum { * @since 15 */ IMAGE_SOURCE_UNSUPPORTED_OPTIONS = 7700203, + /** + * @error Invalid parameter. + * @since 19 + */ + IMAGE_SOURCE_INVALID_PARAMETER = 7700204, /** decode failed */ IMAGE_DECODE_FAILED = 7700301, /** diff --git a/multimedia/image_framework/include/image/image_source_native.h b/multimedia/image_framework/include/image/image_source_native.h index faa192067303cfafd71b3f43de4814321a02ae55..43000f092642d374b6691ebc83e47a952ef5f53f 100644 --- a/multimedia/image_framework/include/image/image_source_native.h +++ b/multimedia/image_framework/include/image/image_source_native.h @@ -362,6 +362,30 @@ Image_ErrorCode OH_DecodingOptions_GetCropAndScaleStrategy(OH_DecodingOptions *o Image_ErrorCode OH_DecodingOptions_SetDesiredDynamicRange(OH_DecodingOptions *options, int32_t desiredDynamicRange); +/** + * @brief Sets the crop region for the decoding options. + * + * @param options Pointer to the decoding options. + * @param cropRegion The target region will be cropped from the image. + * @return Returns one of the following result codes: + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_SOURCE_INVALID_PARAMETER} if options or cropRegion is null pointer. + * @since 19 + */ +Image_ErrorCode OH_DecodingOptions_SetCropRegion(OH_DecodingOptions *options, Image_Region *cropRegion); + +/** + * @brief Gets the crop region for the decoding options. + * + * @param options Pointer to the decoding options. + * @param cropRegion The target region will be cropped from the image. + * @return Returns one of the following result codes: + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_SOURCE_INVALID_PARAMETER} if options or cropRegion is null pointer. + * @since 19 + */ +Image_ErrorCode OH_DecodingOptions_GetCropRegion(OH_DecodingOptions *options, Image_Region *cropRegion); + /** * @brief delete OH_DecodingOptions pointer. * diff --git a/multimedia/image_framework/libimage_source.ndk.json b/multimedia/image_framework/libimage_source.ndk.json index ca6fab1a3a7049fe5b1e2cb062fcc0fc1078472e..104bb376a28f2b6593fb091819268a0dbaf79520 100644 --- a/multimedia/image_framework/libimage_source.ndk.json +++ b/multimedia/image_framework/libimage_source.ndk.json @@ -79,6 +79,14 @@ "first_introduced": "18", "name": "OH_DecodingOptions_GetCropAndScaleStrategy" }, + { + "first_introduced": "19", + "name": "OH_DecodingOptions_SetCropRegion" + }, + { + "first_introduced": "19", + "name": "OH_DecodingOptions_GetCropRegion" + }, { "first_introduced": "12", "name": "OH_DecodingOptions_Release"