diff --git a/multimedia/image_framework/include/image/image_source_native.h b/multimedia/image_framework/include/image/image_source_native.h index 73deea8022baa5b9cbcc1eb7301e5ad8d33fba9e..760b8ca7c28aafe75dc555a95fa88dbb5ad28def 100644 --- a/multimedia/image_framework/include/image/image_source_native.h +++ b/multimedia/image_framework/include/image/image_source_native.h @@ -118,6 +118,23 @@ typedef enum { IMAGE_ALLOCATOR_TYPE_SHARE_MEMORY = 2, } IMAGE_ALLOCATOR_TYPE; +/** + * @brief Confirm the enumeration type for decoding and scaling order of the region.. + * + * @since 16 + */ +typedef enum { + /* + * First scale, then crop. + */ + SCALE_FIRST = 1, + /* + * Perform region decoding first and then scaling. + */ + CROP_FIRST = 2 +} CROP_SCALE_STRATEGY; + + /** * @brief Create a pointer for OH_ImageSource_Info struct. * @@ -207,6 +224,30 @@ Image_ErrorCode OH_DecodingOptions_GetPixelFormat(OH_DecodingOptions *options, Image_ErrorCode OH_DecodingOptions_SetPixelFormat(OH_DecodingOptions *options, int32_t pixelFormat); + +/** + * @brief Get scaleStrategy number for OH_DecodingOptions struct. + * + * @param options The OH_DecodingOptions pointer will be operated. + * @param cropAndScaleStrategy the number of Scaling and cropping strategy. + * @return Returns {@link Image_ErrorCode} + * @since 16 + */ +Image_ErrorCode OH_DecodingOptions_GetCropAndScaleStrategy(OH_DecodingOptions *options, + int32_t *cropAndScaleStrategy); + +/** + * @brief Set scaleStrategy number for OH_DecodingOptions struct. + * + * @param options The OH_DecodingOptions pointer will be operated. + * @param cropAndScaleStrategy the number of Scaling and cropping strategy. + * @return Returns {@link Image_ErrorCode} + * @since 16 + */ +Image_ErrorCode OH_DecodingOptions_SetCropAndScaleStrategy(OH_DecodingOptions *options, + int32_t cropAndScaleStrategy); + + /** * @brief Get index number for OH_DecodingOptions struct. *