From 31a6093afe75e5e240ad5a31a86660bd2f21979a Mon Sep 17 00:00:00 2001 From: aktamilbe <59253707+aktamilbe@users.noreply.github.com> Date: Fri, 11 Jul 2025 13:45:14 +0100 Subject: [PATCH 1/7] gh #89 Add GetDefaultMultiPointWBMatrix --- config/pq_capabilities.json | 5 +++ include/tvSettings.h | 62 ++++++++++++++++++++++++++++++------- 2 files changed, 56 insertions(+), 11 deletions(-) diff --git a/config/pq_capabilities.json b/config/pq_capabilities.json index c1ba015..a6a9626 100644 --- a/config/pq_capabilities.json +++ b/config/pq_capabilities.json @@ -1718,6 +1718,11 @@ "Warm", "Cold", "UserDefined" + ], + "color": [ + "Red", + "Green", + "Blue" ], "context": { "Standard": { diff --git a/include/tvSettings.h b/include/tvSettings.h index 4d600ed..90839ae 100755 --- a/include/tvSettings.h +++ b/include/tvSettings.h @@ -3842,11 +3842,19 @@ 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] hal_rgb_min - The minimum value for red, green and blue adjustment values in HAL. + * @param[out] hal_rgb_max - The maximum value for red, green and blue adjustment values in HAL. + * @param[out] ui_rgb_min - The minimum value for red, green and blue adjustment values in UI. + * @param[out] ui_rgb_max - The maximum value for red, green and blue adjustment values in UI. * @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] 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 @@ -3859,7 +3867,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(int * num_hal_matrix_points, int * num_ui_matrix_points, int * hal_rgb_min, int * hal_rgb_max, int * ui_rgb_min, int * ui_rgb_max, double ** ui_matrix_positions, 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. @@ -3875,10 +3883,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(). @@ -3893,7 +3901,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. @@ -3906,10 +3914,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(). @@ -3924,7 +3932,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. From 29b600ee37d170d8dd17e53d1dac741f10336543 Mon Sep 17 00:00:00 2001 From: aktamilbe <59253707+aktamilbe@users.noreply.github.com> Date: Mon, 14 Jul 2025 13:49:13 +0100 Subject: [PATCH 2/7] gh #89 Corrected case sensitive in MPWB params --- config/pq_capabilities.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/pq_capabilities.json b/config/pq_capabilities.json index a6a9626..969a25f 100644 --- a/config/pq_capabilities.json +++ b/config/pq_capabilities.json @@ -2699,7 +2699,7 @@ "from": -1024, "to": 1023 }, - "ColorTemperature": [ + "colorTemperature": [ "Standard", "Warm", "Cold", From 7e43f6a17e7eea96e784dba9c4a3c6e3b54e52b6 Mon Sep 17 00:00:00 2001 From: aktamilbe <59253707+aktamilbe@users.noreply.github.com> Date: Mon, 14 Jul 2025 17:19:24 +0100 Subject: [PATCH 3/7] gh #89 Reframed caps API Signature --- include/tvSettings.h | 14 +++++--------- include/tvTypes.h | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/include/tvSettings.h b/include/tvSettings.h index 90839ae..c2f1c93 100755 --- a/include/tvSettings.h +++ b/include/tvSettings.h @@ -3841,14 +3841,10 @@ 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] num_ui_matrix_points - The number of points in the UI gamma matrix for customer adjustment. - * @param[out] hal_rgb_min - The minimum value for red, green and blue adjustment values in HAL. - * @param[out] hal_rgb_max - The maximum value for red, green and blue adjustment values in HAL. - * @param[out] ui_rgb_min - The minimum value for red, green and blue adjustment values in UI. - * @param[out] ui_rgb_max - The maximum value for red, green and blue adjustment values in UI. - * @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 + * - 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. @@ -3867,7 +3863,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 * num_ui_matrix_points, int * hal_rgb_min, int * hal_rgb_max, int * ui_rgb_min, int * ui_rgb_max, double ** ui_matrix_positions, tvColorTemp_t **colorTemperature, tvWBColor_t **color, size_t* num_colorTemperature, size_t* num_color, 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. diff --git a/include/tvTypes.h b/include/tvTypes.h index dbc60e5..3cbb38f 100755 --- a/include/tvTypes.h +++ b/include/tvTypes.h @@ -672,6 +672,28 @@ typedef enum tvSdrGamma_MAX //!< End of enum } tvSdrGamma_t; + +/** + * @brief Structure defining the supported DolbyVisionCalibration Components + * + */ +typedef struct { + struct tvGammaMatrix_t hal_gamma, //!< Represents HAL Gamma Values + struct 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 Structure defining the supported DolbyVisionCalibration Components min,max and matrix points + * + */ +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; + #ifdef __cplusplus } #endif From fe7215453bcb825475bef458022a636d644ceb4f Mon Sep 17 00:00:00 2001 From: aktamilbe <59253707+aktamilbe@users.noreply.github.com> Date: Thu, 31 Jul 2025 09:53:16 +0530 Subject: [PATCH 4/7] gh #89 Corrected Case sensitivity in JSON --- config/pq_capabilities.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/pq_capabilities.json b/config/pq_capabilities.json index 237b201..9ca11c7 100644 --- a/config/pq_capabilities.json +++ b/config/pq_capabilities.json @@ -2711,7 +2711,7 @@ "from": -1024, "to": 1023 }, - "colorTemperature": [ + "ColorTemperature": [ "Standard", "Warm", "Cold", From aede958772199ffd21c4c0f574ac036637ab7c1b Mon Sep 17 00:00:00 2001 From: aktamilbe <59253707+aktamilbe@users.noreply.github.com> Date: Mon, 11 Aug 2025 06:00:15 +0100 Subject: [PATCH 5/7] gh #89 Corrected enum description in tvTypes.h --- include/tvTypes.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/include/tvTypes.h b/include/tvTypes.h index 539146d..9c16045 100755 --- a/include/tvTypes.h +++ b/include/tvTypes.h @@ -672,19 +672,9 @@ typedef enum tvSdrGamma_MAX //!< End of enum } tvSdrGamma_t; -/** - * @brief Structure defining the supported DolbyVisionCalibration Components - * - */ -typedef struct { - struct tvGammaMatrix_t hal_gamma, //!< Represents HAL Gamma Values - struct 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 Structure defining the supported DolbyVisionCalibration Components min,max and matrix points + * @brief Structure defining the Gamma Whitbelance min,max and matrix points * */ typedef struct { @@ -693,6 +683,17 @@ typedef struct { 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 * From 925e6bb0a7bc6d025847928c790bd082ec89ed0b Mon Sep 17 00:00:00 2001 From: aktamilbe <59253707+aktamilbe@users.noreply.github.com> Date: Wed, 20 Aug 2025 05:17:26 +0100 Subject: [PATCH 6/7] gh #89 Corrected description as per review comments --- include/tvSettings.h | 2 +- include/tvTypes.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/tvSettings.h b/include/tvSettings.h index c7ea20f..5ee9f1c 100755 --- a/include/tvSettings.h +++ b/include/tvSettings.h @@ -3853,7 +3853,7 @@ 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] multiPointMatrix - Returns a pointer to an structure which contains values associated with MutiPoint WhiteBalance + * @param[out] multiPointMatrix - Returns a pointer to an structure which contains values associated with MultiPoint WhiteBalance * - The returned Pointer must not be freed by the caller. * - Memory should be allocated in HAL function diff --git a/include/tvTypes.h b/include/tvTypes.h index 9c16045..fd0e983 100755 --- a/include/tvTypes.h +++ b/include/tvTypes.h @@ -674,7 +674,7 @@ typedef enum /** - * @brief Structure defining the Gamma Whitbelance min,max and matrix points + * @brief Structure defining the Gamma WhiteBalance min,max and matrix points * */ typedef struct { From 7dcc81a87d4ce151fb62f8b436d55b553d621da5 Mon Sep 17 00:00:00 2001 From: aktamilbe <59253707+aktamilbe@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:25:14 +0100 Subject: [PATCH 7/7] gh #89 Corrected structure syntax --- include/tvTypes.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/tvTypes.h b/include/tvTypes.h index fd0e983..a7006a1 100755 --- a/include/tvTypes.h +++ b/include/tvTypes.h @@ -678,9 +678,9 @@ typedef enum * */ typedef struct { - int gamma_matrix_points, //!< Gamma Matrix Points - int gamma_rgb_min, //!< Gamma RGB Min - int gamma_rgb_max //!< Gamma RGB Max + int gamma_matrix_points; //!< Gamma Matrix Points + int gamma_rgb_min; //!< Gamma RGB Min + int gamma_rgb_max; //!< Gamma RGB Max } tvGammaMatrix_t; /** @@ -688,10 +688,10 @@ typedef struct { * */ 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 + 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; /**