iVS3D v2.0.0
Loading...
Searching...
No Matches
reader.h
1#ifndef READER_H
2#define READER_H
3
4#include <QObject>
5#include <opencv2/core.hpp>
6#include "metadata.h"
7#include "sequentialreader.h"
8#include "readerparams.h"
9
22class Reader
23{
24public:
25 virtual ~Reader() {};
26
27 enum PictureProcessingFlags{
28 APPLY_CROPPING = 1<<0,
29 APPLY_RESIZING = 1<<1,
30 APPLY_ALL = APPLY_CROPPING | APPLY_RESIZING,
31 APPLY_NONE = 0
32 };
33
41 virtual cv::Mat getPic(unsigned int index, PictureProcessingFlags flags = APPLY_ALL) = 0;
47 virtual unsigned int getPicCount() = 0;
53 virtual QString getInputPath() = 0;
59 virtual double getFPS() = 0;
65 virtual double getVideoDuration() = 0;
71 virtual bool isDir() = 0;
78 virtual Reader *copy(std::shared_ptr<ReaderParams> params = nullptr) = 0;
84 virtual std::vector<std::string> getFileVector() = 0;
85
86 virtual SequentialReader *createSequentialReader(std::vector<uint> indices, PictureProcessingFlags flags = APPLY_ALL) = 0;
87
91 virtual void enableMultithreading() {}
96 virtual void addMetaData(MetaData* md) = 0;
101 virtual MetaData* getMetaData() = 0;
106 virtual bool isValid() = 0;
107};
108
109#endif // READER_H
Interface to give plugins access to all parsed and loaded meta data.
Definition metadata.h:20
The Reader interface defines functions which are used for reading and parsing the import.
Definition reader.h:23
virtual cv::Mat getPic(unsigned int index, PictureProcessingFlags flags=APPLY_ALL)=0
Returns the frame to a given index.
virtual std::vector< std::string > getFileVector()=0
Returns a vector with filepaths (only valid, if the reader is a imagereader)
virtual double getVideoDuration()=0
Returns the video duration.
virtual double getFPS()=0
Returns the video FPS.
virtual bool isDir()=0
Returns wether the input is a direcory or not.
virtual MetaData * getMetaData()=0
getMetaData Returns the currently saved MetaData
virtual Reader * copy(std::shared_ptr< ReaderParams > params=nullptr)=0
Creates this reader again and returns it. Optionally, one can provide a shared ptr to a different set...
virtual unsigned int getPicCount()=0
Returns the number of frame.
virtual void addMetaData(MetaData *md)=0
addMetaData Used to add MetaData to the reader
virtual QString getInputPath()=0
Returns the input path.
virtual bool isValid()=0
isValid Retruns wether the reader is valid or not
virtual void enableMultithreading()
enableMultithreading This method has to be called once in the plugins to use the reader while multith...
Definition reader.h:91
Definition sequentialreader.h:10