~ubuntu-branches/ubuntu/trusty/digikam/trusty

« back to all changes in this revision

Viewing changes to core/utilities/imageeditor/widgets/imageregionwidget.h

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-11-26 18:24:20 UTC
  • mfrom: (1.9.1) (3.1.23 experimental)
  • Revision ID: package-import@ubuntu.com-20121126182420-qoy6z0nx4ai0wzcl
Tags: 4:3.0.0~beta3-0ubuntu1
* New upstream release
  - Add build-deps :  libhupnp-dev, libqtgstreamer-dev, libmagickcore-dev
* Merge from debian, remaining changes:
  - Make sure libqt4-opengl-dev, libgl1-mesa-dev and libglu1-mesa-dev only
    install on i386,amd64 and powerpc
  - Depend on libtiff-dev instead of libtiff4-dev
  - Drop digikam breaks/replaces kipi-plugins-common since we're past the
    LTS release now
  - digikam to recommend mplayerthumbs | ffmpegthumbs. We currently only
    have latter in the archives, even though former is also supposed to
    be part of kdemultimedia. (LP: #890059)
  - kipi-plugins to recommend www-browser rather than konqueror directly
    since 2.8 no direct usage of konqueror is present in the flickr
    plugin anymore (LP: #1011211)
  - Keep kubuntu_mysqld_executable_name.diff
  - Don't install libkipi translations
  - Keep deps on libcv-dev, libcvaux-dev
  - Keep split packaging of libraries
  - Replace icons from KDE 3 time in debian/xpm.d/*.xpm with the new
    versions (LP: #658047)
* Update debian/not-installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* ============================================================
2
 
 *
3
 
 * This file is a part of digiKam project
4
 
 * http://www.digikam.org
5
 
 *
6
 
 * Date        : 2004-08-17
7
 
 * Description : a widget to draw an image clip region.
8
 
 *
9
 
 * Copyright (C) 2004-2011 by Gilles Caulier <caulier dot gilles at gmail dot com>
10
 
 *
11
 
 * This program is free software; you can redistribute it
12
 
 * and/or modify it under the terms of the GNU General
13
 
 * Public License as published by the Free Software Foundation;
14
 
 * either version 2, or (at your option)
15
 
 * any later version.
16
 
 *
17
 
 * This program is distributed in the hope that it will be useful,
18
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 
 * GNU General Public License for more details.
21
 
 *
22
 
 * ============================================================ */
23
 
 
24
 
#ifndef IMAGEREGIONWIDGET_H
25
 
#define IMAGEREGIONWIDGET_H
26
 
 
27
 
// Qt includes
28
 
 
29
 
#include <QtCore/QPoint>
30
 
#include <QtCore/QRect>
31
 
#include <QtCore/QEvent>
32
 
#include <QtGui/QPolygon>
33
 
#include <QtGui/QPixmap>
34
 
#include <QtGui/QResizeEvent>
35
 
#include <QtGui/QWheelEvent>
36
 
 
37
 
// Local includes
38
 
 
39
 
#include "dimg.h"
40
 
#include "previewwidget.h"
41
 
#include "digikam_export.h"
42
 
 
43
 
namespace Digikam
44
 
{
45
 
 
46
 
class DIGIKAM_EXPORT ImageRegionWidget : public PreviewWidget
47
 
{
48
 
    Q_OBJECT
49
 
 
50
 
public:
51
 
 
52
 
    ImageRegionWidget(QWidget* parent = 0);
53
 
    ~ImageRegionWidget();
54
 
 
55
 
    /** To get target image region area to render.
56
 
     */
57
 
    QRect  getOriginalImageRegionToRender() const;
58
 
 
59
 
    /** To get target image region image to use for render operations
60
 
        If the bool parameter is true a downscaled version of the image
61
 
        region at screen resolution will be sent.
62
 
        Should be use to increase preview speed for the effects whose
63
 
        behaviour is a function of each pixel.
64
 
     */
65
 
    DImg   getOriginalRegionImage(bool useDownscaledImage = false) const;
66
 
 
67
 
    void   setPreviewImage(const DImg& img);
68
 
 
69
 
    void   setCapturePointMode(bool b);
70
 
    bool   capturePointMode() const;
71
 
 
72
 
    void   setHighLightPoints(const QPolygon& pointsList);
73
 
    void   setCenterImageRegionPosition();
74
 
 
75
 
    void   ICCSettingsChanged();
76
 
    void   exposureSettingsChanged();
77
 
 
78
 
Q_SIGNALS:
79
 
 
80
 
    void signalOriginalClipFocusChanged();
81
 
    void signalCapturedPointFromOriginal(const Digikam::DColor&, const QPoint&);
82
 
 
83
 
public Q_SLOTS:
84
 
 
85
 
    void slotPreviewModeChanged(int mode);
86
 
    void slotOriginalImageRegionChanged(bool targetDone);
87
 
 
88
 
private Q_SLOTS:
89
 
 
90
 
    void slotZoomFactorChanged();
91
 
    void slotPanIconSelectionMoved(const QRect& rect, bool targetDone);
92
 
    void slotContentTakeFocus();
93
 
    void slotContentLeaveFocus();
94
 
 
95
 
private:
96
 
 
97
 
    void   setContentsPosition(int x, int y, bool targetDone);
98
 
 
99
 
    /** To get image region including original or/and target area depending of separate view mode.
100
 
        The region is given using not scaled image unit.
101
 
     */
102
 
    QRect  getOriginalImageRegion() const;
103
 
 
104
 
    QRect  getLocalImageRegionToRender() const;
105
 
 
106
 
    void   backupPixmapRegion();
107
 
    void   restorePixmapRegion();
108
 
 
109
 
    void   enterEvent(QEvent*);
110
 
    void   leaveEvent(QEvent*);
111
 
    void   contentsMousePressEvent(QMouseEvent*);
112
 
    void   contentsMouseReleaseEvent(QMouseEvent*);
113
 
 
114
 
    int    previewWidth();
115
 
    int    previewHeight();
116
 
    bool   previewIsNull();
117
 
    void   resetPreview();
118
 
    QImage previewToQImage() const;
119
 
 
120
 
    void   viewportPaintExtraData();
121
 
    inline void paintPreview(QPixmap* pix, int sx, int sy, int sw, int sh);
122
 
 
123
 
    void   emitCapturedPointFromOriginal(const QPoint& pt);
124
 
 
125
 
private:
126
 
 
127
 
    class ImageRegionWidgetPriv;
128
 
    ImageRegionWidgetPriv* const d;
129
 
};
130
 
 
131
 
}  // namespace Digikam
132
 
 
133
 
#endif /* IMAGEREGIONWIDGET_H */