CVD::ImageRef Class Reference
[Image storage and manipulation]

#include <image_ref.h>

List of all members.


Detailed Description

An (x,y) image co-ordinate

Definition at line 47 of file image_ref.h.


Public Member Functions

 ImageRef ()
 ImageRef (int xp, int yp)
 ImageRef (std::istream &is)
bool next (const ImageRef &max)
bool prev (const ImageRef &max)
bool next (const ImageRef &min, const ImageRef &max)
bool prev (const ImageRef &min, const ImageRef &max)
void home ()
void end (const ImageRef &size)
ImageRefoperator= (const ImageRef &ref)
bool operator== (const ImageRef &ref) const
bool operator!= (const ImageRef &ref) const
ImageRef operator- () const
ImageRefoperator *= (const double scale)
ImageRefoperator/= (const double scale)
ImageRefoperator+= (const ImageRef rhs)
ImageRefoperator-= (const ImageRef rhs)
ImageRef operator * (const double scale) const
ImageRef operator/ (const double scale) const
ImageRef operator+ (const ImageRef rhs) const
ImageRef operator- (const ImageRef rhs) const
ImageRefoperator<<= (int i)
ImageRefoperator>>= (int i)
ImageRef operator>> (int i) const
ImageRef operator<< (int i) const
bool operator< (const ImageRef &other) const
bool operator> (const ImageRef &other) const
unsigned int mag_squared () const
int area () const
ImageRef dot_times (const ImageRef &ref) const
int & operator[] (int i)
int operator[] (int i) const
ImageRef shiftl (int i) const
ImageRef shiftr (int i) const

Public Attributes

int x
int y

Related Functions

(Note that these are not member functions.)

const ImageRef ImageRef_zero (0, 0)
ImageRef operator * (const int scale, const ImageRef &ref)
std::ostream & operator<< (std::ostream &os, const ImageRef &ref)
std::istream & operator>> (std::istream &is, ImageRef &ref)

Constructor & Destructor Documentation

CVD::ImageRef::ImageRef (  )  [inline]

Construct an ImageRef initialised at (0,0).

Definition at line 217 of file image_ref.h.

CVD::ImageRef::ImageRef ( int  xp,
int  yp 
) [inline]

Construct an ImageRef.

Parameters:
xp The x co-ordinate
yp The y co-ordinate

Definition at line 222 of file image_ref.h.

CVD::ImageRef::ImageRef ( std::istream &  is  )  [inline]

Construct an ImageRef from a stream.

Parameters:
is The stream to read

Definition at line 226 of file image_ref.h.


Member Function Documentation

