eLynx::Math::LinearTransformation Class Reference
#include <LinearTransformation.h>
List of all members.
|
Public Member Functions |
| LinearTransformation () |
| Constructor, creates identity transformation.
|
| LinearTransformation (const LinearTransformation &c) |
LinearTransformation & | operator= (const LinearTransformation &c) |
virtual boost::shared_ptr
< AbstractTransformation > | Clone () const |
double | GetValue (uint32 iRow, uint32 iCol) const |
void | SetValue (uint32 iRow, uint32 iCol, double iValue) |
LinearTransformation & | NullTransformation () |
LinearTransformation & | Identity () |
virtual bool | IsIdentity () const |
LinearTransformation & | Translation (double iDX, double iDY) |
LinearTransformation & | Rotation (double iAngle) |
LinearTransformation & | Scale (double iSX, double iSY) |
LinearTransformation & | GeneralTransformation (double iA, double iB, double iC, double iD, double iE, double iF) |
LinearTransformation & | Multiply (const LinearTransformation &iTrf) |
LinearTransformation & | Inverse (const LinearTransformation &iTrf) |
virtual void | Transform (double iX, double iY, double &oX, double &oY) const |
virtual void | GetTransformedBBox (uint32 iWidth, uint32 iHeight, double &oLeft, double &oTop, double &oWidth, double &oHeight) const |
virtual void | InverseTransform (double iX, double iY, double &oX, double &oY) const |
virtual void | GetInverseBBox (uint32 iWidth, uint32 iHeight, double &oLeft, double &oTop, double &oWidth, double &oHeight) const |
Detailed Description
Class implementing 2D linear transformation. Transformation is (as usual) represented by 3x3 matrix. Class provides methods to set typical transformations like translation, rotation or scaling. Also, it provides a method to combine transformations by matrix multiplication.
Definition at line 37 of file LinearTransformation.h.
Constructor & Destructor Documentation
eLynx::Math::LinearTransformation::LinearTransformation |
( |
|
) |
|
Constructor, creates identity transformation.
Copy constructor
- Parameters:
-
| c | the object to be copied |
Member Function Documentation
An assignement operator
- Parameters:
-
| c | the object to be copied |
- Returns:
- the reference to this object
virtual boost::shared_ptr<AbstractTransformation> eLynx::Math::LinearTransformation::Clone |
( |
|
) |
const [virtual] |
double eLynx::Math::LinearTransformation::GetValue |
( |
uint32 |
iRow, |
|
|
uint32 |
iCol | |
|
) |
| | const |
Returns specified value of the transformation matrix.
- Parameters:
-
| iRow | the number of row (0..2) |
| iCol | the number of column (0..2) |
- Returns:
- the matrix value
void eLynx::Math::LinearTransformation::SetValue |
( |
uint32 |
iRow, |
|
|
uint32 |
iCol, |
|
|
double |
iValue | |
|
) |
| | |
Sets specified value of the transformation matrix
- Parameters:
-
| iRow | the number of row (0..2) |
| iCol | the number of column (0..2) |
| iValue | the value to be set |
Sets transformation to null transformation and returns this object. Null transformation transforms all vectors to null vector.
- Returns:
- reference to this object
Sets transformation to identity and returns this object. Identity transforms all vectors to themselves.
- Returns:
- reference to this object.
virtual bool eLynx::Math::LinearTransformation::IsIdentity |
( |
|
) |
const [virtual] |
Returns true, if actual transformation is identity. Can be used to speed up the process (by not transforming at all).
- Returns:
- true for identity transformation, false otherwise.
Implements eLynx::Math::AbstractTransformation.
Sets transformation to translation and returns this object.
- Parameters:
-
| iDX | the delta value in x direction |
| iDY | the delta value in y direction |
- Returns:
- reference to this object
Sets transformation to rotation and returns this object. The rotation is performed around origin [0,0], counter-clockwise for positive angle.
- Parameters:
-
| iAngle | the angle in radians. |
- Returns:
- reference to this object
Sets transformation to scaling and returns this object. The scaling is performed with respect to origin [0, 0].
- Parameters:
-
| iSX | the scale factor in x direction |
| iSY | the scale factor in y direction |
- Returns:
- reference to this object
LinearTransformation& eLynx::Math::LinearTransformation::GeneralTransformation |
( |
double |
iA, |
|
|
double |
iB, |
|
|
double |
iC, |
|
|
double |
iD, |
|
|
double |
iE, |
|
|
double |
iF | |
|
) |
| | |
Sets transformation to general linear transformation: x' = A*x+B*y+C y' = D*x+E*y+F and returns this object.
- Parameters:
-
| iA | the (0,0) matrix coefficient |
| iB | the (1,0) matrix coefficient |
| iC | the (2,0) matrix coefficient |
| iD | the (0,1) matrix coefficient |
| iE | the (1,1) matrix coefficient |
| iF | the (2,1) matrix coefficient |
- Returns:
- reference to this object
Multiplies current matrix with given matrix, storing the result in current object and returning it (behaves like *= operator). The matrix multiplication is equivalent to adding transformations.
- Parameters:
-
| iTrf | the matrix current matrix should be multiplied with |
- Returns:
- reference to this object (result of multiplication this*iTrf)
Sets transformation to inverse of specified transformation. The transformation must be invertible - this means determinant of transformation matrix must be non-zero. If it is not, the exception is raised.
- Parameters:
-
| iTrf | the matrix to be inverted |
- Returns:
- reference to this object (inverted matrix)
virtual void eLynx::Math::LinearTransformation::Transform |
( |
double |
iX, |
|
|
double |
iY, |
|
|
double & |
oX, |
|
|
double & |
oY | |
|
) |
| | const [virtual] |
Abstract method, which transforms position of the pixel in the coordinate space of the first image, into position in the coordinate space of the second image.
- Parameters:
-
| iX | the x coordinate of the pixel on the first image |
| iY | the y coordinate of the pixel on the first image |
| oX | the x position on the second image |
| oY | the y position on the second image |
Implements eLynx::Math::AbstractTransformation.
virtual void eLynx::Math::LinearTransformation::GetTransformedBBox |
( |
uint32 |
iWidth, |
|
|
uint32 |
iHeight, |
|
|
double & |
oLeft, |
|
|
double & |
oTop, |
|
|
double & |
oWidth, |
|
|
double & |
oHeight | |
|
) |
| | const [virtual] |
Abstract method, which computes bounding box of the transformed (second) image in the coordinate space of the first image. First image has a bounding box (0, 0)-(iWidth, iHeight). Second image has a bounding box (oLeft, oTop)-(oLeft+oWidth, oTop+oHeight).
- Parameters:
-
| iWidth | the width of the first image |
| iHeight | the height of the first image |
| oLeft | the left coordinate of the second image bounding box |
| oTop | the top coordinate of the second image bounding box |
| oWidth | the width of the second image bounding box |
| oHeight | the height of the second image bounding box |
Implements eLynx::Math::AbstractTransformation.
virtual void eLynx::Math::LinearTransformation::InverseTransform |
( |
double |
iX, |
|
|
double |
iY, |
|
|
double & |
oX, |
|
|
double & |
oY | |
|
) |
| | const [virtual] |
Abstract method, which transforms position of the pixel in the coordinate space of the second image, into position in the coordinate space of the first image.
- Parameters:
-
| iX | the x coordinate of the pixel on the second image |
| iY | the y coordinate of the pixel on the second image |
| oX | the x position on the first image |
| oY | the y position on the first image |
Implements eLynx::Math::AbstractTransformation.
virtual void eLynx::Math::LinearTransformation::GetInverseBBox |
( |
uint32 |
iWidth, |
|
|
uint32 |
iHeight, |
|
|
double & |
oLeft, |
|
|
double & |
oTop, |
|
|
double & |
oWidth, |
|
|
double & |
oHeight | |
|
) |
| | const [virtual] |
Abstract method, which computes bounding box of the original (first) image in the coordinate space of the second image. Second image has a bounding box (0, 0)-(iWidth, iHeight). First image has a bounding box (oLeft, oTop)-(oLeft+oWidth, oTop+oHeight).
- Parameters:
-
| iWidth | the width of the second image |
| iHeight | the height of the second image |
| oLeft | the left coordinate of the first image bounding box |
| oTop | the top coordinate of the first image bounding box |
| oWidth | the width of the first image bounding box |
| oHeight | the height of the first image bounding box |
Implements eLynx::Math::AbstractTransformation.
The documentation for this class was generated from the following file: