5#include "matrix_2d.hpp"
44 : translation_(translation)
87 translation_ = translation;
99 translation_ = matrix_ * (-1.0 * translation_);
120 return translation_ == affineMatrix.translation_
121 && matrix_ == affineMatrix.matrix_;
132 return !(*
this == affineMatrix);
144 matrix_ += affineMatrix.matrix_;
145 translation_ += affineMatrix.translation_;
157 matrix_ -= affineMatrix.matrix_;
158 translation_ -= affineMatrix.translation_;
170 *
this =
AffineMatrix2D(matrix_ * affineMatrix.matrix_, matrix_ * affineMatrix.translation_ + translation_);
183 translation_ *= value;
196 translation_ /= value;
219 return AffineMatrix2D(lhs.Matrix() + rhs.Matrix(), lhs.Translation() + rhs.Translation());
233 return AffineMatrix2D(lhs.Matrix() - rhs.Matrix(), lhs.Translation() - rhs.Translation());
247 return AffineMatrix2D(lhs.Matrix() * rhs.Matrix(), lhs.Matrix() * rhs.Translation() + lhs.Translation());
261 return lhs.Matrix() * rhs + lhs.Translation();
275 return AffineMatrix2D(lhs.Matrix() * rhs, lhs.Translation() * rhs);
Compacted affine matrix describing the Common Vision Blox coordinate system.
Definition: affine_matrix_2d.hpp:18
AffineMatrix2D & operator+=(const AffineMatrix2D &affineMatrix) noexcept
Adds and assigns to this affine matrix.
Definition: affine_matrix_2d.hpp:142
Point2D< double > operator*(const AffineMatrix2D &lhs, const Point2D< double > &rhs) noexcept
Multiply affine matrix with 2D point.
Definition: affine_matrix_2d.hpp:259
AffineMatrix2D operator+(const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
Add two affine matrices.
Definition: affine_matrix_2d.hpp:217
AffineMatrix2D & operator/=(const double &value) noexcept
Divides each element of this affine matrix by the given value.
Definition: affine_matrix_2d.hpp:193
AffineMatrix2D operator*(const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
Multiply two affine matrices.
Definition: affine_matrix_2d.hpp:245
AffineMatrix2D operator/(const AffineMatrix2D &lhs, const double &rhs)
Divide affine matrix by scalar.
Definition: affine_matrix_2d.hpp:301
AffineMatrix2D & operator*=(const AffineMatrix2D &affineMatrix) noexcept
Multiplies and assigns to this affine matrix.
Definition: affine_matrix_2d.hpp:168
AffineMatrix2D operator*(const AffineMatrix2D &lhs, const double &rhs) noexcept
Multiply affine matrix with scalar.
Definition: affine_matrix_2d.hpp:273
Cvb::Matrix2D Matrix() const noexcept
Get the transformation part of the affine matrix.
Definition: affine_matrix_2d.hpp:54
void SetTranslation(Vector2D< double > translation) noexcept
Set the translation part of the affine matrix.
Definition: affine_matrix_2d.hpp:85
bool IsTranslation() const noexcept
Check if this affine matrix only describes a translation.
Definition: affine_matrix_2d.hpp:107
void SetMatrix(Cvb::Matrix2D matrix) noexcept
Set the transformation part of the affine matrix.
Definition: affine_matrix_2d.hpp:64
AffineMatrix2D operator*(const double &lhs, const AffineMatrix2D &rhs) noexcept
Multiply scalar with affine matrix .
Definition: affine_matrix_2d.hpp:287
bool operator!=(const AffineMatrix2D &affineMatrix) const noexcept
Compares to an other matrix.
Definition: affine_matrix_2d.hpp:130
AffineMatrix2D operator-(const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
Subtract two affine matrices.
Definition: affine_matrix_2d.hpp:231
AffineMatrix2D() noexcept=default
Default constructor for empty affine matrix.
AffineMatrix2D & operator-=(const AffineMatrix2D &affineMatrix) noexcept
Subtracts and assigns to this affine matrix.
Definition: affine_matrix_2d.hpp:155
static AffineMatrix2D Identity() noexcept
The identity element.
Definition: affine_matrix_2d.hpp:26
void Invert()
Invert this affine matrix if possible.
Definition: affine_matrix_2d.hpp:96
bool operator==(const AffineMatrix2D &affineMatrix) const noexcept
Compares to an other matrix.
Definition: affine_matrix_2d.hpp:118
Vector2D< double > Translation() const noexcept
Get the translation part of the affine matrix.
Definition: affine_matrix_2d.hpp:74
Double precision 2x2 matrix class.
Definition: matrix_2d.hpp:16
static Matrix2D Identity() noexcept
The identity element.
Definition: matrix_2d.hpp:24
void Invert()
Inverts this matrix if possible.
Definition: matrix_2d.hpp:257
Multi-purpose 2D vector class.
Definition: point_2d.hpp:20
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24