# opentl::cvprocess::GpuStdShaders Class Reference

Abstract base class for standard shader operations on the GPU. Add actual standard shader implementations by deriving this class. See 0_Template.h as an example. More...

Inherits opentl::core::util::ParameterContainer.

Inherited by opentl::cvprocess::And, opentl::cvprocess::BayerRG2GRAY, opentl::cvprocess::BayerRG2RGB, opentl::cvprocess::BGR2GRAY, opentl::cvprocess::BGR2HSV, opentl::cvprocess::Classify, opentl::cvprocess::ColorGMM, opentl::cvprocess::ColorGMM2, opentl::cvprocess::ColorHistShader, opentl::cvprocess::ColorHistSum, opentl::cvprocess::DebugUInt2Float, opentl::cvprocess::FlipV, opentl::cvprocess::GRAY2Sobel, opentl::cvprocess::Grayscale, opentl::cvprocess::Laplacian, opentl::cvprocess::NonMaxSupression, opentl::cvprocess::Not, opentl::cvprocess::Or, opentl::cvprocess::PixelCount, opentl::cvprocess::RGB2GRAY, opentl::cvprocess::RGB2HSV, opentl::cvprocess::Subtract, and opentl::cvprocess::Xor.

List of all members.

## Public Types
## Public Member Functions
virtual void | addROI (int x1, int y1, int x2, int y2)
| Execute shader operation only on ROIs if not called full image is used more than one ROI can be added calling this method several times Hint: choose a rectangular where to use the shader with (x1, y1), (x2, y2) are the upper left and the lower right border.
virtual void | execute ()
| Execute shader operation on texture(s). Hint: Requires that prepareExecution() is called once for initialization.
opentl::cvprocess::GlFbo * | getGlFbo (const std::string &str, int camIdx)
| Returns a pointer to a frame buffer object class instance. Uses singleton pattern per Camera and modality.
opentl::cvprocess::GlShaderMgr * | getGlShaderMgr (void)
| Returns pointer to a class for OpenGL shader management.
| GpuStdShaders (bool additionalInput=false)
| Constructor.
virtual void | init ()
| Initialization function.
virtual void | prepareDisplayList ()
| Prepare display lists required for 1:1 pixel to texel mapping.
virtual void | prepareExecution (opentl::core::cvdata::TextureGpu &srcTex, opentl::core::cvdata::TextureGpu &srcTex2, opentl::core::cvdata::TextureGpu &dstTex)
| (Re-)initialize operations for shader execution.
virtual void | prepareExecution (opentl::core::cvdata::TextureGpu &srcTex, opentl::core::cvdata::TextureGpu &dstTex)
| (Re-)initialize operations for shader execution.
virtual void | resetROIs ()
| Reset all previously set ROIs.
virtual void | setGlOne2OneTexelMapping ()
| Set required projection parameters for 1:1 pixel to texel mapping.
virtual | ~GpuStdShaders ()
| Destructor.
## Protected Member Functions
virtual void | executeCleanUpStage () const
| Executes post execution processing. Is called from execute().
virtual void | executeInitStage ()
| Executes pre execution processing. Is called from execute().
## Protected Attributes
bool | mAdditionalInput
opentl::cvprocess::GlFbo * | mCurrentFbo
| Keep a pointer to the currently used FBO (for standard shaders).
GLuint | mDispListFullSizeQuad
bool | mDispListPreparedFlag
opentl::core::cvdata::TextureGpu * | mDstTex1
int | mFboFreeId
| helper variable for unique FBO instances
std::map< std::string, opentl::cvprocess::GlFbo * > | mGlFboMap
| Map of frame buffer object.
GLuint | mProgObj
std::vector< std::vector< int > > | mRois
bool | mRoiSet
opentl::cvprocess::GlShaderMgr * | mShaderMgr
opentl::core::cvdata::TextureGpu * | mSrcTex1
opentl::core::cvdata::TextureGpu * | mSrcTex2
GLuint | mTexUnit0
GLuint | mTexUnit1
int | mXresDstTex1
int | mXresSrcTex1
int | mXresSrcTex2
int | mYresDstTex1
int | mYresSrcTex1
int | mYresSrcTex2

## Detailed Description

Abstract base class for standard shader operations on the GPU. Add actual standard shader implementations by deriving this class. See 0_Template.h as an example.

Author:
  Erwin Roth <eroth@mytum.de>

## Member Enumeration Documentation

enum opentl::cvprocess::GpuStdShaders::OfflineParameters

Enumerator:

  OFFLINE_COUNT |

enum opentl::cvprocess::GpuStdShaders::OnlineParameters

Enumerator:

  ONLINE_COUNT |

## Constructor & Destructor Documentation

opentl::cvprocess::GpuStdShaders::GpuStdShaders | ( | bool | additionalInput = `false` | ) |

Constructor.

virtual opentl::cvprocess::GpuStdShaders::~GpuStdShaders | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

virtual void opentl::cvprocess::GpuStdShaders::addROI | ( | int | x1,
|  | int | y1,
|  | int | x2,
|  | int | y2 |
| ) |  |  | `[virtual]`

Execute shader operation only on ROIs if not called full image is used more than one ROI can be added calling this method several times Hint: choose a rectangular where to use the shader with (x1, y1), (x2, y2) are the upper left and the lower right border.

virtual void opentl::cvprocess::GpuStdShaders::execute | ( |  | ) | `[virtual]`

