diff --git a/multimedia/image_framework/include/image/image_packer_native.h b/multimedia/image_framework/include/image/image_packer_native.h index 32ffdff8dda41f8790a84540cd51b620bd174a88..623fdb5e5c259d1489d76d6c4ccfc345081903fc 100644 --- a/multimedia/image_framework/include/image/image_packer_native.h +++ b/multimedia/image_framework/include/image/image_packer_native.h @@ -58,6 +58,22 @@ typedef struct OH_ImagePackerNative OH_ImagePackerNative; struct OH_PackingOptions; typedef struct OH_PackingOptions OH_PackingOptions; +/** + * @brief Enumerates packing dynamic range. + * + * @since 12 + */ +typedef enum { + /* + * Packing according to the content of the image. + */ + IMAGE_PACKER_DYNAMIC_RANGE_AUTO = 0, + /* + * Packing to standard dynamic range. + */ + IMAGE_PACKER_DYNAMIC_RANGE_SDR = 1, +} IMAGE_PACKER_DYNAMIC_RANGE; + /** * @brief Create a pointer for PackingOptions struct. * @@ -112,6 +128,28 @@ Image_ErrorCode OH_PackingOptions_GetQuality(OH_PackingOptions *options, Image_ErrorCode OH_PackingOptions_SetQuality(OH_PackingOptions *options, uint32_t quality); +/** + * @brief Get desiredDynamicRange for PackingOptions struct. + * + * @param options The PackingOptions pointer will be operated. Pointer connot be null. + * @param desiredDynamicRange The number of dynamic range {@link IMAGE_PACKER_DYNAMIC_RANGE}. Pointer connot be null. + * @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - The operation is successful. + * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - Parameter error.Possible causes:Parameter verification failed. + * @since 12 + */ +Image_ErrorCode OH_PackingOptions_GetDesiredDynamicRange(OH_PackingOptions *options, int32_t* desiredDynamicRange); + +/** + * @brief Set desiredDynamicRange number for PackingOptions struct. + * + * @param options The PackingOptions pointer will be operated. Pointer connot be null. + * @param desiredDynamicRange The number of dynamic range {@link IMAGE_PACKER_DYNAMIC_RANGE}. + * @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - The operation is successful. + * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - Parameter error.Possible causes:Parameter verification failed. + * @since 12 + */ +Image_ErrorCode OH_PackingOptions_SetDesiredDynamicRange(OH_PackingOptions *options, int32_t desiredDynamicRange); + /** * @brief delete OH_PackingOptions pointer. * diff --git a/multimedia/image_framework/include/image/image_source_native.h b/multimedia/image_framework/include/image/image_source_native.h index c172388ee9fbaae60a99d2cb68ba0b619a6cd837..65e4121957801b6b5f4655acff1d87d2a4aecf91 100644 --- a/multimedia/image_framework/include/image/image_source_native.h +++ b/multimedia/image_framework/include/image/image_source_native.h @@ -60,6 +60,26 @@ typedef struct OH_ImageSourceNative OH_ImageSourceNative; struct OH_ImageSource_Info; typedef struct OH_ImageSource_Info OH_ImageSource_Info; +/** + * @brief Enumerates decoding dynamic range.. + * + * @since 12 + */ +typedef enum { + /* + * Dynamic range depends on the image. + */ + IMAGE_DYNAMIC_RANGE_AUTO = 0, + /* + * Standard dynamic range. + */ + IMAGE_DYNAMIC_RANGE_SDR = 1, + /* + * High dynamic range. + */ + IMAGE_DYNAMIC_RANGE_HDR = 2, +} IMAGE_DYNAMIC_RANGE; + /** * @brief Create a pointer for OH_ImageSource_Info struct. * @@ -89,6 +109,17 @@ Image_ErrorCode OH_ImageSourceInfo_GetWidth(OH_ImageSource_Info *info, uint32_t */ Image_ErrorCode OH_ImageSourceInfo_GetHeight(OH_ImageSource_Info *info, uint32_t *height); +/** + * @brief Get isHdr for OH_ImageSource_Info struct. + * + * @param info The OH_ImageSource_Info pointer will be operated. Pointer connot be null. + * @param isHdr Whether the image has a high dynamic range. + * @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - The operation is successful. + * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - Parameter error.Possible causes:Parameter verification failed. + * @since 12 + */ +Image_ErrorCode OH_ImageSourceInfo_GetDynamicRange(OH_ImageSource_Info *info, bool *isHdr); + /** * @brief delete OH_ImageSource_Info pointer. * @@ -222,6 +253,30 @@ Image_ErrorCode OH_DecodingOptions_GetDesiredRegion(OH_DecodingOptions *options, Image_ErrorCode OH_DecodingOptions_SetDesiredRegion(OH_DecodingOptions *options, Image_Region *desiredRegion); +/** + * @brief Set desiredDynamicRange number for OH_DecodingOptions struct. + * + * @param options The OH_DecodingOptions pointer will be operated. Pointer connot be null. + * @param desiredDynamicRange the number of desired dynamic range {@link IMAGE_DYNAMIC_RANGE}. Pointer connot be null. + * @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - The operation is successful. + * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - Parameter error.Possible causes:Parameter verification failed. + * @since 12 + */ +Image_ErrorCode OH_DecodingOptions_GetDesiredDynamicRange(OH_DecodingOptions *options, + int32_t *desiredDynamicRange); + +/** + * @brief Set desiredDynamicRange number for OH_DecodingOptions struct. + * + * @param options The OH_DecodingOptions pointer will be operated. Pointer connot be null. + * @param desiredDynamicRange the number of desired dynamic range {@link IMAGE_DYNAMIC_RANGE}. + * @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - The operation is successful. + * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - Parameter error.Possible causes:Parameter verification failed. + * @since 12 + */ +Image_ErrorCode OH_DecodingOptions_SetDesiredDynamicRange(OH_DecodingOptions *options, + int32_t desiredDynamicRange); + /** * @brief delete OH_DecodingOptions pointer. * diff --git a/multimedia/image_framework/include/image/pixelmap_native.h b/multimedia/image_framework/include/image/pixelmap_native.h index 5f176d8215926e024cc745955f917f877d2b97ed..507e3f6435d33689bf3aad8ed5e8c5f45af679f7 100644 --- a/multimedia/image_framework/include/image/pixelmap_native.h +++ b/multimedia/image_framework/include/image/pixelmap_native.h @@ -289,6 +289,17 @@ Image_ErrorCode OH_PixelmapImageInfo_GetPixelFormat(OH_Pixelmap_ImageInfo *info, */ Image_ErrorCode OH_PixelmapImageInfo_GetAlphaType(OH_Pixelmap_ImageInfo *info, int32_t *alphaType); +/** + * @brief Get isHdr boolean for imageinfo struct. + * + * @param info The imageinfo pointer will be operated. Pointer connot be null. + * @param isHdr Whether the image has a high dynamic range. + * @return Returns {@link Image_ErrorCode} IMAGE_SUCCESS - The operation is successful. + * returns {@link Image_ErrorCode} IMAGE_BAD_PARAMETER - Parameter error.Possible causes:Parameter verification failed. + * @since 12 + */ +Image_ErrorCode OH_PixelmapImageInfo_GetDynamicRange(OH_Pixelmap_ImageInfo *info, bool *isHdr); + /** * @brief Delete imageinfo struct pointer. *