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

The ModelInputPictures class is responsible for saving all the Data regarding the input. It implements the interface ISerializable to be able to save all its current Data. More...

#include <modelinputpictures.h>

Inheritance diagram for ModelInputPictures:
ISerializable

Classes

class  Memento
 The Memento class is used to store and restore the keyframe list of mip for undo and redo. More...
 

Signals

void sig_mipChanged ()
 Signal, which is emitted, when the keyframe vector changes.
 

Public Member Functions

 ModelInputPictures (QString inputPath)
 ModelInputPictures Constructor, which uses inputPath to import the frames.
 
 ModelInputPictures ()
 ModelInputPictures Constructor, which creates an empty class. toText can be used on this instance.
 
void addKeyframe (unsigned int index)
 Sets the frame with index as a keyframe.
 
bool isKeyframe (unsigned int index)
 Checks if the indexed frame is a keyframe.
 
void updateMIP (const std::vector< unsigned int > &keyframes)
 Updates the indices of all keyframes.
 
void removeKeyframe (unsigned int index)
 Removes the keyframe with the given index.
 
const cv::Mat * getPic (unsigned int index, Reader::PictureProcessingFlags flags=Reader::APPLY_NONE)
 Returns the frame with the given index.
 
unsigned int getKeyframeCount (bool inBound)
 Returns the number of keyframes.
 
unsigned int getPicCount ()
 Returns the number of frames.
 
std::vector< unsigned int > getAllKeyframes (bool inBound)
 Returns the index vector containing the keyframes.
 
std::shared_ptr< ReaderParamsgetReaderParams ()
 getReaderParams returns the parameters (working resolution, crop, etc.) used by the readers.
 
unsigned int getNextKeyframe (unsigned int index, unsigned int stepsize)
 Returns the stepsize-next keyframe to a given index.
 
unsigned int getPreviousKeyframe (unsigned int index, unsigned int stepsize)
 Returns the stepsize-next keyframe to a given index.
 
QString getPath ()
 Returns the input Path.
 
ReadergetReader ()
 Returns the current Reader as a DelayedCopyReader.
 
ConcurrentReadercreateConcurrentReader ()
 createConcurrentReader creates an object from the class ConcurrentReader which can be used to access pictures in a parallel way
 
QVariant toText () override
 Saves this class to a QVariant.
 
void fromText (QVariant data) override
 Reades its members from the given QVariant.
 
QPoint getBoundaries ()
 Returns the current boundaries.
 
void setBoundaries (QPoint boundaries)
 Set the current boundaries.
 
int loadMetaData (QStringList paths)
 loadMetaData Loads the given meta data for the imported Video
 
int loadMetaDataImages ()
 loadMetaDataImages Tries to extract meta data from the imported images
 

Detailed Description

The ModelInputPictures class is responsible for saving all the Data regarding the input. It implements the interface ISerializable to be able to save all its current Data.

Author
Daniel Brommer
Date
2021/01/28

Constructor & Destructor Documentation

◆ ModelInputPictures()

ModelInputPictures::ModelInputPictures ( QString  inputPath)
explicit

ModelInputPictures Constructor, which uses inputPath to import the frames.

Parameters
inputPathPath to the file or directory to be opend

Member Function Documentation

◆ addKeyframe()

void ModelInputPictures::addKeyframe ( unsigned int  index)

Sets the frame with index as a keyframe.

Parameters
indexIndex of the Keyframe to be added

◆ createConcurrentReader()

ConcurrentReader * ModelInputPictures::createConcurrentReader ( )

createConcurrentReader creates an object from the class ConcurrentReader which can be used to access pictures in a parallel way

Returns
object of the class ConcurrentReader

◆ fromText()

void ModelInputPictures::fromText ( QVariant  data)
overridevirtual

Reades its members from the given QVariant.

Parameters
dataQVariant containing this class data

Implements ISerializable.

◆ getAllKeyframes()

