本文整理汇总了C++中ossimIrect::ul方法的典型用法代码示例。如果您正苦于以下问题:C++ ossimIrect::ul方法的具体用法?C++ ossimIrect::ul怎么用?C++ ossimIrect::ul使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ossimIrect
的用法示例。
在下文中一共展示了ossimIrect::ul方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runFilterTemplate
void ossimScaleFilter::runFilterTemplate(T dummy,
const ossimIrect& imageRect,
const ossimIrect& viewRect)
{
ossimRefPtr<ossimImageData> inputData =
theInputConnection->getTile(imageRect);
if(!inputData.valid() ||
!inputData->getBuf() ||
(inputData->getDataObjectStatus() == OSSIM_EMPTY))
{
return;
}
ossim_int32 h = imageRect.height();
ossimRefPtr<ossimImageData> tempData =
ossimImageDataFactory::instance()->create(NULL,
inputData->getScalarType(),
inputData->getNumberOfBands(),
viewRect.width(),
h);
tempData->setOrigin(ossimIpt(viewRect.ul().x,
imageRect.ul().y));
tempData->initialize();
if((m_ScaleFactor.x != 1.0)||
(m_BlurFactor != 1.0))
{
runHorizontalFilterTemplate(dummy,
inputData,
tempData);
tempData->validate();
}
else
{
tempData->loadTile(inputData.get());
}
if((m_ScaleFactor.y != 1.0)||
(m_BlurFactor != 1.0))
{
runVerticalFilterTemplate(dummy,
tempData,
m_Tile);
}
else
{
m_Tile->loadTile(tempData.get());
}
m_Tile->validate();
}
示例2: getTile
ossimRefPtr<ossimImageData> ossimImageToPlaneNormalFilter::getTile(
const ossimIrect& tileRect,
ossim_uint32 resLevel)
{
if(!isSourceEnabled()||!theInputConnection)
{
return ossimImageSourceFilter::getTile(tileRect, resLevel);
}
if(!theTile.valid())
{
initialize();
}
if(!theTile.valid())
{
return ossimImageSourceFilter::getTile(tileRect, resLevel);
}
theTile->setImageRectangle(tileRect);
theBlankTile->setImageRectangle(tileRect);
ossimIrect requestRect(tileRect.ul().x - 1,
tileRect.ul().y - 1,
tileRect.lr().x + 1,
tileRect.lr().y + 1);
ossimRefPtr<ossimImageData> input =
theInputConnection->getTile(requestRect, resLevel);
if(!input||(input->getDataObjectStatus()==OSSIM_EMPTY)||!input->getBuf())
{
return theBlankTile;
}
double oldScaleX = theXScale;
double oldScaleY = theYScale;
if(resLevel > 0)
{
ossimDpt scaleFactor;
theInputConnection->getDecimationFactor(resLevel, scaleFactor);
if(!scaleFactor.hasNans())
{
theXScale *= scaleFactor.x;
theYScale *= scaleFactor.y;
}
}
computeNormals(input,
theTile);
theXScale = oldScaleX;
theYScale = oldScaleY;
theTile->validate();
return theTile;
}
示例3: getDims
void ossim::getDims(const ossimIrect& rect, kdu_core::kdu_dims& dims)
{
dims.pos.x = rect.ul().x;
dims.pos.y = rect.ul().y;
dims.size.x = static_cast<int>(rect.width());
dims.size.y = static_cast<int>(rect.height());
}
示例4: ossimImageData
//**************************************************************************************************
//! Intercepts the getTile call intended for the adaptee and sets a mutex lock around the
//! adaptee's getTile call.
//**************************************************************************************************
ossimRefPtr<ossimImageData>
ossimImageHandlerMtAdaptor::getTile(const ossimIrect& tile_rect, ossim_uint32 rLevel)
{
if (d_useFauxTile)
{
ossimRefPtr<ossimImageData> ftile = new ossimImageData(*(d_fauxTile.get()));
ftile->setOrigin(tile_rect.ul());
return ftile;
}
if (!m_adaptedHandler.valid())
return NULL;
// The sole purpose of the adapter is this mutex lock around the actual handler getTile:
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
ossimRefPtr<ossimImageData> tile = new ossimImageData();
ossimRefPtr<ossimImageData> temp_tile = 0;
double dt = ossimTimer::instance()->time_s();
if (d_useCache)
temp_tile = m_cache->getTile(tile_rect, rLevel);
else
temp_tile = m_adaptedHandler->getTile(tile_rect, rLevel);
d_getTileT += ossimTimer::instance()->time_s() - dt;
// We make our own instance of a tile and copy the adaptee's returned tile to it. This avoids
// the product tile from changing while being processed up the chain. The adaptee's tile can
// change as soon as the mutex lock is released:
if (temp_tile.valid())
*tile = *(temp_tile.get());
else
tile = NULL;
return tile;
}
示例5: getTile
ossimRefPtr<ossimImageData> ossimFftFilter::getTile(const ossimIrect& rect,
ossim_uint32 resLevel)
{
if(!isSourceEnabled())
return ossimImageSourceFilter::getTile(rect, resLevel);
ossimIrect tempRequest = rect;
ossim_uint32 w = rect.width();
ossim_uint32 h = rect.height();
if(w & 1)
++w;
if(h&1)
++h;
tempRequest = ossimIrect(rect.ul().x, rect.ul().y,
rect.ul().x + (w-1), rect.ul().y + (h-1));
ossimRefPtr<ossimImageData> inTile = theScalarRemapper->getTile(tempRequest, resLevel);
if(!inTile.valid())
return inTile;
if(!theTile.valid())
initialize();
if(!theTile.valid() || !inTile->getBuf())
return theTile;
theTile->setImageRectangle(rect);
ossimRefPtr<ossimImageData> tempTile = theTile;
if(rect != tempRequest)
{
tempTile = (ossimImageData*)theTile->dup();
tempTile->setImageRectangle(tempRequest);
}
runFft(inTile, tempTile);
if(tempTile != theTile)
{
theTile->loadTile(tempTile.get());
}
theTile->validate();
return theTile;
}
示例6: pointList
void oms::SingleImageChain::setImageCut(const ossimIrect& rect)
{
std::vector<ossimDpt> pointList(4);
pointList[0] = rect.ul();
pointList[1] = rect.ur();
pointList[2] = rect.lr();
pointList[3] = rect.ll();
setImageCut(pointList);
}
示例7: theUlCorner
//*******************************************************************
// Public Constructor: ossimDrect
//
//*******************************************************************
ossimDrect::ossimDrect(const ossimIrect& rect)
:
theUlCorner(rect.ul()),
theUrCorner(rect.ur()),
theLrCorner(rect.lr()),
theLlCorner(rect.ll()),
theOrientMode(rect.orientMode())
{
if(rect.isNan())
{
makeNan();
}
}
示例8: fill
void ossimImageDataHelper::fill(T /* dummyVariable */,
const double* values,
const ossimIrect& region)
{
T* buf = reinterpret_cast<T*>(theImageData->getBuf());
ossim_int32 blockLength=theImageData->getWidth()*theImageData->getHeight();
ossim_int32 bandOffset = 0;
ossim_int32 miny,maxy;
ossim_int32 minx, maxx;
ossim_int32 y = 0;
miny = region.ul().y-theOrigin.y;
maxy = region.lr().y-theOrigin.y;
minx = region.ul().x-theOrigin.x;
maxx = region.lr().x-theOrigin.x;
ossim_int32 rowOffset = (miny)*theImageData->getWidth();
ossim_int32 startX = minx;
ossim_int32 endX = maxx;
ossim_int32 bands = (ossim_int32)theImageData->getNumberOfBands();
for (y = miny; (y <= maxy); ++y)
{
startX=minx;
while(startX <= endX)
{
bandOffset = 0;
int band = 0;
for(band = 0; band < bands;++band)
{
buf[rowOffset+bandOffset+startX] = (T)(values[band]);
bandOffset += blockLength;
}
++startX;
}
rowOffset += theImageData->getWidth();
}
}
示例9: getTile
ossimRefPtr<ossimImageData> ossimCFARFilter::getTile(const ossimIrect& tileRect,
ossim_uint32 resLevel)
{
if(!isSourceEnabled())
{
return ossimImageSourceFilter::getTile(tileRect, resLevel);
}
if(!outputTile.valid()) initialize();
if(!outputTile.valid()) return 0;
ossimRefPtr<ossimImageData> data = 0;
if(theInputConnection)
{
data = theInputConnection->getTile(tileRect, resLevel);
} else {
return 0;
}
if(!data.valid()) return 0;
if(data->getDataObjectStatus() == OSSIM_NULL || data->getDataObjectStatus() == OSSIM_EMPTY)
{
return 0;
}
outputTile->setImageRectangle(tileRect);
outputTile->makeBlank();
outputTile->setOrigin(tileRect.ul());
runUcharTransformation(data.get());
if(tileRect.ul().x % 1024 == 0 && tileRect.ul().y % 1024 == 0)
std::cout << "Processing tile: (" << tileRect.ul().x << "," << tileRect.ul().y << ")" << std::endl;
return outputTile;
}
示例10: setRoiRect
void ossimQtRoiRectAnnotator::setRoiRect(const ossimIrect& rect)
{
if (thePoints.size() != 2)
{
thePoints.resize(2);
}
thePoints[0] = rect.ul();
thePoints[1] = rect.lr();
if (theImageWidget)
{
theImageWidget->refreshGraphics();
}
}
示例11: scaleRect
//**************************************************************************************************
ossimIrect ossimScaleFilter::scaleRect(const ossimIrect input,
const ossimDpt& scaleFactor)const
{
ossimIpt origin(ossim::round<int>(input.ul().x*scaleFactor.x),
ossim::round<int>(input.ul().y*scaleFactor.y));
ossim_int32 w = ossim::round<int>(input.width()*scaleFactor.x);
ossim_int32 h = ossim::round<int>(input.height()*scaleFactor.y);
if(w < 1) w = 1;
if(h < 1) h = 1;
return ossimIrect(origin.x,
origin.y,
origin.x + (w-1),
origin.y + (h-1));
}
示例12: convertRequest
void ossimQtScrollingImageWidget::convertRequest(const ossimIrect& reqRect)
{
if(theRgbChain->getInput())
{
QImage tempImage(theTileSize.x,
theTileSize.y,
32);
tempImage.fill(0);
ossimIrect shiftedCacheRect = theBackingStoreCache.getCacheRect() - theShiftToZeroZero;
ossimIrect tempRect = getAbsoluteViewportRect();
tempImage.setOffset(QPoint(theShiftToZeroZero.x + reqRect.ul().x,
theShiftToZeroZero.y + reqRect.ul().y));
if(reqRect.intersects(shiftedCacheRect))
{
if(reqRect.intersects(theBoundingRect))
{
ossimRefPtr<ossimImageData> data = getTile(reqRect);
if(data.valid() && data->getBuf() &&
(data->getDataObjectStatus()!=OSSIM_EMPTY))
{
fillImage(data, &tempImage);
}
}
}
else
{
return;
}
theBackingStoreCache.addTile(tempImage);
ossimIrect viewClip = reqRect.clipToRect(tempRect);
viewClip = viewClip + theShiftToZeroZero;
int xLoc = viewClip.ul().x;
int yLoc = viewClip.ul().y;
int xSize = theTileSize.x;
int ySize = theTileSize.y;
eraseCursor();
repaintContents(xLoc, yLoc, xSize, ySize, false);
}
}
示例13: ossimIpt
ossim_int32 ossimGui::StaticTileImageCache::getTileIndex(const ossimIrect& rect,
const ossimIpt& numberOfTiles,
ossim_int32 x,
ossim_int32 y)const
{
ossimIpt ul = rect.ul();
ossimIpt delta = ossimIpt(x,y) - ul;
if((delta.x < 0) ||
(delta.y < 0) ||
(delta.x >= (int)rect.width())||
(delta.y >= (int)rect.height()))
{
return -1;
}
delta.x /= m_tileSize.x;
delta.y /= m_tileSize.y;
return delta.y*numberOfTiles.x + delta.x;
}
示例14: LineSampleToWorld
ossimDrect shapefileClip::LineSampleToWorld(ossimIrect rect, ossimRefPtr<ossimImageGeometry> ImageGeom)
{
ossimGpt gp1;
ossimGpt gp2;
ossimGpt gp3;
ossimGpt gp4;
ImageGeom->localToWorld(rect.ul(), gp1);
ImageGeom->localToWorld(rect.ur(), gp2);
ImageGeom->localToWorld(rect.lr(), gp3);
ImageGeom->localToWorld(rect.ll(), gp4);
ossimDrect boundsRect(ossimDpt(gp1.lond(), gp1.latd()),
ossimDpt(gp2.lond(), gp2.latd()),
ossimDpt(gp3.lond(), gp3.latd()),
ossimDpt(gp4.lond(), gp4.latd()),
OSSIM_RIGHT_HANDED);
return boundsRect;
}
示例15:
ossim_int32 ossimGui::StaticTileImageCache::computeTileId(const ossimIpt& origin,
const ossimIrect& tileBounderyRect,
const ossimIpt& tileSize)
{
ossim_uint32 numberOfTilesX = tileBounderyRect.width()/tileSize.x;
ossimIpt ul = tileBounderyRect.ul();
ossimIpt delta = origin - ul;
if((delta.x < 0) ||
(delta.y < 0) ||
(delta.x >= (int)tileBounderyRect.width())||
(delta.y >= (int)tileBounderyRect.height()))
{
return -1;
}
delta.x /= tileSize.x;
delta.y /= tileSize.y;
return delta.y*numberOfTilesX + delta.x;
}