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

Public Slots

void slotClearActiveSelection ()
 
void slotClearHighlight ()
 
void slotSetHighlightArea (float tl_x, float tl_y, float br_x, float br_y)
 
void slotSetHighlightShown (int percentage, const QColor &highLightColor=Qt::white)
 
void slotSetSelection (float tl_x, float tl_y, float br_x, float br_y)
 
void slotZoom2Fit ()
 
void slotZoomIn ()
 
void slotZoomOut ()
 
void slotSetTLX (float ratio)
 Selection area specific slots (TL = TopLeft, BR = BottomRight) More...
 
void slotSetTLY (float ratio)
 
void slotSetBRX (float ratio)
 
void slotSetBRY (float ratio)
 

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)
 
 ~DPreviewImage () override
 

Protected Member Functions

void enterEvent (QEvent *) 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
 

Constructor & Destructor Documentation

◆ DPreviewImage()

Digikam::DPreviewImage::DPreviewImage ( QWidget *const  parent)
explicit

◆ ~DPreviewImage()

Digikam::DPreviewImage::~DPreviewImage ( )
override

Member Function Documentation

◆ enableSelectionArea()

void Digikam::DPreviewImage::enableSelectionArea ( bool  b)

◆ enterEvent()

void Digikam::DPreviewImage::enterEvent ( QEvent *  )
overrideprotected

◆ eventFilter()

bool Digikam::DPreviewImage::eventFilter ( QObject *  obj,
QEvent *  ev 
)
overrideprotected

◆ getSelectionArea()

QRectF Digikam::DPreviewImage::getSelectionArea ( ) const

◆ leaveEvent()

void Digikam::DPreviewImage::leaveEvent ( QEvent *  )
overrideprotected

◆ load()

bool Digikam::DPreviewImage::load ( const QUrl &  file) const

◆ mouseMoveEvent()

◆ mousePressEvent()

void Digikam::DPreviewImage::mousePressEvent ( QMouseEvent *  e)
overrideprotected

◆ mouseReleaseEvent()

void Digikam::DPreviewImage::mouseReleaseEvent ( QMouseEvent *  e)
overrideprotected

◆ resizeEvent()

void Digikam::DPreviewImage::resizeEvent ( QResizeEvent *  e)
overrideprotected

◆ setImage()

bool Digikam::DPreviewImage::setImage ( const QImage &  img) const

Referenced by load().

◆ setSelectionArea()

void Digikam::DPreviewImage::setSelectionArea ( const QRectF &  rectangle)

Sets a selection area and show it

Parameters
rectangleThis rectangle should have height and width of 1.0

◆ slotClearActiveSelection

void Digikam::DPreviewImage::slotClearActiveSelection ( )
slot

Referenced by mouseReleaseEvent().

◆ slotClearHighlight

void Digikam::DPreviewImage::slotClearHighlight ( )
slot

This function removes the highlight area.

◆ slotSetBRX

void Digikam::DPreviewImage::slotSetBRX ( float  ratio)
slot

References updateSelVisibility().

◆ slotSetBRY

void Digikam::DPreviewImage::slotSetBRY ( float  ratio)
slot

References updateSelVisibility().

◆ slotSetHighlightArea

void Digikam::DPreviewImage::slotSetHighlightArea ( float  tl_x,
float  tl_y,
float  br_x,
float  br_y 
)
slot

This function is used to darken everything except what is inside the given area.

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

This function sets the percentage of the highlighted area that is visible. The rest is hidden. This stacks with the previous highlight area.

Parameters
percentageis the percentage of the highlighted area that is shown.
hideColoris 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

This function is used to set a selection without the user setting it.

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.

References updateSelVisibility().

◆ slotSetTLX

void Digikam::DPreviewImage::slotSetTLX ( float  ratio)
slot

Selection area specific slots (TL = TopLeft, BR = BottomRight)

References updateSelVisibility().

◆ slotSetTLY

void Digikam::DPreviewImage::slotSetTLY ( float  ratio)
slot

References updateSelVisibility().

◆ slotZoom2Fit

void Digikam::DPreviewImage::slotZoom2Fit ( )
slot

Referenced by DPreviewImage().

◆ slotZoomIn

void Digikam::DPreviewImage::slotZoomIn ( )
slot

Referenced by DPreviewImage(), and wheelEvent().

◆ slotZoomOut

void Digikam::DPreviewImage::slotZoomOut ( )
slot

Referenced by DPreviewImage(), and wheelEvent().

◆ updateHighlight()

void Digikam::DPreviewImage::updateHighlight ( )
protected

◆ updateSelVisibility()

void Digikam::DPreviewImage::updateSelVisibility ( )
protected

◆ wheelEvent()

void Digikam::DPreviewImage::wheelEvent ( QWheelEvent *  e)
overrideprotected

References slotZoomIn(), and slotZoomOut().


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