iVS3D v2.0.0
Loading...
Searching...
No Matches
VideoPlayer Class Reference

The VideoPlayer class provides a view to display images and holds buttons to interact with image sequences.
These buttons are: More...

#include <videoplayer.h>

Inheritance diagram for VideoPlayer:

Classes

struct  OverlayEntry
 

Signals

void sig_play ()
 [signal] sig_play() is emitted on play / pause button press.
 
void sig_showNextImage ()
 [signal] sig_showNextImage() is emitted on show next button press.
 
void sig_showPreviousImage ()
 [signal] sig_showPreviousImage() is emitted on show previous button press.
 
void sig_showFirstImage ()
 [signal] sig_showFirstImage() is emitted on show first button press.
 
void sig_showLastImage ()
 [signal] sig_showLastImage() is emitted on show last button press.
 
void sig_toggleKeyframes ()
 [signal] sig_toggleKeyframes() is emitted on set keyframe / remove keyframe button press.
 
void sig_toggleKeyframesOnly (bool checked)
 [signal] sig_toggleKeyframesOnly(...) is emitted if the keyframes only checkbox is checked/unchecked.
 
void sig_changeStepsize (unsigned int stepsize)
 [signal] sig_changeStepsize(...) is emitted if stepsize changed.
 
void sig_deleteAllKeyframes ()
 [signal] sig_deleteAllKeyframes() is emitted on delete all button press.
 
void sig_cropEdit ()
 [signal] sig_cropEdit() is emitted if the crop button is pressed.
 

Public Member Functions

 VideoPlayer (QWidget *parent=nullptr, ColorTheme theme=DARK)
 Create a VideoPlayer and set the Gui to dark mode, if dark is true.
 
void showImages (std::vector< cv::Mat * > images)
 showImages displays the given images.
 
void showImage (cv::Mat *image)
 showImage displays the given image.
 
void setKeyframe (bool isKeyframe)
 setKeyframe highlights the displayed image if isKeyframe is true.
 
void setKeyframeCount (unsigned int keyframeCount)
 setKeyframeCount displays the given number under keyframe count.
 
void setEnabledBackBtns (bool enabled)
 setEnabledBackBtns enables or disables the |<< and |< buttons.
 
void setEnabledForwardBtns (bool enabled)
 setEnabledForwardBtns enables or disables the >| and >>| buttons.
 
void setPlaying (bool playing)
 setPlaying changes the play/pause button between > and ||.
 
void setStepsize (unsigned int stepsize)
 setStepsize changes the value of the stepsize box.
 
void setKeyframesOnly (bool checked)
 setKeyframesOnly checks the iterate keyframes only checkbox
 
void addWidgetToLayout (QWidget *widget)
 addWidgetToLayout adds the given QWidget to the VideoPlayer between the displayed image and the interaction buttons.
 
void removeWidgetFromLayout (QWidget *widget)
 removeWidgetFromLayout removes the given QWidget from the VideoPlayer.
 
void setColorTheme (ColorTheme theme)
 setColorTheme updates text and icon colors according to a given theme
 

Detailed Description

The VideoPlayer class provides a view to display images and holds buttons to interact with image sequences.
These buttons are:

Button Function Emitted signal
|<< display first image VideoPlayer::sig_showFirstImage()
>>| display last image VideoPlayer::sig_showLastImage()
|< display previous image VideoPlayer::sig_showPreviousImage()
>| display next image VideoPlayer::sig_showNextImage()
> / || play / pause image sequence VideoPlayer::sig_play()

Depending on the selected image, these buttons can be disabled. The state of the play / pause button can be changed using VideoPlayer::setPlaying(). The stepsize for playing the image sequence can be changed as well.

Images are displayed using VideoPlayer::showPixmap() and can be highlighted using VideoPlayer::setKeyframe(). Keyframes can be added and removed one by one or all at once. The VideoPlayer handles resizing of the images.

Author
Dominik Wüst
Date
2021/03/02

Constructor & Destructor Documentation

◆ VideoPlayer()

VideoPlayer::VideoPlayer ( QWidget *  parent = nullptr,
ColorTheme  theme = DARK 
)
explicit

Create a VideoPlayer and set the Gui to dark mode, if dark is true.

Parameters
parentParent for the QWidget
darkGui is dark if true, light otherwise

Member Function Documentation

◆ addWidgetToLayout()

void VideoPlayer::addWidgetToLayout ( QWidget *  widget)

addWidgetToLayout adds the given QWidget to the VideoPlayer between the displayed image and the interaction buttons.

Parameters
widgetThe QWidget to add

◆ removeWidgetFromLayout()

void VideoPlayer::removeWidgetFromLayout ( QWidget *  widget)

removeWidgetFromLayout removes the given QWidget from the VideoPlayer.

Parameters
widgetThe QWidget to remove

◆ setColorTheme()

void VideoPlayer::setColorTheme ( ColorTheme  theme)

setColorTheme updates text and icon colors according to a given theme

Parameters
theme

◆ setEnabledBackBtns()

void VideoPlayer::setEnabledBackBtns ( bool  enabled)

setEnabledBackBtns enables or disables the |<< and |< buttons.

Parameters
enabledEnable the buttons if true, disable otherwise

◆ setEnabledForwardBtns()

void VideoPlayer::setEnabledForwardBtns ( bool  enabled)

setEnabledForwardBtns enables or disables the >| and >>| buttons.

Parameters
enabledEnable the buttons if true, disable otherwise

◆ setKeyframe()

void VideoPlayer::setKeyframe ( bool  isKeyframe)

setKeyframe highlights the displayed image if isKeyframe is true.

Parameters
isKeyframeHighlights the image if true

◆ setKeyframeCount()

void VideoPlayer::setKeyframeCount ( unsigned int  keyframeCount)

setKeyframeCount displays the given number under keyframe count.

Parameters
keyframeCountThe number of keyframes

◆ setKeyframesOnly()

void VideoPlayer::setKeyframesOnly ( bool  checked)

setKeyframesOnly checks the iterate keyframes only checkbox

Parameters
checked

◆ setPlaying()

void VideoPlayer::setPlaying ( bool  playing)

setPlaying changes the play/pause button between > and ||.

Parameters
playingShow || if true, > otherwise

◆ setStepsize()

void VideoPlayer::setStepsize ( unsigned int  stepsize)

setStepsize changes the value of the stepsize box.

Parameters
stepsizeThe new stepsize value

◆ showImage()

void VideoPlayer::showImage ( cv::Mat *  image)

showImage displays the given image.

Parameters
imageThe image as cv:Mat

◆ showImages()

void VideoPlayer::showImages ( std::vector< cv::Mat * >  images)

showImages displays the given images.

Parameters
imagesThe images as cv::Mat to display

◆ sig_changeStepsize

void VideoPlayer::sig_changeStepsize ( unsigned int  stepsize)
signal

[signal] sig_changeStepsize(...) is emitted if stepsize changed.

Parameters
stepsizeThe new stepsize

◆ sig_toggleKeyframesOnly

void VideoPlayer::sig_toggleKeyframesOnly ( bool  checked)
signal

[signal] sig_toggleKeyframesOnly(...) is emitted if the keyframes only checkbox is checked/unchecked.

Parameters
checkedIs true if the scheckbox is checked, false otherwise

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