YARP
Yet Another Robot Platform
GPUInterface.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-FileCopyrightText: 2007 Giacomo Spigler
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef YARPGPUINTERFACES
8 #define YARPGPUINTERFACES
9 
10 #include <yarp/dev/api.h>
11 #include <yarp/sig/Image.h>
12 
15 namespace yarp {
16  namespace dev {
17  class IGPUDevice;
18  }
19 }
20 
27 public:
28  virtual ~IGPUDevice() {}
29 
34  virtual int width() = 0;
39  virtual int height() = 0;
46  virtual bool resize(int width, int height) = 0;
51  virtual void changebpp(int bytespp) = 0;
56  virtual void changetype(int newtype) = 0;
62  virtual int load(char *name) = 0;
69  virtual void setargument(int prg, char *name, float val) = 0;
70  virtual void setargument(int prg, int val) = 0;
71  virtual void setargument(int prg, float val) = 0;
79  virtual void setargument(int prg, char *name, float *vector, int len) = 0;
86  virtual void execute(int prg, unsigned char *in, unsigned char *out) = 0;
94  virtual void execute(int prg, unsigned char *in, unsigned char *in2, unsigned char *out) = 0;
101  virtual void execute(int prg, yarp::sig::Image *in, yarp::sig::Image *out) = 0;
109  virtual void execute(int prg, yarp::sig::Image *in, yarp::sig::Image *in2, yarp::sig::Image *out) = 0;
110 };
111 
112 #endif
A generic interface to GPU port devices.
Definition: GPUInterface.h:26
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).
virtual void setargument(int prg, int val)=0
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).
virtual int height()=0
It returns the current workspace's height.
virtual void execute(int prg, unsigned char *in, unsigned char *out)=0
Execute a loaded program on a given matrix (eg: an image).
virtual void changetype(int newtype)=0
It changes the size of each pixel (the type each pixel's element is).
virtual void setargument(int prg, char *name, float *vector, int len)=0
Set a program's argument to 'vector' (1D vector for single values).
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...
virtual int load(char *name)=0
Load a program for the GPU.
virtual int width()=0
It returns the current workspace's width.
virtual void changebpp(int bytespp)=0
It changes the number of bytes per pixel (data matrix element).
virtual void setargument(int prg, float val)=0
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).
virtual void setargument(int prg, char *name, float val)=0
Set a program's argument to 'val' (float).
Base class for storing images.
Definition: Image.h:82
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18