📄 _csl_prevsetcsc.c
字号:
/** @file _csl_prevSetCSC.c
*
* @brief File for functional layer of CSL API @a CSL_prevSetCSC()
*
* Description
* - The @a CSL_prevSetCSC() function definition & it's associated
* functions
*
* @date 19th October, 2004
* @author Vignesh LA.
*/
#include <csl_prev_aux.h>
#pragma CODE_SECTION (CSL_prevSetCSC, ".text:csl_section:prev");
/** @brief Configures the CSC using the coefficients and offset values
* passed.
*/
CSL_Status CSL_prevSetCSC(
/** Pointer to the object that holds reference to the
* instance of PREV requested after the call
*/
CSL_PrevHandle hPrev,
/** Pointer to the structure giving the CSC coefficients and offsets
*/
CSL_PrevCSCData *data
){
/*Color space conversion coefficients(S10Q8)
[CSCRY] [CSCGY] [CSCBY]
[CSCRCB] [CSCGCB] [CSCBCB]
[CSCRCR] [CSCGCR] [CSCBCR]
*/
if(data == NULL) return (CSL_ESYS_INVPARAMS);
hPrev->regs->CSC0 = CSL_FMK(PREV_CSC0_CSCRY,data->matrix[0][0])|
CSL_FMK(PREV_CSC0_CSCGY,data->matrix[0][1])|
CSL_FMK(PREV_CSC0_CSCBY,data->matrix[0][2]);
hPrev->regs->CSC1 = CSL_FMK(PREV_CSC1_CSCRCB,data->matrix[1][0])|
CSL_FMK(PREV_CSC1_CSCGCB,data->matrix[1][1])|
CSL_FMK(PREV_CSC1_CSCBCB,data->matrix[1][2]);
hPrev->regs->CSC2 = CSL_FMK(PREV_CSC2_CSCRCR,data->matrix[2][0])|
CSL_FMK(PREV_CSC2_CSCGCR,data->matrix[2][1])|
CSL_FMK(PREV_CSC2_CSCBCR,data->matrix[2][2]);
hPrev->regs->CSC_OFFSET = CSL_FMK(PREV_CSC_OFFSET_YOFST,data->offset[0])|
CSL_FMK(PREV_CSC_OFFSET_OFSTCB,data->offset[1])|
CSL_FMK(PREV_CSC_OFFSET_OFSTCR,data->offset[2]);
return (CSL_SOK);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -