|
libcvd
|
#include <image_ref.h>
Public Member Functions | |
| constexpr | ImageRef () |
| Construct an ImageRef initialised at (0,0) | |
| constexpr | ImageRef (const ImageRef &)=default |
| constexpr | ImageRef (int xp, int yp) |
| Construct an ImageRef. More... | |
| ImageRef (std::istream &is) | |
| Construct an ImageRef from a stream. More... | |
| bool | next (const ImageRef &max) |
| Step to the next co-ordinate in the image (in horizontal scanline order). More... | |
| bool | prev (const ImageRef &max) |
| Step to the previous co-ordinate in the image (in horizontal scanline order). More... | |
| bool | next (const ImageRef &min, const ImageRef &max) |
| Step to the next co-ordinate in the image (in horizontal scanline order), for pixels within a rectangular window Successive calls to this function will work backwards along each row of the image. More... | |
| bool | prev (const ImageRef &min, const ImageRef &max) |
| Step to the previous co-ordinate in the image (in horizontal scanline order), for pixels within a rectangule window Successive calls to this function will work backwards along each row of the image. More... | |
| void | home () |
| Resets the ImageRef to (0,0) | |
| void | end (const ImageRef &size) |
| Resets the ImageRef to the maximum co-ordinate in the image i.e. More... | |
| constexpr ImageRef & | operator= (const ImageRef &ref) |
| Assigment. More... | |
| constexpr bool | operator== (const ImageRef &ref) const |
| Logical equals. More... | |
| constexpr bool | operator!= (const ImageRef &ref) const |
| Logical not equals. More... | |
| constexpr ImageRef | operator- () const |
| Unary minus. Negates both x and y components. | |
| constexpr ImageRef & | operator*= (const double scale) |
| Multiply both x and y co-ordinates by a scalar. More... | |
| constexpr ImageRef & | operator/= (const double scale) |
| Divide both x and y co-ordinates by a scalar. More... | |
| constexpr ImageRef & | operator+= (const ImageRef rhs) |
| Add an offset to the co-ordinate. More... | |
| constexpr ImageRef & | operator-= (const ImageRef rhs) |
| Subtract an offset from the co-ordinate. More... | |
| constexpr ImageRef | operator* (const double scale) const |
| Multiply both x and y co-ordinates by a scalar. More... | |
| constexpr ImageRef | operator/ (const double scale) const |
| Divide both x and y co-ordinates by a scalar. More... | |
| constexpr ImageRef | operator+ (const ImageRef rhs) const |
| Add an offset to the co-ordinate. More... | |
| constexpr ImageRef | operator- (const ImageRef rhs) const |
| Subtract an offset from the co-ordinate. More... | |
| constexpr ImageRef & | operator<<= (int i) |
| Bitwise left-shift operator. More... | |
| constexpr ImageRef & | operator>>= (int i) |
| Bitwise right-shift operator. More... | |
| constexpr ImageRef | operator>> (int i) const |
| Bitwise right-shift operator. More... | |
| constexpr ImageRef | operator<< (int i) const |
| Bitwise left-shift operator. More... | |
| 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, i.e. More... | |
| constexpr bool | operator> (const ImageRef &other) const |
| An ImageRef is greater than another ImageRef if it is earlier in the standard horizontal scan-line order, i.e. More... | |
| constexpr unsigned int | mag_squared () const |
| Magnitude-squared (x*x + y*y) | |
| constexpr int | area () const |
| Area (product of x and y; signed) | |
| constexpr ImageRef | dot_times (const ImageRef &ref) const |
| The equivalent of doing .* in matlab. | |
| constexpr int & | operator[] (int i) |
| Square bracket subscripts for easy loops. 0=x 1=y other=error. | |
| constexpr int | operator[] (int i) const |
| Square bracket const subscripts for easy loops. 0=x 1=y other=error. | |
| constexpr ImageRef | shiftl (int i) const |
| constexpr ImageRef | shiftr (int i) const |
| constexpr ImageRef | transpose () const |
Public Attributes | |
| int | x |
| The x co-ordinate. | |
| int | y |
| The y co-ordinate. | |
Related Functions | |
(Note that these are not member functions.) | |
| constexpr ImageRef | operator* (const int scale, const ImageRef &ref) |
| Left-multiply an ImageRef by a scalar. More... | |
| std::ostream & | operator<< (std::ostream &os, const ImageRef &ref) |
| Write an ImageRef to a stream in the format "[x y]". More... | |
| std::istream & | operator>> (std::istream &is, ImageRef &ref) |
| Read an ImageRef from a stream. More... | |
| const ImageRef | ImageRef_zero (0, 0) |
| A zero ImageRef. More... | |
An (x,y) image co-ordinate
|
inline |
Construct an ImageRef.
| xp | The x co-ordinate |
| yp | The y co-ordinate |
|
inline |
Construct an ImageRef from a stream.
| is | The stream to read |
|
inline |
Resets the ImageRef to the maximum co-ordinate in the image i.e.
(size.x - 1, size.y - 1)
| size | The size of the image |
|
inline |
Step to the next co-ordinate in the image (in horizontal scanline order).
Successive calls to this function will work along each row of the image. If the next co-ordinate is off the end of the image, it returns false.
| max | The size of the image |
Step to the next co-ordinate in the image (in horizontal scanline order), for pixels within a rectangular window Successive calls to this function will work backwards along each row of the image.
If the next co-ordinate is off the start of the image, it returns false.
| min | The minimum (x,y) co-ordinates in the window |
| max | The minimum (x,y) co-ordinates in the window |
|
inline |
Logical not equals.
| ref | The co-ordinate to compare with |
|
inline |
Multiply both x and y co-ordinates by a scalar.
| scale | The multiplier |
|
inline |
Multiply both x and y co-ordinates by a scalar.
| scale | The multiplier |
Add an offset to the co-ordinate.
| rhs | The offset |
Add an offset to the co-ordinate.
| rhs | The offset |
Subtract an offset from the co-ordinate.
| rhs | The offset |
Subtract an offset from the co-ordinate.
| rhs | The offset |
|
inline |
Divide both x and y co-ordinates by a scalar.
| scale | The factor |
|
inline |
Divide both x and y co-ordinates by a scalar.
| scale | The factor |
|
inline |
|
inline |
Bitwise left-shift operator.
| i | The amount to shift |
|
inline |
Bitwise left-shift operator.
| i | The amount to shift |
Assigment.
| ref | The co-ordinate to copy |
|
inline |
Logical equals.
| ref | The co-ordinate to compare with |
|
inline |
|
inline |
Bitwise right-shift operator.
| i | The amount to shift |
|
inline |
Bitwise right-shift operator.
| i | The amount to shift |
|
inline |
Step to the previous co-ordinate in the image (in horizontal scanline order).
Successive calls to this function will work backwards along each row of the image. If the next co-ordinate is off the start of the image, it returns false.
| max | The size of the image |
Step to the previous co-ordinate in the image (in horizontal scanline order), for pixels within a rectangule window Successive calls to this function will work backwards along each row of the image.
If the next co-ordinate is off the start of the image, it returns false.
| min | The minimum (x,y) co-ordinates in the window |
| max | The minimum (x,y) co-ordinates in the window |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
related |
Write an ImageRef to a stream in the format "[x y]".
| os | The stream |
| ref | The co-ordinate |
|
related |
Read an ImageRef from a stream.
Any format with two successive numbers will work
1.8.13