diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 274390abd1f8e5c21d6699f604f0454fb2ccba0f..60026174e5eb403b8804eb90cc69e64146fab51e 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -1152,6 +1152,49 @@ typedef struct Camera_ConcurrentInfo { uint32_t modeAndCapabilitySize; } Camera_ConcurrentInfo; +/** + * @brief Enumerates the white balance modes. + * + * @since 20 + * @version 1.0 + */ +typedef enum Camera_WhiteBalanceMode { + /** + * Auto white balance mode. + */ + WHITE_BALANCE_MODE_AUTO = 0, + + /** + * Cloudy white balance mode. + */ + WHITE_BALANCE_MODE_CLOUDY = 1, + + /** + * Incandescent white balance mode. + */ + WHITE_BALANCE_MODE_INCANDESCENT = 2, + + /** + * Fluorescent white balance mode. + */ + WHITE_BALANCE_MODE_FLUORESCENT = 3, + + /** + * Daylight white balance mode. + */ + WHITE_BALANCE_MODE_DAYLIGHT = 4, + + /** + * Manual white balance mode. + */ + WHITE_BALANCE_MODE_MANUAL = 5, + + /** + * Locked white balance mode. + */ + WHITE_BALANCE_MODE_LOCKED = 6 +} Camera_WhiteBalanceMode; + #ifdef __cplusplus } #endif diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index e92a2841fea73cf29949a8c360cd504a751e337d..5bb71a86e196c8a5e8a3dae1e1ec126fbda71d0f 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -670,5 +670,29 @@ { "first_introduced": "19", "name": "OH_CaptureSession_EnableMacro" + }, + { + "first_introduced": "20", + "name": "OH_CaptureSession_IsWhiteBalanceModeSupported" + }, + { + "first_introduced": "20", + "name": "OH_CaptureSession_GetWhiteBalanceMode" + }, + { + "first_introduced": "20", + "name": "OH_CaptureSession_GetWhiteBalanceRange" + }, + { + "first_introduced": "20", + "name": "OH_CaptureSession_GetWhiteBalance" + }, + { + "first_introduced": "20", + "name": "OH_CaptureSession_SetWhiteBalance" + }, + { + "first_introduced": "20", + "name": "OH_CaptureSession_SetWhiteBalanceMode" } ] diff --git a/multimedia/camera_framework/capture_session.h b/multimedia/camera_framework/capture_session.h index 93e77e11881b41895cb9d56b4ba5141c5056c2e1..34ea4d17f5288707b307bb5394703ced8186b0b6 100644 --- a/multimedia/camera_framework/capture_session.h +++ b/multimedia/camera_framework/capture_session.h @@ -956,6 +956,90 @@ Camera_ErrorCode OH_CaptureSession_IsMacroSupported(Camera_CaptureSession* sessi */ Camera_ErrorCode OH_CaptureSession_EnableMacro(Camera_CaptureSession* session, bool enabled); +/** + * @brief Checks whether the specified white balance mode is supported. + * + * @param session Pointer to an {@link Camera_CaptureSession} instance. + * @param whiteBalanceMode White balance mode. + * @param isSupported Pointer to the check result. + * @return Result code. + * {@link #CAMERA_OK} is returned if the function is called successfully. + * {@link #CAMERA_INVALID_ARGUMENT} is returned if the input parameter is missing or the parameter type is incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} is returned if the camera session is not configured. + * @since 20 + */ +Camera_ErrorCode OH_CaptureSession_IsWhiteBalanceModeSupported( + Camera_CaptureSession *session, Camera_WhiteBalanceMode whiteBalanceMode, bool *isSupported); + +/** + * @brief Obtains the white balance mode in use. + * + * @param session Pointer to an {@link Camera_CaptureSession} instance. + * @param whiteBalanceMode Pointer to the white balance mode. + * @return Result code. + * {@link #CAMERA_OK} is returned if the function is called successfully. + * {@link #CAMERA_INVALID_ARGUMENT} is returned if the input parameter is missing or the parameter type is incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} is returned if the camera session is not configured. + * @since 20 + */ +Camera_ErrorCode OH_CaptureSession_GetWhiteBalanceMode( + Camera_CaptureSession *session, Camera_WhiteBalanceMode *whiteBalanceMode); + +/** + * @brief Obtains the supported white balance color temperature range. + * + * @param session Pointer to an {@link Camera_CaptureSession} instance. + * @param minColorTemperature Pointer to the minimum color temperature. + * @param maxColorTemperature Pointer to the maximum color temperature. + * @return Result code. + * {@link #CAMERA_OK} is returned if the function is called successfully. + * {@link #CAMERA_INVALID_ARGUMENT} is returned if the input parameter is missing or the parameter type is incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} is returned if the camera session is not configured. + * @since 20 + */ +Camera_ErrorCode OH_CaptureSession_GetWhiteBalanceRange( + Camera_CaptureSession *session, int32_t *minColorTemperature, int32_t *maxColorTemperature); + +/** + * @brief Obtains the white balance color temperature. + * + * @param session Pointer to an {@link Camera_CaptureSession} instance. + * @param colorTemperature Pointer to the color temperature. + * @return Result code. + * {@link #CAMERA_OK} is returned if the function is called successfully. + * {@link #CAMERA_INVALID_ARGUMENT} is returned if the input parameter is missing or the parameter type is incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} is returned if the camera session is not configured. + * @since 20 + */ +Camera_ErrorCode OH_CaptureSession_GetWhiteBalance(Camera_CaptureSession *session, int32_t *colorTemperature); + +/** + * @brief Sets the white balance color temperature. + * + * @param session Pointer to an {@link Camera_CaptureSession} instance. + * @param colorTemperature Color temperature. + * @return Result code. + * {@link #CAMERA_OK} is returned if the function is called successfully. + * {@link #CAMERA_INVALID_ARGUMENT} is returned if the input parameter is missing or the parameter type is incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} is returned if the camera session is not configured. + * @since 20 + */ +Camera_ErrorCode OH_CaptureSession_SetWhiteBalance(Camera_CaptureSession *session, int32_t colorTemperature); + +/** + * @brief Sets a white balance mode. + * + * @param session Pointer to an {@link Camera_CaptureSession} instance. + * @param whiteBalanceMode White balance mode. + * @return Result code. + * {@link #CAMERA_OK} is returned if the function is called successfully. + * {@link #CAMERA_INVALID_ARGUMENT} is returned if the input parameter is missing or the parameter type is incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} is returned if the camera session is not configured. + * @since 20 + */ +Camera_ErrorCode OH_CaptureSession_SetWhiteBalanceMode( + Camera_CaptureSession *session, Camera_WhiteBalanceMode whiteBalanceMode); + #ifdef __cplusplus } #endif