5#include "_cexports/c_core_3d.h"
10#include "point_3d_h.hpp"
11#include "matrix_3d.hpp"
31inline Matrix3DH
operator+(
const Matrix3DH & lhs,
const Matrix3DH & rhs);
43inline Matrix3DH
operator-(
const Matrix3DH & lhs,
const Matrix3DH & rhs);
79 template<std::
size_t N>
82 static_assert(N == 16,
"CVB: Matrix3D must have 16 elements");
83 std::copy(std::begin(list), std::end(list), matrix_.data()->data());
94 matrix[0][0], matrix[0][1], matrix[0][2], 0.0,
95 matrix[1][0], matrix[1][1], matrix[1][2], 0.0,
96 matrix[2][0], matrix[2][1], matrix[2][2], 0.0,
112 return matrix_[row].data();
124 return matrix_[row].data();
134 const double&
At(
int row,
int column)
const noexcept
136 return (*
this)[row][column];
146 double&
At(
int row,
int column)
noexcept
148 return (*
this)[row][column];
164 return matrix_ == matrix.matrix_;
175 return !(*
this == matrix);
186 *
this = *
this + matrix;
198 *
this = *
this - matrix;
212 for (
auto & line : matrix_)
213 for (
auto & element : line)
226 for(
auto & line : matrix_)
227 for(
auto & element : line)
246 lhs[0][0] + rhs[0][0], lhs[0][1] + rhs[0][1], lhs[0][2] + rhs[0][2], lhs[0][3] + rhs[0][3],
247 lhs[1][0] + rhs[1][0], lhs[1][1] + rhs[1][1], lhs[1][2] + rhs[1][2], lhs[1][3] + rhs[1][3],
248 lhs[2][0] + rhs[2][0], lhs[2][1] + rhs[2][1], lhs[2][2] + rhs[2][2], lhs[2][3] + rhs[2][3],
249 lhs[3][0] + rhs[3][0], lhs[3][1] + rhs[3][1], lhs[3][2] + rhs[3][2], lhs[3][3] + rhs[3][3],
258 lhs[0][0] - rhs[0][0], lhs[0][1] - rhs[0][1], lhs[0][2] - rhs[0][2], lhs[0][3] - rhs[0][3],
259 lhs[1][0] - rhs[1][0], lhs[1][1] - rhs[1][1], lhs[1][2] - rhs[1][2], lhs[1][3] - rhs[1][3],
260 lhs[2][0] - rhs[2][0], lhs[2][1] - rhs[2][1], lhs[2][2] - rhs[2][2], lhs[2][3] - rhs[2][3],
261 lhs[3][0] - rhs[3][0], lhs[3][1] - rhs[3][1], lhs[3][2] - rhs[3][2], lhs[3][3] - rhs[3][3],
280 lhs[0][0] * rhs[0] + lhs[0][1] * rhs[1] + lhs[0][2] * rhs[2] + lhs[0][3] * rhs[3],
281 lhs[1][0] * rhs[0] + lhs[1][1] * rhs[1] + lhs[1][2] * rhs[2] + lhs[1][3] * rhs[3],
282 lhs[2][0] * rhs[0] + lhs[2][1] * rhs[1] + lhs[2][2] * rhs[2] + lhs[2][3] * rhs[3],
283 lhs[3][0] * rhs[0] + lhs[3][1] * rhs[1] + lhs[3][2] * rhs[2] + lhs[3][3] * rhs[3],
300 lhs[0][0] * rhs, lhs[0][1] * rhs, lhs[0][2] * rhs, lhs[0][3] * rhs,
301 lhs[1][0] * rhs, lhs[1][1] * rhs, lhs[1][2] * rhs, lhs[1][3] * rhs,
302 lhs[2][0] * rhs, lhs[2][1] * rhs, lhs[2][2] * rhs, lhs[2][3] * rhs,
303 lhs[3][0] * rhs, lhs[3][1] * rhs, lhs[3][2] * rhs, lhs[3][3] * rhs,
334 lhs[0][0] / rhs, lhs[0][1] / rhs, lhs[0][2] / rhs, lhs[0][3] / rhs,
335 lhs[1][0] / rhs, lhs[1][1] / rhs, lhs[1][2] / rhs, lhs[1][3] / rhs,
336 lhs[2][0] / rhs, lhs[2][1] / rhs, lhs[2][2] / rhs, lhs[2][3] / rhs,
337 lhs[3][0] / rhs, lhs[3][1] / rhs, lhs[3][2] / rhs, lhs[3][3] / rhs
Double precision row-major 4x4 matrix.
Definition: matrix_3d_h.hpp:50
const double & At(int row, int column) const noexcept
Index based element access.
Definition: matrix_3d_h.hpp:134
Matrix3DH operator*(const double &lhs, const Matrix3DH &rhs)
Multiply scalar with matrix .
Definition: matrix_3d_h.hpp:316
const double * operator[](int row) const noexcept
Index based element access.
Definition: matrix_3d_h.hpp:110
double * operator[](int row) noexcept
Index based element access.
Definition: matrix_3d_h.hpp:122
Matrix3DH(const Matrix3D &matrix) noexcept
Create a homogeneous matrix from a matrix.
Definition: matrix_3d_h.hpp:91
Matrix3DH & operator/=(const double &value) noexcept
Divides each element of this matrix by the given value.
Definition: matrix_3d_h.hpp:224
Matrix3DH() noexcept=default
Default constructor for empty matrix.
Matrix3DH operator/(const Matrix3DH &lhs, const double &rhs)
Divide matrix by scalar.
Definition: matrix_3d_h.hpp:330
Matrix3DH & operator-=(const Matrix3DH &matrix) noexcept
Subtracts and assigns to this matrix.
Definition: matrix_3d_h.hpp:196
Matrix3DH & operator+=(const Matrix3DH &matrix) noexcept
Adds and assigns to this matrix.
Definition: matrix_3d_h.hpp:184
Matrix3DH operator*(const Matrix3DH &lhs, const double &rhs)
Multiply matrix with scalar.
Definition: matrix_3d_h.hpp:296
bool operator!=(const Matrix3DH &matrix) const noexcept
Compares to an other matrix.
Definition: matrix_3d_h.hpp:173
double & At(int row, int column) noexcept
Index based element access.
Definition: matrix_3d_h.hpp:146
Matrix3DH & operator*=(const double &value) noexcept
Multiplies and assigns to this matrix.
Definition: matrix_3d_h.hpp:210
Point3DH< double > operator*(const Matrix3DH &lhs, const Point3DH< double > &rhs)
Multiply matrix with 3D point (homogeneous).
Definition: matrix_3d_h.hpp:276
static Matrix3DH Identity() noexcept
The identity element.
Definition: matrix_3d_h.hpp:58
bool operator==(const Matrix3DH &matrix) const noexcept
Compares to an other matrix.
Definition: matrix_3d_h.hpp:162
Double precision 3x3 matrix class.
Definition: matrix_3d.hpp:59
Multi-purpose 3D vector class (homogeneous).
Definition: point_3d_h.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:217
AffineMatrix2D operator-(const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
Subtract two affine matrices.
Definition: affine_matrix_2d.hpp:231