From 8ea1710b988b67b8d8aa084ebbbc85bf84f69398 Mon Sep 17 00:00:00 2001 From: dev-zut Date: Tue, 25 Feb 2025 21:27:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9EOH=5FDecodingOptions=5FGe?= =?UTF-8?q?tCropAndScaleStrategy=EF=BC=8COH=5FDecodingOptions=5FSetCropAnd?= =?UTF-8?q?ScaleStrategy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dev-zut --- .../include/image/image_source_native.h | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/multimedia/image_framework/include/image/image_source_native.h b/multimedia/image_framework/include/image/image_source_native.h index 73deea802..a016a371f 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 Type of allocator used to allocate memory of a PixelMap.. + * + * @since 15 + */ +typedef enum { + /* + * The system determines which memory to use to create the PixelMap. + */ + SCALE_FIRST = 1, + /* + * Use DMA buffer to create the PixelMap. + */ + 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 pixelFormat number for OH_DecodingOptions struct. + * + * @param options The OH_DecodingOptions pointer will be operated. + * @param pixelFormat the number of image pixelFormat. + * @return Returns {@link Image_ErrorCode} + * @since 12 + */ +Image_ErrorCode OH_DecodingOptions_GetCropAndScaleStrategy(OH_DecodingOptions *options, + int32_t *cropAndScaleStrategy); + +/** + * @brief Set pixelFormat number for OH_DecodingOptions struct. + * + * @param options The OH_DecodingOptions pointer will be operated. + * @param pixelFormat the number of image pixelFormat. + * @return Returns {@link Image_ErrorCode} + * @since 12 + */ +Image_ErrorCode OH_DecodingOptions_SetCropAndScaleStrategy(OH_DecodingOptions *options, + int32_t cropAndScaleStrategy); + + /** * @brief Get index number for OH_DecodingOptions struct. * -- Gitee From 0b018cb57b02c24c07aee81b8c967d6905bf0880 Mon Sep 17 00:00:00 2001 From: dev-zut Date: Tue, 25 Feb 2025 21:27:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=A2=9EOH=5FDecodingOptions=5FGe?= =?UTF-8?q?tCropAndScaleStrategy=EF=BC=8COH=5FDecodingOptions=5FSetCropAnd?= =?UTF-8?q?ScaleStrategy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: sjanbs --- .../include/image/image_source_native.h | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/multimedia/image_framework/include/image/image_source_native.h b/multimedia/image_framework/include/image/image_source_native.h index 73deea802..a016a371f 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 Type of allocator used to allocate memory of a PixelMap.. + * + * @since 15 + */ +typedef enum { + /* + * The system determines which memory to use to create the PixelMap. + */ + SCALE_FIRST = 1, + /* + * Use DMA buffer to create the PixelMap. + */ + 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 pixelFormat number for OH_DecodingOptions struct. + * + * @param options The OH_DecodingOptions pointer will be operated. + * @param pixelFormat the number of image pixelFormat. + * @return Returns {@link Image_ErrorCode} + * @since 12 + */ +Image_ErrorCode OH_DecodingOptions_GetCropAndScaleStrategy(OH_DecodingOptions *options, + int32_t *cropAndScaleStrategy); + +/** + * @brief Set pixelFormat number for OH_DecodingOptions struct. + * + * @param options The OH_DecodingOptions pointer will be operated. + * @param pixelFormat the number of image pixelFormat. + * @return Returns {@link Image_ErrorCode} + * @since 12 + */ +Image_ErrorCode OH_DecodingOptions_SetCropAndScaleStrategy(OH_DecodingOptions *options, + int32_t cropAndScaleStrategy); + + /** * @brief Get index number for OH_DecodingOptions struct. * -- Gitee