digiKam
|
Public Member Functions | |
void | disableHistogramGuide () |
void | enableHistogramGuideByColor (const DColor &color) |
HistogramPainter (QObject *const parent) | |
void | initFrom (QWidget *const widget) |
void | render (QPixmap &paintDevice) |
void | setChannelType (ChannelType channelType) |
void | setHighlightSelection (bool highlightSelection) |
void | setHistogram (ImageHistogram *const histogram) |
void | setRenderXGrid (bool renderXGrid) |
void | setScale (HistogramScale scale) |
void | setSelection (double selectionMin, double selectionMax) |
~HistogramPainter () override | |
A class that paints a histogram on a QPixmap.
Warning: before first usage of the render method, you must call initFrom() to initialize the painter.
|
explicit |
Constructor.
parent | the parent for Qt's destruction mechanism |
|
override |
Destructor.
void Digikam::HistogramPainter::disableHistogramGuide | ( | ) |
Disables the rendering of the color guide.
void Digikam::HistogramPainter::enableHistogramGuideByColor | ( | const DColor & | color | ) |
Starts rendering a guide that indicates where in the histogram a specified color can be found.
color | the color to highlight in the histogram |
void Digikam::HistogramPainter::initFrom | ( | QWidget *const | widget | ) |
Stores a widget that is used to initialize the painter used in the next call to render. Therefore you must ensure that this widget will not be destroyed as long as you want to use the render method without a new call to this method!!!
widget | the widget to initialize painting from |
void Digikam::HistogramPainter::render | ( | QPixmap & | paintDevice | ) |
Renders the given histogram on the pixmap. The whole size of the pixmap is used for the histogram.
You must ensure that once before using this method a call to initFrom was made and the widget given in that call is still present.
paintDevice | pixmap to paint the histogram on |
References Digikam::ColorChannels.
void Digikam::HistogramPainter::setChannelType | ( | ChannelType | channelType | ) |
Set the channel type to render with the next call to render.
channelType | channel type to render |
void Digikam::HistogramPainter::setHighlightSelection | ( | bool | highlightSelection | ) |
Decide whether to highlight a specified selection in the histogram or not. The selection must be defined with setHighlightSelection.
highlightSelection | if true, a selection will be highlighted |
void Digikam::HistogramPainter::setHistogram | ( | ImageHistogram *const | histogram | ) |
Set the histogram to paint with the next call to render.
histogram | an existing pointer to a histogram to paint on next call to render. The histogram must still exist at that call. |
void Digikam::HistogramPainter::setRenderXGrid | ( | bool | renderXGrid | ) |
Decide whether to render a separation of the histogram in x direction.
renderXGrid | if true, a separation at some significant value in x direction is rendered. |
void Digikam::HistogramPainter::setScale | ( | HistogramScale | scale | ) |
Set the scale to paint the histogram with.
scale | scal to paint histogram with |
void Digikam::HistogramPainter::setSelection | ( | double | selectionMin, |
double | selectionMax | ||
) |
Sets the selection to highlight.
selectionMin | 0 <= value <= 1, percent of the histogram width to start highlighting as percent. Ensure that this value is smaller then selectionMax. |
selectionMax | 0 <= value <= 1, percent of the histogram width to end highlighting as percent. Ensure that this value is greater then selectionMin. |