AlbumShaper 1.0a3
histogramInterface.h
Go to the documentation of this file.
1//==============================================
2// copyright : (C) 2003-2005 by Will Stokes
3//==============================================
4// This program is free software; you can redistribute it
5// and/or modify it under the terms of the GNU General
6// Public License as published by the Free Software
7// Foundation; either version 2 of the License, or
8// (at your option) any later version.
9//==============================================
10
11#ifndef GUI_EDITING_HISTOGRAMINTERFACE_H
12#define GUI_EDITING_HISTOGRAMINTERFACE_H
13
14//--------------------
15//forward declarations
16//--------------------
17
18#include <qwidget.h>
19//Added by qt3to4:
20#include <QResizeEvent>
21#include <QMouseEvent>
22#include <QPaintEvent>
23
32
34typedef enum
35{
39
40//=====================================
43//=====================================
45{
46Q_OBJECT
47
48public:
50 HistogramInterface( QString imageFilename,
51 QWidget *parent=0,
52 const char* name=0);
53
56
59
60 virtual QSize minimumSizeHint() const;
61
63 void getHistBoundaries(int &lumLeft, int &lumRight,
64 int &redLeft, int &redRight,
65 int &greenLeft, int &greenRight,
66 int &blueLeft, int &blueRight);
67
69 void resetBoundaries();
70 //----------------------
71protected:
72 void paintEvent( QPaintEvent *e);
73 void resizeEvent( QResizeEvent * );
74 void mousePressEvent( QMouseEvent *e);
75 void mouseReleaseEvent( QMouseEvent *);
76 void mouseMoveEvent( QMouseEvent *e);
77 //----------------------
78signals:
80 //----------------------
81private slots:
82 //selects entire range of current channel
83 void selectAll();
84 //----------------------
85private:
87 void getSelectedRange( int &left, int &right );
88
90 double displayToIndex(int val);
91
93 int indexToDisplay(int val);
94
96 bool nearBoundary( QPoint p );
97
100
102 int redVals[256];
103 int greenVals[256];
104 int blueVals[256];
105 int grayVals[256];
106
109
115
118
121
125//----------------------
126};
127//======================
128
129#endif //GUI_EDITING_HISTOGRAMINTERFACE_H
DISPLAYED_CHANNEL displayedChannel
Currently displayed channel.
void mousePressEvent(QMouseEvent *e)
void selectedRangeChanged()
int redVals[256]
color and luminosity histograms
QSize origImageSize
original image dimensions, needed for painting
bool nearBoundary(QPoint p)
determines if mouse is near boundary
HistogramInterface(QString imageFilename, QWidget *parent=0, const char *name=0)
Creates layout.
void resizeEvent(QResizeEvent *)
void mouseMoveEvent(QMouseEvent *e)
DRAG_MODE dragMode
effect of mouse drags
double displayToIndex(int val)
convert screen coordinate to index in 0-255 range
void setDisplayChannel(DISPLAYED_CHANNEL channel)
Sets currently displayed channel.
DRAG_MODE currentMouseShape
current mouse shape.
int indexToDisplay(int val)
converts index in 0-255 ranges to screen coordinate
void resetBoundaries()
resets all boundaries
void mouseReleaseEvent(QMouseEvent *)
void getSelectedRange(int &left, int &right)
this utility function finds currently selected range
int maxRcount
max r,g,b, and gray counts
~HistogramInterface()
Deletes objects.
void getHistBoundaries(int &lumLeft, int &lumRight, int &redLeft, int &redRight, int &greenLeft, int &greenRight, int &blueLeft, int &blueRight)
returns histogram boundaries
virtual QSize minimumSizeHint() const
int lumClick
left and right bounds for each channel
void paintEvent(QPaintEvent *e)
DISPLAYED_CHANNEL
chanel histogram displays
@ LUMINOSITY
DRAG_MODE
current drag mode, effect of mouse movement on selected range
@ NO_EFFECT