Pleora Technologies Inc. eBUS SDK v6.2.8.5877 API



PvBufferConverterRGBFilter Class Reference

Contains a RGB filter configuration that can be used with a PvBufferConverter. More...

Public Member Functions

 PvBufferConverterRGBFilter ()
 Constructor.
 
virtual ~PvBufferConverterRGBFilter ()
 Destructor.
 
double GetGainR () const
 Get the filter's gain (red). More...
 
double GetGainG () const
 Get the filter's gain (green). More...
 
double GetGainB () const
 Get the filter's gain (blue). More...
 
void SetGainR (double aValue)
 Set the filter's gain (red) More...
 
void SetGainG (double aValue)
 Set the filter's gain (green) More...
 
void SetGainB (double aValue)
 Set the filter's gain (blue). More...
 
int32_t GetOffsetR () const
 Get the filter's offset (red). More...
 
int32_t GetOffsetG () const
 Get the filter's offset (green). More...
 
int32_t GetOffsetB () const
 Get the filter's offset (blue). More...
 
void SetOffsetR (int32_t aValue)
 Set the filter's offset (red) More...
 
void SetOffsetG (int32_t aValue)
 Set the filter's offset (green) More...
 
void SetOffsetB (int32_t aValue)
 Set the filter's offset (blue) More...
 
PvResult WhiteBalance (PvBuffer *aBuffer)
 Calculate white-balance gains. More...
 
void Reset ()
 Reset the RGB filter configuration. More...
 

Friends

class PvBufferConverter
 

Detailed Description

Contains a RGB filter configuration that can be used with a PvBufferConverter.

To configure an RGB filter (manual):

  1. Create an RGB filter controller.
  2. Set the filter's values. Use SetGain* and SetOffset* methods. See SetGainB.

To configure a white balance filter (automatic):

  1. Create an RGB filter object.
  2. Calculate and apply white-balance settings. Use WhiteBalance.

Member Function Documentation

◆ GetGainB()

double PvBufferConverterRGBFilter::GetGainB ( ) const

Get the filter's gain (blue).

See SetGainB.

Returns
See SetGainB.

◆ GetGainG()

double PvBufferConverterRGBFilter::GetGainG ( ) const

Get the filter's gain (green).

See SetGainB.

Returns
See SetGainB.

◆ GetGainR()

double PvBufferConverterRGBFilter::GetGainR ( ) const

Get the filter's gain (red).

See SetGainB.

Returns
See SetGainB.

◆ GetOffsetB()

int32_t PvBufferConverterRGBFilter::GetOffsetB ( ) const

Get the filter's offset (blue).

See SetGainB.

Returns
See SetGainB.

◆ GetOffsetG()

int32_t PvBufferConverterRGBFilter::GetOffsetG ( ) const

Get the filter's offset (green).

See SetGainB.

Returns
See SetGainB.

◆ GetOffsetR()

int32_t PvBufferConverterRGBFilter::GetOffsetR ( ) const

Get the filter's offset (red).

See SetGainB.

Returns
See SetGainB.

◆ Reset()

void PvBufferConverterRGBFilter::Reset ( )

Reset the RGB filter configuration.

This method resets the RGB filter configuration (PvBufferConverterRGBFilter) to its default values.

Gains are set to 1; offsets, to 0. After a reset, applying the filter doesn't change the image.

◆ SetGainB()

void PvBufferConverterRGBFilter::SetGainB ( double  aValue)

Set the filter's gain (blue).

The SetGain* and SetOffset methods let you control the transformation made by the filter, for the colors red, green, and blue.

The transformation uses the form:
x' = kx + y

where:

  • x' is the modified color level (for one of red, blue, or green)
  • x is the original color level (for one of red, blue, or green)
  • k is the level multiplier
  • y is the offset

To set a filter's values, use:

To get a filter's values, use:

Parameters
[in]aValueThe new gain (blue).

◆ SetGainG()

void PvBufferConverterRGBFilter::SetGainG ( double  aValue)

Set the filter's gain (green)

See SetGainB.

Parameters
[in]aValueSee SetGainB.

◆ SetGainR()

void PvBufferConverterRGBFilter::SetGainR ( double  aValue)

Set the filter's gain (red)

See SetGainB.

Parameters
[in]aValueSee SetGainB.

◆ SetOffsetB()

void PvBufferConverterRGBFilter::SetOffsetB ( int32_t  aValue)

Set the filter's offset (blue)

See SetGainB.

Parameters
[in]aValueSee SetGainB.

◆ SetOffsetG()

void PvBufferConverterRGBFilter::SetOffsetG ( int32_t  aValue)

Set the filter's offset (green)

See SetGainB.

Parameters
[in]aValueSee SetGainB.

◆ SetOffsetR()

void PvBufferConverterRGBFilter::SetOffsetR ( int32_t  aValue)

Set the filter's offset (red)

See SetGainB.

Parameters
[in]aValueSee SetGainB.

◆ WhiteBalance()

PvResult PvBufferConverterRGBFilter::WhiteBalance ( PvBuffer aBuffer)

Calculate white-balance gains.

The WhiteBalance method receives an image and calculates appropriate gains to white-balance the image. This method sets the gains as if having called SetGainB, SetGainG, and SetGainR.

Internally, the WhiteBalance method uses the following procedure:

  1. Calculate the average colors in the image: Bavg, Gavg, Ravg.
  2. Select the maximum of the three averages: Max = max (Bavg, Gavg, Ravg).
  3. Set the new gains, where:
    • Bgain = Max / Bavg
    • Ggain = Max / Gavg
    • Rgain = Max / Ravg

The WhiteBalance method produces the best results for images that have an even mix of dark and light tones, and an even mix of colors.

Parameters
[in]aBufferThe sample image; the image upon which to base the white-balance settings.
Returns
Includes:

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

Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com