bool CVD::ImageRef::next ( const ImageRef max  )  [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.

Parameters:
max The size of the image

Definition at line 239 of file image_ref.h.

Referenced by CVD::combineImages().

bool CVD::ImageRef::prev ( const ImageRef max  )  [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.

Parameters:
max The size of the image

Definition at line 249 of file image_ref.h.

bool CVD::ImageRef::next ( const ImageRef min,
const ImageRef max 
) [inline]

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.

Parameters:
min The minimum (x,y) co-ordinates in the window
max The minimum (x,y) co-ordinates in the window

Definition at line 244 of file image_ref.h.

bool CVD::ImageRef::prev ( const ImageRef min,
const ImageRef max 
) [inline]

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.

Parameters:
min The minimum (x,y) co-ordinates in the window
max The minimum (x,y) co-ordinates in the window

Definition at line 254 of file image_ref.h.

void CVD::ImageRef::home (  )  [inline]

Resets the ImageRef to (0,0).

Definition at line 259 of file image_ref.h.

void CVD::ImageRef::end ( const ImageRef size  )  [inline]

Resets the ImageRef to the maximum co-ordinate in the image i.e.

(size.x - 1, size.y - 1)

Parameters:
size The size of the image

Definition at line 264 of file image_ref.h.

ImageRef & CVD::ImageRef::operator= ( const ImageRef ref  )  [inline]

Assigment.

Parameters:
ref The co-ordinate to copy

Definition at line 270 of file image_ref.h.

bool CVD::ImageRef::operator== ( const ImageRef ref  )  const [inline]

Logical equals.

Parameters:
ref The co-ordinate to compare with

Definition at line 277 of file image_ref.h.

bool CVD::ImageRef::operator!= ( const ImageRef ref  )  const [inline]

Logical not equals.

Parameters:
ref The co-ordinate to compare with

Definition at line 282 of file image_ref.h.

ImageRef CVD::ImageRef::operator- (  )  const [inline]

Unary minus. Negates both x and y components.

Definition at line 287 of file image_ref.h.

ImageRef & CVD::ImageRef::operator *= ( const double  scale  )  [inline]

Multiply both x and y co-ordinates by a scalar.

Parameters:
scale The multiplier

Definition at line 293 of file image_ref.h.

ImageRef & CVD::ImageRef::operator/= ( const double  scale  )  [inline]

Divide both x and y co-ordinates by a scalar.

Parameters:
scale The factor

Definition at line 300 of file image_ref.h.

ImageRef & CVD::ImageRef::operator+= ( const ImageRef  rhs  )  [inline]

Add an offset to the co-ordinate.

Parameters:
rhs The offset

Definition at line 307 of file image_ref.h.

ImageRef & CVD::ImageRef::operator-= ( const ImageRef  rhs  )  [inline]

Subtract an offset from the co-ordinate.

Parameters:
rhs The offset

Definition at line 314 of file image_ref.h.

ImageRef CVD::ImageRef::operator * ( const double  scale  )  const [inline]

Multiply both x and y co-ordinates by a scalar.

Parameters:
scale The multiplier

Definition at line 321 of file image_ref.h.

ImageRef CVD::ImageRef::operator/ ( const double  scale  )  const [inline]

Divide both x and y co-ordinates by a scalar.

Parameters:
scale The factor

Definition at line 327 of file image_ref.h.

ImageRef CVD::ImageRef::operator+ ( const ImageRef  rhs  )  const [inline]

Add an offset to the co-ordinate.

Parameters:
rhs The offset

Definition at line 333 of file image_ref.h.

ImageRef CVD::ImageRef::operator- ( const ImageRef  rhs  )  const [inline]

Subtract an offset from the co-ordinate.

Parameters:
rhs The offset

Definition at line 339 of file image_ref.h.

ImageRef & CVD::ImageRef::operator<<= ( int  i  )  [inline]

Bitwise left-shift operator.

Parameters:
i The amount to shift

Definition at line 345 of file image_ref.h.

ImageRef & CVD::ImageRef::operator>>= ( int  i  )  [inline]

Bitwise right-shift operator.

Parameters:
i The amount to shift

Definition at line 352 of file image_ref.h.

ImageRef CVD::ImageRef::operator>> ( int  i  )  const [inline]

Bitwise right-shift operator.

Parameters:
i The amount to shift

Definition at line 380 of file image_ref.h.

ImageRef CVD::ImageRef::operator<< ( int  i  )  const [inline]

Bitwise left-shift operator.

Parameters:
i The amount to shift

Definition at line 375 of file image_ref.h.

bool CVD::ImageRef::operator< ( const ImageRef other  )  const [inline]

An ImageRef is less than another ImageRef if it is earlier in the standard horizontal scan-line order, i.e.

has a smaller y-co-ordinate or the same y-co-ordinate but a smaller x-co-ordinate. An ordering of ImageRefs is needed to allow them to be used in STL for sets, maps, multisets, multimaps etc.

Definition at line 391 of file image_ref.h.

bool CVD::ImageRef::operator> ( const ImageRef other  )  const [inline]

An ImageRef is greater than another ImageRef if it is earlier in the standard horizontal scan-line order, i.e.

has a smaller y-co-ordinate or the same y-co-ordinate but a smaller x-co-ordinate.

Definition at line 396 of file image_ref.h.

unsigned int CVD::ImageRef::mag_squared (  )  const [inline]

Magnitude-squared (x*x + y*y).

Definition at line 420 of file image_ref.h.

int CVD::ImageRef::area (  )  const [inline]

Area (product of x and y; signed).

Definition at line 426 of file image_ref.h.

ImageRef CVD::ImageRef::dot_times ( const ImageRef ref  )  const [inline]

The equivalent of doing .* in matlab.

Definition at line 431 of file image_ref.h.

int & CVD::ImageRef::operator[] ( int  i  )  [inline]

Square bracket subscripts for easy loops. 0=x 1=y other=error.

Definition at line 402 of file image_ref.h.

int CVD::ImageRef::operator[] ( int  i  )  const [inline]

Square bracket const subscripts for easy loops. 0=x 1=y other=error.

Definition at line 411 of file image_ref.h.


Friends And Related Function Documentation

const ImageRef ImageRef_zero(0, 0) [related]

A zero ImageRef.

ImageRef operator * ( const int  scale,
const ImageRef ref 
) [related]

Left-multiply an ImageRef by a scalar.

Mutiplies both x and y.

Parameters:
scale The multiplier
ref The ImageRef to scale

Definition at line 386 of file image_ref.h.

std::ostream & operator<< ( std::ostream &  os,
const ImageRef ref 
) [related]

Write an ImageRef to a stream in the format "[x y]".

Parameters:
os The stream
ref The co-ordinate

Definition at line 442 of file image_ref.h.

std::istream & operator>> ( std::istream &  is,
ImageRef ref 
) [related]

Read an ImageRef from a stream.

Any format with two successive numbers will work

Definition at line 449 of file image_ref.h.


Member Data Documentation

int CVD::ImageRef::x

The x co-ordinate.

Definition at line 179 of file image_ref.h.

Referenced by CVD::SubImage< CVD::Rgb< unsigned char > >::begin(), CVD::combineImages(), CVD::ConvertImage< From, To, Conv, both_pod >::convert(), CVD::convolve_gaussian_3(), CVD::convolveGaussian(), CVD::convolveGaussian5_1(), CVD::convolveSeparableSymmetric(), CVD::convolveSymmetric(), CVD::convolveWithBox(), CVD::copy(), CVD::DeinterlaceBuffer< T >::DeinterlaceBuffer(), CVD::dense_tensor_vote_gradients(), CVD::drawBox(), CVD::drawCross(), CVD::drawLine(), CVD::SubImage< CVD::Rgb< unsigned char > >::fill(), CVD::flipVertical(), CVD::DeinterlaceBuffer< T >::get_frame(), CVD::glDrawPixels(), CVD::glOrtho(), CVD::glReadPixels(), CVD::glTexCoord(), CVD::glTexImage2D(), CVD::glTexSubImage2D(), CVD::glTranslate(), CVD::glVertex(), CVD::Gradient< S, T, 1, 2 >::gradient(), CVD::haar2D(), CVD::halfSample(), CVD::harrislike_corner_detect(), CVD::Image< CVD::Rgb< unsigned char > >::Image(), CVD::SubImage< CVD::Rgb< unsigned char > >::in_image(), CVD::SubImage< CVD::Rgb< unsigned char > >::in_image_with_border(), CVD::integral_image(), CVD::interpolate_extremum(), CVD::interpolate_extremum_value(), CVD::joinImages(), CVD::median_filter_3x3(), CVD::SubImage< CVD::Rgb< unsigned char > >::operator[](), CVD::SubImage< CVD::Rgb< unsigned char > >::pos(), CVD::sample(), CVD::DeinterlaceBuffer< T >::size(), CVD::SubImage< CVD::Rgb< unsigned char > >::sub_image(), CVD::transform(), CVD::vec(), and CVD::zeroBorders().

int CVD::ImageRef::y

The y co-ordinate.

Definition at line 180 of file image_ref.h.

Referenced by CVD::combineImages(), CVD::ConvertImage< From, To, Conv, both_pod >::convert(), CVD::convolveGaussian(), CVD::convolveGaussian5_1(), CVD::convolveSeparableSymmetric(), CVD::convolveSymmetric(), CVD::convolveWithBox(), CVD::dense_tensor_vote_gradients(), CVD::drawBox(), CVD::drawCross(), CVD::drawLine(), CVD::SubImage< CVD::Rgb< unsigned char > >::end_ptr(), CVD::SubImage< CVD::Rgb< unsigned char > >::fill(), CVD::flipVertical(), CVD::DeinterlaceBuffer< T >::get_frame(), CVD::glDrawPixels(), CVD::glOrtho(), CVD::glReadPixels(), CVD::glTexCoord(), CVD::glTexImage2D(), CVD::glTexSubImage2D(), CVD::glTranslate(), CVD::glVertex(), CVD::haar2D(), CVD::harrislike_corner_detect(), CVD::SubImage< CVD::Rgb< unsigned char > >::in_image(), CVD::SubImage< CVD::Rgb< unsigned char > >::in_image_with_border(), CVD::integral_image(), CVD::interpolate_extremum(), CVD::interpolate_extremum_value(), CVD::joinImages(), CVD::median_filter_3x3(), CVD::SubImage< CVD::Rgb< unsigned char > >::operator[](), CVD::DeinterlaceBuffer< T >::size(), CVD::SubImage< CVD::Rgb< unsigned char > >::sub_image(), CVD::SubImage< CVD::Rgb< unsigned char > >::totalsize(), CVD::transform(), CVD::vec(), and CVD::zeroBorders().


The documentation for this class was generated from the following file:
Generated on Wed Feb 18 10:23:07 2009 for CVD by  doxygen 1.5.3