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

The VideoPlayerController class manages visualization of image data and manual changes to keyframes. More...

#include <videoplayercontroller.h>

Inheritance diagram for VideoPlayerController:

Public Slots

void slot_play ()
 [slot] slot_play() toggles automatic iteration over image sequence.
 
void slot_showFirstImage ()
 [slot] slot_showFirstImage() displays first image.
 
void slot_showLastImage ()
 [slot] slot_showLastImage() displays last image.
 
void slot_showPreviousImage ()
 [slot] slot_showPreviousImage() displays image going one or more steps backward from current image.
 
void slot_showNextImage ()
 [slot] slot_showNextImage() displays image going one or more steps forward from current image.
 
void slot_toggleKeyframe ()
 [slot] slot_toggleKeyframe() toggles keyframe-state for currently displayed image.
 
void slot_toggleKeyframesOnly (bool checked)
 [slot] slot_toggleKeyframesOnly(...) switches between displaying all images or keyframes only.
 
void slot_changeStepSize (unsigned int stepsize)
 [slot] slot_changeStepSize(...) changes stepsize for iterating the images.
 
void slot_changeIndex (unsigned int index)
 [slot] slot_changeIndex(...) displays the image from DataManager referenced by given index.
 
void slot_mipChanged ()
 [slot] slot_mipChanged() is called when image data changed. VideoPlayer and Timeline are updated.
 
void slot_deleteKeyframes ()
 [slot] slot_deleteKeyframes() deletes all selected keyframes.
 
void slot_deleteAllKeyframes ()
 [slot] slot_deleteAllKeyframes() deletes all keyframes.
 
void slot_stopPlay ()
 [slot] slot_stopPlay() stops running videoPlayer.
 
void slot_updateBoundaries (QPoint boundaries)
 [slot] slot_updateBoundaries() updates the mip so that the boundaries are up to date
 
void slot_resetBoundaries ()
 [slot] slot_resetBoundaries() updates the mip so that the boundaries are back to default
 
void slot_imageProcessed (cv::Mat *preview, int id)
 [slot] slot_imageProcessed(...) is invoked when image has been processed and provides additional images.
 
void slot_redraw ()
 [slot] slot_redraw() draws selected image again.
 
void slot_receiveImage (uint idx, const cv::Mat &img)
 [slot] slot_receiveImage draws given image with and applies a transformable plugin if neccessary
 
void slot_displayImage (uint idx, const cv::Mat &img)
 [slot] slot_displayImage diplays img if transformation is enabled
 
void slot_selectedITransformChanged (uint id)
 [slot] slot_selectedITransformChanged connects new plugin to videoplayer
 
void slot_transformEnabledChanged (bool enabled)
 slot_transformEnabledChanged reads data with new changed enabled parameter
 

Signals

void sig_hasStatusMessage (QString message)
 [signal] sig_hasStatusMessage(...) is emitted when VideoPlayerController has a status message to display to the user.
 
void sig_imageToProcess (cv::Mat *image, int id)
 [signal] sig_imageToProcess(...) is emitted when VideoPlayer is about to display a new image.
 
void sig_read (uint idx)
 [signal] sig_read sends an image request to the worker thread to read the image.
 
void sig_sendToITransform (uint idx, const cv::Mat &img, const Resolution &resolution, const ROI &roi)
 [signal] sig_sendToITransform sends the image for processing to the connected ITransforms.
 
void sig_toggleKeyframe (uint idx, bool isNowKeyframe)
 [signal] sig_toggleKeyframe notifies about a manual keyframe change by clicking Add keyframe/Remove keyframe
 
void sig_deleteKeyframes ()
 [signal] sig_deleteKeyframes is emitted when all keyframes are deleted
 
void sig_deleteAllKeyframes ()
 [signal] sig_deleteAllKeyframes is emitted when frames are reseted to be keyframes
 

Public Member Functions

 VideoPlayerController (QObject *parent=nullptr, VideoPlayer *player=nullptr, Timeline *timeline=nullptr, DataManager *dataManager=nullptr, AlgorithmController *algoController=nullptr)
 Creates a VideoPlayerController instance. Connects to the signals from VideoPlayer and Timeline and initializes both with image data from DataManager. Initializes a timer to interrupt periodically.
 
 ~VideoPlayerController ()
 disconnects signals, deletes timer and VideoPlayerController instance.
 
unsigned int getImageIndexOnScreen ()
 getImageIndexOnScreen getter for m_imageIndexOnScreen (only used in tests for now)
 

Detailed Description

The VideoPlayerController class manages visualization of image data and manual changes to keyframes.

The image data is provided by the DataManager *dataManager. For visualization a VideoPlayer *player and a Timeline *timeline are used. The user can select images and modify keyframes using Timeline and VideoPlayer functions which delegate the command to this VideoPlayerController using signals. This VideoPlayerController is tasked with updating the data provided by dataManager as well as refreshing the view-elements (Timeline and VideoPlayer) periodically and after changes to the image data.

Author
Dominik Wüst
Date
2021/02/10

