digiKam
Digikam::HistogramPainter Class Reference
+ Inheritance diagram for Digikam::HistogramPainter:

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ HistogramPainter()

Digikam::HistogramPainter::HistogramPainter ( QObject *const  parent)
explicit

Constructor.

Parameters
parentthe parent for Qt's destruction mechanism

◆ ~HistogramPainter()

Digikam::HistogramPainter::~HistogramPainter ( )
override

Destructor.

Member Function Documentation

◆ disableHistogramGuide()

void Digikam::HistogramPainter::disableHistogramGuide ( )

Disables the rendering of the color guide.

◆ enableHistogramGuideByColor()

void Digikam::HistogramPainter::enableHistogramGuideByColor ( const DColor color)

Starts rendering a guide that indicates where in the histogram a specified color can be found.

Parameters
colorthe color to highlight in the histogram

◆ initFrom()

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!!!

Parameters
widgetthe widget to initialize painting from

◆ render()

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.

Parameters
paintDevicepixmap to paint the histogram on

References Digikam::ColorChannels.

◆ setChannelType()

void Digikam::HistogramPainter::setChannelType ( ChannelType  channelType)

Set the channel type to render with the next call to render.

Parameters
channelTypechannel type to render

◆ setHighlightSelection()

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.

Parameters
highlightSelectionif true, a selection will be highlighted

◆ setHistogram()

void Digikam::HistogramPainter::setHistogram ( ImageHistogram *const  histogram)

Set the histogram to paint with the next call to render.

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)

Decide whether to render a separation of the histogram in x direction.

Parameters
renderXGridif true, a separation at some significant value in x direction is rendered.

◆ setScale()

void Digikam::HistogramPainter::setScale ( HistogramScale  scale)

Set the scale to paint the histogram with.

Parameters
scalescal to paint histogram with

◆ setSelection()

void Digikam::HistogramPainter::setSelection ( double  selectionMin,
double  selectionMax 
)

Sets the selection to highlight.

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.

The documentation for this class was generated from the following files: