DGtal
1.5.beta
|
Aim: Image adapter for generic arrays with sub-domain view capability. More...
#include <DGtal/images/ArrayImageAdapter.h>
Public Types | |
using | Self = ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > > |
Self type. More... | |
using | ArrayIterator = TArrayIterator |
The given random-access iterator's type. More... | |
using | Value = typename std::iterator_traits< ArrayIterator >::value_type |
The value type stored in the image. More... | |
using | Reference = typename std::iterator_traits< ArrayIterator >::reference |
Mutable reference type. More... | |
using | ConstReference = const Reference |
Constant reference type. More... | |
using | Domain = HyperRectDomain< TSpace > |
Domain type. More... | |
using | Point = typename Domain::Point |
Point type. More... | |
using | Dimension = typename Domain::Dimension |
Dimension type. More... | |
using | Size = typename Domain::Size |
Size type. More... | |
using | Vector = typename Domain::Vector |
Vector type. More... | |
using | Vertex = Point |
Vertex type. More... | |
using | Integer = typename Domain::Integer |
Integer type. More... | |
using | Linearizer = DGtal::Linearizer< Domain, ColMajorStorage > |
Linearization of the points. More... | |
using | Iterator = typename IteratorCompletionTraits< Self >::Iterator |
Mutable iterator based on ArrayImageIterator. More... | |
using | ConstIterator = typename IteratorCompletionTraits< Self >::ConstIterator |
Constant iterator base on ArrayImageIterator. More... | |
Public Types inherited from DGtal::IteratorCompletion< ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > > > | |
typedef IteratorCompletionTraits< ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > > >::Iterator | Iterator |
Mutable iterator type. More... | |
typedef IteratorCompletionTraits< ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > > >::ConstIterator | ConstIterator |
Constant iterator type. More... | |
typedef IteratorCompletionTraits< ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > > >::DistanceFunctor | DistanceFunctor |
Type of the functor calculating the distance between iterators. More... | |
typedef boost::reverse_iterator< Iterator > | ReverseIterator |
Mutable reverse iterator type. More... | |
typedef boost::reverse_iterator< ConstIterator > | ConstReverseIterator |
Constant reverse iterator type. More... | |
typedef SimpleRandomAccessRangeFromPoint< ConstIterator, Iterator, DistanceFunctor > | Range |
Mutable range type. More... | |
typedef SimpleRandomAccessConstRangeFromPoint< ConstIterator, DistanceFunctor > | ConstRange |
Constant range type. More... | |
typedef std::ptrdiff_t | Difference |
Type of the distance between two iterators. More... | |
Private Member Functions | |
BOOST_CONCEPT_ASSERT ((boost_concepts::RandomAccessTraversalConcept< TArrayIterator >)) | |
Private Attributes | |
ArrayIterator | myArrayIterator |
Pointer to the allocated memory. More... | |
Domain | myFullDomain |
Definition (full) domain. More... | |
Domain | myViewDomain |
Viewable domain. More... | |
Friends | |
template<class > | |
class | ArrayImageIterator |
Additional Inherited Members | |
Protected Member Functions inherited from DGtal::IteratorCompletion< ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > > > | |
~IteratorCompletion () | |
Protected destructor to avoid memory leak. More... | |
Aim: Image adapter for generic arrays with sub-domain view capability.
Description of template class 'ArrayImageAdapter'
This creates an image (concepts::CImage compatible) given a random-access iterator (that can be a T* pointer) that fully spans an array of data, and two domains:
The available iterators for this image can return the corresponding point and are faster than using an iterator over the domain (see ArrayImageIterator). Reverse iterators and ranges are defined in the inherited class IteratorCompletion.
Some helpers are available (see makeArrayImageAdapterFromIterator and makeArrayImageAdapterFromImage) for easy construction (with template deduction) from an iterator or an CConstImage model.
It is important to note that, since this class only adapts an already existing storage to an image, all copy operations (constructor and operator) lead to shallow copies.
The following code snippet demonstrates how to use ArrayImageAdapter from converting a native C-array to an image:
Another usage example is illustrated in the image module documentation, ArrayImageAdapter.
TArrayIterator | Type of a random-access iterator over the datas (can be a T* pointer). |
TSpace | Type of the space associated to the HyperRectDomain (auto-deduced from TDomain template, see ArrayImageAdapter). |
Definition at line 116 of file ArrayImageAdapter.h.
using DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::ArrayIterator = TArrayIterator |
The given random-access iterator's type.
Definition at line 126 of file ArrayImageAdapter.h.
using DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::ConstIterator = typename IteratorCompletionTraits<Self>::ConstIterator |
Constant iterator base on ArrayImageIterator.
Definition at line 146 of file ArrayImageAdapter.h.
using DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::ConstReference = const Reference |
Constant reference type.
Definition at line 129 of file ArrayImageAdapter.h.
using DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::Dimension = typename Domain::Dimension |
Dimension type.
Definition at line 134 of file ArrayImageAdapter.h.
using DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::Domain = HyperRectDomain<TSpace> |
Domain type.
Definition at line 132 of file ArrayImageAdapter.h.
using DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::Integer = typename Domain::Integer |
Integer type.
Definition at line 138 of file ArrayImageAdapter.h.
using DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::Iterator = typename IteratorCompletionTraits<Self>::Iterator |
Mutable iterator based on ArrayImageIterator.
Definition at line 145 of file ArrayImageAdapter.h.
using DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::Linearizer = DGtal::Linearizer<Domain, ColMajorStorage> |
Linearization of the points.
Definition at line 141 of file ArrayImageAdapter.h.
using DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::Point = typename Domain::Point |
Point type.
Definition at line 133 of file ArrayImageAdapter.h.
using DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::Reference = typename std::iterator_traits<ArrayIterator>::reference |
Mutable reference type.
Definition at line 128 of file ArrayImageAdapter.h.
using DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::Self = ArrayImageAdapter<TArrayIterator, HyperRectDomain<TSpace> > |
Self type.
Definition at line 125 of file ArrayImageAdapter.h.
using DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::Size = typename Domain::Size |
Size type.
Definition at line 135 of file ArrayImageAdapter.h.
using DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::Value = typename std::iterator_traits<ArrayIterator>::value_type |
The value type stored in the image.
Definition at line 127 of file ArrayImageAdapter.h.
using DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::Vector = typename Domain::Vector |
Vector type.
Definition at line 136 of file ArrayImageAdapter.h.
using DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::Vertex = Point |
Vertex type.
Definition at line 137 of file ArrayImageAdapter.h.
|
inline |
Default constructor.
Empty allocated memory on empty domains.
Definition at line 152 of file ArrayImageAdapter.h.
|
inline |
Constructor from iterator, full domain and viewable domain.
anArrayIterator | A random-access iterator on the datas. |
aFullDomain | The domain span by the given iterator. |
aViewDomain | The viewable domain of this image. |
Definition at line 164 of file ArrayImageAdapter.h.
References DGtal::PointVector< dim, TEuclideanRing, TContainer >::isLower(), DGtal::PointVector< dim, TEuclideanRing, TContainer >::isUpper(), DGtal::HyperRectDomain< TSpace >::lowerBound(), and DGtal::HyperRectDomain< TSpace >::upperBound().
|
inline |
Constructor from iterator and full domain.
The viewable domain is then the full domain.
anArrayIterator | A random-access iterator on the datas. |
aFullDomain | The domain span by the given iterator. |
Definition at line 183 of file ArrayImageAdapter.h.
|
inline |
Copy constructor with other viewable domain.
The full domain will be the same as the copied ArrayImageAdapter. Only the viewable domain will be modified.
other | An another ArrayImageAdapter instance. |
aViewDomain | A new viewable domain for this image. |
Definition at line 197 of file ArrayImageAdapter.h.
|
inline |
Definition at line 266 of file ArrayImageAdapter.h.
|
inline |
Definition at line 275 of file ArrayImageAdapter.h.
|
private |
DGtal::ArrayImageAdapter< TArrayIterator, HyperRectDomain< TSpace > >::BOOST_STATIC_CONSTANT | ( | Dimension | , |
dimension | = Domain::dimension |
||
) |
Rank of the space.
|
inline |
Definition at line 284 of file ArrayImageAdapter.h.
|
inline |
Definition at line 311 of file ArrayImageAdapter.h.
|
inline |
Dereference of a mutable iterator.
[in] | aFullIndex | Linearized index of the point. |
Definition at line 325 of file ArrayImageAdapter.h.
|
inline |
Dereference of a constant iterator.
[in] | aFullIndex | Linearized index of the point. |
Definition at line 340 of file ArrayImageAdapter.h.
|
inline |
Definition at line 205 of file ArrayImageAdapter.h.
|
inline |
Definition at line 293 of file ArrayImageAdapter.h.
|
inline |
Definition at line 302 of file ArrayImageAdapter.h.
|
inline |
Definition at line 214 of file ArrayImageAdapter.h.
|
inline |
Reads a value given a point lying inside the full domain.
[in] | aPoint | The point. |
Definition at line 225 of file ArrayImageAdapter.h.
References aPoint().
|
inline |
Checks the validity/consistency of the object.
Definition at line 364 of file ArrayImageAdapter.h.
|
inline |
Reads a value given a point lying inside the full domain.
[in] | aPoint | The point. |
Definition at line 257 of file ArrayImageAdapter.h.
References aPoint().
|
inline |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Definition at line 355 of file ArrayImageAdapter.h.
|
inline |
Sets a value given a point lying inside the full domain.
[in] | aPoint | The point. |
[in] | aValue | The value. |
Definition at line 241 of file ArrayImageAdapter.h.
References aPoint().
|
friend |
Definition at line 144 of file ArrayImageAdapter.h.
|
private |
Pointer to the allocated memory.
Definition at line 371 of file ArrayImageAdapter.h.
|
private |
Definition (full) domain.
Definition at line 372 of file ArrayImageAdapter.h.
|
private |
Viewable domain.
Definition at line 373 of file ArrayImageAdapter.h.