|
Krita Source Code Documentation
|
A class that can render different KisHistograms. It renders a somewhat smooth shape (with different colors for rgb, cmyk and xyz channels). It can also render the different channels of a colorspace overlapped. More...
#include <KisHistogramPainter.h>
Classes | |
| class | Private |
Public Member Functions | |
| QList< int > | availableChannels () const |
| Get a list containing all the indices of the channels that were setup using the "setup" function. | |
| const QVector< int > & | channels () const |
| Get the list of channels that are currently activated (the only ones that will be painted) | |
| 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 painted is formed by the logarithmic mapping of the original histogram values instead of the values themselves. | |
| KisHistogramPainter () | |
| QImage | paint (const QSize &imageSize) |
| Returns a RGBA image of size "imageSize" with the result of rendering the selected histogram channels on it. | |
| QImage | paint (int w, int h) |
| Returns a RGBA image of size "w"x"h" with the result of rendering the selected histogram channels on it. | |
| void | paint (QPainter &painter, const QRect &rect) |
| Paints the selected histogram channels in the given rect using the given painter. | |
| qreal | scale () const |
| Return the vertical scale that is used to paint the histogram shape. A scale of 1 will paint all the histogram in the given rect. Scales less that 1 are not allowed. | |
| void | setChannel (int channel) |
| Set currently active channel (the one that will be painted) | |
| void | setChannels (const QVector< int > &channels) |
| Set currently active channels (the ones that will be painted) | |
| void | setDefaultColor (const QColor &newDefaultColor) |
| Set the default color used when there is no preference to color the selected histogram channel. | |
| 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 histograms. | |
| void | setScaleToCutLongPeaks () |
| Sometimes there can be some outliers in the histogram that show in the painted shape 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 histograms to 1. | |
| void | setup (KisHistogram *histogram, const KoColorSpace *colorSpace, QVector< int > channels={}) |
| Sets up the painter by passing a KisHistogram, the color space for the histogram and the channels that must be set up for it. | |
| int | totalNumberOfAvailableChannels () const |
| Get the number of channels that are being used. It can be less than the total number of channels in the KisHistogram. This can be set by using the setup function. | |
| ~KisHistogramPainter () | |
Private Attributes | |
| QScopedPointer< Private > | m_d |
A class that can render different KisHistograms. It renders a somewhat smooth shape (with different colors for rgb, cmyk and xyz channels). It can also render the different channels of a colorspace overlapped.
Definition at line 27 of file KisHistogramPainter.h.
| KisHistogramPainter::KisHistogramPainter | ( | ) |
Definition at line 289 of file KisHistogramPainter.cpp.
References m_d.
| KisHistogramPainter::~KisHistogramPainter | ( | ) |
Definition at line 295 of file KisHistogramPainter.cpp.
| QList< int > KisHistogramPainter::availableChannels | ( | ) | const |
Get a list containing all the indices of the channels that were setup using the "setup" function.
Definition at line 366 of file KisHistogramPainter.cpp.
References m_d.
| const QVector< int > & KisHistogramPainter::channels | ( | ) | const |
Get the list of channels that are currently activated (the only ones that will be painted)
Definition at line 371 of file KisHistogramPainter.cpp.
References m_d.
| QColor KisHistogramPainter::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 386 of file KisHistogramPainter.cpp.
References m_d.
| bool KisHistogramPainter::isLogarithmic | ( | ) | const |
Returns true if the histogram shape being painted is formed by the logarithmic mapping of the original histogram values instead of the values themselves.
Definition at line 444 of file KisHistogramPainter.cpp.
References m_d.
| QImage KisHistogramPainter::paint | ( | const QSize & | imageSize | ) |
| QImage KisHistogramPainter::paint | ( | int | w, |
| int | h ) |
Returns a RGBA image of size "w"x"h" with the result of rendering the selected histogram channels on it.
Definition at line 350 of file KisHistogramPainter.cpp.
References paint().
| void KisHistogramPainter::paint | ( | QPainter & | painter, |
| const QRect & | rect ) |
Paints the selected histogram channels in the given rect using the given painter.
Definition at line 355 of file KisHistogramPainter.cpp.
References m_d.
| qreal KisHistogramPainter::scale | ( | ) | const |
Return the vertical scale that is used to paint the histogram shape. A scale of 1 will paint all the histogram in the given rect. Scales less that 1 are not allowed.
Definition at line 396 of file KisHistogramPainter.cpp.
References m_d.
| void KisHistogramPainter::setChannel | ( | int | channel | ) |
Set currently active channel (the one that will be painted)
Definition at line 376 of file KisHistogramPainter.cpp.
References setChannels().
Set currently active channels (the ones that will be painted)
Definition at line 381 of file KisHistogramPainter.cpp.
References channels(), and m_d.
| void KisHistogramPainter::setDefaultColor | ( | const QColor & | newDefaultColor | ) |
Set the default color used when there is no preference to color the selected histogram channel.
Definition at line 391 of file KisHistogramPainter.cpp.
References m_d.
| void KisHistogramPainter::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.
Definition at line 449 of file KisHistogramPainter.cpp.
References m_d.
| void KisHistogramPainter::setScale | ( | qreal | newScale | ) |
Set the scale used to paint the histograms.
Definition at line 401 of file KisHistogramPainter.cpp.
References m_d.
| void KisHistogramPainter::setScaleToCutLongPeaks | ( | ) |
Sometimes there can be some outliers in the histogram that show in the painted shape 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 411 of file KisHistogramPainter.cpp.
References isLogarithmic(), m_d, and setScale().
| void KisHistogramPainter::setScaleToFit | ( | ) |
Set the scale used to paint the histograms to 1.
Definition at line 406 of file KisHistogramPainter.cpp.
References setScale().
| void KisHistogramPainter::setup | ( | KisHistogram * | histogram, |
| const KoColorSpace * | colorSpace, | ||
| QVector< int > | channels = {} ) |
Sets up the painter by passing a KisHistogram, the color space for the histogram and the channels that must be set up for it.
| histogram | A KisHistogram pointer to take the info from. The histogram pointer is not stored or owned internally, so you can safely delete it if you don't need it |
| colorSpaces | The color space associated with the histogram. It is 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 that contains the channel indices for the channels that must be used to compute the histogram. For example, if the histogram is a Lab histogram, and you are interested only in the lightness channel, the vector should have only one element, the number 0 (index of the lightness channel). If the collection is empty, then all the channels will be used |
Definition at line 298 of file KisHistogramPainter.cpp.
References KisHistogramPainter::Private::bestCutOffHeight(), KisHistogram::calculations(), KoColorSpace::channelCount(), channels(), KisHistogramPainter::Private::computeChannelPaintingInfo(), KisHistogramPainter::Private::computeHistogramShape(), KisHistogram::Calculations::getHighest(), m_d, KisHistogram::setChannel(), KisHistogramPainter::Private::simplifyHistogramShape(), and KisHistogramPainter::Private::smoothHistogramShape().
| int KisHistogramPainter::totalNumberOfAvailableChannels | ( | ) | const |
Get the number of channels that are being used. It can be less than the total number of channels in the KisHistogram. This can be set by using the setup function.
Definition at line 361 of file KisHistogramPainter.cpp.
References m_d.
|
private |
Definition at line 165 of file KisHistogramPainter.h.