📄 omxipbm_addc_u8_c1r_sfs.c
字号:
/**** * File Name: omxIPBM_AddC_U8_C1R_Sfs.c* OpenMAX DL: v1.0.2* Revision: 10586* Date: Wednesday, March 5, 2008* * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved.* * ** Description : Image arithmetic operation - Add a constant to every* pixel in the ROI of a single channel source image.*/#include "omxtypes.h"#include "armCOMM.h"#include "armOMX.h"#include "omxIP.h"/** * Function: omxIPBM_AddC_U8_C1R_Sfs (4.2.1.2.2) * * Description: * Computes corresponding arithmetic operation with a constant and each * element of the source ROI and places the scaled result in the destination * image referenced by the pointer pDst. * * Input Arguments: * * pSrc - pointer to the source ROI * srcStep - distance in bytes between the starts of consecutive lines in * the source image * value - constant for operation * dstStep - distance in bytes between the starts of consecutive lines in * the destination image * roiSize - size of the source and destination ROI in pixels * scaleFactor - scale factor value, valid in the range [-7,7] * * Output Arguments: * * pDst - pointer to the destination ROI * * Return Value: * * OMX_Sts_NoErr - no errors detected * OMX_Sts_BadArgErr - bad arguments detected; at least one of the * following is true: * - pSrc or pDst is NULL * - srcStep or dstStep is less than or equal to zero * - roiSize has a field with zero or negative value. * - scaleFactor is outside the range [-7,7] * */ OMXResult omxIPBM_AddC_U8_C1R_Sfs( const OMX_U8* pSrc, OMX_INT srcStep, OMX_U8 value, OMX_U8* pDst, OMX_INT dstStep, OMXSize roiSize, OMX_INT scaleFactor ){ OMX_INT addWidth = roiSize.width; OMX_INT addHeight = roiSize.height; OMX_U16 round = 0; OMX_INT i, j; armRetArgErrIf(!pSrc, OMX_Sts_BadArgErr); armRetArgErrIf(!pDst, OMX_Sts_BadArgErr); armRetArgErrIf(srcStep <= 0, OMX_Sts_BadArgErr); armRetArgErrIf(dstStep <= 0, OMX_Sts_BadArgErr); armRetArgErrIf(roiSize.width <= 0, OMX_Sts_BadArgErr); armRetArgErrIf(roiSize.height <= 0, OMX_Sts_BadArgErr); armRetArgErrIf(scaleFactor < -7 || scaleFactor > 7, OMX_Sts_BadArgErr); if(scaleFactor > 0) { round = 1 << (scaleFactor - 1); } if(scaleFactor >= 0) { for(i=0; i<addHeight; i++, pSrc+=srcStep, pDst+=dstStep) { for(j=0; j<addWidth; j++) { pDst[j] = (OMX_U8) armClip(OMX_MIN_U8, OMX_MAX_U8, (pSrc[j] + value + round) >> scaleFactor); } } } else { for(i=0; i<addHeight; i++, pSrc+=srcStep, pDst+=dstStep) { for(j=0; j<addWidth; j++) { pDst[j] = (OMX_U8) armClip(OMX_MIN_U8, OMX_MAX_U8, (pSrc[j] + value + round) << -scaleFactor); } } } return OMX_Sts_NoErr;}/* End of file */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -