Skip to content
Open
5 changes: 5 additions & 0 deletions config/pq_capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -1717,6 +1717,11 @@
"Warm",
"Cold",
"UserDefined"
],
"color": [
"Red",
"Green",
"Blue"
],
"context": {
"Standard": {
Expand Down
66 changes: 51 additions & 15 deletions include/tvSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -3853,12 +3853,16 @@ tvError_t GetMEMC(tvVideoSrcType_t videoSrcType, tvPQModeIndex_t pq_mode, tvVide
*
* If the platform does not support multi-point white balance, then tvERROR_OPERATION_NOT_SUPPORTED is returned.
*
* @param[out] num_hal_matrix_points - The number of points in the HAL gamma matrix.
* @param[out] rgb_min - The minimum value for red, green and blue adjustment values.
* @param[out] rgb_max - The maximum value for red, green and blue adjustment values.
* @param[out] num_ui_matrix_points - The number of points in the UI gamma matrix for customer adjustment.
* @param[out] ui_matrix_positions - An array of positions for the UI matrix points.
* Points to an array with `num_ui_matrix_points` elements with values between 0.0 and 1.0.
* @param[out] multiPointMatrix - Returns a pointer to an structure which contains values associated with MutiPoint WhiteBalance
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mutipoint -> Multipoint

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

* - The returned Pointer must not be freed by the caller.
* - Memory should be allocated in HAL function

* @param[out] colorTemperature - A pointer to an array of the supported colorTemperature components.
* @param[out] color - A pointer to an array of the supported white balance color components.
* @param[out] num_colorTemperature - The total number of supported MultiPoint white balance colorTemperature components.
* - Represents the number of elements in the 'colorTemperature' array.
* @param[out] num_color - The total number of supported MultiPoint white balance color components.
* - Represents the number of elements in the 'color' array.
* @param[out] context_caps - A capabilities structure listing the configuration contexts supported.
*
* @return tvError_t
Expand All @@ -3871,7 +3875,7 @@ tvError_t GetMEMC(tvVideoSrcType_t videoSrcType, tvPQModeIndex_t pq_mode, tvVide
*
* @pre TvInit() should be called before calling this API
*/
tvError_t GetMultiPointWBCaps(int * num_hal_matrix_points, int * rgb_min, int * rgb_max, int * num_ui_matrix_points, double ** ui_matrix_positions, tvContextCaps_t ** context_caps);
tvError_t GetMultiPointWBCaps( tvMultiPointWB_t **multiPointMatrix, tvColorTemp_t **colorTemperature, tvWBColor_t **color, size_t* num_colorTemperature, size_t* num_color, tvContextCaps_t ** context_caps);

/**
* @brief Sets the multi-point white balance red, green and blue values for the whole matrix.
Expand All @@ -3887,10 +3891,10 @@ tvError_t GetMultiPointWBCaps(int * num_hal_matrix_points, int * rgb_min, int *
*
* If the platform does not support multi-point white balance, then tvERROR_OPERATION_NOT_SUPPORTED is returned.
*
* @param[in] colorTemp - Color temperature type value. Valid value will be a member of ::tvColorTemp_t
* @param[in] videoSrcType - Source input value. Valid value will be a member of ::tvVideoSrcType_t
* @param[in] pq_mode - Picture mode index. Valid value will be a member of ::tvPQModeIndex_t
* @param[in] videoFormatType - Video format type value. Valid value will be a member of ::tvVideoFormatType_t
* @param[in] videoSrcType - Source input value. Valid value will be a member of ::tvVideoSrcType_t
* @param[in] colorTemp - Color temperature type value. Valid value will be a member of ::tvColorTemp_t
* @param[in] r - Array of red values. Element values must be `rgb_min` <= r <= `rgb_max` as returned by GetMultiPointWBCaps().
* @param[in] g - Array of green values. Element values must be `rgb_min` <=g <= `rgb_max` as returned by GetMultiPointWBCaps().
* @param[in] b - Array of blue values. Element values must be `rgb_min` <=b <= `rgb_max` as returned by GetMultiPointWBCaps().
Expand All @@ -3905,7 +3909,7 @@ tvError_t GetMultiPointWBCaps(int * num_hal_matrix_points, int * rgb_min, int *
*
* @pre TvInit() should be called before calling this API
*/
tvError_t SetMultiPointWBMatrix(tvColorTemp_t colorTemp, tvPQModeIndex_t pq_mode, tvVideoFormatType_t videoFormatType, tvVideoSrcType_t videoSrcType, int * r, int * g, int * b);
tvError_t SetMultiPointWBMatrix(tvVideoSrcType_t videoSrcType, tvPQModeIndex_t pq_mode, tvVideoFormatType_t videoFormatType, tvColorTemp_t colorTemp, int * r, int * g, int * b);

/**
* @brief Gets the multi-point white balance red, green and blue values for the whole matrix.
Expand All @@ -3918,10 +3922,10 @@ tvError_t SetMultiPointWBMatrix(tvColorTemp_t colorTemp, tvPQModeIndex_t pq_mode
*
* If the platform does not support multi-point white balance, then tvERROR_OPERATION_NOT_SUPPORTED is returned.
*
* @param[in] colorTemp         - Color temperature type value. Valid value will be a member of ::tvColorTemp_t
* @param[in] pq_mode           - Picture mode index. Valid value will be a member of ::tvPQModeIndex_t
* @param[in] videoFormatType   - Video format type value. Valid value will be a member of ::tvVideoFormatType_t
* @param[in] videoSrcType      - Source input value. Valid value will be a member of ::tvVideoSrcType_t
* @param[in] videoSrcType - Source input value. Valid value will be a member of ::tvVideoSrcType_t
* @param[in] pq_mode - Picture mode index. Valid value will be a member of ::tvPQModeIndex_t
* @param[in] videoFormatType - Video format type value. Valid value will be a member of ::tvVideoFormatType_t
* @param[in] colorTemp - Color temperature type value. Valid value will be a member of ::tvColorTemp_t
* @param[in] r                 - Array of red values.  Element values must be `rgb_min` <= r <= `rgb_max` as returned by GetMultiPointWBCaps().
* @param[in] g                 - Array of green values.  Element values must be `rgb_min` <= g <= `rgb_max` as returned by GetMultiPointWBCaps().
* @param[in] b                 - Array of blue values.  Element values must be `rgb_min` <= b <= `rgb_max` as returned by GetMultiPointWBCaps().
Expand All @@ -3936,7 +3940,39 @@ tvError_t SetMultiPointWBMatrix(tvColorTemp_t colorTemp, tvPQModeIndex_t pq_mode
*
* @pre TvInit() should be called before calling this API
*/
tvError_t GetMultiPointWBMatrix(tvColorTemp_t colorTemp, tvPQModeIndex_t pq_mode, tvVideoFormatType_t videoFormatType, tvVideoSrcType_t videoSrcType, int * r, int * g, int * b);
tvError_t GetMultiPointWBMatrix(tvVideoSrcType_t videoSrcType, tvPQModeIndex_t pq_mode, tvVideoFormatType_t videoFormatType, tvColorTemp_t colorTemp, int * r, int * g, int * b);

/**
* @brief Gets the default MultiPoint WhiteBalance.
*
* This function gets the default multi-point white balance values for the given videoSource,
* videoFormat,pictureMode and colorTemperature.
*
*
* Gain - Modifies the intensity of Red, Green, and Blue at the brighter level
* Offset - Modifies the intensity of Red, Green, and Blue at the darker level
*
* @param[in] videoSrcType - Source input value.Valid value will be a member of ::tvVideoSrcType_t
* @param[in] pictureMode - Picture mode value to be saved.Valid values are as per values returned by
* ::pic_modes_t.value parmeter from GetTVSupportedPictureModes API.
* @param[in] videoFormatType - Video format type value.Valid value will be a member of ::tvVideoFormatType_t
* @param[in] colorTemperature - ColorTemperature value. Valid value will be a member of ::tvColorTemp_t
* @param[in] r                  - Array of red values.  Element values must be `rgb_min` <= r <= `rgb_max` as returned by GetMultiPointWBCaps().
* @param[in] g                  - Array of green values.  Element values must be `rgb_min` <= g <= `rgb_max` as returned by GetMultiPointWBCaps().
* @param[in] b                 - Array of blue values.  Element values must be `rgb_min` <= b <= `rgb_max` as returned by GetMultiPointWBCaps().
*
* @return tvError_t
*
* @retval tvERROR_NONE - Success
* @retval tvERROR_INVALID_PARAM - Parameter is invalid
* @retval tvERROR_INVALID_STATE - Interface is not initialized
* @retval tvERROR_GENERAL - Underlying failures - SoC, memory, etc
*
* @pre TvInit() should be called before calling this API
*
* @see SetMultiPointWBMatrix()
*/
tvError_t GetDefaultMultiPointWBMatrix(tvVideoSrcType_t videoSrcType, tvPQModeIndex_t pq_mode, tvVideoFormatType_t videoFormatType, tvColorTemp_t colorTemp, int * r, int * g, int * b);

/**
* @brief Gets the Dolby Vision PQ Calibration setting capabilities supported by the platform.
Expand Down
22 changes: 22 additions & 0 deletions include/tvTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,28 @@ typedef enum
tvSdrGamma_MAX //!< End of enum
} tvSdrGamma_t;


/**
* @brief Structure defining the Gamma Whitbelance min,max and matrix points
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitbelance -> Whitebalance

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

*
*/
typedef struct {
int gamma_matrix_points, //!< Gamma Matrix Points
int gamma_rgb_min, //!< Gamma RGB Min
int gamma_rgb_max //!< Gamma RGB Max
} tvGammaMatrix_t;

/**
* @brief Structure defining the supported Gamma WhiteBalance
*
*/
typedef struct {
tvGammaMatrix_t hal_gamma, //!< Represents HAL Gamma Values
tvGammaMatrix_t ui_gamma, //!< Represent UI Gamma Values
double **ui_matrix_positions, //!< Array of UI Matrix Positions
size_t num_ui_matrix_positions //!< Number of UI Matrix Positions
} tvMultiPointWB_t;

/**
* @brief Enumeration defining the supported DolbyVisionCalibration Components
*
Expand Down