|
Krita Source Code Documentation
|
A widget that can display different KisHistograms. It renders a somewhat smooth shape with different colors (for rgb, cmyk and xyz channels). It can also display the different channels of a colorspace overlapped. More...
#include <KisHistogramView.h>
Inheritance diagram for KisHistogramView:Classes | |
| class | Private |
Public Slots | |
| void | clearChannels () |
| This clears the channel selection. The widget will show a null symbol in it's center when there are no activated channels. | |
| void | setChannel (int channel, int histogramIndex=0) |
| Activates the given channel of the given histogram. This allows to change the view between the different histograms and channels passed to the setup function. | |
| void | setChannels (const QVector< int > &channels, int histogramIndex=0) |
| Activates the given channels of the given histogram. This allows to change the view between the different histograms and channels passed to the setup function. This function activates multiple channels that will be displayed at once in the widget. | |
| void | setDefaultColor (const QColor &newDefaultColor) |
| Set the default color used when there is no preference to color the selected histogram. | |
| void | setLogarithmic (bool logarithmic) |
| Set if the histogram shape being shown is formed by the logarithmic mapping of the original histogram values instead of the values themselves. | |
| void | setScale (qreal newScale) |
| Set the scale used to paint the widget. The scale can also be changed by clicking and dragging up/down in the widget. | |
| void | setScaleToCutLongPeaks () |
| Sometimes there can be some outliers in the histogram that show in the widget as long vertical peaks. Since a scale of 1 will show all the histogram, this can make its interesting parts too small to take any valuable information from them. This function will try to come up with a scale value that favors those interesting parts over the long peaks, which will be pushed and will look cut. | |
| void | setScaleToFit () |
| Set the scale used to paint the widget to 1. You can also return to a scale of 1 by double clicking on the widget if the current scale is other than 1. If you double click when the scale is one the effect will be the same as calling setScaleToCutLongPeaks. | |
Public Member Functions | |
| const QVector< int > & | channels () const |
| Returns the channels that are available for the currently selected histogram. | |
| QColor | defaultColor () const |
| Returns the color that is being used to paint a generic histogram. All the histogram channels will use this color with the exception of the red, green and blue channels in a rgba histogram; the cyan, magenta, yellow and black channels in a cmyka histogram; and the x, y, and z channels in a xyz histogram. | |
| bool | isLogarithmic () const |
| Returns true if the histogram shape being shown is formed by the logarithmic mapping of the original histogram values instead of the values themselves. | |
| KisHistogramView (QWidget *parent) | |
| qreal | scale () const |
| Return the vertical scale that is used to paint the histogram shape. A scale of 1 will show all the histogram in the widget area. Scales less that 1 are not allowed. | |
| void | setup (const QVector< KisHistogram * > &histograms, const QVector< const KoColorSpace * > &colorSpaces, const QVector< QVector< int > > &channels={}) |
| Sets up the widget by passing a collection of KisHistograms, the color space for each histogram and the channels that must be set up for each histogram. | |
| ~KisHistogramView () | |
Protected Member Functions | |
| void | mouseDoubleClickEvent (QMouseEvent *e) override |
| void | mouseMoveEvent (QMouseEvent *e) override |
| void | mousePressEvent (QMouseEvent *e) override |
| void | paintEvent (QPaintEvent *e) override |
Private Attributes | |
| QScopedPointer< Private > | m_d |
A widget that can display different KisHistograms. It renders a somewhat smooth shape with different colors (for rgb, cmyk and xyz channels). It can also display the different channels of a colorspace overlapped.
Definition at line 25 of file KisHistogramView.h.
| KisHistogramView::KisHistogramView | ( | QWidget * | parent | ) |
Definition at line 28 of file KisHistogramView.cpp.
| KisHistogramView::~KisHistogramView | ( | ) |
Definition at line 33 of file KisHistogramView.cpp.
References m_d.
| const QVector< int > & KisHistogramView::channels | ( | ) | const |
Returns the channels that are available for the currently selected histogram.
Definition at line 69 of file KisHistogramView.cpp.
References m_d.
|
slot |
This clears the channel selection. The widget will show a null symbol in it's center when there are no activated channels.
Definition at line 96 of file KisHistogramView.cpp.
References setChannels().
| QColor KisHistogramView::defaultColor | ( | ) | const |
Returns the color that is being used to paint a generic histogram. All the histogram channels will use this color with the exception of the red, green and blue channels in a rgba histogram; the cyan, magenta, yellow and black channels in a cmyka histogram; and the x, y, and z channels in a xyz histogram.
Definition at line 101 of file KisHistogramView.cpp.
References m_d.
| bool KisHistogramView::isLogarithmic | ( | ) | const |
Returns true if the histogram shape being shown is formed by the logarithmic mapping of the original histogram values instead of the values themselves.
Definition at line 144 of file KisHistogramView.cpp.
References m_d.
|
overrideprotected |
Definition at line 211 of file KisHistogramView.cpp.
References m_d, qFuzzyCompare(), scale(), setScaleToCutLongPeaks(), and setScaleToFit().
|
overrideprotected |
Definition at line 245 of file KisHistogramView.cpp.
References m_d, and setScale().
|
overrideprotected |
Definition at line 229 of file KisHistogramView.cpp.
|
overrideprotected |
Definition at line 160 of file KisHistogramView.cpp.
| qreal KisHistogramView::scale | ( | ) | const |
Return the vertical scale that is used to paint the histogram shape. A scale of 1 will show all the histogram in the widget area. Scales less that 1 are not allowed.
Definition at line 116 of file KisHistogramView.cpp.
References m_d.
|
slot |
Activates the given channel of the given histogram. This allows to change the view between the different histograms and channels passed to the setup function.
Definition at line 74 of file KisHistogramView.cpp.
References setChannels().
Activates the given channels of the given histogram. This allows to change the view between the different histograms and channels passed to the setup function. This function activates multiple channels that will be displayed at once in the widget.
Definition at line 79 of file KisHistogramView.cpp.
References channels(), defaultColor(), isLogarithmic(), m_d, and setScaleToFit().
|
slot |
Set the default color used when there is no preference to color the selected histogram.
Definition at line 108 of file KisHistogramView.cpp.
References m_d.
|
slot |
Set if the histogram shape being shown is formed by the logarithmic mapping of the original histogram values instead of the values themselves.
Definition at line 151 of file KisHistogramView.cpp.
References m_d, and setScaleToFit().
|
slot |
Set the scale used to paint the widget. The scale can also be changed by clicking and dragging up/down in the widget.
Definition at line 123 of file KisHistogramView.cpp.
References m_d.
|
slot |
Sometimes there can be some outliers in the histogram that show in the widget as long vertical peaks. Since a scale of 1 will show all the histogram, this can make its interesting parts too small to take any valuable information from them. This function will try to come up with a scale value that favors those interesting parts over the long peaks, which will be pushed and will look cut.
Definition at line 136 of file KisHistogramView.cpp.
References m_d.
|
slot |
Set the scale used to paint the widget to 1. You can also return to a scale of 1 by double clicking on the widget if the current scale is other than 1. If you double click when the scale is one the effect will be the same as calling setScaleToCutLongPeaks.
Definition at line 131 of file KisHistogramView.cpp.
References setScale().
| void KisHistogramView::setup | ( | const QVector< KisHistogram * > & | histograms, |
| const QVector< const KoColorSpace * > & | colorSpaces, | ||
| const QVector< QVector< int > > & | channels = {} ) |
Sets up the widget by passing a collection of KisHistograms, the color space for each histogram and the channels that must be set up for each histogram.
| histograms | A collection of KisHistogram pointers to take the info from. You can add several histograms and later select which histogram is used at any given moment. This prevents calling multiple times the setup function with different histograms. That way the shaped to draw are computed only once. The histogram pointers are not stored or owned internally, so you can safely delete them if you don't need them |
| colorSpaces | The collection of color spaces associated with each histogram. They are used to color different channels. For example, the histogram for the red channel of a rgb histogram will be painted as a red shape |
| channels | A collection of vectors that contain the channel number for the channels that must be used to compute the histograms. For example, if the second histogram is a Lab histogram, and you are interested only in the lightness channel, the second vector in the collection should have only one element, the number 0 (index of the lightness channel). If the collection is empty or if the vector of channels for any given histogram is empty, then all the channels will be used |
Definition at line 38 of file KisHistogramView.cpp.
References channels(), and m_d.
|
private |
Definition at line 168 of file KisHistogramView.h.