From 2e75e0992260d31831b6862634b69737c828130c Mon Sep 17 00:00:00 2001 From: zhaona45 Date: Wed, 14 May 2025 16:54:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BC=96=E8=A7=A3=E7=A0=81?= =?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: zhaona45 Change-Id: I9b146c285bfc8d222c4c1cb2961caaa04cf96ed0 --- .../include/image/image_packer_native.h | 12 +++++ .../include/image/image_source_native.h | 48 +++++++++++++++++++ .../image_framework/libimage_packer.ndk.json | 4 ++ .../image_framework/libimage_source.ndk.json | 16 +++++++ 4 files changed, 80 insertions(+) diff --git a/multimedia/image_framework/include/image/image_packer_native.h b/multimedia/image_framework/include/image/image_packer_native.h index 6020ea9cc..7149c5fd8 100644 --- a/multimedia/image_framework/include/image/image_packer_native.h +++ b/multimedia/image_framework/include/image/image_packer_native.h @@ -479,6 +479,18 @@ Image_ErrorCode OH_ImagePackerNative_PackToFileFromPixelmapSequence(OH_ImagePack */ Image_ErrorCode OH_ImagePackerNative_Release(OH_ImagePackerNative *imagePacker); +/** + * @brief Obtains the supported image formats that can be encoded. + * + * @param supportedFormats Double pointer to an array of the supported image formats. + * @param length Pointer to the length of the array. + * @return One of the following result codes: + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_PACKER_INVALID_PARAMETER} if supportedFormats or length is empty. + * @since 20 + */ +Image_ErrorCode OH_ImagePackerNative_GetSupportedFormats(Image_MimeType **supportedFormats, size_t *length); + #ifdef __cplusplus }; #endif diff --git a/multimedia/image_framework/include/image/image_source_native.h b/multimedia/image_framework/include/image/image_source_native.h index 66e83042b..3513d6095 100644 --- a/multimedia/image_framework/include/image/image_source_native.h +++ b/multimedia/image_framework/include/image/image_source_native.h @@ -176,6 +176,18 @@ Image_ErrorCode OH_ImageSourceInfo_GetHeight(OH_ImageSource_Info *info, uint32_t */ Image_ErrorCode OH_ImageSourceInfo_GetDynamicRange(OH_ImageSource_Info *info, bool *isHdr); +/** + * @brief Obtains the MIME type of an image source. + * + * @param info Pointer to the OH_ImageSource_Info struct. + * @param mimeType Pointer to the MIME type of the image source. + * @return Returns one of the following result codes: + * {@link IMAGE_SUCCESS}: The execution is successful. + * {@link IMAGE_SOURCE_INVALID_PARAMETER}: info or mimeType is a null pointer. + * @since 20 + */ +Image_ErrorCode OH_ImageSourceInfo_GetMimeType(OH_ImageSource_Info *info, Image_MimeType *mimeType); + /** * @brief delete OH_ImageSource_Info pointer. * @@ -386,6 +398,30 @@ Image_ErrorCode OH_DecodingOptions_SetCropRegion(OH_DecodingOptions *options, Im */ Image_ErrorCode OH_DecodingOptions_GetCropRegion(OH_DecodingOptions *options, Image_Region *cropRegion); +/** + * @brief Obtains the color space set in the decoding options. + * + * @param options Pointer to the decoding options. + * @param colorSpace Pointer to the color space, {@link ColorSpaceName}. + * @return Returns one of the following result codes: + * {@link IMAGE_SUCCESS}: if the execution is successful. + * {@link IMAGE_SOURCE_INVALID_PARAMETER}: if options or colorSpace is null pointer. + * @since 20 + */ +Image_ErrorCode OH_DecodingOptions_GetDesiredColorSpace(OH_DecodingOptions *options, int32_t *colorSpace); + +/** + * @brief Sets desired color space for decoding options. + * + * @param options Pointer to the decoding options. + * @param colorSpace Desired color space, {@link ColorSpaceName}. + * @return Returns one of the following result codes: + * {@link IMAGE_SUCCESS}: if the execution is successful. + * {@link IMAGE_SOURCE_INVALID_PARAMETER}: if options is a null pointer or colorSpace is not supported. + * @since 20 + */ +Image_ErrorCode OH_DecodingOptions_SetDesiredColorSpace(OH_DecodingOptions *options, int32_t colorSpace); + /** * @brief delete OH_DecodingOptions pointer. * @@ -648,6 +684,18 @@ Image_ErrorCode OH_DecodingOptionsForPicture_SetDesiredAuxiliaryPictures(OH_Deco * @since 13 */ Image_ErrorCode OH_DecodingOptionsForPicture_Release(OH_DecodingOptionsForPicture *options); + +/** + * @brief Obtains the supported image formats that can be decoded. + * + * @param supportedFormats Double pointer to an array of the supported image formats. + * @param length Pointer to the length of the array. + * @return One of the following result codes: + * {@link IMAGE_SUCCESS} if the execution is successful. + * {@link IMAGE_SOURCE_INVALID_PARAMETER} if supportedFormats or length is empty. + * @since 20 + */ +Image_ErrorCode OH_ImageSourceNative_GetSupportedFormats(Image_MimeType **supportedFormats, size_t *length); #ifdef __cplusplus }; #endif diff --git a/multimedia/image_framework/libimage_packer.ndk.json b/multimedia/image_framework/libimage_packer.ndk.json index ea2143d7c..284840815 100644 --- a/multimedia/image_framework/libimage_packer.ndk.json +++ b/multimedia/image_framework/libimage_packer.ndk.json @@ -122,5 +122,9 @@ { "first_introduced": "12", "name": "OH_ImagePackerNative_Release" + }, + { + "first_introduced": "20", + "name": "OH_ImagePackerNative_GetSupportedFormats" } ] \ No newline at end of file diff --git a/multimedia/image_framework/libimage_source.ndk.json b/multimedia/image_framework/libimage_source.ndk.json index 877bae574..e95669459 100644 --- a/multimedia/image_framework/libimage_source.ndk.json +++ b/multimedia/image_framework/libimage_source.ndk.json @@ -15,6 +15,10 @@ "first_introduced": "12", "name": "OH_ImageSourceInfo_GetDynamicRange" }, + { + "first_introduced": "20", + "name": "OH_ImageSourceInfo_GetMimeType" + }, { "first_introduced": "12", "name": "OH_ImageSourceInfo_Release" @@ -87,6 +91,14 @@ "first_introduced": "19", "name": "OH_DecodingOptions_GetCropRegion" }, + { + "first_introduced": "20", + "name": "OH_DecodingOptions_GetDesiredColorSpace" + }, + { + "first_introduced": "20", + "name": "OH_DecodingOptions_SetDesiredColorSpace" + }, { "first_introduced": "12", "name": "OH_DecodingOptions_Release" @@ -166,5 +178,9 @@ { "first_introduced": "13", "name": "OH_DecodingOptionsForPicture_Release" + }, + { + "first_introduced": "20", + "name": "OH_ImageSourceNative_GetSupportedFormats" } ] \ No newline at end of file -- Gitee