|
Krita Source Code Documentation
|
#include <kis_histogram.h>
Inheritance diagram for KisHistogram:Classes | |
| class | Calculations |
Public Member Functions | |
| Calculations | calculations () |
| qint32 | channel () |
| void | computeHistogram () |
| enumHistogramType | getHistogramType () |
| quint32 | getValue (quint8 i) |
| bool | hasSelection () |
| KisHistogram (KisPaintDeviceSP paintdev, const QRect &bounds, KoHistogramProducer *producer, const enumHistogramType type) | |
| KisHistogram (KisPaintLayerSP layer, KoHistogramProducer *producer, const enumHistogramType type) | |
| KoHistogramProducer * | producer () |
| Calculations | selectionCalculations () |
| double | selectionFrom () |
| double | selectionTo () |
| void | setChannel (qint32 channel) |
| void | setHistogramType (enumHistogramType type) |
| void | setNoSelection () |
| void | setProducer (KoHistogramProducer *producer) |
| void | setSelection (double from, double to) |
| void | updateHistogram () |
| virtual | ~KisHistogram () |
Public Member Functions inherited from KisShared | |
| bool | deref () |
| bool | ref () |
| int | refCount () |
| QAtomicInt * | sharedWeakReference () |
Private Member Functions | |
| QVector< Calculations > | calculateForRange (double from, double to) |
| Calculations | calculateSingleRange (int channel, double from, double to) |
| void | dump () |
Private Attributes | |
| QRect | m_bounds |
| qint32 | m_channel {0} |
| QVector< Calculations > | m_completeCalculations |
| const KisPaintDeviceSP | m_paintDevice |
| KoHistogramProducer * | m_producer {nullptr} |
| bool | m_selection {false} |
| QVector< Calculations > | m_selectionCalculations |
| double | m_selFrom {0.0} |
| double | m_selTo {0.0} |
| enumHistogramType | m_type {LINEAR} |
Additional Inherited Members | |
Protected Member Functions inherited from KisShared | |
| KisShared () | |
| ~KisShared () | |
The histogram class computes the histogram data from the specified layer for the specified channel, through the use of a KoHistogramProducer. This class is only for layers and paintdevices. KisImages are not supported, but you can use the mergedImage function to create a paintdevice and feed that to this class.
A Histogram also can have a selection: this is a specific range in the current histogram that will get calculations done on it as well. If the range's begin and end are the same, it is supposed to specify a single bin in the histogram.
The calculations are done in the range 0 - 1, instead of the native range that a pixel might have, so it's not always as precise as it could be. But you can't have it all...
Definition at line 36 of file kis_histogram.h.
| KisHistogram::KisHistogram | ( | KisPaintLayerSP | layer, |
| KoHistogramProducer * | producer, | ||
| const enumHistogramType | type ) |
Definition at line 19 of file kis_histogram.cc.
References KisImage::bounds(), KisBaseNode::image, m_bounds, m_channel, m_producer, m_selection, m_type, producer(), KisWeakSharedPtr< T >::toStrongRef(), and updateHistogram().
| KisHistogram::KisHistogram | ( | KisPaintDeviceSP | paintdev, |
| const QRect & | bounds, | ||
| KoHistogramProducer * | producer, | ||
| const enumHistogramType | type ) |
Definition at line 38 of file kis_histogram.cc.
References bounds, m_bounds, m_channel, m_producer, m_selection, m_type, producer(), and updateHistogram().
|
virtual |
Definition at line 57 of file kis_histogram.cc.
References m_producer.
|
private |
Definition at line 126 of file kis_histogram.cc.
References calculateSingleRange(), calculations(), KoHistogramProducer::channels(), and m_producer.
|
private |
Definition at line 139 of file kis_histogram.cc.
References channel(), KoHistogramProducer::count(), KoHistogramProducer::getBinAt(), KisHistogram::Calculations::m_count, KisHistogram::Calculations::m_high, KisHistogram::Calculations::m_low, KisHistogram::Calculations::m_max, KisHistogram::Calculations::m_mean, KisHistogram::Calculations::m_min, m_producer, KisHistogram::Calculations::m_total, KoHistogramProducer::numberOfBins(), KoHistogramProducer::viewFrom(), and KoHistogramProducer::viewWidth().
| KisHistogram::Calculations KisHistogram::calculations | ( | ) |
The information on the entire view for the current channel
Definition at line 116 of file kis_histogram.cc.
References m_channel, and m_completeCalculations.
|
inline |
Definition at line 148 of file kis_histogram.h.
| void KisHistogram::computeHistogram | ( | ) |
(Re)computes the mathematical information from the information currently in the producer. Needs to be called when you change the selection and want to get that information
Definition at line 98 of file kis_histogram.cc.
References calculateForRange(), dump(), m_completeCalculations, m_producer, m_selection, m_selectionCalculations, m_selFrom, m_selTo, KoHistogramProducer::viewFrom(), and KoHistogramProducer::viewWidth().
|
private |
Definition at line 198 of file kis_histogram.cc.
References calculations(), dbgMath, KisHistogram::Calculations::getHighest(), KisHistogram::Calculations::getLowest(), KisHistogram::Calculations::getMax(), KisHistogram::Calculations::getMean(), KisHistogram::Calculations::getMin(), KisHistogram::Calculations::getTotal(), LINEAR, LOGARITHMIC, m_channel, m_producer, m_type, and KoHistogramProducer::positionToString().
|
inline |
Definition at line 131 of file kis_histogram.h.
|
inline |
Definition at line 127 of file kis_histogram.h.
|
inline |
Definition at line 152 of file kis_histogram.h.
|
inline |
Definition at line 145 of file kis_histogram.h.
| KisHistogram::Calculations KisHistogram::selectionCalculations | ( | ) |
The information on the current selection for the current channel
Definition at line 121 of file kis_histogram.cc.
References m_channel, and m_selectionCalculations.
|
inline |
Definition at line 155 of file kis_histogram.h.
|
inline |
Definition at line 158 of file kis_histogram.h.
|
inline |
Definition at line 141 of file kis_histogram.h.
|
inline |
Definition at line 134 of file kis_histogram.h.
|
inline |
Definition at line 161 of file kis_histogram.h.
|
inline |
Definition at line 137 of file kis_histogram.h.
|
inline |
Sets the current selection
Definition at line 165 of file kis_histogram.h.
| void KisHistogram::updateHistogram | ( | ) |
Updates the information in the producer
Definition at line 62 of file kis_histogram.cc.
References KoHistogramProducer::addRegionToBin(), KoHistogramProducer::channels(), KoHistogramProducer::clear(), KisPaintDevice::colorSpace(), computeHistogram(), m_bounds, m_completeCalculations, m_paintDevice, m_producer, KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nConseqPixels(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixels(), and KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::oldRawData().
|
private |
Definition at line 177 of file kis_histogram.h.
|
private |
Definition at line 181 of file kis_histogram.h.
|
private |
Definition at line 186 of file kis_histogram.h.
|
private |
Definition at line 176 of file kis_histogram.h.
|
private |
Definition at line 178 of file kis_histogram.h.
|
private |
Definition at line 184 of file kis_histogram.h.
|
private |
Definition at line 186 of file kis_histogram.h.
|
private |
Definition at line 182 of file kis_histogram.h.
|
private |
Definition at line 183 of file kis_histogram.h.
|
private |
Definition at line 179 of file kis_histogram.h.