krita
kis_histogram_view.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _KIS_HISTOGRAM_VIEW_
00020 #define _KIS_HISTOGRAM_VIEW_
00021
00022 #include <qlabel.h>
00023 #include <qpixmap.h>
00024 #include <qvaluevector.h>
00025 #include <qstringlist.h>
00026
00027 #include "kis_types.h"
00028 #include "kis_histogram_producer.h"
00029 #include "kis_histogram.h"
00030
00031 class KisChannelInfo;
00032
00048 class KisHistogramView : public QLabel {
00049 Q_OBJECT
00050 public:
00051 KisHistogramView(QWidget *parent = 0, const char *name = 0, WFlags f = 0);
00052 virtual ~KisHistogramView();
00053
00054 void setPaintDevice(KisPaintDeviceSP dev);
00055 void setHistogram(KisHistogramSP histogram);
00056 void setView(double from, double size);
00057 KisHistogramProducerSP currentProducer();
00058 QStringList channelStrings();
00060 KisIDList listProducers();
00062 void setCurrentChannels(const KisID& producerID, QValueVector<KisChannelInfo *> channels);
00064 void setCurrentChannels(KisHistogramProducerSP producer, QValueVector<KisChannelInfo *> channels);
00065 bool hasColor();
00066 void setColor(bool set);
00067
00068 public slots:
00069 void setActiveChannel(int channel);
00070 void setHistogramType(enumHistogramType type);
00071 void updateHistogram();
00072
00073 signals:
00074 void rightClicked(const QPoint& pos);
00075
00076 protected:
00077 virtual void mousePressEvent(QMouseEvent * e);
00078
00079 private:
00080 void setChannels();
00081 void addProducerChannels(KisHistogramProducerSP producer);
00082
00083 typedef struct {
00084 bool isProducer;
00085 KisHistogramProducerSP producer;
00086 KisChannelInfo * channel;
00087 } ComboboxInfo;
00088
00089 QValueVector<ComboboxInfo> m_comboInfo;
00090 QPixmap m_pix;
00091 KisHistogramSP m_histogram;
00092 KisColorSpace* m_cs;
00093 KisHistogramProducerSP m_currentProducer;
00094 QValueVector<KisChannelInfo *> m_channels;
00095
00096 QValueVector<Q_INT32> m_channelToOffset;
00097 QStringList m_channelStrings;
00098 bool m_color;
00099 double m_from;
00100 double m_width;
00101 };
00102
00103 #endif // _KIS_HISTOGRAM_VIEW_
|