~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to utilities/imageeditor/widgets/imageguidewidget.h

  • Committer: Package Import Robot
  • Author(s): Felix Geyer, Rohan Garg, Philip Muškovac, Felix Geyer
  • Date: 2011-09-23 18:18:55 UTC
  • mfrom: (1.2.36 upstream)
  • Revision ID: package-import@ubuntu.com-20110923181855-ifs67wxkugshev9k
Tags: 2:2.1.1-0ubuntu1
[ Rohan Garg ]
* New upstream release (LP: #834190)
  - debian/control
    + Build with libqtwebkit-dev
 - debian/kipi-plugins-common
    + Install libkvkontakte required by kipi-plugins
 - debian/digikam
    + Install panoramagui

[ Philip Muškovac ]
* New upstream release
  - debian/control:
    + Add libcv-dev, libcvaux-dev, libhighgui-dev, libboost-graph1.46-dev,
      libksane-dev, libxml2-dev, libxslt-dev, libqt4-opengl-dev, libqjson-dev,
      libgpod-dev and libqca2-dev to build-deps
    + Add packages for kipi-plugins, libmediawiki, libkface, libkgeomap and
      libkvkontakte
  - debian/rules:
    + Don't build with gphoto2 since it doesn't build with it.
  - Add kubuntu_fix_test_linking.diff to fix linking of the dngconverter test
  - update install files
  - update kubuntu_01_mysqld_executable_name.diff for new cmake layout
    and rename to kubuntu_mysqld_executable_name.diff
* Fix typo in digikam-data description (LP: #804894)
* Fix Vcs links

[ Felix Geyer ]
* Move library data files to the new packages libkface-data, libkgeomap-data
  and libkvkontakte-data.
* Override version of the embedded library packages to 1.0~digikam<version>.
* Exclude the library packages from digikam-dbg to prevent file conflicts in
  the future.
* Call dh_install with --list-missing.

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-20
7
 
 * Description : a widget to display an image with guides
8
 
 *
9
 
 * Copyright (C) 2004-2010 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 IMAGEGUIDEWIDGET_H
25
 
#define IMAGEGUIDEWIDGET_H
26
 
 
27
 
// Qt includes
28
 
 
29
 
#include <QtGui/QWidget>
30
 
#include <QtGui/QColor>
31
 
#include <QtGui/QPixmap>
32
 
#include <QtGui/QResizeEvent>
33
 
#include <QtGui/QMouseEvent>
34
 
#include <QtGui/QPaintEvent>
35
 
#include <QtCore/QPoint>
36
 
#include <QtCore/QEvent>
37
 
#include <QtCore/QTimerEvent>
38
 
 
39
 
// Local includes
40
 
 
41
 
#include "dcolor.h"
42
 
#include "digikam_export.h"
43
 
 
44
 
namespace Digikam
45
 
{
46
 
 
47
 
class DColor;
48
 
class ImageIface;
49
 
 
50
 
class DIGIKAM_EXPORT ImageGuideWidget : public QWidget
51
 
{
52
 
    Q_OBJECT
53
 
 
54
 
public:
55
 
 
56
 
    enum GuideToolMode
57
 
    {
58
 
        HVGuideMode=0,
59
 
        PickColorMode
60
 
    };
61
 
 
62
 
    enum ColorPointSrc
63
 
    {
64
 
        OriginalImage=0,
65
 
        PreviewImage,
66
 
        TargetPreviewImage
67
 
    };
68
 
 
69
 
public:
70
 
 
71
 
    explicit ImageGuideWidget(QWidget* parent=0,
72
 
                              bool spotVisible=true, int guideMode=PickColorMode,
73
 
                              const QColor& guideColor=Qt::red, int guideSize=1,
74
 
                              bool blink=false, bool useImageSelection=false);
75
 
    ~ImageGuideWidget();
76
 
 
77
 
    ImageIface* imageIface() const;
78
 
 
79
 
    QPoint getSpotPosition();
80
 
    DColor getSpotColor(int getColorFrom);
81
 
    void   setSpotVisible(bool spotVisible, bool blink=false);
82
 
    int    previewMode();
83
 
    void   resetSpotPosition();
84
 
    void   updatePreview();
85
 
    void   setPoints(const QPolygon& p, bool drawLine=false);
86
 
    void   resetPoints();
87
 
 
88
 
    void   setPaintColor(const QColor& color);
89
 
    void   setEraseMode(bool erase);
90
 
    void   setMaskEnabled(bool enabled);
91
 
    void   setMaskPenSize(int size);
92
 
 
93
 
    QImage getMask() const;
94
 
 
95
 
    void   ICCSettingsChanged();
96
 
    void   exposureSettingsChanged();
97
 
 
98
 
public Q_SLOTS:
99
 
 
100
 
    void slotChangeGuideColor(const QColor& color);
101
 
    void slotChangeGuideSize(int size);
102
 
    void slotPreviewModeChanged(int mode);
103
 
 
104
 
Q_SIGNALS:
105
 
 
106
 
    void spotPositionChangedFromOriginal(const Digikam::DColor& color, const QPoint& position);
107
 
    void spotPositionChangedFromTarget(const Digikam::DColor& color, const QPoint& position);
108
 
    void signalResized();
109
 
 
110
 
private:
111
 
 
112
 
    void   paintEvent(QPaintEvent*);
113
 
    void   resizeEvent(QResizeEvent*);
114
 
    void   timerEvent(QTimerEvent*);
115
 
    void   mousePressEvent(QMouseEvent*);
116
 
    void   mouseReleaseEvent(QMouseEvent*);
117
 
    void   mouseMoveEvent(QMouseEvent*);
118
 
    void   enterEvent(QEvent*);
119
 
    void   leaveEvent(QEvent*);
120
 
    void   updatePixmap();
121
 
    void   drawLineTo(const QPoint& endPoint);
122
 
    void   drawLineTo(int width, bool erase, const QColor& color, const QPoint& start, const QPoint& end);
123
 
    QPoint translatePointPosition(QPoint& point);
124
 
    void   drawText(QPainter* p, const QPoint& corner, const QString& text);
125
 
    void   updateMaskCursor();
126
 
 
127
 
private:
128
 
 
129
 
    class ImageGuideWidgetPriv;
130
 
    ImageGuideWidgetPriv* const d;
131
 
};
132
 
 
133
 
}  // namespace Digikam
134
 
 
135
 
#endif /* IMAGEGUIDEWIDGET_H */