1
/* ============================================================
3
* This file is a part of digiKam project
4
* http://www.digikam.org
7
* Description : a widget to display an image with guides
9
* Copyright (C) 2004-2008 Gilles Caulier <caulier dot gilles at gmail dot com>
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)
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.
22
* ============================================================ */
24
#ifndef IMAGEGUIDEWIDGET_H
25
#define IMAGEGUIDEWIDGET_H
36
#include "digikam_export.h"
45
class ImageGuideWidgetPriv;
47
class DIGIKAM_EXPORT ImageGuideWidget : public QWidget
59
enum RenderingPreviewMode
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.
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);
86
ImageIface* imageIface();
88
QPoint getSpotPosition();
89
DColor getSpotColor(int getColorFrom);
90
void setSpotVisible(bool spotVisible, bool blink=false);
91
int getRenderingPreviewMode();
92
void resetSpotPosition();
97
void slotChangeGuideColor(const QColor &color);
98
void slotChangeGuideSize(int size);
99
void slotChangeRenderingPreviewMode(int mode);
100
void slotToggleUnderExposure(bool);
101
void slotToggleOverExposure(bool);
105
void spotPositionChangedFromOriginal(const Digikam::DColor &color, const QPoint &position);
106
void spotPositionChangedFromTarget(const Digikam::DColor &color, const QPoint &position);
107
void signalResized();
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*);
126
ImageGuideWidgetPriv *d;
129
} // NameSpace Digikam
131
#endif /* IMAGEGUIDEWIDGET_H */