LibreOffice Module basegfx (master) 1
|
#include <b2dhommatrix.hxx>
Public Member Functions | |
constexpr | B2DHomMatrix ()=default |
constexpr | B2DHomMatrix (double f_0x0, double f_0x1, double f_0x2, double f_1x0, double f_1x1, double f_1x2) |
constructor to allow setting all needed values for a 3x2 matrix at once. More... | |
double | a () const |
double | b () const |
double | c () const |
double | d () const |
double | e () const |
double | f () const |
double | get (sal_uInt16 nRow, sal_uInt16 nColumn) const |
void | set (sal_uInt16 nRow, sal_uInt16 nColumn, double fValue) |
void | set3x2 (double f_0x0, double f_0x1, double f_0x2, double f_1x0, double f_1x1, double f_1x2) |
allow setting all needed values for a 3x2 matrix in one call. More... | |
bool | isIdentity () const |
void | identity () |
bool | isInvertible () const |
bool | invert () |
void | rotate (double fRadiant) |
void | translate (double fX, double fY) |
void | translate (const B2DTuple &rTuple) |
void | scale (double fX, double fY) |
void | scale (const B2DTuple &rTuple) |
void | shearX (double fSx) |
void | shearY (double fSy) |
bool | operator== (const B2DHomMatrix &rMat) const |
bool | operator!= (const B2DHomMatrix &rMat) const |
B2DHomMatrix & | operator*= (const B2DHomMatrix &rMat) |
bool | decompose (B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const |
Help routine to decompose given homogen 3x3 matrix to components. More... | |
Static Public Member Functions | |
static B2DHomMatrix | abcdef (double da, double db, double dc, double dd, double de, double df) |
Convenience creator for declaration of the matrix that is commonly used by web standards (SVG, CSS, HTML). More... | |
Private Member Functions | |
void | computeAdjoint (double(&dst)[6]) const |
double | computeDeterminant (double(&dst)[6]) const |
void | doMulMatrix (const B2DHomMatrix &rMat) |
Private Attributes | |
std::array< std::array< double, 3 >, 2 > | mfValues |
Definition at line 35 of file b2dhommatrix.hxx.
|
constexprdefault |
|
inlineconstexpr |
constructor to allow setting all needed values for a 3x2 matrix at once.
The parameter f_0x1 e.g. is the same as using set(0, 1, f)
Definition at line 49 of file b2dhommatrix.hxx.
|
inline |
Definition at line 74 of file b2dhommatrix.hxx.
References get().
Referenced by doMulMatrix(), identity(), isIdentity(), and operator==().
|
inlinestatic |
Convenience creator for declaration of the matrix that is commonly used by web standards (SVG, CSS, HTML).
Values a,b,c,d,e,f represent the following values in the matrix: [a,c,e] [a,c,e] [b,d,f] or [b,d,f] [0,0,1]
Definition at line 68 of file b2dhommatrix.hxx.
|
inline |
Definition at line 76 of file b2dhommatrix.hxx.
References get().
Referenced by doMulMatrix(), identity(), isIdentity(), and operator==().
|
inline |
|
private |
Definition at line 109 of file b2dhommatrix.cxx.
References get().
Referenced by invert(), and isInvertible().
|
private |
Definition at line 120 of file b2dhommatrix.cxx.
References mfValues.
Referenced by invert(), and isInvertible().
|
inline |
Definition at line 80 of file b2dhommatrix.hxx.
References get().
bool basegfx::B2DHomMatrix::decompose | ( | B2DTuple & | rScale, |
B2DTuple & | rTranslate, | ||
double & | rRotate, | ||
double & | rShearX | ||
) | const |
Help routine to decompose given homogen 3x3 matrix to components.
Decomposition.
A correction of the components is done to avoid inaccuracies.
See basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix() for the opposite, to compose a homogen 3x3 matrix from components.
New, optimized version with local shearX detection. Old version (keeping below, is working well, too) used the 3D matrix decomposition when shear was used. Keeping old version as comment below since it may get necessary to add the determinant() test from there here, too.
Definition at line 280 of file b2dhommatrix.cxx.
References basegfx::B2DVector::cross(), basegfx::fTools::equalZero(), get(), basegfx::B2DVector::getLength(), basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), basegfx::B2DVector::scalar(), basegfx::Tuple2D< TYPE >::setX(), and basegfx::Tuple2D< TYPE >::setY().
Referenced by basegfx::utils::B2DHomMatrixBufferedOnDemandDecompose::impCheckDecompose().
|
private |
Definition at line 145 of file b2dhommatrix.cxx.
References a(), b(), c(), and mfValues.
Referenced by operator*=(), rotate(), scale(), shearX(), shearY(), and translate().
|
inline |
Definition at line 82 of file b2dhommatrix.hxx.
References get().
|
inline |
Definition at line 84 of file b2dhommatrix.hxx.
References get().
|
inline |
Definition at line 86 of file b2dhommatrix.hxx.
Referenced by computeAdjoint(), decompose(), basegfx::utils::getColumn(), isIdentity(), basegfx::B2DVector::operator*=(), basegfx::B2IVector::operator*=(), and basegfx::B2DSize::operator*=().
void basegfx::B2DHomMatrix::identity | ( | ) |
Definition at line 60 of file b2dhommatrix.cxx.
References a(), b(), basegfx::internal::implGetDefaultValue(), mfValues, and basegfx::RowSize.
Referenced by basegfx::unotools::homMatrixFromAffineMatrix(), and basegfx::utils::number2PolyPolygon().
bool basegfx::B2DHomMatrix::invert | ( | ) |
Definition at line 81 of file b2dhommatrix.cxx.
References computeAdjoint(), computeDeterminant(), basegfx::fTools::equalZero(), isIdentity(), and mfValues.
bool basegfx::B2DHomMatrix::isIdentity | ( | ) | const |
Definition at line 41 of file b2dhommatrix.cxx.
References a(), b(), get(), basegfx::internal::implGetDefaultValue(), and basegfx::RowSize.
Referenced by invert(), operator*=(), basegfx::B2DRange::transform(), basegfx::B2DCubicBezier::transform(), basegfx::B2DPolygon::transform(), basegfx::B2DPolyPolygon::transform(), basegfx::B3DPolygon::transformTextureCoordinates(), and basegfx::B3DPolyPolygon::transformTextureCoordinates().
bool basegfx::B2DHomMatrix::isInvertible | ( | ) | const |
Definition at line 69 of file b2dhommatrix.cxx.
References computeAdjoint(), computeDeterminant(), and basegfx::fTools::equalZero().
bool basegfx::B2DHomMatrix::operator!= | ( | const B2DHomMatrix & | rMat | ) | const |
Definition at line 185 of file b2dhommatrix.cxx.
B2DHomMatrix & basegfx::B2DHomMatrix::operator*= | ( | const B2DHomMatrix & | rMat | ) |
Definition at line 125 of file b2dhommatrix.cxx.
References doMulMatrix(), and isIdentity().
bool basegfx::B2DHomMatrix::operator== | ( | const B2DHomMatrix & | rMat | ) | const |
Definition at line 165 of file b2dhommatrix.cxx.
void basegfx::B2DHomMatrix::rotate | ( | double | fRadiant | ) |
Definition at line 190 of file b2dhommatrix.cxx.
References basegfx::utils::createSinCosOrthogonal(), doMulMatrix(), basegfx::fTools::equalZero(), and set().
Referenced by basegfx::utils::createAreaGeometryForLineStartEnd(), basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange(), and basegfx::utils::importFromSvgD().
void basegfx::B2DHomMatrix::scale | ( | const B2DTuple & | rTuple | ) |
Definition at line 242 of file b2dhommatrix.cxx.
References basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), and scale().
void basegfx::B2DHomMatrix::scale | ( | double | fX, |
double | fY | ||
) |
Definition at line 227 of file b2dhommatrix.cxx.
References doMulMatrix(), basegfx::fTools::equal(), and set().
Referenced by basegfx::utils::createAreaGeometryForLineStartEnd(), basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange(), basegfx::utils::createSourceRangeTargetRangeTransform(), basegfx::init1DGradientInfo(), basegfx::initEllipticalGradientInfo(), basegfx::initRectGradientInfo(), and scale().
|
inline |
Definition at line 91 of file b2dhommatrix.hxx.
Referenced by basegfx::utils::createRotateB2DHomMatrix(), basegfx::utils::createScaleB2DHomMatrix(), basegfx::utils::createScaleTranslateB2DHomMatrix(), basegfx::utils::createShearXB2DHomMatrix(), basegfx::utils::createShearYB2DHomMatrix(), basegfx::utils::createSourceRangeTargetRangeTransform(), basegfx::utils::createTranslateB2DHomMatrix(), basegfx::unotools::homMatrixFromAffineMatrix(), rotate(), scale(), shearX(), shearY(), and translate().
void basegfx::B2DHomMatrix::set3x2 | ( | double | f_0x0, |
double | f_0x1, | ||
double | f_0x2, | ||
double | f_1x0, | ||
double | f_1x1, | ||
double | f_1x2 | ||
) |
allow setting all needed values for a 3x2 matrix in one call.
The parameter f_0x1 e.g. is the same as using set(0, 1, f)
Definition at line 31 of file b2dhommatrix.cxx.
References mfValues.
Referenced by basegfx::utils::createRotateAroundPoint().
void basegfx::B2DHomMatrix::shearX | ( | double | fSx | ) |
Definition at line 247 of file b2dhommatrix.cxx.
References doMulMatrix(), basegfx::fTools::equalZero(), and set().
void basegfx::B2DHomMatrix::shearY | ( | double | fSy | ) |
Definition at line 260 of file b2dhommatrix.cxx.
References doMulMatrix(), basegfx::fTools::equalZero(), and set().
void basegfx::B2DHomMatrix::translate | ( | const B2DTuple & | rTuple | ) |
Definition at line 222 of file b2dhommatrix.cxx.
References basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), and translate().
void basegfx::B2DHomMatrix::translate | ( | double | fX, |
double | fY | ||
) |
Definition at line 209 of file b2dhommatrix.cxx.
References doMulMatrix(), basegfx::fTools::equalZero(), and set().
Referenced by basegfx::utils::createAreaGeometryForLineStartEnd(), basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange(), basegfx::utils::createSourceRangeTargetRangeTransform(), basegfx::utils::importFromSvgD(), basegfx::init1DGradientInfo(), basegfx::initEllipticalGradientInfo(), basegfx::initRectGradientInfo(), basegfx::utils::number2PolyPolygon(), and translate().
|
private |
Definition at line 39 of file b2dhommatrix.hxx.
Referenced by computeDeterminant(), doMulMatrix(), identity(), invert(), operator==(), and set3x2().