-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a96bcd0
commit 7c4a0f4
Showing
4 changed files
with
86 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
.. _readers.memoryview: | ||
|
||
readers.memoryview | ||
================== | ||
|
||
The MemoryView Reader is a special stage that allows | ||
the reading of point data arranged in rows directly from memory -- | ||
each point needs to have dimension data arranged at a fixed offset | ||
from a base address of the point. | ||
Before each point is read, the MemoryViewReader calls a function that | ||
should return the point's base address, or a null pointer if there are no | ||
points to be read. | ||
|
||
Note that the memoryview reader does not currently work with columnar | ||
data (data where individual dimensions are packed into arrays). | ||
|
||
Usage | ||
===== | ||
|
||
The MemoryViewReader cannot be used from the command-line. It is for use | ||
by software using the PDAL API. | ||
|
||
After creating an instance of the MemoryViewReader, the user should | ||
call pushField() for every dimension that should be read from memory. | ||
pushField() takes a single argument, a MemoryViewReader::Field, that consists | ||
of a dimension name, a type and an offset from the base pointer: | ||
|
||
.. code-block:: c++ | ||
|
||
struct Field | ||
{ | ||
std::string m_name; | ||
Dimension::Type m_type; | ||
size_t m_offset; | ||
}; | ||
|
||
void pushField(const Field&); | ||
|
||
The user should also call setIncrementer(), a function that takes a | ||
single argument, an std::function that receives the ID of the point to | ||
be added and should return the base address of the point data, or a | ||
null pointer if there are no more points to be read. | ||
|
||
.. code-block:: c++ | ||
|
||
using PointIncrementer = std::function<char *(PointId)>; | ||
void setIncrementer(PointIncrementer inc); | ||
|
||
|
||
Options | ||
------- | ||
|
||
None. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters