#include <Pipeline.hpp>
Public Types | |
enum | ActionType { Process, Reset } |
Actions enumeration. More... | |
Public Types inherited from Glip::CorePipeline::AbstractPipelineLayout | |
enum | ComponentKind { THIS_PIPELINE = -1, FILTER = 0, PIPELINE = 1 } |
Flags describing the component kind. More... | |
Public Member Functions | |
Pipeline (const AbstractPipelineLayout &p, const std::string &name) | |
Pipeline constructor. More... | |
int | getNumActions (void) const |
Get the number of filters applied during processing. More... | |
int | getSize (bool askDriver=false) |
Get the size in bytes of the elements on the GPU for this pipeline. More... | |
Pipeline & | operator<< (HdlTexture &texture) |
Add a data as input to the pipeline. The user must maintain the texture in memory while this Pipeline hasn't received a Pipeline::Process or Pipeline::Reset signal. More... | |
Pipeline & | operator<< (Pipeline &pipeline) |
Add all the output of variable pipeline as input of this pipeline. The user must maintain the texture(s) in memory while this Pipeline hasn't received a Pipeline::Process or Pipeline::Reset signal. More... | |
Pipeline & | operator<< (ActionType a) |
Apply operation on previously input data. More... | |
HdlTexture & | out (int id=0, int cellID=0) |
Return the output of the pipeline. More... | |
HdlTexture & | out (const std::string &portName, int cellID=0) |
Return the output of the pipeline. More... | |
Filter & | operator[] (int filterID) |
Access to the filter of described index. More... | |
bool | wentThroughFirstRun (void) const |
Check if the pipeline was already computed, at least once. More... | |
bool | isBroken (void) const |
Check if the pipeline is broken (its initialization failed, or an error occured during its first run). More... | |
int | createBuffersCell (void) |
Create a new buffers cell for this pipeline. More... | |
int | getNumBuffersCells (void) const |
Get the number of buffers cells. More... | |
bool | isBuffersCellValid (int cellID) const |
Test if a cell ID is valid. More... | |
int | getCurrentCellID (void) const |
Get the ID of the buffers cell currently in use for rendering. More... | |
std::vector< int > | getCellIDs (void) const |
Get all the IDs of the available cells. More... | |
void | changeTargetBuffersCell (int cellID) |
Change the rendering target to another buffers cell. More... | |
void | removeBuffersCell (int cellID) |
Remove a buffers cell. If the cell is in use, it is necessary that the user change the rendering target afterward. More... | |
void | enablePerfsMonitoring (void) |
Enable performances monitoring. More... | |
void | disablePerfsMonitoring (void) |
Disable performances monitoring. More... | |
double | getTiming (int filterID) |
Get last result of performance monitoring IF it is still enabled. More... | |
double | getTiming (int action, std::string &filterName) |
Get last result of performance monitoring IF it is still enabled. More... | |
double | getTotalTiming (void) |
Get total time elapsed for last run. More... | |
Public Member Functions inherited from Glip::CorePipeline::AbstractPipelineLayout | |
AbstractPipelineLayout (const AbstractPipelineLayout &c) | |
AbstractPipelineLayout constructor. More... | |
void | checkElement (int i) const |
Check if element exists and raise an exception if any errors occur. More... | |
int | getNumElements (void) const |
Get the number of elements. More... | |
int | getNumConnections (void) const |
Get the number of connections. More... | |
void | getInfoElements (int &numFilters, int &numPipelines, int &numUniformVariables) |
Get the total number of Filters and Pipelines contained by this pipeline. More... | |
int | getElementIndex (const std::string &name) const |
Get the ID of an element knowing its name. More... | |
bool | doesElementExist (const std::string &name) const |
Check if an element exists knowing its name. More... | |
ComponentKind | getElementKind (int i) const |
Get the kind of an element. More... | |
const std::string & | getElementName (int i) const |
Get the name of an element. More... | |
int | getElementID (int i) const |
Get element ID in global structure. More... | |
int | getElementID (const std::string &name) const |
Get element ID in global structure. More... | |
AbstractComponentLayout & | componentLayout (int i) const |
Get the component layout by its index. More... | |
AbstractComponentLayout & | componentLayout (const std::string &name) const |
Get the component layout by its name. More... | |
AbstractFilterLayout & | filterLayout (int i) const |
Get the filter layout by its index. More... | |
AbstractFilterLayout & | filterLayout (const std::string &name) const |
Get the filter layout by its name. More... | |
AbstractPipelineLayout & | pipelineLayout (int i) const |
Get the pipeline layout by its index. More... | |
AbstractPipelineLayout & | pipelineLayout (const std::string &name) const |
Get the pipeline layout by its name. More... | |
Connection | getConnection (int i) const |
Get the connection by its ID. More... | |
bool | check (bool exception=true) |
Check the validity of the pipeline layout. More... | |
Public Member Functions inherited from Glip::CorePipeline::AbstractComponentLayout | |
AbstractComponentLayout (const AbstractComponentLayout &) | |
AbstractComponentLayout constructor. More... | |
void | checkInputPort (int i) const |
Check the validity of an input port. Raise an exception if any errors occur. More... | |
void | checkOutputPort (int i) const |
Check the validity of an output port. Raise an exception if any errors occur. More... | |
const std::string & | getLayoutName (void) const |
Returns the layout name of this component. More... | |
int | getNumInputPort (void) const |
Get the number of input ports. More... | |
const std::string & | getInputPortName (int i) const |
Return the name of an input port. Raise an exception if any errors occur. More... | |
int | getInputPortID (const std::string &name) const |
Get the index of an input port knowing its name. Raise an exception if any errors occur. More... | |
bool | doesInputPortExist (const std::string &name) const |
Check if an input port exists, knowing its name. More... | |
int | getNumOutputPort (void) const |
Get the number of output ports. More... | |
const std::string & | getOutputPortName (int i) const |
Return the name of an output port. Raise an exception if any errors occur. More... | |
int | getOutputPortID (const std::string &name) const |
Get the index of an output port knowing its name. Raise an exception if any errors occur. More... | |
bool | doesOutputPortExist (const std::string &name) const |
Check if an output port exists, knowing its name. More... | |
Public Member Functions inherited from Glip::CorePipeline::Component | |
std::string | getFullName (void) const |
Returns the full name of this component (might be overloaded). More... | |
const std::string & | getName (void) const |
Returns the name of this component. More... | |
Protected Member Functions | |
void | process (void) |
Apply the pipeline. | |
Protected Member Functions inherited from Glip::CorePipeline::AbstractPipelineLayout | |
AbstractPipelineLayout (const std::string &type) | |
AbstractPipelineLayout constructor. More... | |
void | setElementID (int i, int ID) |
Set element ID in global structure or raise an exception if any errors occur. More... | |
std::vector< Connection > | getConnectionDestinations (int id, int p) |
Get all destinations of an output port. More... | |
Connection | getConnectionSource (int id, int p) |
Get the source of an input port. More... | |
Protected Member Functions inherited from Glip::CorePipeline::AbstractComponentLayout | |
AbstractComponentLayout (const std::string &_layoutName) | |
AbstractComponentLayout constructor. More... | |
AbstractComponentLayout (const std::string &_layoutName, const std::vector< std::string > &_inputPorts, const std::vector< std::string > &_outputPorts) | |
AbstractComponentLayout constructor. More... | |
Protected Member Functions inherited from Glip::CorePipeline::Component | |
Component (const std::string &_layoutName, const std::vector< std::string > &_inputPorts, const std::vector< std::string > &_outputPorts, const std::string &_instanceName) | |
Component constructor. More... | |
Component (const AbstractComponentLayout &, const std::string &_instanceName) | |
Component constructor. More... | |
Pipeline object.
How to process the inputs :
How to access and modify a uniform variable in a filter :
Buffers Cell : in order to save rendering results (for a ping-pong between the same pipeline, its outputs being used as its future inputs), you can use the buffers cell which represents the needed buffers for one full computation. A simple example of a pipeline applied in a loop :
Pipeline::Pipeline | ( | const AbstractPipelineLayout & | p, |
const std::string & | name | ||
) |
void Pipeline::changeTargetBuffersCell | ( | int | cellID | ) |
Change the rendering target to another buffers cell.
cellID | The targeted ID. |
int Pipeline::createBuffersCell | ( | void | ) |
Create a new buffers cell for this pipeline.
The function will not change the current cell used by the pipeline.
void Pipeline::disablePerfsMonitoring | ( | void | ) |
Disable performances monitoring.
Stops a monitoring session on this instance. Do nothing if no session was started.
void Pipeline::enablePerfsMonitoring | ( | void | ) |
Enable performances monitoring.
Any following process on this instance will record time to perform the pipeline (time per element and total time). Calling this function twice will not reset previous results.
std::vector< int > Pipeline::getCellIDs | ( | void | ) | const |
Get all the IDs of the available cells.
int Pipeline::getCurrentCellID | ( | void | ) | const |
Get the ID of the buffers cell currently in use for rendering.
int Pipeline::getNumActions | ( | void | ) | const |
Get the number of filters applied during processing.
int Pipeline::getNumBuffersCells | ( | void | ) | const |
Get the number of buffers cells.
int Pipeline::getSize | ( | bool | askDriver = false | ) |
Get the size in bytes of the elements on the GPU for this pipeline.
askDriver | If true, it will use HdlTexture::getSizeOnGPU() to determine the real size (might be slower). |
double Pipeline::getTiming | ( | int | filterID | ) |
Get last result of performance monitoring IF it is still enabled.
filterID | The ID of the filter. |
double Pipeline::getTiming | ( | int | action, |
std::string & | filterName | ||
) |
Get last result of performance monitoring IF it is still enabled.
action | The ID of the filter. |
filterName | A reference string that will contain the name of the filter indexed by action at the end of the function. |
double Pipeline::getTotalTiming | ( | void | ) |
Get total time elapsed for last run.
bool Pipeline::isBroken | ( | void | ) | const |
Check if the pipeline is broken (its initialization failed, or an error occured during its first run).
bool Pipeline::isBuffersCellValid | ( | int | cellID | ) | const |
Test if a cell ID is valid.
cellID | The targeted ID. |
Pipeline & Pipeline::operator<< | ( | HdlTexture & | texture | ) |
Add a data as input to the pipeline. The user must maintain the texture in memory while this Pipeline hasn't received a Pipeline::Process or Pipeline::Reset signal.
texture | The data to use. |
Add all the output of variable pipeline as input of this pipeline. The user must maintain the texture(s) in memory while this Pipeline hasn't received a Pipeline::Process or Pipeline::Reset signal.
pipeline | The pipeline outputs to append. |
Pipeline & Pipeline::operator<< | ( | ActionType | a | ) |
Apply operation on previously input data.
a | The ActionType (Process or Reset arguments). |
Filter & Pipeline::operator[] | ( | int | filterID | ) |
Access to the filter of described index.
filterID | The index of the filter, obtained with AbstractPipelineLayout::getElementID. |
HdlTexture & Pipeline::out | ( | int | i = 0 , |
int | cellID = 0 |
||
) |
Return the output of the pipeline.
i | The ID of the output port. |
cellID | Choose the target cell (default : current in-use cell). |
HdlTexture & Pipeline::out | ( | const std::string & | portName, |
int | cellID = 0 |
||
) |
Return the output of the pipeline.
portName | The name of the output port. |
cellID | Choose the target cell (default : current in-use cell). |
void Pipeline::removeBuffersCell | ( | int | cellID | ) |
Remove a buffers cell. If the cell is in use, it is necessary that the user change the rendering target afterward.
cellID | The targeted ID. |
bool Pipeline::wentThroughFirstRun | ( | void | ) | const |
Check if the pipeline was already computed, at least once.