std::vector< unsigned int > ModelInputPictures::getAllKeyframes ( bool  inBound)

Returns the index vector containing the keyframes.

Parameters
inBoundtrue: returns only the keyframes that are between the currently set boundaries false: returns all keyframes
Returns
Keyframe vector

◆ getBoundaries()

QPoint ModelInputPictures::getBoundaries ( )

Returns the current boundaries.

Returns
The current boundaries

◆ getKeyframeCount()

unsigned int ModelInputPictures::getKeyframeCount ( bool  inBound)

Returns the number of keyframes.

Parameters
inBoundtrue: returns only the amount of keyframes between the currently set boundaries false: returns the total amount of keyframes
Returns
Number of keyframes

◆ getNextKeyframe()

unsigned int ModelInputPictures::getNextKeyframe ( unsigned int  index,
unsigned int  stepsize 
)

Returns the stepsize-next keyframe to a given index.

Parameters
indexIndex of the current frame
stepsizeNumber of keyframes to be skipped
Returns
The index of the stepsize-next keyframe if it exists, otherwise it will return the last keyframe

◆ getPath()

QString ModelInputPictures::getPath ( )

Returns the input Path.

Returns
QString with the inputPath

◆ getPic()

const cv::Mat * ModelInputPictures::getPic ( unsigned int  index,
Reader::PictureProcessingFlags  flags = Reader::APPLY_NONE 
)

Returns the frame with the given index.

Parameters
indexIndex of the frame
Returns
Mat pointer to the frame

◆ getPicCount()

unsigned int ModelInputPictures::getPicCount ( )

Returns the number of frames.

Returns
Number of frames

◆ getPreviousKeyframe()

unsigned int ModelInputPictures::getPreviousKeyframe ( unsigned int  index,
unsigned int  stepsize 
)

Returns the stepsize-next keyframe to a given index.

Parameters
indexIndex of the current frame
stepsizeNumber of keyframes to be skipped
Returns
The index of the stepsize-next keyframe if it exists, otherwise it will return the first keyframe

◆ getReader()

Reader * ModelInputPictures::getReader ( )

Returns the current Reader as a DelayedCopyReader.

Returns
A DelayedCopyReader

◆ getReaderParams()

std::shared_ptr< ReaderParams > ModelInputPictures::getReaderParams ( )

getReaderParams returns the parameters (working resolution, crop, etc.) used by the readers.

Returns

◆ isKeyframe()

bool ModelInputPictures::isKeyframe ( unsigned int  index)

Checks if the indexed frame is a keyframe.

Parameters
indexIndex of the frame to be checked
Returns
true if the frame is a keyframe false otherwise

◆ loadMetaData()

int ModelInputPictures::loadMetaData ( QStringList  paths)

loadMetaData Loads the given meta data for the imported Video

Parameters
pathPaths the the meta data to load
Returns
how many MetaDataReader have succesfully loaded the meta data

◆ loadMetaDataImages()

int ModelInputPictures::loadMetaDataImages ( )

loadMetaDataImages Tries to extract meta data from the imported images

Returns
how many MetaDataReader have succesfully loaded meta data

◆ removeKeyframe()

void ModelInputPictures::removeKeyframe ( unsigned int  index)

Removes the keyframe with the given index.

Parameters
indexIndex of the keyframe to be removed

◆ setBoundaries()

void ModelInputPictures::setBoundaries ( QPoint  boundaries)

Set the current boundaries.

Parameters
boundariesThe new boundaries

◆ toText()

QVariant ModelInputPictures::toText ( )
overridevirtual

Saves this class to a QVariant.

Returns
QVariant containing important data from this class

Implements ISerializable.

◆ updateMIP()

void ModelInputPictures::updateMIP ( const std::vector< unsigned int > &  keyframes)

Updates the indices of all keyframes.

Parameters
keyframesIndex vector with the indices of the keyframes

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