~ubuntu-branches/ubuntu/intrepid/digikam/intrepid

« back to all changes in this revision

Viewing changes to digikam/libs/widgets/imageplugins/imageguidewidget.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2008-07-17 20:25:39 UTC
  • mfrom: (1.3.2 upstream) (37 hardy)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20080717202539-1bw3w3nrsso7yj4z
* New upstream release
  - digiKam 0.9.4 Release Plan (KDE3) ~ 13 July 08 (Closes: #490144)
* DEB_CONFIGURE_EXTRA_FLAGS := --without-included-sqlite3
* Debhelper compatibility level V7
* Install pixmaps in debian/*.install
* Add debian/digikam.lintian-overrides

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-2008 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 <qwidget.h>
 
30
#include <qpoint.h>
 
31
#include <qcolor.h>
 
32
 
 
33
// Local includes
 
34
 
 
35
#include "dcolor.h"
 
36
#include "digikam_export.h"
 
37
 
 
38
class QPixmap;
 
39
 
 
40
namespace Digikam
 
41
{
 
42
 
 
43
class DColor;
 
44
class ImageIface;
 
45
class ImageGuideWidgetPriv;
 
46
 
 
47
class DIGIKAM_EXPORT ImageGuideWidget : public QWidget
 
48
{
 
49
Q_OBJECT
 
50
 
 
51
public:
 
52
 
 
53
    enum GuideToolMode 
 
54
    {
 
55
        HVGuideMode=0,
 
56
        PickColorMode
 
57
    };
 
58
 
 
59
    enum RenderingPreviewMode 
 
60
    {
 
61
        PreviewOriginalImage=0,     // Original image only.
 
62
        PreviewBothImagesHorz,      // Horizontal with original and target duplicated.
 
63
        PreviewBothImagesVert,      // Vertical with original and target duplicated.
 
64
        PreviewBothImagesHorzCont,  // Horizontal with original and target in contiguous.
 
65
        PreviewBothImagesVertCont,  // Vertical with original and target in contiguous.
 
66
        PreviewTargetImage,         // Target image only.
 
67
        PreviewToggleOnMouseOver,   // Original image if mouse is over image area, else target image.
 
68
        NoPreviewMode               // Target image only without information displayed.
 
69
    };
 
70
 
 
71
    enum ColorPointSrc
 
72
    {
 
73
        OriginalImage=0,
 
74
        PreviewImage,
 
75
        TargetPreviewImage
 
76
    };
 
77
 
 
78
public:
 
79
 
 
80
    ImageGuideWidget(int w, int h, QWidget *parent=0, 
 
81
                     bool spotVisible=true, int guideMode=HVGuideMode,
 
82
                     const QColor& guideColor=Qt::red, int guideSize=1, 
 
83
                     bool blink=false, bool useImageSelection=false);
 
84
    ~ImageGuideWidget();
 
85
        
 
86
    ImageIface* imageIface();
 
87
    
 
88
    QPoint getSpotPosition();
 
89
    DColor getSpotColor(int getColorFrom);
 
90
    void   setSpotVisible(bool spotVisible, bool blink=false);
 
91
    int    getRenderingPreviewMode();
 
92
    void   resetSpotPosition();
 
93
    void   updatePreview();
 
94
 
 
95
public slots:
 
96
        
 
97
    void slotChangeGuideColor(const QColor &color);
 
98
    void slotChangeGuideSize(int size);    
 
99
    void slotChangeRenderingPreviewMode(int mode);
 
100
    void slotToggleUnderExposure(bool);    
 
101
    void slotToggleOverExposure(bool);    
 
102
    
 
103
signals:
 
104
 
 
105
    void spotPositionChangedFromOriginal(const Digikam::DColor &color, const QPoint &position);
 
106
    void spotPositionChangedFromTarget(const Digikam::DColor &color, const QPoint &position);
 
107
    void signalResized();
 
108
 
 
109
protected:
 
110
    
 
111
    void paintEvent(QPaintEvent*);
 
112
    void resizeEvent(QResizeEvent*);
 
113
    void timerEvent(QTimerEvent*);
 
114
    void mousePressEvent(QMouseEvent*);
 
115
    void mouseReleaseEvent(QMouseEvent*);
 
116
    void mouseMoveEvent(QMouseEvent*);
 
117
    void enterEvent(QEvent*);
 
118
    void leaveEvent(QEvent*);
 
119
    
 
120
private:
 
121
 
 
122
    void updatePixmap();
 
123
 
 
124
private:
 
125
 
 
126
    ImageGuideWidgetPriv *d;    
 
127
};
 
128
 
 
129
}  // NameSpace Digikam
 
130
 
 
131
#endif /* IMAGEGUIDEWIDGET_H */