YARP
Yet Another Robot Platform
yarp::dev::IGPUDevice Class Referenceabstract

A generic interface to GPU port devices. More...

#include <yarp/dev/GPUInterface.h>

Public Member Functions

virtual ~IGPUDevice ()
 
virtual int width ()=0
 It returns the current workspace's width. More...
 
virtual int height ()=0
 It returns the current workspace's height. More...
 
virtual bool resize (int width, int height)=0
 It changes the dimensions of the current working space (the texture used for communication with the GPU). More...
 
virtual void changebpp (int bytespp)=0
 It changes the number of bytes per pixel (data matrix element). More...
 
virtual void changetype (int newtype)=0
 It changes the size of each pixel (the type each pixel's element is). More...
 
virtual int load (char *name)=0
 Load a program for the GPU. More...
 
virtual void setargument (int prg, char *name, float val)=0
 Set a program's argument to 'val' (float). More...
 
virtual void setargument (int prg, int val)=0
 
virtual void setargument (int prg, float val)=0
 
virtual void setargument (int prg, char *name, float *vector, int len)=0
 Set a program's argument to 'vector' (1D vector for single values). More...
 
virtual void execute (int prg, unsigned char *in, unsigned char *out)=0
 Execute a loaded program on a given matrix (eg: an image). More...
 
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). More...
 
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). More...
 
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). More...
 

Detailed Description

A generic interface to GPU port devices.

Definition at line 29 of file GPUInterface.h.

Constructor & Destructor Documentation

◆ ~IGPUDevice()

virtual yarp::dev::IGPUDevice::~IGPUDevice ( )
inlinevirtual

Definition at line 31 of file GPUInterface.h.

Member Function Documentation

◆ changebpp()

virtual void yarp::dev::IGPUDevice::changebpp ( int  bytespp)
pure virtual

It changes the number of bytes per pixel (data matrix element).

Matrices are passed as 1D vectors.

Parameters
bytesppthe new number of bytes per pixel

◆ changetype()

virtual void yarp::dev::IGPUDevice::changetype ( int  newtype)
pure virtual

It changes the size of each pixel (the type each pixel's element is).

Parameters
newtypethe new pixel's elements type (cfr. enum YarpVocabPixelTypesEnum under image.h)

◆ execute() [1/4]

virtual void yarp::dev::IGPUDevice::execute ( int  prg,
unsigned char *  in,
unsigned char *  in2,
unsigned char *  out 
)
pure virtual

Execute a loaded program on 2 given matrices (eg: images).

Parameters
prga previously loaded program
inthe first matrix containing the data to be processed
in2the second matrix containing the data to be processed
outthe program's results

◆ execute() [2/4]

virtual void yarp::dev::IGPUDevice::execute ( int  prg,
unsigned char *  in,
unsigned char *  out 
)
pure virtual

Execute a loaded program on a given matrix (eg: an image).

Parameters
prga previously loaded program
inthe matrix containing the data to be processed
outthe program's results

◆ execute() [3/4]

virtual void yarp::dev::IGPUDevice::execute ( int  prg,
yarp::sig::Image in,
yarp::sig::Image in2,
yarp::sig::Image out 
)
pure virtual

Execute a loaded program on 2 given matrices (eg: images).

Parameters
prga previously loaded program
inthe first sig::ImageOf containing the data to be processed
in2the second sig::ImageOf containing the data to be processed
outthe program's results (sig::ImageOf)

◆ execute() [4/4]

virtual void yarp::dev::IGPUDevice::execute ( int  prg,
yarp::sig::Image in,
yarp::sig::Image out 
)
pure virtual

Execute a loaded program on a given matrix (eg: an image).

Parameters
prga previously loaded program
inthe sig::ImageOf containing the data to be processed
outthe program's results (sig::ImageOf)

◆ height()

virtual int yarp::dev::IGPUDevice::height ( )
pure virtual

It returns the current workspace's height.

Returns
height of current workspace

◆ load()

virtual int yarp::dev::IGPUDevice::load ( char *  name)
pure virtual

Load a program for the GPU.

Parameters
namethe name of the program to load from the HD
Returns
an object representing the program casted to int (for compatibility purpose)

◆ resize()

virtual bool yarp::dev::IGPUDevice::resize ( int  width,
int  height 
)
pure virtual

It changes the dimensions of the current working space (the texture used for communication with the GPU).

Parameters
widththe new width
heightthe new height
Returns
true if successful

◆ setargument() [1/4]

virtual void yarp::dev::IGPUDevice::setargument ( int  prg,
char *  name,
float *  vector,
int  len 
)
pure virtual

Set a program's argument to 'vector' (1D vector for single values).

Parameters
prga program
namethe name of the argument to set
vectorthe value/s to set
lenthe vector's length

◆ setargument() [2/4]

virtual void yarp::dev::IGPUDevice::setargument ( int  prg,
char *  name,
float  val 
)
pure virtual

Set a program's argument to 'val' (float).

Parameters
prga program
namethe name of the argument to set
vectorthe value to set

◆ setargument() [3/4]

virtual void yarp::dev::IGPUDevice::setargument ( int  prg,
float  val 
)
pure virtual

◆ setargument() [4/4]

virtual void yarp::dev::IGPUDevice::setargument ( int  prg,
int  val 
)
pure virtual

◆ width()

virtual int yarp::dev::IGPUDevice::width ( )
pure virtual

It returns the current workspace's width.

Returns
width of current workspace

The documentation for this class was generated from the following file: