Krita Source Code Documentation
Loading...
Searching...
No Matches
KisTransformUtils::MatricesPack Struct Reference

#include <kis_transform_utils.h>

Public Member Functions

QTransform finalTransform () const
 
 MatricesPack (const ToolTransformArgs &args)
 

Public Attributes

QTransform BRI
 
QMatrix4x4 P
 
QTransform projectedP
 
QTransform S
 
QTransform SC
 
QTransform T
 
QTransform TS
 

Detailed Description

Definition at line 66 of file kis_transform_utils.h.

Constructor & Destructor Documentation

◆ MatricesPack()

KisTransformUtils::MatricesPack::MatricesPack ( const ToolTransformArgs & args)

Definition at line 159 of file kis_transform_utils.cpp.

160{
161 TS = QTransform::fromTranslate(-args.originalCenter().x(), -args.originalCenter().y());
162 SC = QTransform::fromScale(args.scaleX(), args.scaleY());
163 S.shear(0, args.shearY()); S.shear(args.shearX(), 0);
164
166 BRI.rotate(180. * -args.boundsRotation() / M_PI);
167 P.rotate(180. * normalizeAngle(args.aX()) / M_PI, QVector3D(1, 0, 0));
168 P.rotate(180. * normalizeAngle(args.aY()) / M_PI, QVector3D(0, 1, 0));
169 P.rotate(180. * normalizeAngle(args.aZ()) / M_PI, QVector3D(0, 0, 1));
170 projectedP = P.toTransform(args.cameraPos().z());
171 } else if (args.mode() == ToolTransformArgs::PERSPECTIVE_4POINT) {
172 // see a comment in KisPerspectiveTransformStrategy::Private::transformIntoArgs()
173#if 0
174 projectedP.rotate(kisRadiansToDegrees(args.aZ()));
176#else
178#endif
179 P = QMatrix4x4(projectedP);
180 }
181
182 QPointF translation = args.transformedCenter();
183 T = QTransform::fromTranslate(translation.x(), translation.y());
184}
QPointF transformedCenter() const
QTransform flattenedPerspectiveTransform() const
QPointF originalCenter() const
double boundsRotation() const
TransformMode mode() const
QVector3D cameraPos() const
T kisRadiansToDegrees(T radians)
Definition kis_global.h:181
std::enable_if< std::is_floating_point< T >::value, T >::type normalizeAngle(T a)
Definition kis_global.h:121
#define M_PI
Definition kis_global.h:111

References ToolTransformArgs::aX(), ToolTransformArgs::aY(), ToolTransformArgs::aZ(), ToolTransformArgs::boundsRotation(), BRI, ToolTransformArgs::cameraPos(), ToolTransformArgs::flattenedPerspectiveTransform(), ToolTransformArgs::FREE_TRANSFORM, kisRadiansToDegrees(), M_PI, ToolTransformArgs::mode(), normalizeAngle(), ToolTransformArgs::originalCenter(), P, ToolTransformArgs::PERSPECTIVE_4POINT, projectedP, S, SC, ToolTransformArgs::scaleX(), ToolTransformArgs::scaleY(), ToolTransformArgs::shearX(), ToolTransformArgs::shearY(), ToolTransformArgs::transformedCenter(), and TS.

Member Function Documentation

◆ finalTransform()

QTransform KisTransformUtils::MatricesPack::finalTransform ( ) const

Definition at line 186 of file kis_transform_utils.cpp.

187{
188 return TS * BRI * SC * S * projectedP * T;
189}

References S.

Member Data Documentation

◆ BRI

QTransform KisTransformUtils::MatricesPack::BRI

Definition at line 77 of file kis_transform_utils.h.

◆ P

QMatrix4x4 KisTransformUtils::MatricesPack::P

Definition at line 73 of file kis_transform_utils.h.

◆ projectedP

QTransform KisTransformUtils::MatricesPack::projectedP

Definition at line 74 of file kis_transform_utils.h.

◆ S

QTransform KisTransformUtils::MatricesPack::S

Definition at line 72 of file kis_transform_utils.h.

◆ SC

QTransform KisTransformUtils::MatricesPack::SC

Definition at line 71 of file kis_transform_utils.h.

◆ T

QTransform KisTransformUtils::MatricesPack::T

Definition at line 75 of file kis_transform_utils.h.

◆ TS

QTransform KisTransformUtils::MatricesPack::TS

Definition at line 70 of file kis_transform_utils.h.


The documentation for this struct was generated from the following files: