File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
DGtal::Linearizer< HyperRectDomain< TSpace >, TStorageOrder > Struct Template Reference

Aim: Linearization and de-linearization interface for HyperRectDomain. More...

#include <DGtal/kernel/domains/Linearizer.h>

Inheritance diagram for DGtal::Linearizer< HyperRectDomain< TSpace >, TStorageOrder >:
[legend]

Public Types

typedef HyperRectDomain< TSpace > Domain
 The domain type.
typedef TSpace::Point Point
 The point type.
typedef Point Extent
 The domain's extent type.
typedef TSpace::Size Size
 The space's size type.

Static Public Member Functions

static Size getIndex (Point aPoint, Point const &aLowerBound, Extent const &anExtent)
static Size getIndex (Point aPoint, Extent const &anExtent)
static Size getIndex (Point aPoint, Domain const &aDomain)
static Point getPoint (Size anIndex, Point const &aLowerBound, Extent const &anExtent)
static Point getPoint (Size anIndex, Extent const &anExtent)
static Point getPoint (Size anIndex, Domain const &aDomain)

Detailed Description

template<typename TSpace, typename TStorageOrder>
struct DGtal::Linearizer< HyperRectDomain< TSpace >, TStorageOrder >

Aim: Linearization and de-linearization interface for HyperRectDomain.

This is a static class that provides point linearization (point to index) and de-linearization (index to point) for storages working on HyperRectDomain.

The storage order can be specified by template (default is colum-major ordered).

Example:

typedef SpaceND<2> Space;
typedef typename Space::Point Point;
const Domain domain( Point(0, 1), Point(4, 3) );
typename Linearizer<Domain>::Size id = Linearizer<Domain>::getIndex( Point(2, 2), domain ); // returns 7.
Point pt = Linearizer<Domain>::getPoint( 7, domain); // returns Point(2,2).
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
PointVector< dim, Integer > Point
Points in DGtal::SpaceND.
Definition SpaceND.h:110
HyperRectDomain< TSpace > Domain
The domain type.
Definition Linearizer.h:110
Aim: Linearization and de-linearization interface for domains.
Definition Linearizer.h:78
Domain domain
Template Parameters
TSpaceType of the space of the HyperRectDomain (auto-deduced from TDomain template, see Linearizer).
TStorageOrderStorage Order (RowMajorStorage of ColMajorStorage).

Definition at line 107 of file Linearizer.h.

Member Typedef Documentation

◆ Domain

template<typename TSpace, typename TStorageOrder>
typedef HyperRectDomain<TSpace> DGtal::Linearizer< HyperRectDomain< TSpace >, TStorageOrder >::Domain

The domain type.

Definition at line 110 of file Linearizer.h.

◆ Extent

template<typename TSpace, typename TStorageOrder>
typedef Point DGtal::Linearizer< HyperRectDomain< TSpace >, TStorageOrder >::Extent

The domain's extent type.

Definition at line 112 of file Linearizer.h.

◆ Point

template<typename TSpace, typename TStorageOrder>
typedef TSpace::Point DGtal::Linearizer< HyperRectDomain< TSpace >, TStorageOrder >::Point

The point type.

Definition at line 111 of file Linearizer.h.

◆ Size

template<typename TSpace, typename TStorageOrder>
typedef TSpace::Size DGtal::Linearizer< HyperRectDomain< TSpace >, TStorageOrder >::Size

The space's size type.

Definition at line 113 of file Linearizer.h.

Member Function Documentation

◆ getIndex() [1/3]

template<typename TSpace, typename TStorageOrder>
Size DGtal::Linearizer< HyperRectDomain< TSpace >, TStorageOrder >::getIndex ( Point aPoint,
Domain const & aDomain )
inlinestatic

Linearized index of a point, given a domain.

Parameters
[in]aPointThe Point to be linearized.
[in]aDomainThe domain.
Returns
the linearized index of the point.

References aPoint.

◆ getIndex() [2/3]

template<typename TSpace, typename TStorageOrder>
Size DGtal::Linearizer< HyperRectDomain< TSpace >, TStorageOrder >::getIndex ( Point aPoint,
Extent const & anExtent )
inlinestatic

Linearized index of a point, given the domain extent.

The lower-bound of the domain is defined to the origin.

Parameters
[in]aPointThe Point to be linearized.
[in]anExtentThe extent of the domain.
Returns
the linearized index of the point.

References aPoint.

◆ getIndex() [3/3]

template<typename TSpace, typename TStorageOrder>
Size DGtal::Linearizer< HyperRectDomain< TSpace >, TStorageOrder >::getIndex ( Point aPoint,
Point const & aLowerBound,
Extent const & anExtent )
inlinestatic

Linearized index of a point, given the domain lower-bound and extent.

Parameters
[in]aPointThe point to be linearized.
[in]aLowerBoundThe lower-bound of the domain.
[in]anExtentThe extent of the domain.
Returns
the linearized index of the point.

References aPoint.

◆ getPoint() [1/3]

template<typename TSpace, typename TStorageOrder>
Point DGtal::Linearizer< HyperRectDomain< TSpace >, TStorageOrder >::getPoint ( Size anIndex,
Domain const & aDomain )
inlinestatic

De-linearization of an index, given a domain.

Parameters
[in]anIndexThe linearized index.
[in]aDomainThe domain.
Returns
the point whose linearized index is anIndex.

◆ getPoint() [2/3]

template<typename TSpace, typename TStorageOrder>
Point DGtal::Linearizer< HyperRectDomain< TSpace >, TStorageOrder >::getPoint ( Size anIndex,
Extent const & anExtent )
inlinestatic

De-linearization of an index, given the domain extent.

The lower-bound of the domain is set to the origin.

Parameters
[in]anIndexThe linearized index.
[in]anExtentThe domain extent.
Returns
the point whose linearized index is anIndex.

◆ getPoint() [3/3]

template<typename TSpace, typename TStorageOrder>
Point DGtal::Linearizer< HyperRectDomain< TSpace >, TStorageOrder >::getPoint ( Size anIndex,
Point const & aLowerBound,
Extent const & anExtent )
inlinestatic

De-linearization of an index, given the domain lower-bound and extent.

Parameters
[in]anIndexThe linearized index.
[in]aLowerBoundThe lower-bound of the domain.
[in]anExtentThe domain extent.
Returns
the point whose linearized index is anIndex.

The documentation for this struct was generated from the following file: