![]() |
digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
|
Public Types | |
enum | TransformationAction { NoTransformation = 0 , FlipHorizontal = 1 , FlipVertical = 2 , Rotate90 = 5 , Rotate180 = 6 , Rotate270 = 7 } |
This describes single transform primitives. More... | |
Public Member Functions | |
MetaEngineRotation () | |
Constructs the identity matrix (the matrix describing no transformation) | |
MetaEngineRotation (int m11, int m12, int m21, int m22) | |
MetaEngineRotation (MetaEngine::ImageOrientation exifOrientation) | |
Returns the matrix corresponding to the given TransformationAction. | |
MetaEngineRotation (TransformationAction action) | |
Returns the matrix corresponding to the given TransformationAction. | |
MetaEngine::ImageOrientation | exifOrientation () const |
Returns the Exif orientation flag describing this matrix. | |
bool | isNoTransform () const |
Returns true of this matrix describes no transformation (is the identity matrix) | |
bool | operator!= (const MetaEngineRotation &ma) const |
MetaEngineRotation & | operator*= (const MetaEngineRotation &ma) |
MetaEngineRotation & | operator*= (const QList< TransformationAction > &actions) |
Applies the given transform actions to this matrix. | |
MetaEngineRotation & | operator*= (MetaEngine::ImageOrientation exifOrientation) |
Applies the given Exif orientation flag to this matrix. | |
MetaEngineRotation & | operator*= (TransformationAction action) |
Applies the given transform to this matrix. | |
bool | operator== (const MetaEngineRotation &ma) const |
QTransform | toTransform () const |
Returns a QTransform representing this matrix. | |
QList< TransformationAction > | transformations () const |
Returns the actions described by this matrix. | |
Static Public Member Functions | |
static QTransform | toTransform (MetaEngine::ImageOrientation orientation) |
Returns a QTransform for the given Exif orientation. | |
Protected Member Functions | |
void | set (int m11, int m12, int m21, int m22) |
Protected Attributes | |
int | m [2][2] |
Note some of the defined Exif rotation flags combine two of these actions. The enum values correspond to those defined as JXFORM_CODE in the often used the JPEG tool transupp.h.
MetaEngine::ImageOrientation Digikam::MetaEngineRotation::exifOrientation | ( | ) | const |
Returns ORIENTATION_UNSPECIFIED if no flag matches this matrix.
QList< MetaEngineRotation::TransformationAction > Digikam::MetaEngineRotation::transformations | ( | ) | const |
Converts the mathematically correct description into the primitive operations that can be carried out losslessly.
The order matters. Not all possible matrices are supported, but all those that can be combined by Exif rotation flags and the transform actions above. If isNoTransform() or the matrix is not supported returns an empty list.