# opentl::cvprocess::ColorHistShader Class Reference

This is a shader example for computing the color histogram of an image, inside a specific ROI, and under a specific binary mask (shadow). More...

Inherits opentl::cvprocess::GpuStdShaders.

List of all members.

## Classes
struct | Param
## Public Member Functions
| ColorHistShader (Param *param=NULL)
| Constructor.
void | copyHistoFromGPU (opentl::core::cvdata::ColourHist2d &MDestination)
| Copy back the histogram from GPU.
virtual void | execute ()
| Shader execution (overrides the base class method).
opentl::cvprocess::GlFbo * | getCurrentFbo ()
| Get the current FBO (if we want to upload textures from outside, we need to bind to the current FBO!) TODO: This is hacking the class... make it with another function, for uploading/downloading the textures from outside!
int | getNBlocks ()
| Return actual number of sub-histograms.
Param & | params ()
| Get/Set parameters for this class.
virtual void | prepareDisplayList ()
| Fixed display list for computing the histogram in parallel, by dividing the image into blocks of fixed size.
virtual | ~ColorHistShader ()
| Destructor.

## Detailed Description

This is a shader example for computing the color histogram of an image, inside a specific ROI, and under a specific binary mask (shadow).

The histogram can be used for color-based matching NOTE: Derived class from GpuStdShaders.

Author:
  Giorgio Panin <panin@in.tum.de>

## Constructor & Destructor Documentation

opentl::cvprocess::ColorHistShader::ColorHistShader | ( | Param * | param = `NULL` | ) |

Constructor.

Parameters:

  | param | Structure of parameters for this class

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

Destructor.

## Member Function Documentation

void opentl::cvprocess::ColorHistShader::copyHistoFromGPU | ( | opentl::core::cvdata::ColourHist2d & | MDestination | ) |

Copy back the histogram from GPU.

Parameters:

  | MDestination | Destination histogram (the source is the GPU texture mColourHistoTexture)

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

Shader execution (overrides the base class method).

Reimplemented from opentl::cvprocess::GpuStdShaders.

opentl::cvprocess::GlFbo* opentl::cvprocess::ColorHistShader::getCurrentFbo | ( |  | ) | `[inline]`

Get the current FBO (if we want to upload textures from outside, we need to bind to the current FBO!) TODO: This is hacking the class... make it with another function, for uploading/downloading the textures from outside!

int opentl::cvprocess::ColorHistShader::getNBlocks | ( |  | ) | `[inline]`

Return actual number of sub-histograms.

Param& opentl::cvprocess::ColorHistShader::params | ( |  | ) |

Get/Set parameters for this class.

Returns:
  Reference to parameter struct

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

Fixed display list for computing the histogram in parallel, by dividing the image into blocks of fixed size.

Reimplemented from opentl::cvprocess::GpuStdShaders.