~bfiller/gallery-app/gallery-app-46-new

« back to all changes in this revision

Viewing changes to src/photoeditor/photo-edit-thread.h

mergeĀ lp:~artmello/gallery-app/gallery-app-remove_local_photoeditor

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2013-2014 Canonical Ltd
3
 
 *
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.
7
 
 *
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.
12
 
 *
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/>.
15
 
 */
16
 
 
17
 
#ifndef GALLERY_PHOTO_EDIT_THREAD_H_
18
 
#define GALLERY_PHOTO_EDIT_THREAD_H_
19
 
 
20
 
#include "photo-caches.h"
21
 
#include "photo-edit-command.h"
22
 
 
23
 
// util
24
 
#include "orientation.h"
25
 
 
26
 
#include <QImage>
27
 
#include <QThread>
28
 
#include <QUrl>
29
 
 
30
 
class PhotoData;
31
 
 
32
 
/*!
33
 
 * \brief The PhotoEditThread class
34
 
 */
35
 
class PhotoEditThread: public QThread
36
 
{
37
 
    Q_OBJECT
38
 
public:
39
 
    PhotoEditThread(PhotoData *photo, const PhotoEditCommand& command);
40
 
 
41
 
    const PhotoEditCommand& command() const;
42
 
 
43
 
protected:
44
 
    void run() Q_DECL_OVERRIDE;
45
 
 
46
 
private:
47
 
    QImage enhanceImage(const QImage& image);
48
 
    QImage compensateExposure(const QImage& image, qreal compansation);
49
 
    QImage doColorBalance(const QImage& image, qreal brightness, qreal contrast, qreal saturation, qreal hue);
50
 
    void handleSimpleMetadataRotation(const PhotoEditCommand& state);
51
 
 
52
 
    PhotoData *m_photo;
53
 
    PhotoEditCommand m_command;
54
 
};
55
 
 
56
 
#endif