hi_mpi_isp_cal_gain_by_temp

Description

Calculates the WB gain coefficient at a specific color temperature.

Prototype

hi_s32 hi_mpi_isp_cal_gain_by_temp(hi_vi_pipe vi_pipe, const hi_isp_wb_attr *wb_attr, hi_u16 color_temp, hi_s16 shift, hi_u16 *awb_gain)

Constraints

  • The WB calibration parameters determine the accuracy of gain calculated at the preset color temperature. Therefore, ensure that calibration is complete and the calibration parameters are configured to the ISP before calling this interface. You can set the calibration result by calling hi_mpi_isp_set_wb_attr, and then calculate the gain of the preset color temperature by calling hi_mpi_isp_cal_gain_by_temp. During the process, the calibration result cannot be modified.
  • hi_mpi_isp_cal_gain_by_temp is implemented based on AWB calibration parameters. Therefore, this interface checks only the valid ranges of the calibration parameters static_wb and curve_para of hi_isp_awb_attr and does not restrict other parameters.
  • shift determines the position relationship between the illuminant and the Planckian curve. When shift is negative, the illuminant is in the left of the Planckian curve, and the calculated WB gain causes a slight red cast at the preset color temperature. When shift is positive, the illuminant is in the right of the Planckian curve, and the calculated WB gain causes a slight green cast at the preset color temperature.

Parameters

Parameter

Input/Output

Description

vi_pipe

Input

VI pipe ID

Value range: [0, 8)

wb_attr

Input

WB attribute. static_wb and curve_para in hi_isp_awb_attr are required.

color_temp

Input

Color temperature (unit: Kelvin)

Value range: [1500, 15000]

shift

Input

Positions and distance of the white point and the Planckian curve. Value range: [-64, 64]

awb_gain

Output

Gains of the four channels (R, Gr, Gb, and B) at the preset color temperature

Returns

  • 0: success
  • Other values: failure. For details, see Error Codes.