From 8c63b46cce346b90caec0a680a35dbfe873224ee Mon Sep 17 00:00:00 2001 From: wangdongyusky <15222869+wangdongyusky@user.noreply.gitee.com> Date: Wed, 28 May 2025 11:17:20 +0800 Subject: [PATCH] =?UTF-8?q?ndk=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wang --- multimedia/camera_framework/camera.h | 43 ++++++++++ multimedia/camera_framework/camera.ndk.json | 24 ++++++ multimedia/camera_framework/capture_session.h | 84 +++++++++++++++++++ 3 files changed, 151 insertions(+) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 274390abd..60026174e 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 e92a2841f..5bb71a86e 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 93e77e118..34ea4d17f 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 -- Gitee