本文整理汇总了C++中ROT函数的典型用法代码示例。如果您正苦于以下问题:C++ ROT函数的具体用法?C++ ROT怎么用?C++ ROT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ROT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: roundedRectToPoints
vector<cv::Point2f> roundedRectToPoints (cv::RotatedRect rr)
{
typedef cv::Point2f P;
vector<P> ret;
float px = rr.center.x;
float py = rr.center.y;
float ox = rr.size.width / 2;
float oy = rr.size.height / 2;
double rads = rr.angle * M_PI / 180;
double vsin = sin (rads);
double vcos = cos (rads);
#define ROT(sx,sy) (P ( \
px + (sx) * ox * vcos - (sy) * oy * vsin, \
py + (sy) * oy * vcos + (sx) * ox * vsin \
))
ret.push_back (ROT (-1, -1));
ret.push_back (ROT (+1, -1));
ret.push_back (ROT (+1, +1));
ret.push_back (ROT (-1, +1));
#undef ROT
return ret;
}
示例2: ROT
ErrVal
NalUnitParser::destroy()
{
ROT( m_bInitialized );
ROT( m_bNalUnitInitialized );
delete this;
return Err::m_nOK;
}
示例3: memset
Int H264AVCEncoderTest::padBuf(UChar *output, Int iStrideOut, Int width, Int height, Int width_out, Int height_out, Int fillMode)
{
int j;
UChar *pDst;
enum FillMode
{
FILL_CLEAR = 0,
FILL_FRAME,
FILL_FIELD
};
//horizontal;
if(width < width_out)
{
pDst = output;
for(j=0; j<height; j++)
{
memset(pDst+width, 0, (width_out-width)*sizeof(UChar));
pDst += iStrideOut;
}
}
if(height < height_out)
{
if(FILL_CLEAR == fillMode)
{
pDst = output +height*iStrideOut;
for(j=height; j<height_out; j++)
{
memset(pDst, 0, width_out*sizeof(UChar));
pDst += iStrideOut;
}
}
else if(FILL_FRAME == fillMode )
{
pDst = output +height*iStrideOut;
for(j=height; j<height_out; j++)
{
memcpy(pDst, pDst-iStrideOut, iStrideOut*sizeof(UChar));
pDst += iStrideOut;
}
}
else if(FILL_FIELD == fillMode)
{
ROT( (height_out - height) & 1 );
pDst = output +height*iStrideOut;
for(j=height; j<height_out; j+=2)
{
memcpy(pDst, pDst-2*iStrideOut, 2*iStrideOut*sizeof(UChar));
pDst += iStrideOut*2;
}
}
else
ROT(!"Not supported yet!\n");
}
return Err::m_nOK;
}
示例4: rand_prng_get
uint32_t rand_prng_get(prng_t* p_prng)
{
/* Bob Jenkins' small PRNG
http://burtleburtle.net/bob/rand/smallprng.html */
uint32_t e = p_prng->a - ROT(p_prng->b, 27);
p_prng->a = p_prng->b ^ ROT(p_prng->c, 17);
p_prng->b = p_prng->c + p_prng->d;
p_prng->c = p_prng->d + e;
p_prng->d = e + p_prng->a;
return p_prng->d;
}
示例5: ROT
ErrVal
ControlData::initFGSData( UInt uiNumMb )
{
ROT( m_pacFGSMbQP );
ROT( m_pauiFGSMbCbp );
ROT( m_pabFGS8x8Trafo );
ROFS( ( m_pacFGSMbQP = new UChar [uiNumMb] ) );
ROFS( ( m_pauiFGSMbCbp = new UInt [uiNumMb] ) );
ROFS( ( m_pabFGS8x8Trafo = new Bool [uiNumMb] ) );
return Err::m_nOK;
}
示例6: ROT
ErrVal MotionEstimationCost::xInitRateDistortionModel( Int iSubPelSearchLimit, RateDistortionIf* pcRateDistortionIf )
{
ROT( NULL == pcRateDistortionIf )
m_pcRateDistortionIf = pcRateDistortionIf;
// make it larger
iSubPelSearchLimit += 4;
iSubPelSearchLimit *= 8;
if( m_iSearchLimit != iSubPelSearchLimit )
{
RNOK( xUninit() )
m_iSearchLimit = iSubPelSearchLimit;
m_puiComponentCostOriginP = new UInt[ 4 * iSubPelSearchLimit ];
iSubPelSearchLimit *= 2;
m_puiComponentCost = m_puiComponentCostOriginP + iSubPelSearchLimit;
for( Int n = -iSubPelSearchLimit; n < iSubPelSearchLimit; n++)
{
m_puiComponentCost[n] = getComponentBits( n );
}
}
return Err::m_nOK;
}
示例7: AOT_DBG
ErrVal MbDataCtrl::init( const SequenceParameterSet& rcSPS )
{
AOT_DBG( m_bInitDone );
UInt uiSize = rcSPS.getMbInFrame();
ROT( 0 == uiSize );
if( m_uiSize == uiSize )
{
RNOK( xResetData() );
}
else
{
RNOK( xDeleteData() );
RNOK( xCreateData( uiSize ) );
m_uiSize = uiSize;
}
m_iMbPerLine = rcSPS.getFrameWidthInMbs();
RNOK( m_cpDFPBuffer.init( uiSize+1 ) );
m_cpDFPBuffer.clear();
m_bInitDone = true;
return Err::m_nOK;
}
示例8: ROT
ErrVal
BitReadBuffer::initPacket( UInt* puiBits,
UInt uiBitsInPacket )
{
// invalidate all members if something is wrong
m_pulStreamPacket = NULL;
m_ulCurrentBits = 0xdeaddead;
m_uiNextBits = 0xdeaddead;
m_uiBitsLeft = 0;
m_iValidBits = 0;
m_uiDWordsLeft = 0;
ROT( NULL == puiBits );
// now init the Bitstream object
m_pulStreamPacket = puiBits;
m_uiBitsLeft = uiBitsInPacket;
m_uiDWordsLeft = m_uiBitsLeft >> 5;
m_iValidBits = -32;
// preload first two dwords if valid
xReadNextWord();
xReadNextWord();
return Err::m_nOK;
}
示例9: ROT
ErrVal
QualityLevelParameter::create( QualityLevelParameter*& rpcQualityLevelParameter )
{
rpcQualityLevelParameter = new QualityLevelParameter;
ROT( NULL == rpcQualityLevelParameter );
return Err::m_nOK;
}
示例10: ROT
//-----------------------------------------------------------------------------
// 説明: 関節回転量の設定(クォータニオン)
// 引数:
// frm [in] フレーム番号
// jid [in] 関節インデクス
// q [in] 回転クォータニオン
// 返り値:
// true 設定成功
// false 設定失敗
// その他:
//-----------------------------------------------------------------------------
bool CMotionData::SetRotation(size_t frm, size_t jid, const Quaternionf &q)
{
if (!IsRange(frm, jid))
return false;
ROT(frm, jid) = q;
return true;
}
示例11: ROT
ErrVal
ReconstructionBypass::xPad8x8Blk_MbAff( YuvMbBufferExtension* pcBuffer, UInt ui8x8Blk, Bool bV0, Bool bV1, Bool bH, Bool bC0, Bool bC1 )
{
Bool bSwitch = ( !bV0 && bV1 && bH ) || ( !bV0 && !bH && !bC0 && ( bV1 || bC1 ) );
Bool bDouble = ( bV0 && bV1 ) || ( ( bV0 || bC0 ) && !bH && ( bV1 || bC1 ) );
ROT( bSwitch && bDouble );
Bool bFromAbove = ( ui8x8Blk < 2 );
Bool bFromLeft = ( ui8x8Blk % 2 == 0 );
B8x8Idx cIdx( (Par8x8)ui8x8Blk );
if( bDouble )
{
RNOK( xPadBlock_MbAff( pcBuffer, cIdx, bV0, bH, bC0, true, bFromAbove, bFromLeft ) );
RNOK( xPadBlock_MbAff( pcBuffer, cIdx, bV1, bH, bC1, true, !bFromAbove, bFromLeft ) );
}
else if( bSwitch )
{
RNOK( xPadBlock_MbAff( pcBuffer, cIdx, bV1, bH, bC1, false, !bFromAbove, bFromLeft ) );
}
else
{
RNOK( xPadBlock_MbAff( pcBuffer, cIdx, bV0, bH, bC0, false, bFromAbove, bFromLeft ) );
}
return Err::m_nOK;
}
示例12: ROT
ErrVal
PreProcessorParameter::create( PreProcessorParameter*& rpcPreProcessorParameter )
{
rpcPreProcessorParameter = new PreProcessorParameter;
ROT( NULL == rpcPreProcessorParameter );
return Err::m_nOK;
}
示例13: ROT
ErrVal ControlMngH264AVCDecoder::create( ControlMngH264AVCDecoder*& rpcControlMngH264AVCDecoder )
{
rpcControlMngH264AVCDecoder = new ControlMngH264AVCDecoder;
ROT( NULL == rpcControlMngH264AVCDecoder );
return Err::m_nOK;
}
示例14: ROT
ErrVal ReadYuvFile::readFrame( UChar *pLum,
UChar *pCb,
UChar *pCr,
UInt uiBufHeight,
UInt uiBufWidth,
UInt uiBufStride)
{
//printf("Llegirem els tres plans de l'arxiu %s\n",m_cFileName);
ROT( uiBufHeight < m_uiLumPicHeight || uiBufWidth < m_uiLumPicWidth );
UInt uiPicHeight = m_uiLumPicHeight;
UInt uiPicWidth = m_uiLumPicWidth;
UInt uiClearSize = uiBufWidth - uiPicWidth;
UInt uiStartLine = m_uiStartLine;
UInt uiEndLine = m_uiEndLine;
RNOKS( xReadPlane( pLum, uiBufHeight, uiBufWidth, uiBufStride, uiPicHeight, uiPicWidth, uiStartLine, uiEndLine ) );
uiPicHeight >>= 1;
uiPicWidth >>= 1;
uiClearSize >>= 1;
uiBufHeight >>= 1;
uiBufWidth >>= 1;
uiBufStride >>= 1;
uiStartLine >>= 1;
uiEndLine >>= 1;
RNOKS( xReadPlane( pCb, uiBufHeight, uiBufWidth, uiBufStride, uiPicHeight, uiPicWidth, uiStartLine, uiEndLine ) );
RNOKS( xReadPlane( pCr, uiBufHeight, uiBufWidth, uiBufStride, uiPicHeight, uiPicWidth, uiStartLine, uiEndLine ) );
return Err::m_nOK;
}
示例15: ROT
ErrVal
PictureParameterSet::create( PictureParameterSet*& rpcPPS )
{
rpcPPS = new PictureParameterSet;
ROT( NULL == rpcPPS );
return Err::m_nOK;
}