iVS3D v2.0.0
Loading...
Searching...
No Matches
factory.h
1#ifndef FACTORY_H
2#define FACTORY_H
3
4#include <reader.h>
5
6#include <QObject>
7#include <tuple>
8
9#include "flowcalculator.h"
10#include "flowcalculatorcpu.h"
11#include "imagegatherer.h"
12#include "imagegatherercpu.h"
13#include "keyframeselector.h"
14
15#ifdef WITH_CUDA
16#include "flowcalculatorcuda.h"
17#include "imagegatherercuda.h"
18#endif
19
20#define CUDA 0
21#define CPU 1
22
36class Factory {
37 public:
38 static Factory &instance() {
39 static Factory INSTANCE = Factory();
40 return INSTANCE;
41 }
57 std::tuple<ImageGatherer *, FlowCalculator *, KeyframeSelector *>
58 createComponents(std::vector<uint> futureFrames, Reader *reader,
59 bool useCuda, double threshold);
60
61 private:
62 Factory();
63 ImageGatherer *createImageGatherer(std::vector<uint> futureFrames,
64 Reader *reader, bool useCuda);
65 FlowCalculator *createFlowCalculator(bool useCuda);
66};
67
68#endif // FACTORY_H
The Factory class is responsible for creating and destroying as well as managing a single object of t...
Definition factory.h:36
std::tuple< ImageGatherer *, FlowCalculator *, KeyframeSelector * > createComponents(std::vector< uint > futureFrames, Reader *reader, bool useCuda, double threshold)
createComponents creates all neccessary components for the sample process (ImageGatherer,...
Definition factory.cpp:4
The FlowCalculator class is an interface which defines the structure for the hardware specific algori...
Definition flowcalculator.h:23
The ImageGatherer class is an interface which defines the structure for the hardware specific algorit...
Definition imagegatherer.h:30
The Reader interface defines functions which are used for reading and parsing the import.
Definition reader.h:23