digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::HistogramPainter Class Reference

A class that paints a histogram on a QPixmap. More...

+ Inheritance diagram for Digikam::HistogramPainter:

Public Member Functions

 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.
 

Detailed Description

Note
Before first usage of the render method, you must call initFrom() to initialize the painter.

Constructor & Destructor Documentation

◆ HistogramPainter()

Digikam::HistogramPainter::HistogramPainter ( QObject *const  parent)
explicit
Parameters
parentthe parent for Qt's destruction mechanism

Member Function Documentation

◆ enableHistogramGuideByColor()

void Digikam::HistogramPainter::enableHistogramGuideByColor ( const DColor color)
Parameters
colorthe 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
widgetthe 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
paintDevicepixmap to paint the histogram on

◆ setChannelType()

void Digikam::HistogramPainter::setChannelType ( ChannelType  channelType)
Parameters
channelTypechannel type to render

◆ setHighlightSelection()

void Digikam::HistogramPainter::setHighlightSelection ( bool  highlightSelection)

The selection must be defined with setHighlightSelection.

Parameters
highlightSelectionif true, a selection will be highlighted

◆ setHistogram()

void Digikam::HistogramPainter::setHistogram ( ImageHistogram *const  histogram)
Parameters
histograman 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
renderXGridif true, a separation at some significant value in x direction is rendered.

◆ setScale()

void Digikam::HistogramPainter::setScale ( HistogramScale  scale)
Parameters
scalescal to paint histogram with

◆ setSelection()

void Digikam::HistogramPainter::setSelection ( double  selectionMin,
double  selectionMax 
)
Parameters
selectionMin0 <= value <= 1, percent of the histogram width to start highlighting as percent. Ensure that this value is smaller then selectionMax.
selectionMax0 <= value <= 1, percent of the histogram width to end highlighting as percent. Ensure that this value is greater then selectionMin.