chalk

kis_histogram_view.h
1/*
2 * Copyright (c) 2005 Bart Coppens <kde@bartcoppens.be>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef _KIS_HISTOGRAM_VIEW_
20#define _KIS_HISTOGRAM_VIEW_
21
22#include <tqlabel.h>
23#include <tqpixmap.h>
24#include <tqvaluevector.h>
25#include <tqstringlist.h>
26
27#include "kis_types.h"
28#include "kis_histogram_producer.h"
29#include "kis_histogram.h"
30
31class KisChannelInfo;
32
48class KisHistogramView : public TQLabel {
49 TQ_OBJECT
50
51public:
52 KisHistogramView(TQWidget *parent = 0, const char *name = 0, WFlags f = 0);
53 virtual ~KisHistogramView();
54
55 void setPaintDevice(KisPaintDeviceSP dev);
56 void setHistogram(KisHistogramSP histogram);
57 void setView(double from, double size);
58 KisHistogramProducerSP currentProducer();
59 TQStringList channelStrings();
61 KisIDList listProducers();
63 void setCurrentChannels(const KisID& producerID, TQValueVector<KisChannelInfo *> channels);
65 void setCurrentChannels(KisHistogramProducerSP producer, TQValueVector<KisChannelInfo *> channels);
66 bool hasColor();
67 void setColor(bool set);
68
69public slots:
70 void setActiveChannel(int channel);
71 void setHistogramType(enumHistogramType type);
72 void updateHistogram();
73
74signals:
75 void rightClicked(const TQPoint& pos);
76
77protected:
78 virtual void mousePressEvent(TQMouseEvent * e);
79
80private:
81 void setChannels();
82 void addProducerChannels(KisHistogramProducerSP producer);
83
84 typedef struct {
85 bool isProducer;
86 KisHistogramProducerSP producer;
87 KisChannelInfo * channel;
88 } ComboboxInfo;
89
90 TQValueVector<ComboboxInfo> m_comboInfo;
91 TQPixmap m_pix;
92 KisHistogramSP m_histogram;
93 KisColorSpace* m_cs;
94 KisHistogramProducerSP m_currentProducer;
95 TQValueVector<KisChannelInfo *> m_channels;
96 // Maps the channels in m_channels to a real channel offset in the producer->channels()
97 TQValueVector<TQ_INT32> m_channelToOffset;
98 TQStringList m_channelStrings;
99 bool m_color;
100 double m_from;
101 double m_width;
102};
103
104#endif // _KIS_HISTOGRAM_VIEW_
This class gives some basic information about a channel, that is, one of the components that makes up...
A colorspace is the definition of a certain color model in Chalk.
KisIDList listProducers()
Lists all producers currently available.
void setCurrentChannels(const KisID &producerID, TQValueVector< KisChannelInfo * > channels)
Sets the currently displayed channels to channels of the producer with producerID as ID.
Chalk has a large number of extensible resources.
Definition kis_id.h:57