本文整理汇总了C++中PointBuffer::copyPointsFast方法的典型用法代码示例。如果您正苦于以下问题:C++ PointBuffer::copyPointsFast方法的具体用法?C++ PointBuffer::copyPointsFast怎么用?C++ PointBuffer::copyPointsFast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointBuffer
的用法示例。
在下文中一共展示了PointBuffer::copyPointsFast方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
boost::uint32_t ByteSwap::processBuffer(PointBuffer& dstData, const PointBuffer& srcData) const
{
const Schema& dstSchema = dstData.getSchema();
schema::index_by_index const& dstDims = dstSchema.getDimensions().get<schema::index>();
dstData.setSpatialBounds(srcData.getSpatialBounds());
dstData.copyPointsFast(0, 0, srcData, srcData.getNumPoints());
dstData.setNumPoints(srcData.getNumPoints());
for (boost::uint32_t i = 0; i != dstData.getNumPoints(); ++i)
{
boost::uint8_t* data = dstData.getData(i);
std::size_t position = 0;
for (boost::uint32_t n = 0; n < dstDims.size(); ++n)
{
const Dimension& d = dstSchema.getDimension(n);
std::size_t size = d.getByteSize();
boost::uint8_t* pos = data + position;
SWAP_ENDIANNESS_N(*pos, size);
position = position + size;
}
}
return dstData.getNumPoints();
}
示例2: tmp
boost::uint32_t Mosaic::readBufferImpl(PointBuffer& destData)
{
boost::uint32_t totalNumPointsToRead = destData.getCapacity();
boost::uint32_t totalNumPointsRead = 0;
boost::uint32_t destPointIndex = 0;
// for each stage, we read as many points as we can
while (totalNumPointsRead < totalNumPointsToRead)
{
assert(m_iteratorIndex < m_prevIterators.size());
m_prevIterator = m_prevIterators[m_iteratorIndex];
// read as much as we can into temp buffer
PointBuffer tmp(destData.getSchema(), totalNumPointsToRead-totalNumPointsRead);
boost::uint32_t numRead = m_prevIterator->read(tmp);
totalNumPointsRead += numRead;
// concat the temp buffer on to end of real dest buffer
destData.copyPointsFast(destPointIndex, 0, tmp, numRead);
destPointIndex += numRead;
destData.setNumPoints(destData.getNumPoints() + numRead);
if (m_prevIterator->atEnd())
{
++m_iteratorIndex;
}
if (m_iteratorIndex == m_prevIterators.size())
{
break;
}
}
return totalNumPointsRead;
}
示例3: addToCache
void Cache::addToCache(boost::uint64_t pointIndex, const PointBuffer& data) const
{
PointBuffer* block = new PointBuffer(data.getSchema(), m_cacheBlockSize);
block->copyPointsFast(0, 0, data, m_cacheBlockSize);
m_cache->insert(pointIndex, block);
return;
}
示例4: python_error
boost::uint32_t Predicate::processBuffer(PointBuffer& data, pdal::plang::BufferedInvocation& python) const
{
python.resetArguments();
python.beginChunk(data);
python.execute();
if (!python.hasOutputVariable("Mask"))
{
throw python_error("Mask variable not set in predicate filter function");
}
boost::uint8_t* mask = new boost::uint8_t[data.getNumPoints()];
PointBuffer dstData(data.getSchema(), data.getCapacity());
python.extractResult("Mask", (boost::uint8_t*)mask, data.getNumPoints(), 1, pdal::dimension::RawByte, 1);
boost::uint8_t* dst = dstData.getData(0);
boost::uint8_t* src = data.getData(0);
const Schema& schema = dstData.getSchema();
boost::uint32_t numBytes = schema.getByteSize();
assert(numBytes == data.getSchema().getByteSize());
boost::uint32_t numSrcPoints = data.getNumPoints();
boost::uint32_t count = 0;
for (boost::uint32_t srcIndex=0; srcIndex<numSrcPoints; srcIndex++)
{
if (mask[srcIndex])
{
memcpy(dst, src, numBytes);
dst += numBytes;
++count;
dstData.setNumPoints(count);
}
src += numBytes;
}
data.copyPointsFast(0, 0, dstData, count);
data.setNumPoints(count);
delete[] mask;
return count;
}