Skip to content

Commit

Permalink
Document purpose of cached_location_t [ci skip] (#287)
Browse files Browse the repository at this point in the history
Closes #130
  • Loading branch information
mloskot authored Apr 15, 2019
1 parent d5348c6 commit 6a57721
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doc/design_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,7 @@ GIL provides two models of ``PixelLocatorConcept`` - a memory-based
locator, ``memory_based_2d_locator`` and a virtual locator
``virtual_2d_locator``.

``memory_based_2d_locator`` is a locator over planar or interleaved
The ``memory_based_2d_locator`` is a locator over planar or interleaved
images that have their pixels in memory. It takes a model of
``StepIteratorConcept`` over pixels as a template parameter. (When
instantiated with a model of ``MutableStepIteratorConcept``, it models
Expand Down Expand Up @@ -1368,7 +1368,13 @@ obtain a 2D pixel locator, as the diagram indicates:

.. image:: images/step_iterator.gif

``virtual_2d_locator`` is a locator that is instantiated with a
The ``memory_based_2d_locator`` also offers `cached_location_t` as mechanism to
store relative locations for optimized repeated access of neighborhood pixels.
The 2D coordinates of relative locations are cached as 1-dimensional raw byte offsets.
This provides efficient access if a neighboring locations relative to a given
locator are read or written frequently (e.g. in filters).

The ``virtual_2d_locator`` is a locator that is instantiated with a
function object invoked upon dereferencing a pixel. It returns the
value of a pixel given its X,Y coordinates. Virtual locators can be
used to implement virtual image views that can model any user-defined
Expand Down

0 comments on commit 6a57721

Please sign in to comment.