5#include "_cexports/c_core_3d.h"
8#include "matrix_3d.hpp"
80inline AffineMatrix3D
operator+(
const AffineMatrix3D & lhs,
const AffineMatrix3D & rhs)
noexcept;
91inline AffineMatrix3D
operator-(
const AffineMatrix3D & lhs,
const AffineMatrix3D & rhs)
noexcept;
103inline AffineMatrix3D
operator*(
const AffineMatrix3D & lhs,
const AffineMatrix3D & rhs);
116inline AffineMatrix3D
operator*(
const AffineMatrix3D & lhs,
const double & rhs)
noexcept;
127inline AffineMatrix3D
operator*(
const double & lhs,
const AffineMatrix3D & rhs)
noexcept;
138inline AffineMatrix3D
operator/(
const AffineMatrix3D & lhs,
const double & rhs);
176 , translation_(translation)
219 translation_ = translation;
240 return Internal::DoResCallValueOut<double>([&](
double & value)
242 auto thisData =
reinterpret_cast<const CExports::CVC3DTransformation*
>(
this);
243 return CVB_CALL_CAPI(CVC3DTransformationDeterminant(*thisData, value));
256 Internal::DoResCall([&]()
258 auto data =
reinterpret_cast<const CExports::CVC3DTransformation*
>(
this);
259 auto dataInv =
reinterpret_cast<CExports::CVC3DTransformation*
>(
this);
260 return CVB_CALL_CAPI(CVC3DInvertTransformation(*data, *dataInv));
286 return translation_ == transformation.translation_
287 && matrix_ == transformation.matrix_;
298 return !(*
this == transformation);
309 *
this = *
this + transformation;
321 *
this = *
this - transformation;
335 *
this = *
this * transformation;
347 *
this = *
this *value;
359 *
this = *
this / value;
376 return AffineMatrix3D(lhs.Matrix() + rhs.Matrix(), lhs.Translation() + rhs.Translation());
381 return AffineMatrix3D(lhs.Matrix() - rhs.Matrix(), lhs.Translation() - rhs.Translation());
387 return Internal::DoResCallValueOut<AffineMatrix3D>([&](
AffineMatrix3D & value)
389 auto valueData =
reinterpret_cast<CExports::CVC3DTransformation*
>(&value);
390 auto lhsData =
reinterpret_cast<const CExports::CVC3DTransformation*
>(&lhs);
391 auto rhsData =
reinterpret_cast<const CExports::CVC3DTransformation*
>(&rhs);
392 return CVB_CALL_CAPI(CVC3DMultiplyTransformations(*lhsData,
402 return AffineMatrix3D(lhs.Matrix() * rhs, lhs.Translation() * rhs);
Affine transformation for 3D containing a transformation matrix and a translation vector.
Definition: affine_matrix_3d.hpp:147
AffineMatrix3D Inverse()
Gets the inverse of this transformation if possible.
Definition: affine_matrix_3d.hpp:271
bool operator==(const AffineMatrix3D &transformation) const noexcept
Compares to an other transformation.
Definition: affine_matrix_3d.hpp:284
static AffineMatrix3D Identity() noexcept
The identity element.
Definition: affine_matrix_3d.hpp:155
Vector3D< double > Translation() const noexcept
Gets the translation part of the transformation.
Definition: affine_matrix_3d.hpp:206
Matrix3D Matrix() const noexcept
Gets the matrix part of the transformation.
Definition: affine_matrix_3d.hpp:186
AffineMatrix3D & operator*=(const AffineMatrix3D &transformation)
Multiplies and assigns to this transformation.
Definition: affine_matrix_3d.hpp:333
AffineMatrix3D & operator/=(const double &value) noexcept
Divides each element of this transformation by the given value.
Definition: affine_matrix_3d.hpp:357
AffineMatrix3D() noexcept=default
Default constructor for empty transformation.
bool IsTranslation() const noexcept
Checks if this transformation describes a translation.
Definition: affine_matrix_3d.hpp:228
double Det() const
Transformation determinant.
Definition: affine_matrix_3d.hpp:238
bool operator!=(const AffineMatrix3D &transformation) const noexcept
Compares to an other transformation.
Definition: affine_matrix_3d.hpp:296
void SetTranslation(Vector3D< double > translation) noexcept
Sets the translation part of the transformation.
Definition: affine_matrix_3d.hpp:217
AffineMatrix3D & operator-=(const AffineMatrix3D &transformation) noexcept
Subtracts and assigns to this transformation.
Definition: affine_matrix_3d.hpp:319
void SetMatrix(Matrix3D matrix) noexcept
Sets the matrix part of the transformation.
Definition: affine_matrix_3d.hpp:196
void Invert()
Inverts this transformation in-place if possible.
Definition: affine_matrix_3d.hpp:254
AffineMatrix3D & operator+=(const AffineMatrix3D &transformation) noexcept
Adds and assigns to this affine matrix.
Definition: affine_matrix_3d.hpp:307
Double precision 3x3 matrix class.
Definition: matrix_3d.hpp:60
static Matrix3D Identity() noexcept
The identity element.
Definition: matrix_3d.hpp:68
Multi-purpose 3D vector class.
Definition: point_3d.hpp:22
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24
AffineMatrix2D operator+(const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
Add two affine matrices.
Definition: affine_matrix_2d.hpp:231
AffineMatrix2D operator*(const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
Multiply two affine matrices.
Definition: affine_matrix_2d.hpp:259
AffineMatrix2D operator/(const AffineMatrix2D &lhs, const double &rhs)
Divide affine matrix by scalar.
Definition: affine_matrix_2d.hpp:315
AffineMatrix2D operator-(const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
Subtract two affine matrices.
Definition: affine_matrix_2d.hpp:245
Factor components to be applied in the 3D domain.
Definition: core_3d.hpp:17