digiKam Developer Documentation: Digikam::MetaEngineRotation Class Reference

| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Digikam::MetaEngineRotation Class Reference

## Public Types
enum | TransformationAction { NoTransformation = 0 , FlipHorizontal = 1 , FlipVertical = 2 , Rotate90 = 5 , Rotate180 = 6 , Rotate270 = 7 , RotateAuto = 8 }
| 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.
static QString | transformationActionToString (TransformationAction action)
| Converts a TransformationAction to a localized QString description.

## Protected Member Functions
void | set (int m11, int m12, int m21, int m22)

## Protected Attributes
int | m [2][2]

## Member Enumeration Documentation

## ◆ TransformationAction

enum Digikam::MetaEngineRotation::TransformationAction

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.

Enumerator
NoTransformation | no transformation
FlipHorizontal | horizontal flip
FlipVertical | vertical flip
Rotate90 | 90-degree clockwise rotation
Rotate180 | 180-degree rotation
Rotate270 | 270-degree clockwise (or 90 ccw)
RotateAuto | auto-rotate based on AutoRotator class

## Member Function Documentation

## ◆ exifOrientation()

MetaEngine::ImageOrientation Digikam::MetaEngineRotation::exifOrientation | ( |  | ) | const

Returns ORIENTATION_UNSPECIFIED if no flag matches this matrix.

## ◆ transformationActionToString()

QString Digikam::MetaEngineRotation::transformationActionToString | ( | TransformationAction | action | ) |
| static

Converts a MetaEngineRotation::TransformationAction to a QString description.

This is useful for debugging and UI display purposes.

## ◆ transformations()

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.