本文整理汇总了C++中ViewerNodePtr::isUserRoIEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ ViewerNodePtr::isUserRoIEnabled方法的具体用法?C++ ViewerNodePtr::isUserRoIEnabled怎么用?C++ ViewerNodePtr::isUserRoIEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewerNodePtr
的用法示例。
在下文中一共展示了ViewerNodePtr::isUserRoIEnabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rectClippedToRoI
// 0___1___2___3
// | /| /| /|
// | / | / | / |
// |/ |/ |/ |
// 4---5---6----7
// | /| /| /|
// | / | / | / |
// |/ |/ |/ |
// 8---9--10--11
// | /| /| /|
// | / | / | / |
// |/ |/ |/ |
// 12--13--14--15
void
ViewerGL::Implementation::drawRenderingVAO(unsigned int mipMapLevel,
int textureIndex,
ViewerGL::DrawPolygonModeEnum polygonMode,
bool background)
{
// always running in the main thread
assert( qApp && qApp->thread() == QThread::currentThread() );
assert( QGLContext::currentContext() == _this->context() );
///the texture rectangle in image coordinates. The values in it are multiples of tile size.
///
const RectI &textureBounds = this->displayTextures[textureIndex].texture->getBounds();
//const RectD& originalCanonicalRoI = this->displayTextures[textureIndex].originalCanonicalRoi;
///This is the coordinates in the image being rendered where datas are valid, this is in pixel coordinates
///at the time we initialize it but we will convert it later to canonical coordinates. See 1)
const double par = this->displayTextures[textureIndex].pixelAspectRatio;
RectD canonicalRoIRoundedToTileSize;
textureBounds.toCanonical_noClipping(mipMapLevel, par /*, rod*/, &canonicalRoIRoundedToTileSize);
///the RoD of the image in canonical coords.
RectD rod = _this->getRoD(textureIndex);
ViewerNodePtr internalNode = _this->getViewerTab()->getInternalNode();
bool clipToDisplayWindow = internalNode->isClipToFormatEnabled();
RectD rectClippedToRoI(canonicalRoIRoundedToTileSize);
rectClippedToRoI.intersect(rod, &rectClippedToRoI);
if (clipToDisplayWindow) {
rod.intersect(this->displayTextures[textureIndex].format, &rod);
rectClippedToRoI.intersect(this->displayTextures[textureIndex].format, &rectClippedToRoI);
}
//if user RoI is enabled, clip the rod to that roi
bool userRoiEnabled = internalNode->isUserRoIEnabled();
////The texture real size (r.w,r.h) might be slightly bigger than the actual
////pixel coordinates bounds r.x1,r.x2 r.y1 r.y2 because we clipped these bounds against the bounds
////in the ViewerInstance::renderViewer function. That means we need to draw actually only the part of
////the texture that contains the bounds.
////Notice that r.w and r.h are scaled to the closest Po2 of the current scaling factor, so we need to scale it up
////So it is in the same coordinates as the bounds.
///Edit: we no longer divide by the closestPo2 since the viewer now computes images at lower resolution by itself, the drawing
///doesn't need to be scaled.
if (userRoiEnabled) {
RectD userRoI = internalNode->getUserRoI();
//if the userRoI isn't intersecting the rod, just don't render anything
if ( !rod.intersect(userRoI, &rod) ) {
return;
}
rectClippedToRoI.intersect(rod, &rectClippedToRoI);
//clipTexCoords<RectD>(canonicalTexRect,rectClippedToRoI,texBottom,texTop,texLeft,texRight);
}
if (polygonMode != eDrawPolygonModeWhole) {
/// draw only the plane defined by the wipe handle
QPolygonF polygonPoints, polygonTexCoords;
RectD floatRectClippedToRoI;
floatRectClippedToRoI.x1 = rectClippedToRoI.x1;
floatRectClippedToRoI.y1 = rectClippedToRoI.y1;
floatRectClippedToRoI.x2 = rectClippedToRoI.x2;
floatRectClippedToRoI.y2 = rectClippedToRoI.y2;
Implementation::WipePolygonEnum polyType = this->getWipePolygon(floatRectClippedToRoI, polygonMode == eDrawPolygonModeWipeRight, &polygonPoints);
if (polyType == Implementation::eWipePolygonEmpty) {
///don't draw anything
return;
} else if (polyType == Implementation::eWipePolygonPartial) {
this->getPolygonTextureCoordinates(polygonPoints, canonicalRoIRoundedToTileSize, polygonTexCoords);
assert(displayTextures[textureIndex].texture);
GL_GPU::ActiveTexture(GL_TEXTURE0);
GL_GPU::GetIntegerv(GL_TEXTURE_BINDING_2D, (GLint*)&prevBoundTexture);
GL_GPU::BindTexture( GL_TEXTURE_2D, displayTextures[textureIndex].texture->getTexID() );
//.........这里部分代码省略.........