A class that paints a histogram on a QPixmap.
More...
|
| HistogramPainter (QObject *const parent) |
| Constructor.
|
|
| ~HistogramPainter () override |
| Destructor.
|
|
void | disableHistogramGuide () |
| Disables the rendering of the color guide.
|
|
void | enableHistogramGuideByColor (const DColor &color) |
| Starts rendering a guide that indicates where in the histogram a specified color can be found.
|
|
void | initFrom (QWidget *const widget) |
| Stores a widget that is used to initialize the painter used in the next call to render.
|
|
void | render (QPixmap &paintDevice) |
| Renders the given histogram on the pixmap.
|
|
void | setChannelType (ChannelType channelType) |
| Set the channel type to render with the next call to render.
|
|
void | setHighlightSelection (bool highlightSelection) |
| Decide whether to highlight a specified selection in the histogram or not.
|
|
void | setHistogram (ImageHistogram *const histogram) |
| Set the histogram to paint with the next call to render.
|
|
void | setRenderXGrid (bool renderXGrid) |
| Decide whether to render a separation of the histogram in x direction.
|
|
void | setScale (HistogramScale scale) |
| Set the scale to paint the histogram with.
|
|
void | setSelection (double selectionMin, double selectionMax) |
| Sets the selection to highlight.
|
|
- Note
- Before first usage of the render method, you must call initFrom() to initialize the painter.
◆ HistogramPainter()
Digikam::HistogramPainter::HistogramPainter |
( |
QObject *const |
parent | ) |
|
|
explicit |
- Parameters
-
parent | the parent for Qt's destruction mechanism |
◆ enableHistogramGuideByColor()
void Digikam::HistogramPainter::enableHistogramGuideByColor |
( |
const DColor & |
color | ) |
|
- Parameters
-
color | the color to highlight in the histogram |
◆ initFrom()
void Digikam::HistogramPainter::initFrom |
( |
QWidget *const |
widget | ) |
|
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!!!
- Parameters
-
widget | the widget to initialize painting from |
◆ render()
void Digikam::HistogramPainter::render |
( |
QPixmap & |
paintDevice | ) |
|
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.
- Parameters
-
paintDevice | pixmap to paint the histogram on |
◆ setChannelType()
void Digikam::HistogramPainter::setChannelType |
( |
ChannelType |
channelType | ) |
|
- Parameters
-
channelType | channel type to render |
◆ setHighlightSelection()
void Digikam::HistogramPainter::setHighlightSelection |
( |
bool |
highlightSelection | ) |
|
The selection must be defined with setHighlightSelection.
- Parameters
-
highlightSelection | if true, a selection will be highlighted |
◆ setHistogram()
void Digikam::HistogramPainter::setHistogram |
( |
ImageHistogram *const |
histogram | ) |
|
- Parameters
-
histogram | an existing pointer to a histogram to paint on next call to render. The histogram must still exist at that call. |
◆ setRenderXGrid()
void Digikam::HistogramPainter::setRenderXGrid |
( |
bool |
renderXGrid | ) |
|
- Parameters
-
renderXGrid | if true, a separation at some significant value in x direction is rendered. |
◆ setScale()
- Parameters
-
scale | scal to paint histogram with |
◆ setSelection()
void Digikam::HistogramPainter::setSelection |
( |
double |
selectionMin, |
|
|
double |
selectionMax |
|
) |
| |
- Parameters
-
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. |