!536 add image hdr capi

Merge pull request !536 from zjy/master
This commit is contained in:
openharmony_ci 2024-04-28 17:59:43 +00:00 committed by Gitee
commit 086f8d90cb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 104 additions and 0 deletions

View File

@ -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.
*

View File

@ -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.
*

View File

@ -315,6 +315,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.
*