43 "invalid NormalizedAngleInterval endpoints");
68 return x._a >= _a || x._b <= _b;
70 return x._a >= _a && x._b <= _b;
80 return wraps() ? false : (x._a > _b && x._b < _a);
83 return _a > x._b && _b < x._a;
85 return x._b < _a || x._a > _b;
91 return CONTAINS | DISJOINT | WITHIN;
93 return DISJOINT | WITHIN;
96 return CONTAINS | DISJOINT;
98 if (_a == x && _b == x) {
99 return CONTAINS | WITHIN;
112 return CONTAINS | DISJOINT | WITHIN;
114 return DISJOINT | WITHIN;
117 return CONTAINS | DISJOINT;
119 if (_a == x._a && _b == x._b) {
120 return CONTAINS | WITHIN;
126 if (_a <= x._a && _b >= x._b) {
129 if (_a >= x._a && _b <= x._b) {
138 if (_a <= x._a || _b >= x._b) {
141 return (_a > x._b && _b < x._a) ? DISJOINT : INTERSECTS;
148 if (x._a <= _a || x._b >= _b) {
151 return (x._a > _b && x._b < _a) ? DISJOINT : INTERSECTS;
154 if (_a <= x._a && _b >= x._b) {
157 if (_a >= x._a && _b <= x._b) {
160 return (_a <= x._b && _b >= x._a) ? INTERSECTS : DISJOINT;
238 if (x >
Angle(0.0)) {
245 if (a <= b) {
return full(); }
250 if (a <
Angle(0.0)) {
252 if (a <= b) {
return full(); }
256 if (a <= b) {
return full(); }
268 if (a > b) {
return empty(); }
270 if (b <
Angle(0.0)) {
272 if (a > b) {
return empty(); }
278 if (a > b) {
return empty(); }
287 return os <<
'[' << i.
getA() <<
", " << i.
getB() <<
']';
bool isEmpty() const
isEmpty returns true if this interval does not contain any normalized angles.
bool isDisjointFrom(NormalizedAngle x) const
NormalizedAngle is an angle that lies in the range [0, 2π), with one exception - a NormalizedAngle ca...
bool isNan() const
isNan returns true if the angle value is NaN.
NormalizedAngle getB() const
getB returns the second endpoint of this interval.
NormalizedAngleInterval & expandTo(NormalizedAngle x)
std::ostream & operator<<(std::ostream &, Angle const &)
bool contains(NormalizedAngle x) const
bool isFull() const
isFull returns true if this interval contains all normalized angles.
NormalizedAngle getAngleTo(NormalizedAngle const &a) const
getAngleTo computes the angle α ∈ [0, 2π) such that adding α to this angle and then normalizing the ...
bool wraps() const
wraps returns true if the interval "wraps" around the 0/2π angle discontinuity, i.e.
bool isNan() const
isNan returns true if the angle value is NaN.
A base class for image defects.
NormalizedAngleInterval()
This constructor creates an empty interval.
bool intersects(NormalizedAngle x) const
static NormalizedAngleInterval empty()
NormalizedAngleInterval dilatedBy(Angle x) const
For positive x, dilatedBy returns the morphological dilation of this interval by [-x,x].
Relationship relate(NormalizedAngle x) const
NormalizedAngleInterval represents closed intervals of normalized angles, i.e.
This file declares a class representing closed intervals of normalized angles, i.e.
static NormalizedAngleInterval full()
Angle represents an angle in radians.
NormalizedAngleInterval & clipTo(NormalizedAngle x)
clipTo shrinks this interval until all its points are in x.
NormalizedAngle getA() const
getA returns the first endpoint of this interval.
bool isNormalized() const
isNormalized returns true if this angle lies in the range [0, 2π).
NormalizedAngle getSize() const
getSize returns the size (length, width) of this interval.