23#include "kis_colorspace.h"
24#include "kis_histogram_producer.h"
26enum enumHistogramType {
52 double m_max, m_min, m_mean, m_total, m_median, m_stddev;
54 TQ_UINT32 m_high, m_low, m_count;
60 Calculations() : m_max(0.0), m_min(0.0), m_mean(0.0), m_total(0.0), m_median(0.0),
61 m_stddev(0.0), m_high(0), m_low(0), m_count(0) {}
66 inline double getMax() { return m_max; }
71 inline double getMin() { return m_min; }
77 inline double getMean() { return m_mean; }
81 inline TQ_UINT32 getCount() { return m_count; }
88 KisHistogramProducerSP producer,
89 const enumHistogramType type);
92 KisHistogramProducerSP producer,
93 const enumHistogramType type);
111 inline TQ_UINT32 getValue(TQ_UINT8 i) { return m_producer->getBinAt(m_channel, i); }
113 inline enumHistogramType getHistogramType() { return m_type; }
114 inline void setHistogramType(enumHistogramType type) { m_type = type; }
115 inline void setProducer(KisHistogramProducerSP producer) { m_producer = producer; }
116 inline void setChannel(TQ_INT32 channel) { m_channel = channel; }
117 inline KisHistogramProducerSP producer() { return m_producer; }
118 inline TQ_INT32 channel() { return m_channel; }
120 inline bool hasSelection() { return m_selection; }
121 inline double selectionFrom() { return m_selFrom; }
122 inline double selectionTo() { return m_selTo; }
123 inline void setNoSelection() { m_selection = false; }
126 { m_selection = true; m_selFrom = from; m_selTo = to; }
132 TQValueVector<Calculations> calculateForRange( double from, double to);
133 Calculations calculateSingleRange( int channel, double from, double to);
135 KisPaintDeviceSP m_device;
136 KisHistogramProducerSP m_producer;
138 enumHistogramType m_type;
141 double m_selFrom, m_selTo;
144 KisPaintDeviceSP m_dev;
146 TQValueVector<Calculations> m_completeCalculations, m_selectionCalculations;
Class that stores the result of histogram calculations.
double getMean() This function return the mean of value of the histogram.
double getMax() This function return the maximum bound of the histogram (values at greater position than the maximum ...
TQ_UINT32 getHighest() This function return the highest value of the histogram.
TQ_UINT32 getLowest() This function return the lowest value of the histogram.
double getTotal() The sum of (the contents of every bin * the double value of that bin)
double getMin() This function return the minimum bound of the histogram (values at smaller position than the minimum ...
TQ_UINT32 getCount() This function return the number of pixels used by the histogram.
The histogram class computes the histogram data from the specified layer for the specified channel,...
Calculations selectionCalculations() The information on the current selection for the current channel.
void setSelection(double from, double to) Sets the current selection.
void computeHistogram() (Re)computes the mathematical information from the information currently in the producer.
Calculations calculations() The information on the entire view for the current channel.
void updateHistogram() Updates the information in the producer.
|