本文整理汇总了C++中DataAccessor::getRow方法的典型用法代码示例。如果您正苦于以下问题:C++ DataAccessor::getRow方法的具体用法?C++ DataAccessor::getRow怎么用?C++ DataAccessor::getRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataAccessor
的用法示例。
在下文中一共展示了DataAccessor::getRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: preprocess
bool BackgroundSuppressionShell::preprocess()
{
if(mpRaster == NULL)
{
return false;
}
RasterDataDescriptor *pDesc = static_cast<RasterDataDescriptor*>(mpRaster->getDataDescriptor());
if(mpTemporaryBuffer.get() == NULL)
{
mpTemporaryBuffer.reset(new char[pDesc->getRowCount() * pDesc->getColumnCount() * pDesc->getBytesPerElement()]);
if(mpTemporaryBuffer.get() == NULL)
{
return false;
}
}
DataAccessor frameAccessor = getCurrentFrameAccessor();
size_t rowSize = pDesc->getColumnCount() * pDesc->getBytesPerElement();
for(unsigned int row = 0; row < pDesc->getRowCount(); row++)
{
if(!frameAccessor.isValid())
{
return false;
}
memcpy(mpTemporaryBuffer.get() + row * rowSize, frameAccessor->getRow(), rowSize);
frameAccessor->nextColumn();
}
return true;
}
示例2: getPage
RasterPage* ConvertToBsqPager::getPage(DataRequest* pOriginalRequest, DimensionDescriptor startRow,
DimensionDescriptor startColumn, DimensionDescriptor startBand)
{
VERIFYRV(pOriginalRequest != NULL, NULL);
if (pOriginalRequest->getWritable())
{
return NULL;
}
InterleaveFormatType requestedType = pOriginalRequest->getInterleaveFormat();
DimensionDescriptor stopRow = pOriginalRequest->getStopRow();
DimensionDescriptor stopColumn = pOriginalRequest->getStopColumn();
DimensionDescriptor stopBand = pOriginalRequest->getStopBand();
unsigned int concurrentRows = std::min(pOriginalRequest->getConcurrentRows(),
stopRow.getActiveNumber() - startRow.getActiveNumber() + 1);
unsigned int concurrentBands = pOriginalRequest->getConcurrentBands();
VERIFY(requestedType == BSQ);
VERIFY(startBand == stopBand && concurrentBands == 1);
VERIFY(mpRaster != NULL);
const RasterDataDescriptor* pDd = dynamic_cast<const RasterDataDescriptor*>(mpRaster->getDataDescriptor());
VERIFY(pDd != NULL);
InterleaveFormatType interleave = pDd->getInterleaveFormat();
VERIFY(interleave == BIL || interleave == BIP);
unsigned int numRows = pDd->getRowCount();
unsigned int numCols = pDd->getColumnCount();
unsigned int numBands = pDd->getBandCount();
if (startRow.getActiveNumber() >= numRows || stopRow.getActiveNumber() >= numRows ||
startColumn.getActiveNumber() >= numCols || stopColumn.getActiveNumber() >= numCols ||
startBand.getActiveNumber() >= numBands || stopBand.getActiveNumber() >= numBands)
{
return NULL;
}
unsigned int cols = stopColumn.getActiveNumber() - startColumn.getActiveNumber() + 1;
std::auto_ptr<ConvertToBsqPage> pPage(new ConvertToBsqPage(concurrentRows, cols, mBytesPerElement));
unsigned char* pDst = reinterpret_cast<unsigned char*>(pPage->getRawData());
if (pDst == NULL)
{
return NULL;
}
FactoryResource<DataRequest> pRequest;
pRequest->setRows(startRow, stopRow);
pRequest->setColumns(startColumn, stopColumn, cols);
pRequest->setBands(startBand, startBand, 1);
DataAccessor da = mpRaster->getDataAccessor(pRequest.release());
if (interleave == BIP)
{
for (unsigned int row = 0; row < concurrentRows; ++row)
{
for (unsigned int col = 0; col < cols; ++col)
{
if (da.isValid() == false)
{
return NULL;
}
memcpy(pDst, da->getColumn(), mBytesPerElement);
pDst += mBytesPerElement;
da->nextColumn();
}
da->nextRow();
}
}
else if (interleave == BIL)
{
for (unsigned int row = 0; row < concurrentRows; ++row)
{
if (da.isValid() == false)
{
return NULL;
}
memcpy(pDst, da->getRow(), mBytesPerElement * cols);
pDst += mBytesPerElement * cols;
da->nextRow();
}
}
return pPage.release();
}