9. MeshShading

9.1. Function Description

  • The dark corners around the lens are corrected in the form of grid

9.2. API Reference

9.2.1. CVI_ISP_SetMeshShadingAttr

【Description】

Set Mesh Shading algorithm parameters.

【Syntax】

CVI_S32 CVI_ISP_SetMeshShadingAttr(VI_PIPE ViPipe, const ISP_MESH_SHADING_ATTR_S *pstMeshShadingAttr);

【Parameter】

Parameter

Description

Input / Output

ViPipe

VI_PIPE number

Input

pstMeshShadingAttr

Mesh Shading algorithm parameters

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h, cvi_comm_isp.h

  • Library files: libisp.so

【Note】

None.

【Example】

None.

【Related Topic】

9.2.2. CVI_ISP_GetMeshShadingAttr

【Description】

Get Mesh Shading algorithm parameters.

【Syntax】

CVI_S32 CVI_ISP_GetMeshShadingAttr(VI_PIPE ViPipe, ISP_MESH_SHADING_ATTR_S *pstMeshShadingAttr);

【Parameter】

Parameter

Description

Input / Output

ViPipe

VI_PIPE number

Input

pstMeshShadingAttr

Mesh Shading algorithm parameters

Output

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h, cvi_comm_isp.h

  • Library files: libisp.so

【Note】

None.

【Example】

None.

【Related Topic】

9.2.3. CVI_ISP_SetMeshShadingGainLutAttr

【Description】

Set LSC grid form compensation gain table.

【Syntax】

CVI_S32 CVI_ISP_SetMeshShadingGainLutAttr(VI_PIPE ViPipe, const ISP_MESH_SHADING_GAIN_LUT_ATTR_S *pstMeshShadingGainLutAttr);

【Parameter】

Parameter

Description

Input / Output

ViPipe

VI_PIPE number

Input

pstMeshShadingGainLutAttr

LSC grid form compensation gain table

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h, cvi_comm_isp.h

  • Library files: libisp.so

【Note】

None.

【Example】

None.

【Related Topic】

9.2.4. CVI_ISP_GetMeshShadingGainLutAttr

【Description】

Get LSC grid form compensation gain table.

【Syntax】

CVI_S32 CVI_ISP_GetMeshShadingGainLutAttr(VI_PIPE ViPipe, ISP_MESH_SHADING_GAIN_LUT_ATTR_S *pstMeshShadingGainLutAttr);

【Parameter】

Parameter

Description

Input / Output

ViPipe

VI_PIPE number

Input

pstMeshShadingGainLutAttr

LSC grid form compensation gain table

Output

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h, cvi_comm_isp.h

  • Library files: libisp.so

【Note】

None.

【Example】

None.

【Related Topic】

9.3. Data Types

9.3.1. ISP_MESH_SHADING_MANUAL_ATTR_S

【Description】

Manual parameters of Mesh Shading algorithm.

【Syntax】

typedef struct _ISP_MESH_SHADING_MANUAL_ATTR_S {
   CVI_U16 MeshStr;
} ISP_MESH_SHADING_MANUAL_ATTR_S;

【Member】

Member

Description

MeshStr

LSC compensation strength;

Value range: [0x0, 0xfff]

Data type: CVI_U16

【Note】

None.

【Related Data Type and Interface】

9.3.2. ISP_MESH_SHADING_AUTO_ATTR_S

【Description】

Automated parameters of Mesh Shading algorithm.

【Syntax】

typedef struct _ISP_MESH_SHADING_AUTO_ATTR_S {
   CVI_U16 MeshStr[ISP_AUTO_ISO_STRENGTH_NUM];
} ISP_MESH_SHADING_AUTO_ATTR_S;

【Member】

Member

Description

MeshStr

LSC compensation strength;

Value range: [0x0, 0xfff]

Data type: CVI_U16

【Note】

None.

【Related Data Type and Interface】

9.3.3. ISP_MESH_SHADING_ATTR_S

【Description】

Mesh Shading algorithm parameters.

【Syntax】

typedef struct _ISP_MESH_SHADING_ATTR_S {
   CVI_BOOL Enable;
   ISP_OP_TYPE_E enOpType;
   CVI_U8 UpdateInterval;
   CVI_BOOL OverflowProtection;
   ISP_MESH_SHADING_MANUAL_ATTR_S stManual;
   ISP_MESH_SHADING_AUTO_ATTR_S stAuto;
} ISP_MESH_SHADING_ATTR_S;

【Member】

Member

Description

Enable

Enable LSC function. 0: close. 1: enable Value range: [0, 1] Data type: CVI_BOOL

enOpType

Select manual or automatic mode

UpdateInterval

Affects the parameter update interval, the larger the value, the slower the screen changes and the better the performance.

Value range: [0x0, 0xff] Data type: CVI_U8

OverflowProtection

Avoid color cast in overexposed areas Value range: [0, 1] Data type: CVI_BOOL

stManual

Manual parameters

stAuto

Automatic parameters

【Note】

None.

【Related Data Type and Interface】

9.3.4. ISP_MESH_SHADING_GAIN_LUT_S

【Description】

LSC grid form compensation gain table details.

【Syntax】

typedef struct _ISP_MESH_SHADING_GAIN_LUT_S {
   CVI_U16 ColorTemperature;
   CVI_U16 RGain[CVI_ISP_LSC_GRID_POINTS];
   CVI_U16 GGain[CVI_ISP_LSC_GRID_POINTS];
   CVI_U16 BGain[CVI_ISP_LSC_GRID_POINTS];
} ISP_MESH_SHADING_GAIN_LUT_S;

【Member】

Member

Description

ColorTemperature

the color temperature corresponding to the color temperature adaptive LSC compensation gain table, in K.

Value range: [0x0, 0x7530]

Data type: CVI_U16

RGain

Red channel gain;

Value range: [0x0, 0xfff]

Data type: CVI_U16

GGain

Green channel gain;

Value range: [0x0, 0xfff]

Data type: CVI_U16

BGain

Blue channel gain;

Value range: [0x0, 0xfff]

Data type: CVI_U16

【Note】

None.

【Related Data Type and Interface】

9.3.5. ISP_MESH_SHADING_GAIN_LUT_ATTR_S

【Description】

LSC grid form compensation gain table.

【Syntax】

typedef struct _ISP_MESH_SHADING_GAIN_LUT_ATTR_S {
   CVI_U8 Size;
   ISP_MESH_SHADING_GAIN_LUT_S LscGainLut[ISP_MLSC_COLOR_TEMPERATURE_SIZE];
} ISP_MESH_SHADING_GAIN_LUT_ATTR_S;

【Member】

Member

Description

Size

Number of color temperature adaptive LSC compensation gain meters;

Value range: [0x1, 0x7]

Data type: CVI_U8

LscGainLut

LSC grid form compensation gain table

【Note】

None.

【Related Data Type and Interface】