13#ifndef ML_SUB_IMAGE_BOXD_H
14#define ML_SUB_IMAGE_BOXD_H
82 return (v1==box.
v1) && (v2==box.
v2);
95 return (v1[0]>v2[0]) || (v1[1]>v2[1]) || (v1[2]>v2[2]) || (v1[3]>v2[3]) || (v1[4]>v2[4]) || (v1[5]>v2[5]);
142 return SubImageBoxd::intersect(*
this, box);
170 inline ostream&
operator<<(ostream& s,
const ML_NAMESPACE::SubImageBoxd &box)
172 return s <<
"(" << box.v1 <<
")(" << box.v2 <<
")";
SubImageBoxd - SubImageBox with coordinates of float data type.
bool operator!=(const SubImageBoxd &box) const
Returns true if both boxes are identical.
MLEXPORT SubImageBoxd(const SubImageBox &box)
Constructor: Create a box from an integer box.
Vector6 v2
Corner v2 of the box region.
SubImageBoxd()
Constructor: Constructs an empty region, i.e., v2 < v1.
bool operator==(const SubImageBoxd &box) const
Returns true if both boxes are identical.
void makeEmpty()
Makes box empty, restores constructor state.
SubImageBoxd(const Vector6 &vector1, const Vector6 &vector2)
Constructor: Subimage box is defined by both corner points vector1 and vector2.
Vector6 getExtent() const
Returns distance vector between v1 and v2, i.e., returns extents of the box.
MLEXPORT void correct()
Swaps all components where v1.* > v2.*.
static SubImageBoxd intersect(const SubImageBoxd &box1, const SubImageBoxd &box2)
Returns intersection of box1 and box2.
static MLEXPORT SubImageBoxd calcAATransformedBox(const SubImageBox &box, const Matrix4 &matrix)
Returns axis aligned bounding box of all corners of box transformed with matrix.
bool isEmpty() const
Returns true if any component of v1 is greater than the corresponding one of v2 (which is defined as ...
Vector6 clamp(const Vector6 &position)
Clamps the position to the nearest position inside the SubImageBox.
Vector6 v1
Corner v1 of the box region.
SubImageBoxd intersect(const SubImageBoxd &box)
Memberfunction version to intersect this with a given box.
SubImageBoxd(const Vector6 &extent)
Constructor: Create a box with origin (0,0,0,0,0,0) and a given extent.
#define MLEXPORT
To export symbols from a dll/shared object, we need to mark them with the MLEXPORT symbol.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
FloatingPointVector< T, size, DataContainer > compMax(FloatingPointVector< T, size, DataContainer > buffer1, const FloatingPointVector< T, size, DataContainer > &buffer2)
Component wise maximum of buffer1 and buffer2.
bool operator==(const Tmat2< DT > &a, const Tmat2< DT > &b)
a == b ? Return true if yes.
FloatingPointVector< T, size, DataContainer > compMin(FloatingPointVector< T, size, DataContainer > buffer1, const FloatingPointVector< T, size, DataContainer > &buffer2)
Component wise minimum of buffer1 and buffer2.
MLEXPORT std::ostream & operator<<(std::ostream &s, const ml::Field &v)
Overloads the operator "<<" for stream output of Field objects.