YARP
Yet Another Robot Platform
GPUInterface.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2007 Giacomo Spigler
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARPGPUINTERFACES
11 #define YARPGPUINTERFACES
12 
13 #include <yarp/dev/api.h>
14 #include <yarp/sig/Image.h>
15 
18 namespace yarp {
19  namespace dev {
20  class IGPUDevice;
21  }
22 }
23 
30 public:
31  virtual ~IGPUDevice() {}
32 
37  virtual int width() = 0;
42  virtual int height() = 0;
49  virtual bool resize(int width, int height) = 0;
54  virtual void changebpp(int bytespp) = 0;
59  virtual void changetype(int newtype) = 0;
65  virtual int load(char *name) = 0;
72  virtual void setargument(int prg, char *name, float val) = 0;
73  virtual void setargument(int prg, int val) = 0;
74  virtual void setargument(int prg, float val) = 0;
82  virtual void setargument(int prg, char *name, float *vector, int len) = 0;
89  virtual void execute(int prg, unsigned char *in, unsigned char *out) = 0;
97  virtual void execute(int prg, unsigned char *in, unsigned char *in2, unsigned char *out) = 0;
104  virtual void execute(int prg, yarp::sig::Image *in, yarp::sig::Image *out) = 0;
112  virtual void execute(int prg, yarp::sig::Image *in, yarp::sig::Image *in2, yarp::sig::Image *out) = 0;
113 };
114 
115 #endif
yarp::dev::IGPUDevice
A generic interface to GPU port devices.
Definition: GPUInterface.h:29
yarp::dev::IGPUDevice::execute
virtual void execute(int prg, unsigned char *in, unsigned char *out)=0
Execute a loaded program on a given matrix (eg: an image).
yarp::dev::IGPUDevice::setargument
virtual void setargument(int prg, char *name, float val)=0
Set a program's argument to 'val' (float).
yarp::dev::IGPUDevice::changebpp
virtual void changebpp(int bytespp)=0
It changes the number of bytes per pixel (data matrix element).
yarp::dev::IGPUDevice::execute
virtual void execute(int prg, yarp::sig::Image *in, yarp::sig::Image *in2, yarp::sig::Image *out)=0
Execute a loaded program on 2 given matrices (eg: images).
yarp::dev::IGPUDevice::setargument
virtual void setargument(int prg, int val)=0
yarp::dev::IGPUDevice::execute
virtual void execute(int prg, yarp::sig::Image *in, yarp::sig::Image *out)=0
Execute a loaded program on a given matrix (eg: an image).
yarp::dev::IGPUDevice::execute
virtual void execute(int prg, unsigned char *in, unsigned char *in2, unsigned char *out)=0
Execute a loaded program on 2 given matrices (eg: images).
yarp::dev::IGPUDevice::setargument
virtual void setargument(int prg, float val)=0
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
Image.h
yarp::dev::IGPUDevice::height
virtual int height()=0
It returns the current workspace's height.
yarp::dev::IGPUDevice::width
virtual int width()=0
It returns the current workspace's width.
yarp::dev::IGPUDevice::~IGPUDevice
virtual ~IGPUDevice()
Definition: GPUInterface.h:31
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::dev::IGPUDevice::setargument
virtual void setargument(int prg, char *name, float *vector, int len)=0
Set a program's argument to 'vector' (1D vector for single values).
yarp::sig::Image
Base class for storing images.
Definition: Image.h:85
yarp::dev::IGPUDevice::changetype
virtual void changetype(int newtype)=0
It changes the size of each pixel (the type each pixel's element is).
yarp::dev::IGPUDevice::load
virtual int load(char *name)=0
Load a program for the GPU.
api.h
yarp::dev::IGPUDevice::resize
virtual bool resize(int width, int height)=0
It changes the dimensions of the current working space (the texture used for communication with the G...