Please enable JavaScript to view this site.

IDS peak 2.8.0 / uEye+ firmware 3.33

GainSelector

There are several gain values that differ by type (analog, digital, combined) and channel (master, red, green, blue).

GainSelector entry (generic)

Gain type (comfort)

Gain channel (comfort)

Meaning

AnalogAll

PEAK_GAIN_TYPE_ANALOG

PEAK_GAIN_CHANNEL_MASTER

Analog master gain to all channels. Done by the sensor before digitization.

AnalogRed, AnalogGreen, AnalogBlue

PEAK_GAIN_TYPE_ANALOG

PEAK_GAIN_CHANNEL_RED, PEAK_GAIN_CHANNEL_GREEN, PEAK_GAIN_CHANNEL_BLUE

Analog gain for color gains. Done by the sensor before digitization (if available).

DigitalAll

PEAK_GAIN_TYPE_DIGITAL

PEAK_GAIN_CHANNEL_MASTER

Digital master gain to all channels. Usually done in FPGA for IDS Vision cameras.

DigitalRed, DigitalGreen, DigitalBlue

PEAK_GAIN_TYPE_DIGITAL

PEAK_GAIN_CHANNEL_RED, PEAK_GAIN_CHANNEL_GREEN, PEAK_GAIN_CHANNEL_BLUE

Digital gain for color gains. Usually done in FPGA for uEye+ cameras.

All

PEAK_GAIN_TYPE_COMBINED

PEAK_GAIN_CHANNEL_MASTER

Master gain to all channels, but depending on the camera model, how this is done. In case of support for uEye cameras by the uEye Transport Layer, the gains may be achieved by combining analog and digital gain.

Red, Green, Blue

PEAK_GAIN_TYPE_COMBINED

PEAK_GAIN_CHANNEL_RED, PEAK_GAIN_CHANNEL_GREEN, PEAK_GAIN_CHANNEL_BLUE

See above. Non-unique selector for the color gains.

With comfortSDK, the information about gain type and gain channel is passed with each function call.

comfortC

peak_status status = PEAK_STATUS_SUCCESS;
 
// Digital red gain
double gainRed = 0.0;
 
// Get current value of "DigitalRed" gain
status = peak_Gain_Get(hCam, PEAK_GAIN_TYPE_DIGITAL, PEAK_GAIN_CHANNEL_RED, &gainRed);
if (PEAK_ERROR(status)) { /* Error handling ... */ }
 
// Set current value of "DigitalRed" gain to 1.5
status = peak_Gain_Set(hCam, PEAK_GAIN_TYPE_DIGITAL, PEAK_GAIN_CHANNEL_RED, 1.5);
if (PEAK_ERROR(status)) { /* Error handling ... */ }

With genericSDK, the GainSelector must first be set before the associated gain value can be read or written. After setting the GainSelector, all functions are applied to this gain.

genericC++

// Get current GainSelector entry
std::string selector = nodemapRemoteDevice->FindNode<peak::core::nodes::EnumerationNode>("GainSelector")->CurrentEntry()->SymbolicValue();
 
// Set GainSelector to "DigitalRed";
nodemapRemoteDevice->FindNode<peak::core::nodes::EnumerationNode>("GainSelector")->SetCurrentEntry("DigitalRed");
 
// Get current value of "DigitalRed" gain
double gain = nodemapRemoteDevice->FindNode<peak::core::nodes::FloatNode>("Gain")->Value();
 
// Set current value of "DigitalRed" gain to 1.5
nodemapRemoteDevice->FindNode<peak::core::nodes::FloatNode>("Gain")->SetValue(1.5);

Querying the minimum value, maximum value and increment

comfortC

peak_status status = PEAK_STATUS_SUCCESS;
 
// Digital red gain
peak_access_status accessStatus = peak_Gain_GetAccessStatus(hCam, PEAK_GAIN_TYPE_DIGITAL, PEAK_GAIN_CHANNEL_RED);
if (PEAK_IS_READABLE(accessStatus))
{
  // Digital red gain is readable
  double minGainRed = 0.0;
  double maxGainRed = 0.0;
  double incGainRed = 0.0;
 
  // Query the minimum, maximum and increment
  status = peak_Gain_GetRange(hCam, PEAK_GAIN_TYPE_DIGITAL, PEAK_GAIN_CHANNEL_RED, &minGainRed, &maxGainRed, &incGainRed);
  if (PEAK_ERROR(status)) { /* Error handling ... */ }
}

genericC++

// Set GainSelector to "DigitalRed";
nodemapRemoteDevice->FindNode<peak::core::nodes::EnumerationNode>("GainSelector")->SetCurrentEntry("DigitalRed");
 
// Query the minimum value
double min = m_nodemapRemoteDevice->FindNode<peak::core::nodes::FloatNode>("Gain")->Minimum();
 
// Query the maximum value
double max = nodemapRemoteDevice->FindNode<peak::core::nodes::FloatNode>("Gain")->Maximum();
 
// Query the increment
double inc = 0.01;
if (nodemapRemoteDevice->FindNode<peak::core::nodes::FloatNode>("Gain")->HasConstantIncrement())
{
inc = m_nodemapRemoteDevice->FindNode<peak::core::nodes::FloatNode>("Gain")->Increment();
}

Querying the current gain value

comfortC

peak_status status = PEAK_STATUS_SUCCESS;
 
// Digital red gain
double gainRed = 0.0;
peak_access_status accessStatus = peak_Gain_GetAccessStatus(hCam, PEAK_GAIN_TYPE_DIGITAL, PEAK_GAIN_CHANNEL_RED);
if (PEAK_IS_READABLE(accessStatus))
{
  // Digital red gain is readable, call the getter function
  status = peak_Gain_Get(hCam, PEAK_GAIN_TYPE_DIGITAL, PEAK_GAIN_CHANNEL_RED, &gainRed);
  if (PEAK_ERROR(status)) { /* Error handling ... */ }
}

genericC++

double gain = nodemapRemoteDevice->FindNode<peak::core::nodes::FloatNode>("Gain")->Value();

Setting the gain value

comfortC

peak_status status = PEAK_STATUS_SUCCESS;
 
// Digital red gain
double gainRed = 1.5;
peak_access_status accessStatus = peak_Gain_GetAccessStatus(hCam, PEAK_GAIN_TYPE_DIGITAL, PEAK_GAIN_CHANNEL_RED);
if (PEAK_IS_WRITEABLE(accessStatus))
{
  status = peak_Gain_Set(hCam, PEAK_GAIN_TYPE_DIGITAL, PEAK_GAIN_CHANNEL_RED, gainRed);
  if (PEAK_ERROR(status)) { /* Error handling ... */ }
}

genericC++

double gain = 1.5;
nodemapRemoteDevice->FindNode<peak::core::nodes::FloatNode>("Gain")->SetValue(gain);

Querying the range for the color gains, the current value and setting a new, valid value

Prerequisite: The IDS peak API and a camera was opened (Device). See also Opening a camera (API)

© 2024 IDS Imaging Development Systems GmbH