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

Public Slots

void slotClearActiveSelection ()
void slotClearHighlight ()
 This function removes the highlight area.
void slotSetHighlightArea (float tl_x, float tl_y, float br_x, float br_y)
 This function is used to darken everything except what is inside the given area.
void slotSetHighlightShown (int percentage, const QColor &highLightColor=Qt::white)
 This function sets the percentage of the highlighted area that is visible.
void slotSetSelection (float tl_x, float tl_y, float br_x, float br_y)
 This function is used to set a selection without the user setting it.
void slotZoom2Fit ()
void slotZoomIn ()
void slotZoomOut ()
void slotSetTLX (float ratio)
 Selection area specific slots (TL = TopLeft, BR = BottomRight).
void slotSetTLY (float ratio)
void slotSetBRX (float ratio)
void slotSetBRY (float ratio)

Signals

void signalSelectionChanged (const QRectF &)

Public Member Functions

 DPreviewImage (QWidget *const parent)
void enableSelectionArea (bool b)
QRectF getSelectionArea () const
bool load (const QUrl &file) const
bool setImage (const QImage &img) const
void setSelectionArea (const QRectF &rectangle)
 Sets a selection area and show it.

Protected Member Functions

void enterEvent (QEnterEvent *) override
bool eventFilter (QObject *, QEvent *) override
void leaveEvent (QEvent *) override
void mouseMoveEvent (QMouseEvent *) override
void mousePressEvent (QMouseEvent *) override
void mouseReleaseEvent (QMouseEvent *) override
void resizeEvent (QResizeEvent *) override
void updateHighlight ()
void updateSelVisibility ()
void wheelEvent (QWheelEvent *) override

Member Function Documentation

◆ setSelectionArea()

void Digikam::DPreviewImage::setSelectionArea ( const QRectF & rectangle)
Parameters
rectangleThis rectangle should have height and width of 1.0

◆ slotSetHighlightArea

void Digikam::DPreviewImage::slotSetHighlightArea ( float tl_x,
float tl_y,
float br_x,
float br_y )
slot
Note
all parameters must be in the range 0.0 -> 1.0.
Parameters
tl_xis the x coordinate of the top left corner 0=0 1=image with.
tl_yis the y coordinate of the top left corner 0=0 1=image height.
br_xis the x coordinate of the bottom right corner 0=0 1=image with.
br_yis the y coordinate of the bottom right corner 0=0 1=image height.

◆ slotSetHighlightShown

void Digikam::DPreviewImage::slotSetHighlightShown ( int percentage,
const QColor & highLightColor = Qt::white )
slot

The rest is hidden. This stacks with the previous highlight area.

Parameters
percentageis the percentage of the highlighted area that is shown.
highLightColoris the color to use to hide the highlighted area of the image.

◆ slotSetSelection

void Digikam::DPreviewImage::slotSetSelection ( float tl_x,
float tl_y,
float br_x,
float br_y )
slot
Note
all parameters must be in the range 0.0 -> 1.0.
Parameters
tl_xis the x coordinate of the top left corner 0=0 1=image with.
tl_yis the y coordinate of the top left corner 0=0 1=image height.
br_xis the x coordinate of the bottom right corner 0=0 1=image with.
br_yis the y coordinate of the bottom right corner 0=0 1=image height.