DGtal 1.3.0
|
Aim: Small class that contains the code that depends on the arithmetical thickness (either naive or standard) of a digital straight line (DSL). It provides mainly two static methods: More...
#include <DGtal/geometry/curves/ArithmeticalDSLKernel.h>
Public Types | |
typedef SpaceND< 2, TCoordinate > | Space |
typedef Space::Vector | Vector |
typedef std::pair< Vector, Vector > | Steps |
Public Member Functions | |
BOOST_STATIC_CONSTANT (unsigned short, ForegroundAdjacency=8) | |
BOOST_STATIC_CONSTANT (unsigned short, BackgroundAdjacency=4) | |
Static Public Member Functions | |
template<typename TInteger > | |
static Vector | shift (const TInteger &a, const TInteger &b) |
template<typename TInteger > | |
static Steps | steps (const TInteger &a, const TInteger &b) |
template<typename TInteger > | |
static TInteger | norm (const TInteger &a, const TInteger &b) |
Aim: Small class that contains the code that depends on the arithmetical thickness (either naive or standard) of a digital straight line (DSL). It provides mainly two static methods:
These methods are specialized with respect to the chosen adjacency 8 (default) or 4.
Digital straight lines and segments
TCoordinate | a model of integer for the DGtal point coordinates |
adjacency | integer equal to 8 (default) for naive (simply 8-connected) DSL, and 4 for standard (simply 4-connected) DSL. |
Definition at line 91 of file ArithmeticalDSLKernel.h.
typedef SpaceND<2, TCoordinate> DGtal::ArithmeticalDSLKernel< TCoordinate, adjacency >::Space |
Type of the digital plane.
Definition at line 99 of file ArithmeticalDSLKernel.h.
typedef std::pair<Vector, Vector> DGtal::ArithmeticalDSLKernel< TCoordinate, adjacency >::Steps |
Type of the step vectors, defined as a STL pair of Vector
Definition at line 107 of file ArithmeticalDSLKernel.h.
typedef Space::Vector DGtal::ArithmeticalDSLKernel< TCoordinate, adjacency >::Vector |
Type of the shift vector.
Definition at line 103 of file ArithmeticalDSLKernel.h.
DGtal::ArithmeticalDSLKernel< TCoordinate, adjacency >::BOOST_STATIC_CONSTANT | ( | unsigned short | , |
BackgroundAdjacency | = 4 |
||
) |
Adjacency used for the complement
DGtal::ArithmeticalDSLKernel< TCoordinate, adjacency >::BOOST_STATIC_CONSTANT | ( | unsigned short | , |
ForegroundAdjacency | = 8 |
||
) |
Adjacency used for the DSL
|
static |
Returns the \( L_{\infty} \) (for the 8-adjacency) or the \( L_1 \) norm (for the 4-adjacency) of two integers a and b,
a | a-parameter |
b | b-parameter |
TInteger | a model of integer for the parameters a and b |
|
static |
Given parameters a and b, this method computes the shift vector translating a point of remainder \( r \) to a point of remainder \( r + \omega \)
NB: The shift vector is set to (0,0) if \( \omega = 0 \), ie. a and b are both null.
NB: If ( a , b ) lies between two octants (resp. quadrants) (eg. b > 0 and a = 0), the shift vector of the next octant (resp. quadrant) is chosen with respect to the counter-clockwise orientation.
a | a-parameter |
b | b-parameter |
TInteger | a model of integer for the parameters a and b |
Referenced by specialCases(), and test().
|
static |
Given parameters a and b, this method returns the two step vectors, ie. the vectors that are used to iterate over the points of a DSL of slope a / b.
In the general case, the first vector \( v \) translates any point \( p \) of remainder \( r \) to its unique neighbor point \( q \) of remainder greater than or equal to \( r \), while the second one \( w \) is such that \( v - w = s \).
NB: The two vectors are set to (0,0) if \( \omega = 0 \), ie. a and b are both null.
NB: The second vector is set to (0,0) if \( \omega = 1 \), ie. if either a or b is null, if either a == b or either a == - b in the naive case.
a | a-parameter |
b | b-parameter |
TInteger | a model of integer for the parameters a and b |
Referenced by specialCases(), and test().