digiKam
Digikam::MetaEngineRotation Class Reference

Public Types

enum  TransformationAction {
  NoTransformation = 0 , FlipHorizontal = 1 , FlipVertical = 2 , Rotate90 = 5 ,
  Rotate180 = 6 , Rotate270 = 7
}
 

Public Member Functions

MetaEngine::ImageOrientation exifOrientation () const
 
bool isNoTransform () const
 
 MetaEngineRotation ()
 
 MetaEngineRotation (int m11, int m12, int m21, int m22)
 
 MetaEngineRotation (MetaEngine::ImageOrientation exifOrientation)
 
 MetaEngineRotation (TransformationAction action)
 
bool operator!= (const MetaEngineRotation &ma) const
 
MetaEngineRotationoperator*= (const MetaEngineRotation &ma)
 
MetaEngineRotationoperator*= (MetaEngine::ImageOrientation exifOrientation)
 
MetaEngineRotationoperator*= (QList< TransformationAction > actions)
 
MetaEngineRotationoperator*= (TransformationAction action)
 
bool operator== (const MetaEngineRotation &ma) const
 
QTransform toTransform () const
 
QList< TransformationActiontransformations () const
 

Static Public Member Functions

static QTransform toTransform (MetaEngine::ImageOrientation orientation)
 

Protected Member Functions

void set (int m11, int m12, int m21, int m22)
 

Protected Attributes

int m [2][2]
 

Member Enumeration Documentation

◆ TransformationAction

This describes single transform primitives. 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)

Constructor & Destructor Documentation

◆ MetaEngineRotation() [1/4]

Digikam::MetaEngineRotation::MetaEngineRotation ( )

Constructs the identity matrix (the matrix describing no transformation)

References set().

◆ MetaEngineRotation() [2/4]

Digikam::MetaEngineRotation::MetaEngineRotation ( TransformationAction  action)
explicit

Returns the matrix corresponding to the given TransformationAction

References Digikam::Matrix::matrix().

◆ MetaEngineRotation() [3/4]

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

Returns the matrix corresponding to the given TransformationAction

References exifOrientation(), and Digikam::Matrix::matrix().

◆ MetaEngineRotation() [4/4]

Digikam::MetaEngineRotation::MetaEngineRotation ( int  m11,
int  m12,
int  m21,
int  m22 
)

References set().

Member Function Documentation

◆ exifOrientation()

◆ isNoTransform()

bool Digikam::MetaEngineRotation::isNoTransform ( ) const

Returns true of this matrix describes no transformation (is the identity matrix)

◆ operator!=()

bool Digikam::MetaEngineRotation::operator!= ( const MetaEngineRotation ma) const

◆ operator*=() [1/4]

MetaEngineRotation & Digikam::MetaEngineRotation::operator*= ( const MetaEngineRotation ma)

References m, and set().

◆ operator*=() [2/4]

MetaEngineRotation & Digikam::MetaEngineRotation::operator*= ( MetaEngine::ImageOrientation  exifOrientation)

Applies the given Exif orientation flag to this matrix

References exifOrientation(), and Digikam::Matrix::matrix().

◆ operator*=() [3/4]

MetaEngineRotation & Digikam::MetaEngineRotation::operator*= ( QList< TransformationAction actions)

Applies the given transform actions to this matrix

References Digikam::Matrix::matrix().

◆ operator*=() [4/4]

MetaEngineRotation & Digikam::MetaEngineRotation::operator*= ( TransformationAction  action)

Applies the given transform to this matrix

References Digikam::Matrix::matrix().

◆ operator==()

bool Digikam::MetaEngineRotation::operator== ( const MetaEngineRotation ma) const

References m.

◆ set()

void Digikam::MetaEngineRotation::set ( int  m11,
int  m12,
int  m21,
int  m22 
)
protected

References m.

Referenced by MetaEngineRotation(), and operator*=().

◆ toTransform() [1/2]

QTransform Digikam::MetaEngineRotation::toTransform ( ) const

◆ toTransform() [2/2]

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

Converts the mathematically correct description into the primitive operations that can be carried out losslessly.

References FlipHorizontal, FlipVertical, Rotate180, Rotate270, and Rotate90.

Referenced by Digikam::JPEGUtils::JpegRotator::exifTransform().

Member Data Documentation

◆ m

int Digikam::MetaEngineRotation::m[2][2]
protected

Referenced by operator*=(), operator==(), and set().


The documentation for this class was generated from the following files: