12 #ifndef __CVD_IMAGE_REF_H__ 13 #define __CVD_IMAGE_REF_H__ 17 #include <cvd/exceptions.h> 149 constexpr
int area()
const;
166 constexpr
ImageRef transpose()
const 191 #include <cvd/internal/image_ref_implementation.hh> 201 return os <<
"[" << ref.
x <<
" " << ref.
y <<
"]";
219 is >> std::ws >> ref.
x >> std::ws;
224 is >> std::ws >> ref.
y >> std::ws;
231 is >> std::ws >> ref.
x >> std::ws >> ref.
y >> std::ws;
238 is >> ref.
x >> ref.
y;
246 is.setstate(std::ios_base::badbit);
constexpr ImageRef operator/(const double scale) const
Divide both x and y co-ordinates by a scalar.
Definition: image_ref.h:112
constexpr ImageRef shiftl(int i) const
Definition: image_ref.h:144
constexpr ImageRef shiftr(int i) const
Definition: image_ref.h:152
constexpr int area() const
Area (product of x and y; signed)
Definition: image_ref.h:213
All classes and functions are within the CVD namespace.
Definition: argb.h:6
constexpr ImageRef & operator*=(const double scale)
Multiply both x and y co-ordinates by a scalar.
Definition: image_ref.h:78
constexpr ImageRef operator+(const ImageRef rhs) const
Add an offset to the co-ordinate.
Definition: image_ref.h:118
constexpr ImageRef()
Construct an ImageRef initialised at (0,0)
Definition: image_ref.h:2
std::istream & operator>>(std::istream &is, ImageRef &ref)
Read an ImageRef from a stream.
Definition: image_ref.h:206
constexpr bool operator>(const ImageRef &other) const
An ImageRef is greater than another ImageRef if it is earlier in the standard horizontal scan-line or...
Definition: image_ref.h:181
constexpr ImageRef & operator<<=(int i)
Bitwise left-shift operator.
Definition: image_ref.h:130
std::ostream & operator<<(std::ostream &os, const ImageRef &ref)
Write an ImageRef to a stream in the format "[x y]".
Definition: image_ref.h:199
constexpr unsigned int mag_squared() const
Magnitude-squared (x*x + y*y)
Definition: image_ref.h:207
bool next(const ImageRef &max)
Step to the next co-ordinate in the image (in horizontal scanline order).
Definition: image_ref.h:24
constexpr ImageRef operator>>(int i) const
Bitwise right-shift operator.
Definition: image_ref.h:165
constexpr ImageRef operator*(const double scale) const
Multiply both x and y co-ordinates by a scalar.
Definition: image_ref.h:106
bool prev(const ImageRef &max)
Step to the previous co-ordinate in the image (in horizontal scanline order).
Definition: image_ref.h:34
const ImageRef ImageRef_zero(0, 0)
A zero ImageRef.
constexpr ImageRef & operator>>=(int i)
Bitwise right-shift operator.
Definition: image_ref.h:137
constexpr ImageRef & operator=(const ImageRef &ref)
Assigment.
Definition: image_ref.h:55
constexpr ImageRef & operator+=(const ImageRef rhs)
Add an offset to the co-ordinate.
Definition: image_ref.h:92
int x
The x co-ordinate.
Definition: image_ref.h:172
Base class for all CVD exceptions.
Definition: exceptions.h:15
constexpr ImageRef operator-() const
Unary minus. Negates both x and y components.
Definition: image_ref.h:72
Definition: image_ref.h:29
constexpr bool operator<(const ImageRef &other) const
An ImageRef is less than another ImageRef if it is earlier in the standard horizontal scan-line order...
Definition: image_ref.h:176
constexpr bool operator!=(const ImageRef &ref) const
Logical not equals.
Definition: image_ref.h:67
void home()
Resets the ImageRef to (0,0)
Definition: image_ref.h:44
Exception if subscript for [] is not 0 or 1.
Definition: image_ref.h:185
constexpr bool operator==(const ImageRef &ref) const
Logical equals.
Definition: image_ref.h:62
int y
The y co-ordinate.
Definition: image_ref.h:173
constexpr int & operator[](int i)
Square bracket subscripts for easy loops. 0=x 1=y other=error.
Definition: image_ref.h:187
void end(const ImageRef &size)
Resets the ImageRef to the maximum co-ordinate in the image i.e.
Definition: image_ref.h:49
constexpr ImageRef & operator-=(const ImageRef rhs)
Subtract an offset from the co-ordinate.
Definition: image_ref.h:99
constexpr ImageRef operator<<(int i) const
Bitwise left-shift operator.
Definition: image_ref.h:160
constexpr ImageRef dot_times(const ImageRef &ref) const
The equivalent of doing .* in matlab.
Definition: image_ref.h:218
constexpr ImageRef & operator/=(const double scale)
Divide both x and y co-ordinates by a scalar.
Definition: image_ref.h:85