DGtal 1.4.0
|
Aim: Represents a digital straight line with slope in the first quadrant (Q0: x >= 0, y >= 0 ). More...
#include <DGtal/arithmetic/StandardDSLQ0.h>
Data Structures | |
struct | ConstIterator |
Public Types | |
typedef TFraction | Fraction |
typedef StandardDSLQ0< TFraction > | Self |
typedef Fraction::Integer | Integer |
typedef Fraction::UnsignedInteger | UnsignedInteger |
typedef Fraction::Quotient | Quotient |
typedef IntegerComputer< Integer > | IC |
typedef IC::IntegerParamType | IntegerParamType |
typedef IC::Vector2I | Vector2I |
typedef IC::Point2I | Point2I |
typedef IC::Point2I | Point |
Protected Attributes | |
Pattern< Fraction > | myPattern |
the characteristic pattern of this DSL. | |
Integer | myMu |
the shift to origin. | |
Static Private Member Functions | |
static Fraction | deepest (Fraction f1, Fraction f2, Fraction f3) |
static Fraction | deepest (Fraction f1, Fraction f2) |
Private Attributes | |
IC | ic |
Used in some computations. | |
Aim: Represents a digital straight line with slope in the first quadrant (Q0: x >= 0, y >= 0 ).
Description of template class 'StandardDSLQ0'
It is the 4-connected set of points (x,y) of Z2 satisfying:
\( mu <= ax - by < mu + a + b \)
You may move on it point by point with iterators ConstIterator. You can find upper and lower leaning points, find points on the DSL given one coordinate. You may extract subsegment with smartDSS() and reversedSmartDSS() algorithms.
TFraction | the type chosen to represent fractions, a model of CFraction. You may use SternBrocot::Fraction for instance. |
Model of boost::CopyConstructible, boost::Assignable, concepts::CPointPredicate
Definition at line 79 of file StandardDSLQ0.h.
typedef TFraction DGtal::StandardDSLQ0< TFraction >::Fraction |
Definition at line 83 of file StandardDSLQ0.h.
typedef IntegerComputer<Integer> DGtal::StandardDSLQ0< TFraction >::IC |
Definition at line 91 of file StandardDSLQ0.h.
typedef Fraction::Integer DGtal::StandardDSLQ0< TFraction >::Integer |
Definition at line 85 of file StandardDSLQ0.h.
typedef IC::IntegerParamType DGtal::StandardDSLQ0< TFraction >::IntegerParamType |
Definition at line 92 of file StandardDSLQ0.h.
typedef IC::Point2I DGtal::StandardDSLQ0< TFraction >::Point |
Definition at line 97 of file StandardDSLQ0.h.
typedef IC::Point2I DGtal::StandardDSLQ0< TFraction >::Point2I |
Definition at line 94 of file StandardDSLQ0.h.
typedef Fraction::Quotient DGtal::StandardDSLQ0< TFraction >::Quotient |
Definition at line 87 of file StandardDSLQ0.h.
typedef StandardDSLQ0<TFraction> DGtal::StandardDSLQ0< TFraction >::Self |
Definition at line 84 of file StandardDSLQ0.h.
typedef Fraction::UnsignedInteger DGtal::StandardDSLQ0< TFraction >::UnsignedInteger |
Definition at line 86 of file StandardDSLQ0.h.
typedef IC::Vector2I DGtal::StandardDSLQ0< TFraction >::Vector2I |
Definition at line 93 of file StandardDSLQ0.h.
DGtal::StandardDSLQ0< TFraction >::~StandardDSLQ0 | ( | ) |
Destructor.
DGtal::StandardDSLQ0< TFraction >::StandardDSLQ0 | ( | ) |
Constructor. Null DSL.
DGtal::StandardDSLQ0< TFraction >::StandardDSLQ0 | ( | const StandardDSLQ0< TFraction > & | other | ) |
Copy constructor.
other | the object to clone. |
DGtal::StandardDSLQ0< TFraction >::StandardDSLQ0 | ( | Fraction | aSlope, |
IntegerParamType | aMu ) |
Creates the DSL(a,b,mu).
aSlope | the slope a/b, where gcd(a,b)=1 |
aMu | the shift to origin. |
DGtal::StandardDSLQ0< TFraction >::StandardDSLQ0 | ( | IntegerParamType | a1, |
IntegerParamType | b1, | ||
IntegerParamType | mu1 ) |
Creates the DSL(a/g,b/g,mu), where g = gcd( a, b).
a1 | any integer |
b1 | any integer |
mu1 | the shift to origin. |
Integer DGtal::StandardDSLQ0< TFraction >::a | ( | ) | const |
Integer DGtal::StandardDSLQ0< TFraction >::b | ( | ) | const |
bool DGtal::StandardDSLQ0< TFraction >::before | ( | const Point & | p1, |
const Point & | p2 ) const |
bool DGtal::StandardDSLQ0< TFraction >::beforeOrEqual | ( | const Point & | p1, |
const Point & | p2 ) const |
ConstIterator DGtal::StandardDSLQ0< TFraction >::begin | ( | Point | p | ) | const |
p | a point in the DSL. |
|
staticprivate |
|
staticprivate |
Self DGtal::StandardDSLQ0< TFraction >::DSSWithinTwoPatterns | ( | Point | U1, |
Point | U2, | ||
const Point & | A, | ||
const Point & | B ) const |
Used by reversedSmartDSS. Computes the exact characteristics of the subsegment [A,B] of this DSL. Note that |U2-U1| = 2 * length().
A | any point belonging to this DSL, A < B. |
B | any point belonging to this DSL, A < B. |
U1 | the first upper leaning point such that U1 <= A. |
U2 | the second upper leaning point such that B <= U2. |
ConstIterator DGtal::StandardDSLQ0< TFraction >::end | ( | Point | p | ) | const |
p | a point in the DSL. |
bool DGtal::StandardDSLQ0< TFraction >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
Point DGtal::StandardDSLQ0< TFraction >::L | ( | ) | const |
Point DGtal::StandardDSLQ0< TFraction >::lowestX | ( | IntegerParamType | y | ) | const |
Point DGtal::StandardDSLQ0< TFraction >::lowestY | ( | IntegerParamType | x | ) | const |
const Integer & DGtal::StandardDSLQ0< TFraction >::mu | ( | ) | const |
Integer DGtal::StandardDSLQ0< TFraction >::mup | ( | ) | const |
bool DGtal::StandardDSLQ0< TFraction >::operator() | ( | const Point & | p | ) | const |
p | any point in Z2. |
StandardDSLQ0 & DGtal::StandardDSLQ0< TFraction >::operator= | ( | const StandardDSLQ0< TFraction > & | other | ) |
Assignment.
other | the object to copy. |
const Pattern< Fraction > & DGtal::StandardDSLQ0< TFraction >::pattern | ( | ) | const |
Integer DGtal::StandardDSLQ0< TFraction >::r | ( | const Point & | p | ) | const |
Remainder a p.x - b p.y of point p in this DSL.
p | any point in Z2 |
Self DGtal::StandardDSLQ0< TFraction >::reversedSmartDSS | ( | const Point & | A, |
const Point & | B ) const |
Algorithm ReversedSmartDSS. See M. Said and J.-O. Lachaud, DGCI2010.
Computes the exact characteristics of the subsegment [A,B] of this DSL in time O(log(|B-A|)). An even better bound in the output is achieved.
A | any point belonging to this DSL, A < B. |
B | any point belonging to this DSL, A < B. |
Self DGtal::StandardDSLQ0< TFraction >::reversedSmartDSS | ( | Point | U1, |
Point | U2, | ||
const Point & | A, | ||
const Point & | B ) const |
Algorithm ReversedSmartDSS. See M. Said and J.-O. Lachaud, DGCI2010.
Computes the exact characteristics of the subsegment [A,B] of this DSL in time O(log(|B-A|)). An even better bound in the output is achieved.
A | any point belonging to this DSL, A < B. |
B | any point belonging to this DSL, A < B. |
U1 | the first upper leaning point such that U1 <= A. |
U2 | the second upper leaning point such that B <= U2. |
void DGtal::StandardDSLQ0< TFraction >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Fraction DGtal::StandardDSLQ0< TFraction >::slope | ( | ) | const |
Self DGtal::StandardDSLQ0< TFraction >::smartDSS | ( | const Point & | A, |
const Point & | B ) const |
Algorithm SmartDSS. See M. Said and J.-O. Lachaud, DGCI2009.
Computes the exact characteristics of the subsegment [A,B] of this DSL in time O(sum_k u_k), where the continued fraction of this DSL slope a/b is [u_0; u_1, u_2, ... ]
A | any point belonging to this DSL, A < B. |
B | any point belonging to this DSL, A < B. |
Point DGtal::StandardDSLQ0< TFraction >::U | ( | ) | const |
Point DGtal::StandardDSLQ0< TFraction >::uppermostX | ( | IntegerParamType | y | ) | const |
Point DGtal::StandardDSLQ0< TFraction >::uppermostY | ( | IntegerParamType | x | ) | const |
Vector2I DGtal::StandardDSLQ0< TFraction >::v | ( | ) | const |
|
private |
Used in some computations.
Definition at line 386 of file StandardDSLQ0.h.
|
protected |
the shift to origin.
Definition at line 381 of file StandardDSLQ0.h.
|
protected |
the characteristic pattern of this DSL.
Definition at line 379 of file StandardDSLQ0.h.