You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

52 lines
1.4 KiB

#ifndef BASESTRATEGY_H
#define BASESTRATEGY_H
#include <QObject>
#include "model/backendImageProcessor/utils/OpenClHelper.h"
#include "model/ultrasoundModule/metadata/UsMetadataBag.h"
#include "model/backendImageProcessor/dtoInternal/KernelInput.h"
class BaseStrategy : public QObject
{
Q_OBJECT
private:
void saveOuput(cl::Image* inputFrame, UsMetadataBag& metadata);
protected:
cl::Kernel _clKernel;
cl::Context _clContext;
cl::CommandQueue _clQueue;
OpenClHelper _openClHelper;
cl::Device getDefaultDevice(const cl::Context& context);
virtual cl::Image* gpuProcess(cl::Image* inputFrame,
UsMetadataBag& metadata,
cl::Buffer* scrathPad) = 0;
virtual void finalize() = 0;
public:
BaseStrategy(const cl::Context context,
const cl::CommandQueue queue,
const QString kernelPath,
const QString kernelName);
virtual void cpuProcess(KernelInput_t parameters) = 0;
signals:
void gpuDataReady(cl::Image* frames,
UsMetadataBag& metadata,
cl::Buffer* scrathPad);
//uncrustify off
public slots:
//uncrustify on
void newGpuData(cl::Image* frames,
UsMetadataBag& metadata,
cl::Buffer* scrathPad);
void newCpuData(KernelInput_t parameters);
};
#endif //BASESTRATEGY_H