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
}
 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
 
MetaEngineRotationoperator*= (const MetaEngineRotation &ma)
 
MetaEngineRotationoperator*= (const QList< TransformationAction > &actions)
 Applies the given transform actions to this matrix.
 
MetaEngineRotationoperator*= (MetaEngine::ImageOrientation exifOrientation)
 Applies the given Exif orientation flag to this matrix.
 
MetaEngineRotationoperator*= (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< TransformationActiontransformations () 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]
 

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)

Member Function Documentation

◆ exifOrientation()

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

Returns ORIENTATION_UNSPECIFIED if no flag matches this matrix.

◆ 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.