10#include "rotationmatrix.h"
68 case RotationMatrix::NoTransformation:
71 return flipHorizontal;
87 switch (exifOrientation)
89 case KExiv2::ORIENTATION_NORMAL:
91 case KExiv2::ORIENTATION_HFLIP:
92 return flipHorizontal;
93 case KExiv2::ORIENTATION_ROT_180:
95 case KExiv2::ORIENTATION_VFLIP:
97 case KExiv2::ORIENTATION_ROT_90_HFLIP:
98 return rotate90flipHorizontal;
99 case KExiv2::ORIENTATION_ROT_90:
101 case KExiv2::ORIENTATION_ROT_90_VFLIP:
102 return rotate90flipVertical;
103 case KExiv2::ORIENTATION_ROT_270:
105 case KExiv2::ORIENTATION_UNSPECIFIED:
121 *
this = Matrix::matrix(action);
131 set(m11, m12, m21, m22);
134void RotationMatrix::set(
int m11,
int m12,
int m21,
int m22)
144 return (*
this == Matrix::identity);
149 set( ma.m[0][0]*m[0][0] + ma.m[0][1]*m[1][0], ma.m[0][0]*m[0][1] + ma.m[0][1]*m[1][1],
150 ma.m[1][0]*m[0][0] + ma.m[1][1]*m[1][0], ma.m[1][0]*m[0][1] + ma.m[1][1]*m[1][1] );
155bool RotationMatrix::operator==(
const RotationMatrix& ma)
const
157 return m[0][0]==ma.m[0][0] &&
158 m[0][1]==ma.m[0][1] &&
159 m[1][0]==ma.m[1][0] &&
163bool RotationMatrix::operator!=(
const RotationMatrix& ma)
const
170 return (*
this *= Matrix::matrix(action));
177 *
this *= Matrix::matrix(action);
195 if (*
this == Matrix::rotate90)
199 else if (*
this == Matrix::rotate180)
203 else if (*
this == Matrix::rotate270)
207 else if (*
this == Matrix::flipHorizontal)
211 else if (*
this == Matrix::flipVertical)
215 else if (*
this == Matrix::rotate90flipHorizontal)
221 else if (*
this == Matrix::rotate90flipVertical)
233 if (*
this == Matrix::identity)
235 return KExiv2::ORIENTATION_NORMAL;
238 if (*
this == Matrix::rotate90)
240 return KExiv2::ORIENTATION_ROT_90;
242 else if (*
this == Matrix::rotate180)
244 return KExiv2::ORIENTATION_ROT_180;
246 else if (*
this == Matrix::rotate270)
248 return KExiv2::ORIENTATION_ROT_270;
250 else if (*
this == Matrix::flipHorizontal)
252 return KExiv2::ORIENTATION_HFLIP;
254 else if (*
this == Matrix::flipVertical)
256 return KExiv2::ORIENTATION_VFLIP;
258 else if (*
this == Matrix::rotate90flipHorizontal)
260 return KExiv2::ORIENTATION_ROT_90_HFLIP;
262 else if (*
this == Matrix::rotate90flipVertical)
264 return KExiv2::ORIENTATION_ROT_90_VFLIP;
267 return KExiv2::ORIENTATION_UNSPECIFIED;
281 case KExiv2::ORIENTATION_NORMAL:
282 case KExiv2::ORIENTATION_UNSPECIFIED:
285 case KExiv2::ORIENTATION_HFLIP:
289 case KExiv2::ORIENTATION_ROT_180:
293 case KExiv2::ORIENTATION_VFLIP:
297 case KExiv2::ORIENTATION_ROT_90_HFLIP:
302 case KExiv2::ORIENTATION_ROT_90:
306 case KExiv2::ORIENTATION_ROT_90_VFLIP:
311 case KExiv2::ORIENTATION_ROT_270:
319#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
320#if KEXIV2_BUILD_DEPRECATED_SINCE(5, 1)
321QMatrix RotationMatrix::toMatrix()
const
328#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
329#if KEXIV2_BUILD_DEPRECATED_SINCE(5, 1)
ImageOrientation
The image orientation values given by Exif metadata.
bool isNoTransform() const
Returns true of this matrix describes no transformation (is the identity matrix)
TransformationAction
This describes single transform primitives.
@ Rotate180
90-degree clockwise rotation
@ FlipHorizontal
no transformation
@ Rotate270
180-degree rotation
@ FlipVertical
horizontal flip
QList< TransformationAction > transformations() const
Returns the actions described by this matrix.
RotationMatrix()
Constructs the identity matrix (the matrix describing no transformation)
KExiv2::ImageOrientation exifOrientation() const
Returns the Exif orienation flag describing this matrix.
QTransform toTransform() const
Returns a QTransform representing this matrix.
KExiv2Iface - Exiv2 library interface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:12:07 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.