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.
48 lines
1.2 KiB
48 lines
1.2 KiB
5 years ago
|
#include "model/processor/strategies/Rejection.h"
|
||
|
#include "model/processor/BIP.h"
|
||
5 years ago
|
#include <QPixmap>
|
||
|
#include <QImage>
|
||
|
|
||
|
Rejection::Rejection(const Context context,
|
||
|
const QString kernelPath) :
|
||
5 years ago
|
IProcessStrategy(context, kernelPath, "Rejection", Q_NULLPTR),
|
||
5 years ago
|
_kernelFunctor(KernelFunctor<Image2D, Image2D,
|
||
|
Rejection_t>(_kernel))
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
void Rejection::cpuProcess(ScenGenOutput_t parameters)
|
||
|
{
|
||
5 years ago
|
//_rejectionThr = parameters.rejectThreshold.value;
|
||
5 years ago
|
}
|
||
|
|
||
|
void Rejection::finalize()
|
||
|
{
|
||
|
}
|
||
|
|
||
5 years ago
|
Image* Rejection::processKernel(Image *frames, Buffer* scratchPad)
|
||
5 years ago
|
{
|
||
|
Context context = _openCLHelper.getContext();
|
||
|
auto format = frames->getImageInfo<CL_IMAGE_FORMAT>();
|
||
|
auto width = frames->getImageInfo<CL_IMAGE_WIDTH>();
|
||
|
auto height = frames->getImageInfo<CL_IMAGE_HEIGHT>();
|
||
|
auto imageOutput = new Image2D(context,
|
||
|
CL_MEM_READ_WRITE,
|
||
|
ImageFormat(format.image_channel_order, format.image_channel_data_type),
|
||
|
width,
|
||
|
height);
|
||
5 years ago
|
cl::EnqueueArgs eargs(BIP::getInstance()->CLQueue, cl::NDRange(width, height));
|
||
5 years ago
|
|
||
|
_openCLHelper.runKernelFunctor<Image2D, Image2D, Rejection_t>(_kernelFunctor,
|
||
|
eargs,
|
||
|
*static_cast<Image2D*>(frames),
|
||
|
*imageOutput,
|
||
|
_kernelParameters);
|
||
|
delete frames;
|
||
|
|
||
|
return imageOutput;
|
||
|
}
|
||
|
|
||
|
|