DirectPoint Class Reference

#include <image.h>

List of all members.

Public Member Functions

 DirectPoint ()
 DirectPoint (int a, int b)
 DirectPoint (Token data)
Data getSaveDescription ()
void copyFrom (const PointValue &other)
 operator PointValue ()
DirectPointoperator+= (const DirectPoint &other)
DirectPoint operator- (const DirectPoint &other) const
bool operator== (const DirectPoint &other) const

Public Attributes

int x
int y


Detailed Description

Direct points are epxressed in integers and refer to pixel coordinates. These coordinates are not supposed to occur within the spreadsheet, they are mainly used to speed up image operations (that will then work by iterating over integers), and annotation of the type coordinate one is dealing with (direct points are pixel coordinates, PointValues are orthonormal coordinates relying on the coordinate system associated with images).

Definition at line 15 of file image.h.


Constructor & Destructor Documentation

DirectPoint::DirectPoint  )  [inline]
 

Initalizes the point with value (0, 0)

Definition at line 24 of file image.h.

References x, and y.

00025     {
00026       x = 0;
00027       y = 0;
00028     };

DirectPoint::DirectPoint int  a,
int  b
[inline]
 

Initializes the coordinate

Definition at line 33 of file image.h.

References x, and y.

00034     {
00035       x = a;
00036       y = b;
00037     }

DirectPoint::DirectPoint Token  data  )  [inline]
 

Initializing from a token

Definition at line 42 of file image.h.

References x, and y.

00043     {
00044       x = (Signed4)data["x"];
00045       y = (Signed4)data["y"];
00046     }


Member Function Documentation

void DirectPoint::copyFrom const PointValue other  )  [inline]
 

Copys the data from a pointvalue thereby truncating (rouding down) all data behind the comma

Definition at line 65 of file image.h.

References PointValue::x, x, PointValue::y, and y.

Referenced by ImageValue::ocsToDcs().

00066     {
00067       x = (int)other.x;
00068       y = (int)other.y;
00069     }

Data DirectPoint::getSaveDescription  )  [inline]
 

Returns the saved description of this direct point

Definition at line 52 of file image.h.

References x, and y.

Referenced by ImageValue::getSaveDescription().

00053     {
00054       Token r;
00055       r["type"]=Symbol("directpoint");
00056       r["x"]=Signed4(x);
00057       r["y"]=Signed4(y);
00058       return r;
00059     };

DirectPoint::operator PointValue  )  [inline]
 

automatic convertion to point values is possible because no data will be lost

Definition at line 75 of file image.h.

References x, PointValue::x, y, and PointValue::y.

00076     {
00077       PointValue result;
00078       result.x = x;
00079       result.y = y;
00080       return result;
00081     }

DirectPoint& DirectPoint::operator+= const DirectPoint other  )  [inline]
 

Translates the coordinate

Definition at line 86 of file image.h.

References x, and y.

00087     {
00088       x+=other.x;
00089       y+=other.y;
00090       return * this;
00091     }

DirectPoint DirectPoint::operator- const DirectPoint other  )  const [inline]
 

subtracts the points

Definition at line 96 of file image.h.

References x, and y.

00097     {
00098       DirectPoint result;
00099       result.x = x - other.x;
00100       result.y = y - other.y;
00101       return result;
00102     }

bool DirectPoint::operator== const DirectPoint other  )  const [inline]
 

Compares the values of the two points

Definition at line 107 of file image.h.

References x, and y.

00108     {
00109       return x==other.x && y==other.y;
00110     }


Member Data Documentation

int DirectPoint::x
 

Definition at line 18 of file image.h.

Referenced by ImageValue::addFrom(), copyFrom(), Runtime::crop(), DirectPoint(), dist(), ImageValue::drawAxes(), getSaveDescription(), ImageValue::ImageValue(), ImageValue::left(), ImageValue::loadImage(), ImageValue::ocsToDcs(), operator PointValue(), operator+=(), operator-(), operator==(), ImageValue::outside(), ImageValue::right(), and Runtime::straighten().

int DirectPoint::y
 

Definition at line 19 of file image.h.

Referenced by ImageValue::addFrom(), ImageValue::bottom(), copyFrom(), Runtime::crop(), DirectPoint(), dist(), getSaveDescription(), ImageValue::ImageValue(), ImageValue::loadImage(), ImageValue::ocsToDcs(), operator PointValue(), operator+=(), operator-(), operator==(), ImageValue::outside(), Runtime::straighten(), and ImageValue::top().


The documentation for this class was generated from the following file:
Generated on Mon Jun 5 22:08:43 2006 for iis by  doxygen 1.4.6