Constructor & Destructor Documentation

◆ VideoPlayerController()

VideoPlayerController::VideoPlayerController ( QObject *  parent = nullptr,
VideoPlayer player = nullptr,
Timeline timeline = nullptr,
DataManager dataManager = nullptr,
AlgorithmController algoController = nullptr 
)
explicit

Creates a VideoPlayerController instance. Connects to the signals from VideoPlayer and Timeline and initializes both with image data from DataManager. Initializes a timer to interrupt periodically.

Parameters
parenta QWidget as parent in the Qt object hierarchy
playera VideoPlayer instance to display images
timelinea Timeline instance to visualize keyframe distribution
dataManagera DataManager Instance to access image data
algoControlleran AlgorithmController instance to transform images and preview them

Member Function Documentation

◆ getImageIndexOnScreen()

unsigned int VideoPlayerController::getImageIndexOnScreen ( )

getImageIndexOnScreen getter for m_imageIndexOnScreen (only used in tests for now)

Returns
index of image currently displayed

◆ sig_hasStatusMessage

void VideoPlayerController::sig_hasStatusMessage ( QString  message)
signal

[signal] sig_hasStatusMessage(...) is emitted when VideoPlayerController has a status message to display to the user.

Parameters
messagethe QString to display.

◆ sig_imageToProcess

void VideoPlayerController::sig_imageToProcess ( cv::Mat *  image,
int  id 
)
signal

[signal] sig_imageToProcess(...) is emitted when VideoPlayer is about to display a new image.

Parameters
imagethe image thats getting displayed
idIdentifier for the result

◆ sig_read

void VideoPlayerController::sig_read ( uint  idx)
signal

[signal] sig_read sends an image request to the worker thread to read the image.

Parameters
idxThe image index

◆ sig_sendToITransform

void VideoPlayerController::sig_sendToITransform ( uint  idx,
const cv::Mat &  img,
const Resolution resolution,
const ROI roi 
)
signal

[signal] sig_sendToITransform sends the image for processing to the connected ITransforms.

Parameters
idxThe image index
imgThe image to process

◆ sig_toggleKeyframe

void VideoPlayerController::sig_toggleKeyframe ( uint  idx,
bool  isNowKeyframe 
)
signal

[signal] sig_toggleKeyframe notifies about a manual keyframe change by clicking Add keyframe/Remove keyframe

Parameters
idxIndex of the changed frame
isNowKeyframetrue if the frame wasn't a keyframe and became one by the user, false otherwise

◆ slot_changeIndex

void VideoPlayerController::slot_changeIndex ( unsigned int  index)
slot

[slot] slot_changeIndex(...) displays the image from DataManager referenced by given index.

Parameters
indexof image to display

◆ slot_changeStepSize

void VideoPlayerController::slot_changeStepSize ( unsigned int  stepsize)
slot

[slot] slot_changeStepSize(...) changes stepsize for iterating the images.

Parameters
stepsizenew stepsize

◆ slot_displayImage

void VideoPlayerController::slot_displayImage ( uint  idx,
const cv::Mat &  img 
)
slot

[slot] slot_displayImage diplays img if transformation is enabled

Parameters
idxindex if image
imgimage

◆ slot_imageProcessed

void VideoPlayerController::slot_imageProcessed ( cv::Mat *  preview,
int  id 
)
slot

[slot] slot_imageProcessed(...) is invoked when image has been processed and provides additional images.

Parameters
procesedImgsThe results of image processing
idIdentifier for the result

◆ slot_receiveImage

void VideoPlayerController::slot_receiveImage ( uint  idx,
const cv::Mat &  img 
)
slot

[slot] slot_receiveImage draws given image with and applies a transformable plugin if neccessary

Parameters
idxtransformable plugin index
imgimage which should be displayed or transformed

◆ slot_selectedITransformChanged

void VideoPlayerController::slot_selectedITransformChanged ( uint  id)
slot

[slot] slot_selectedITransformChanged connects new plugin to videoplayer

Parameters
idplugin id

◆ slot_showNextImage

void VideoPlayerController::slot_showNextImage ( )
slot

[slot] slot_showNextImage() displays image going one or more steps forward from current image.

See also
VideoPlayerController::slot_changeStepSize to change stepsize.

◆ slot_showPreviousImage

void VideoPlayerController::slot_showPreviousImage ( )
slot

[slot] slot_showPreviousImage() displays image going one or more steps backward from current image.

See also
VideoPlayerController::slot_changeStepSize to change stepsize.

◆ slot_toggleKeyframesOnly

void VideoPlayerController::slot_toggleKeyframesOnly ( bool  checked)
slot

[slot] slot_toggleKeyframesOnly(...) switches between displaying all images or keyframes only.

Parameters
checkeddisplay all images if false, keyframes only if true

◆ slot_transformEnabledChanged

void VideoPlayerController::slot_transformEnabledChanged ( bool  enabled)
slot

slot_transformEnabledChanged reads data with new changed enabled parameter

Parameters
enablednew enabled parameter

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