Execute shader operation on texture(s). Hint: Requires that prepareExecution() is called once for initialization.

Reimplemented in opentl::cvprocess::Grayscale, opentl::cvprocess::ColorGMM, opentl::cvprocess::ColorGMM2, opentl::cvprocess::ColorHistShader, opentl::cvprocess::ColorHistSum, opentl::cvprocess::DebugUInt2Float, and opentl::cvprocess::Laplacian.

virtual void opentl::cvprocess::GpuStdShaders::executeCleanUpStage | ( |  | ) | const`[protected, virtual]`

Executes post execution processing. Is called from execute().

virtual void opentl::cvprocess::GpuStdShaders::executeInitStage | ( |  | ) | `[protected, virtual]`

Executes pre execution processing. Is called from execute().

opentl::cvprocess::GlFbo* opentl::cvprocess::GpuStdShaders::getGlFbo | ( | const std::string & | str,
|  | int | camIdx |
| ) |  |  |

Returns a pointer to a frame buffer object class instance. Uses singleton pattern per Camera and modality.

Parameters:

  | str | Arbitrary string to uniquely identify this fbo instance. If str = "_ENFORCE_NEW_", the creation of a new fbo instance is enforced!
  | camIdx | Camera index.

Returns:
  Pointer to fbo class instance.

opentl::cvprocess::GlShaderMgr* opentl::cvprocess::GpuStdShaders::getGlShaderMgr | ( | void |  | ) |

Returns pointer to a class for OpenGL shader management.

Returns:
  Pointer to shader management class instance.

virtual void opentl::cvprocess::GpuStdShaders::init | ( |  | ) | `[virtual]`

Initialization function.

Implements opentl::core::util::ParameterContainer.

virtual void opentl::cvprocess::GpuStdShaders::prepareDisplayList | ( |  | ) | `[virtual]`

Prepare display lists required for 1:1 pixel to texel mapping.

Reimplemented in opentl::cvprocess::ColorHistShader, opentl::cvprocess::ColorHistSum, opentl::cvprocess::FlipV, and opentl::cvprocess::PixelCount.

virtual void opentl::cvprocess::GpuStdShaders::prepareExecution | ( | opentl::core::cvdata::TextureGpu & | srcTex,
|  | opentl::core::cvdata::TextureGpu & | srcTex2,
|  | opentl::core::cvdata::TextureGpu & | dstTex |
| ) |  |  | `[virtual]`

(Re-)initialize operations for shader execution.

virtual void opentl::cvprocess::GpuStdShaders::prepareExecution | ( | opentl::core::cvdata::TextureGpu & | srcTex,
|  | opentl::core::cvdata::TextureGpu & | dstTex |
| ) |  |  | `[virtual]`

(Re-)initialize operations for shader execution.

Reimplemented in opentl::cvprocess::DebugUInt2Float.

virtual void opentl::cvprocess::GpuStdShaders::resetROIs | ( |  | ) | `[virtual]`

Reset all previously set ROIs.

virtual void opentl::cvprocess::GpuStdShaders::setGlOne2OneTexelMapping | ( |  | ) | `[virtual]`

Set required projection parameters for 1:1 pixel to texel mapping.

## Member Data Documentation

bool opentl::cvprocess::GpuStdShaders::mAdditionalInput`[protected]`

opentl::cvprocess::GlFbo* opentl::cvprocess::GpuStdShaders::mCurrentFbo`[protected]`

Keep a pointer to the currently used FBO (for standard shaders).

GLuint opentl::cvprocess::GpuStdShaders::mDispListFullSizeQuad`[protected]`

bool opentl::cvprocess::GpuStdShaders::mDispListPreparedFlag`[protected]`

opentl::core::cvdata::TextureGpu* opentl::cvprocess::GpuStdShaders::mDstTex1`[protected]`

int opentl::cvprocess::GpuStdShaders::mFboFreeId`[protected]`

helper variable for unique FBO instances

std::map<std::string, opentl::cvprocess::GlFbo* > opentl::cvprocess::GpuStdShaders::mGlFboMap`[protected]`

Map of frame buffer object.

GLuint opentl::cvprocess::GpuStdShaders::mProgObj`[protected]`

std::vector<std::vector<int> > opentl::cvprocess::GpuStdShaders::mRois`[protected]`

bool opentl::cvprocess::GpuStdShaders::mRoiSet`[protected]`

opentl::cvprocess::GlShaderMgr* opentl::cvprocess::GpuStdShaders::mShaderMgr`[protected]`

opentl::core::cvdata::TextureGpu* opentl::cvprocess::GpuStdShaders::mSrcTex1`[protected]`

opentl::core::cvdata::TextureGpu* opentl::cvprocess::GpuStdShaders::mSrcTex2`[protected]`

GLuint opentl::cvprocess::GpuStdShaders::mTexUnit0`[protected]`

GLuint opentl::cvprocess::GpuStdShaders::mTexUnit1`[protected]`

int opentl::cvprocess::GpuStdShaders::mXresDstTex1`[protected]`

int opentl::cvprocess::GpuStdShaders::mXresSrcTex1`[protected]`

int opentl::cvprocess::GpuStdShaders::mXresSrcTex2`[protected]`

int opentl::cvprocess::GpuStdShaders::mYresDstTex1`[protected]`

int opentl::cvprocess::GpuStdShaders::mYresSrcTex1`[protected]`

int opentl::cvprocess::GpuStdShaders::mYresSrcTex2`[protected]`