本文整理汇总了C++中ossimRefPtr::getOrigin方法的典型用法代码示例。如果您正苦于以下问题:C++ ossimRefPtr::getOrigin方法的具体用法?C++ ossimRefPtr::getOrigin怎么用?C++ ossimRefPtr::getOrigin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ossimRefPtr
的用法示例。
在下文中一共展示了ossimRefPtr::getOrigin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cacheInfo
ossimRefPtr<ossimImageData> ossimFixedTileCache::addTile(ossimRefPtr<ossimImageData> imageData,
bool duplicateData)
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
ossimRefPtr<ossimImageData> result = NULL;
if(!imageData.valid())
{
return result;
}
if(!imageData->getBuf())
{
return result;
}
ossim_int32 id = computeId(imageData->getOrigin());
if(id < 0)
{
return result;
}
std::map<ossim_int32, ossimFixedTileCacheInfo>::iterator tileIter =
theTileMap.find(id);
if(tileIter==theTileMap.end())
{
if(duplicateData)
{
result = (ossimImageData*)imageData->dup();
}
else
{
result = imageData;
}
ossimFixedTileCacheInfo cacheInfo(result, id);
theCacheSize += imageData->getDataSizeInBytes();
theTileMap.insert(make_pair(id, cacheInfo));
if(theUseLruFlag)
{
theLruQueue.push_back(id);
}
}
return result;
}
示例2: if
template<class T> void ossimCFARFilter::convolveFull(
T,
ossimRefPtr<ossimImageData> inputData,
ossimRefPtr<ossimImageData> outputData)
{
// let's set up some temporary variables so we don't
// have to call the functions in loops. Iknow that compilers
// typically optimize this out but if we are in debug mode
// with no optimization it will still run fast
//
double sum = 0.0,sqrsum = 0.0,variance = 0.0;
ossim_int32 inputW = static_cast<ossim_int32>(inputData->getWidth());
ossim_uint32 outputW = outputData->getWidth();
ossim_uint32 outputH = outputData->getHeight();
ossim_uint32 numberOfBands = inputData->getNumberOfBands();
ossimIpt outputOrigin = outputData->getOrigin();
ossimIpt inputOrigin = inputData->getOrigin();
ossim_int32 startInputOffset = std::abs(outputOrigin.y - inputOrigin.y)*
inputW + std::abs(outputOrigin.x - inputOrigin.x);
ossim_int32 ulKernelStart = -(2*inputW) - 2;
ossim_int32 ul1KernelStart = -inputW - 1;
ossim_int32 leftKernelStart = -2;
ossim_int32 ll1KernelStart = inputW - 1;
ossim_int32 llKernelStart = (2*inputW) - 2;
//populate kernel offset indices
ossim_int32 KernelStart[BOXSIZE];
T* KernelStartBuf[BOXSIZE];
for(ossim_uint16 i=0;i<BOXSIZE;i++)
{
int offset = i-(BOXSIZE/2);
KernelStart[i] = offset*inputW + offset;
KernelStartBuf[i] = NULL;
}
T* ulKernelStartBuf = NULL;
T* ul1KernelStartBuf = NULL;
T* leftKernelStartBuf = NULL;
T* ll1KernelStartBuf = NULL;
T* llKernelStartBuf = NULL;
for(ossim_uint32 band = 0; band < numberOfBands; ++band)
{
T* inputBuf = static_cast<T*>(inputData->getBuf(band))+startInputOffset;
T* outputBuf = static_cast<T*>(outputData->getBuf(band));
T maxPix = static_cast<T>(getMaxPixelValue(band));
T minPix = static_cast<T>(getMinPixelValue(band));
if(inputBuf&&outputBuf)
{
for(ossim_uint32 row = 0; row < outputW; ++row)
{
ossim_int32 rowOffset = inputW*row;
ulKernelStartBuf = inputBuf + (rowOffset + ulKernelStart);
ul1KernelStartBuf = inputBuf + (rowOffset + ul1KernelStart);
leftKernelStartBuf = inputBuf + (rowOffset + leftKernelStart);
ll1KernelStartBuf = inputBuf + (rowOffset + ll1KernelStart);
llKernelStartBuf = inputBuf + (rowOffset + llKernelStart);
for(ossim_uint16 i=0;i<BOXSIZE;i++)
{
KernelStartBuf[i] = inputBuf + (rowOffset + KernelStart[i]);
}
for(ossim_uint32 col = 0; col < outputH; ++col)
{
//calculate mean
sum = 0.0;
sqrsum = 0.0;
for(ossim_uint32 r=0; r<5; ++r)
sum += theKernel[0][r]*(double)ulKernelStartBuf[r];
for(ossim_uint32 r=0; r<5; ++r)
sum += theKernel[1][r]*(double)ul1KernelStartBuf[r];
for(ossim_uint32 r=0; r<5; ++r)
sum += theKernel[2][r]*(double)leftKernelStartBuf[r];
for(ossim_uint32 r=0; r<5; ++r)
sum += theKernel[3][r]*(double)ll1KernelStartBuf[r];
for(ossim_uint32 r=0; r<5; ++r)
sum += theKernel[4][r]*(double)llKernelStartBuf[r];
/*
for(ossim_uint16 i=0;i<BOXSIZE;i++)
{
for(ossim_uint32 r=0; r<5; ++r)
{
sum += theKernel[i][r]*(double)KernelStartBuf[i][r];
sqrsum += theKernel[i][r]*(double)KernelStartBuf[i][r]
*(double)KernelStartBuf[i][r];
}
}
*/
//calculate mean of squares
for(ossim_uint32 r=0; r<5; ++r)
sqrsum += theKernel[0][r]*(double)ulKernelStartBuf[r]
//.........这里部分代码省略.........