2
* Copyright (C) 2011 Canonical Ltd
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Lucas Beeler <lucas@yorba.org>
20
#ifndef GALLERY_ORIENTATION_H_
21
#define GALLERY_ORIENTATION_H_
26
ORIGINAL_ORIENTATION = 0,
30
BOTTOM_RIGHT_ORIGIN = 3,
31
BOTTOM_LEFT_ORIGIN = 4,
34
RIGHT_BOTTOM_ORIGIN = 7,
35
LEFT_BOTTOM_ORIGIN = 8,
40
* \brief The OrientationCorrection struct
42
class OrientationCorrection
45
static OrientationCorrection fromOrientation(Orientation o);
46
static OrientationCorrection identity();
47
static Orientation rotateOrientation(Orientation orientation, bool left);
49
QTransform toTransform() const;
51
bool isFlippedFrom(const OrientationCorrection& other) const;
52
int getNormalizedRotationDifference(const OrientationCorrection& other) const;
55
OrientationCorrection(double rotation_angle, double horizontal_scale_factor)
56
: m_rotationAngle(rotation_angle),
57
m_horizontalScaleFactor(horizontal_scale_factor) { }
59
const double m_rotationAngle;
60
const double m_horizontalScaleFactor;
64
#endif // GALLERY_ORIENTATION_H_