本文整理汇总了C++中Patches类的典型用法代码示例。如果您正苦于以下问题:C++ Patches类的具体用法?C++ Patches怎么用?C++ Patches使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Patches类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Rect
void Panel::_onMaskPatches( Patches& patches, const Rect& geo, const Rect& clip, WgBlendMode blendMode )
{
//TODO: Don't just check isOpaque() globally, check rect by rect.
if( (m_bOpaque && blendMode == WG_BLENDMODE_BLEND) || blendMode == WG_BLENDMODE_OPAQUE )
{
patches.sub( Rect(geo,clip) );
return;
}
switch( m_maskOp )
{
case WG_MASKOP_RECURSE:
{
Rect childGeo;
PanelHook * p = static_cast<PanelHook*>(_firstHookWithGeo( childGeo ));
while(p)
{
if( p->isVisible() )
p->_widget()->_onMaskPatches( patches, childGeo + geo.pos(), clip, blendMode );
p = static_cast<PanelHook*>(_nextHookWithGeo( childGeo, p ));
}
break;
}
case WG_MASKOP_SKIP:
break;
case WG_MASKOP_MASK:
patches.sub( Rect(geo,clip) );
break;
}
}
示例2: GetHash
/// Get cached MD5 hash for a given patch file
bool Patcher::GetHash(char * pat, uint8 mymd5[16]) {
for (Patches::iterator i = _patches.begin(); i != _patches.end(); ++i)
if (!stricmp(pat, i->first.c_str())) {
memcpy(mymd5, i->second->md5, 16);
return true;
}
return false;
}
示例3: _maskPatches
void Widget::_maskPatches( Patches& patches, const Rect& geo, const Rect& clip, BlendMode blendMode )
{
if( (m_bOpaque && blendMode == BlendMode::Blend) || blendMode == BlendMode::Replace )
{
patches.sub( Rect( geo, clip ) );
}
}
示例4: _collectPatches
void SplitPanel::_collectPatches(Patches& container, const Rect& geo, const Rect& clip)
{
if (m_pSkin)
container.add(Rect(geo, clip));
else
{
if (m_firstChild.pWidget)
m_firstChild.pWidget->_collectPatches(container, m_firstChild.geo + geo.pos(), clip );
if( m_pHandleSkin )
container.add(Rect(m_handleGeo, clip));
if (m_secondChild.pWidget)
m_secondChild.pWidget->_collectPatches(container, m_secondChild.geo + geo.pos(), clip );
}
}
示例5: Rect
void Container::_collectPatches( Patches& container, const Rect& geo, const Rect& clip )
{
if( m_pSkin )
container.add( Rect( geo, clip ) );
else
{
Rect childGeo;
Hook * p = _firstHookWithGeo( childGeo );
while(p)
{
if( p->_isVisible() )
p->_widget()->_collectPatches( container, childGeo + geo.pos(), clip );
p = _nextHookWithGeo( childGeo, p );
}
}
}
示例6: _renderPatches
void Widget::_renderPatches( GfxDevice * pDevice, const Rect& _canvas, const Rect& _window, const Patches& patches )
{
pDevice->setClipList(patches.size(), patches.begin());
_render( pDevice, _canvas, _window );
}
示例7: track3
void track3(ImageSource::InputDevice input, int numBaseClassifier, float overlap, float searchFactor, char* resultDir, Rect initBB, char* source = NULL)
{
unsigned char *curFrame=NULL;
int key;
//choose the image source
ImageSource *imageSequenceSource;
switch (input)
{
case ImageSource::AVI:
imageSequenceSource = new ImageSourceAVIFile(source);
break;
case ImageSource::DIRECTORY:
imageSequenceSource = new ImageSourceDir(source);
break;
case ImageSource::USB:
imageSequenceSource = new ImageSourceUSBCam();
break;
default:
return;
}
ImageHandler* imageSequence = new ImageHandler (imageSequenceSource);
imageSequence->getImage();
imageSequence->viewImage ("Tracking...", false);
trackingRect=initBB;
curFrame = imageSequence->getGrayImage ();
ImageRepresentation* curFrameRep = new ImageRepresentation(curFrame, imageSequence->getImageSize());
Rect wholeImage;
wholeImage = imageSequence->getImageSize();
// Pula o inicio do video
for(int t = 0; t < 60; t++, imageSequence->getImage());
IplImage *image;
image = imageSequence->getIplImage();
//cvWaitKey(0);
printf ("init tracker...");
Classifier* tracker;
tracker = new Classifier(image, trackingRect);
printf (" done.\n");
Size trackingRectSize;
trackingRectSize = trackingRect;
printf ("start tracking (stop by pressing any key)...\n\n");
// Inicializa o detector
Detector* detector;
detector = new Detector(tracker->getClassifier());
Rect trackedPatch = trackingRect;
Rect validROI;
validROI.upper = validROI.left = 0;
validROI.height = image->height;
validROI.width = image->width;
key=(char)-1;
while (key==(char)-1)
{
imageSequence->getImage();
image = imageSequence->getIplImage();
curFrame = imageSequence->getGrayImage ();
if (curFrame == NULL) break;
//calculate the patches within the search region
Patches *trackingPatches;
Rect searchRegion;
searchRegion = getTrackingROI(searchFactor, trackedPatch, validROI);
trackingPatches = new PatchesRegularScan(searchRegion, wholeImage, trackingRectSize, overlap);
curFrameRep->setNewImageAndROI(curFrame, searchRegion);
detector->classifySmooth(curFrameRep, trackingPatches);
trackedPatch = trackingPatches->getRect(detector->getPatchIdxOfBestDetection());
if (detector->getNumDetections() <= 0){printf("Lost...\n");break;}
// Treina o classificador
tracker->train(image,trackedPatch);
//.........这里部分代码省略.........