digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
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)
 MetaEngineRotation (TransformationAction action)
MetaEngine::ImageOrientation exifOrientation () const
bool isNoTransform () const
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
QList< TransformationAction > transformations () const
 Converts the mathematically correct description into the primitive operations that can be carried out losslessly.

Static Public Member Functions

static QTransform toTransform (MetaEngine::ImageOrientation 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] = {{ 0 }}

Member Enumeration Documentation

◆ 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

Constructor & Destructor Documentation

◆ MetaEngineRotation() [1/2]

Digikam::MetaEngineRotation::MetaEngineRotation ( TransformationAction action)
explicit
Returns
the matrix corresponding to the given TransformationAction

◆ MetaEngineRotation() [2/2]

Digikam::MetaEngineRotation::MetaEngineRotation ( MetaEngine::ImageOrientation exifOrientation)
explicit
Returns
the matrix corresponding to the given TransformationAction

Member Function Documentation

◆ exifOrientation()

MetaEngine::ImageOrientation Digikam::MetaEngineRotation::exifOrientation ( ) const
Returns
the Exif orientation flag describing this matrix. Returns ORIENTATION_UNSPECIFIED if no flag matches this matrix.

◆ isNoTransform()

bool Digikam::MetaEngineRotation::isNoTransform ( ) const
Returns
true of this matrix describes no transformation (is the identity matrix)

◆ toTransform() [1/2]

QTransform Digikam::MetaEngineRotation::toTransform ( ) const
Returns
a QTransform representing this matrix

◆ toTransform() [2/2]

QTransform Digikam::MetaEngineRotation::toTransform ( MetaEngine::ImageOrientation orientation)
static
Returns
a QTransform for the given Exif orientation

◆ 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
Returns
the actions described by this matrix. 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.