Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

fl::Point Class Reference

#include <point.h>

Inheritance diagram for fl::Point:

fl::MatrixAbstract< float > fl::PointInterest fl::PointAffine List of all members.

Public Methods

 Point ()
 Point (float x, float y)
template<class T>  Point (const MatrixAbstract< T > &A)
 Point (std::istream &stream)
Vector< float > homogenous (float third) const
Vector< float > homogenous (float third, float fourth) const
virtual float & operator() (const int row, const int column) const
 Element accesss.

virtual float & operator[] (const int row) const
 Element access, treating us as a vector.

virtual int rows () const
virtual int columns () const
virtual MatrixAbstract< float > * duplicate () const
 Make a new instance of self on the heap, with shallow copy semantics. Used for views. Since this is class sensitive, it must be overridden.

virtual void resize (const int rows, const int columns=1)
 We only have one size. This will throw an exception if (rows * columns) != 2.

virtual void read (std::istream &stream)
virtual void write (std::ostream &stream, bool withName=false)
 withName is ignored, and no class id is ever written for Points

float distance (const Point &that) const
 Euclidean distance between two points.

float distance () const
 Euclidean distance from origin.

float angle (const Point &that) const
 Determines angle of vector (that - this).

float angle () const
 Determines angle of vector from origin to this point.


Public Attributes

float x
float y

Detailed Description

A point in a pixel raster.

Point uses float values for x and y, so we define the following convention for interpreting the fractional part of a pixel coordinate: The image coordinate system starts in the upper left corner. Positive x goes to the right, and positive y goes down. Integer pixel coordinates (eg: 0, 1.0, 2.0, etc.) refer to the center of the pixel. IE: a pixel begins at -0.5 and ends at 0.5. This convention allows easy conversion between ints and floats that is also geometrically consistent and valid. The only thing it makes more difficult is determining the edges and center of an image, usually one-time calculations.


Constructor & Destructor Documentation

Point::Point  
 

Point::Point float    x,
float    y
 

template<class T>
fl::Point::Point const MatrixAbstract< T > &    A [inline]
 

Point::Point std::istream &    stream
 


Member Function Documentation

float Point::angle  
 

Determines angle of vector from origin to this point.

float Point::angle const Point &    that const
 

Determines angle of vector (that - this).

int Point::columns   [virtual]
 

Reimplemented from fl::MatrixAbstract< float >.

float Point::distance  
 

Euclidean distance from origin.

float Point::distance const Point &    that const
 

Euclidean distance between two points.

MatrixAbstract< float > * Point::duplicate   const [virtual]
 

Make a new instance of self on the heap, with shallow copy semantics. Used for views. Since this is class sensitive, it must be overridden.

Implements fl::MatrixAbstract< float >.

Vector< float > Point::homogenous float    third,
float    fourth
const
 

Vector< float > Point::homogenous float    third const
 

virtual float& fl::Point::operator() const int    row,
const int    column
const [inline, virtual]
 

Element accesss.

Implements fl::MatrixAbstract< float >.

virtual float& fl::Point::operator[] const int    row const [inline, virtual]
 

Element access, treating us as a vector.

Reimplemented from fl::MatrixAbstract< float >.

void Point::read std::istream &    stream [virtual]
 

Reimplemented from fl::MatrixAbstract< float >.

Reimplemented in fl::PointInterest, and fl::PointAffine.

void Point::resize const int    rows,
const int    columns = 1
[virtual]
 

We only have one size. This will throw an exception if (rows * columns) != 2.

Implements fl::MatrixAbstract< float >.

int Point::rows   [virtual]
 

Reimplemented from fl::MatrixAbstract< float >.

void Point::write std::ostream &    stream,
bool    withName = false
[virtual]
 

withName is ignored, and no class id is ever written for Points

Reimplemented in fl::PointInterest, and fl::PointAffine.


Member Data Documentation

float fl::Point::x
 

float fl::Point::y
 


The documentation for this class was generated from the following files:
Generated on Thu Dec 9 17:13:26 2004 for fl by doxygen1.2.18