KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
kjb::Vanishing_point Class Reference

A vanishing point for a set of parallel lines in an image. More...

#include <vanishing_point.h>

Inheritance diagram for kjb::Vanishing_point:
kjb::Readable kjb::Writeable

Public Types

enum  Vanishing_point_type {
  REGULAR = 0, INFINITY_UP, INFINITY_DOWN, INFINITY_LEFT,
  INFINITY_RIGHT
}
 the possible types of vanishing point. We need this to differentiate between vanishing points with finite coordinates and vanishing points at infinity More...
 

Public Member Functions

 Vanishing_point (Vanishing_point_type itype=REGULAR)
 Default constructor, it initialize the vanishing point in (0,0) More...
 
 Vanishing_point (double x, double y)
 
 Vanishing_point (const kjb::Vector &position)
 
 Vanishing_point (const char *filename)
 
 Vanishing_point (std::istream &in)
 
 Vanishing_point (const Vanishing_point &src)
 
Vanishing_pointoperator= (const Vanishing_point &src)
 
bool operator== (const Vanishing_point &vp)
 
 ~Vanishing_point ()
 
bool is_at_infinity () const
 returns true is the vanishing point is at infinity More...
 
const Vanishing_point_typeget_type () const
 returns the vanishing point type More...
 
double get_x () const
 returns the x coordinate of this vanishing point More...
 
double get_y () const
 returns the y coordinate of this vanishing point More...
 
void set_x (double ix)
 
void set_y (double iy)
 
void set_type (const Vanishing_point_type &itype)
 Sets the type of this Vanishing point. More...
 
void set_point (double x, double y)
 Sets the position of this Vanishing point. More...
 
void set_position (const kjb::Vector &position)
 Sets the position of this Vanishing point. More...
 
void read (std::istream &in)
 Reads this Vanishing point from an input stream. More...
 
void write (std::ostream &out) const
 Writes this Vanishing point to an output stream. More...
 
- Public Member Functions inherited from kjb::Readable
virtual ~Readable ()
 Deletes this Readable. More...
 
virtual void read (const char *fname)
 Reads this Readable from a file. More...
 
- Public Member Functions inherited from kjb::Writeable
virtual ~Writeable ()
 Deletes this Writeable. More...
 
virtual void write (const char *fname) const
 Writes this Writeable to a file. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from kjb::Readable
static const char * read_field_value (std::istream &in, const char *field_name, char *field_buf, size_t buf_len, char separator=':')
 Reads a line off in into a buffer and returns a pointer to the field value in the buffer. More...
 
static const char * read_field_value (std::istream &in, const char *field_name, char separator=':')
 Reads a line off in into an internal buffer and returns a pointer to the field value in the buffer. More...
 

Detailed Description

A vanishing point for a set of parallel lines in an image.

Member Enumeration Documentation

the possible types of vanishing point. We need this to differentiate between vanishing points with finite coordinates and vanishing points at infinity

Enumerator
REGULAR 
INFINITY_UP 
INFINITY_DOWN 
INFINITY_LEFT 
INFINITY_RIGHT 

Constructor & Destructor Documentation

kjb::Vanishing_point::Vanishing_point ( Vanishing_point_type  itype = REGULAR)
inline

Default constructor, it initialize the vanishing point in (0,0)

kjb::Vanishing_point::Vanishing_point ( double  x,
double  y 
)
inline
kjb::Vanishing_point::Vanishing_point ( const kjb::Vector position)
inline
kjb::Vanishing_point::Vanishing_point ( const char *  filename)
inline
kjb::Vanishing_point::Vanishing_point ( std::istream &  in)
inline
kjb::Vanishing_point::Vanishing_point ( const Vanishing_point src)
inline
kjb::Vanishing_point::~Vanishing_point ( )
inline

Member Function Documentation

const Vanishing_point_type& kjb::Vanishing_point::get_type ( ) const
inline

returns the vanishing point type

double kjb::Vanishing_point::get_x ( ) const
inline

returns the x coordinate of this vanishing point

double kjb::Vanishing_point::get_y ( ) const
inline

returns the y coordinate of this vanishing point

bool kjb::Vanishing_point::is_at_infinity ( ) const
inline

returns true is the vanishing point is at infinity

Vanishing_point& kjb::Vanishing_point::operator= ( const Vanishing_point src)
inline
bool Vanishing_point::operator== ( const Vanishing_point vp)
void Vanishing_point::read ( std::istream &  in)
virtual

Reads this Vanishing point from an input stream.

Reads this Vanishing point from an input stream.

Parameters
inthe input stream to read this vanishing point from

Implements kjb::Readable.

void kjb::Vanishing_point::set_point ( double  x,
double  y 
)
inline

Sets the position of this Vanishing point.

void kjb::Vanishing_point::set_position ( const kjb::Vector position)
inline

Sets the position of this Vanishing point.

void kjb::Vanishing_point::set_type ( const Vanishing_point_type itype)
inline

Sets the type of this Vanishing point.

void kjb::Vanishing_point::set_x ( double  ix)
inline
void kjb::Vanishing_point::set_y ( double  iy)
inline
void Vanishing_point::write ( std::ostream &  out) const
virtual

Writes this Vanishing point to an output stream.

Writes this Vanishing point to an input stream.

Parameters
outthe output stream to write this vanishing point to

Implements kjb::Writeable.


The documentation for this class was generated from the following files: