38. CSC

38.1. Function Overview

This feature provides a color gamut conversion of some related quality setting, by setting hue, luma, saturation, contrast, color gamut conversion standard specification types, affecting the effect of the picture, without needing to know what a transformation matrix calculation process, Of course, the user can also directly set the coeff and offset of the transformation matrix to affect the image quality

38.2. API Reference

38.2.1. CVI_ISP_SetCSCAttr

【Description】

Set CSC attribute parameter

【Syntax】

CVI_S32 CVI_ISP_SetCSCAttr(VI_PIPE ViPipe, const ISP_CSC_ATTR_S * pstCSCAttr);

【Parameter】

Parameter

Description

Input/Output

ViPipe

VI_PIPE number

Input

pstCSCAttr

CSC attribute parameter

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】

38.2.2. CVI_ISP_GetCSCAttr

【Description】

Get CSC attribute parameter

【Syntax】


【Parameter】

Parameter

Description

Input/Output

ViPipe

VI_PIPE number

Input

pstCSCAttr

CSC attribute parameter

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】

38.3. Data Types

38.3.1. ISP_CSC_ATTR_S

【Description】

CSC attribute parameter

【Syntax】

 typedef struct _ISP_CSC_ATTR_S {
  CVI_BOOL Enable;
  ISP_CSC_COLORGAMUT enColorGamut;
  CVI_U8 UpdateInterval;
  CVI_U8 Hue;
  CVI_U8 Luma;
  CVI_U8 Contrast;
  CVI_U8 Saturation;
  ISP_CSC_MATRX_S stUserMatrx;
} ISP_CSC_ATTR_S;

【Member】

Member

Description

Enable

CSC module enable

Value range: [0, 1]

Data type: CVI_BOOL

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

enColorGamut

Color gamut conversion type selection

0: ISP_CSC_COLORGAMUT_BT601

1: ISP_CSC_COLORGAMUT_BT709

2: ISP_CSC_COLORGAMUT_BT2020

3: ISP_CSC_COLORGAMUT_USER

Hue

Adjust chroma

Value range: [0x0, 0x64]

Data type: CVI_U8

Luma

adjust brightness

Value range: [0x0, 0x64]

Data type: CVI_U8

Contrast

adjust contrast

Value range: [0x0, 0x64]

Data type: CVI_U8

Saturation

adjust saturation

Value range: [0x0, 0x64]

Data type: CVI_U8

stUserMatrx

Custom gamut conversion matrix

【Note】

None.

【Related Data Type and Interface】

38.3.2. ISP_CSC_COLORGAMUT

【Description】

CSC color gamut conversion standard format

【Syntax】

 typedef enum _ISP_CSC_COLORGAMUT {
  ISP_CSC_COLORGAMUT_BT601,
  ISP_CSC_COLORGAMUT_BT709,
  ISP_CSC_COLORGAMUT_BT2020,
  ISP_CSC_COLORGAMUT_USER,
  ISP_CSC_COLORGAMUT_NUM
} ISP_CSC_COLORGAMUT;

【Member】

Member

Description

ISP_CSC_COLORGAMUT_BT601

BT601 Color Gamut Conversion Standard

ISP_CSC_COLORGAMUT_BT709

BT709 Color Gamut Conversion Standard

ISP_CSC_COLORGAMUT_BT2020

BT2020 Color Gamut Conversion Standard

ISP_CSC_COLORGAMUT_USER

Custom color gamut conversion, used in conjunction with ISP_CSC_MATRX_S

【Note】

None.

【Related Data Type and Interface】

38.3.3. ISP_CSC_MATRX_S

【Description】

CSC custom conversion matrix

【Syntax】

 typedef struct _ISP_CSC_MATRX_S {
  CVI_S16 userCscCoef[CSC_MATRIX_SIZE];
  CVI_S16 userCscOffset[CSC_OFFSET_SIZE];
} ISP_CSC_MATRX_S;

【Member】

Member

Description

userCscCoef[CSC_MATRIX_SIZE]

Coefficients of 3*3 color gamut conversion matrix

Value range: [-0x2000, 0x1fff]

Data type: CVI_S16

userCscOffset[CSC_OFFSET_SIZE]

Output offset

Value range: [-0x100, 0xff]

Data type: CVI_S16

【Note】

None.

【Related Data Type and Interface】