IDS peak comfortC v1.14.2
Loading...
Searching...
No Matches

LUT related functions and types. More...

Enumerations

enum  peak_lut_selector { PEAK_LUT_8BIT , PEAK_LUT_10BIT , PEAK_LUT_12BIT }
 Enumeration for specifying which LUT should be used for LUT configuration. More...
enum  peak_lut_channel { PEAK_LUT_CHANNEL_RED , PEAK_LUT_CHANNEL_GREEN , PEAK_LUT_CHANNEL_BLUE , PEAK_LUT_CHANNEL_ALL }
 Enumeration for specifying which channel/channels should be modified when configuring the LUT. More...
enum  peak_lut_preset {
  PEAK_LUT_PRESET_IDENTITY , PEAK_LUT_PRESET_INVERSE , PEAK_LUT_PRESET_JET , PEAK_LUT_PRESET_HOT ,
  PEAK_LUT_PRESET_RAINBOW , PEAK_LUT_PRESET_ONLY_RED , PEAK_LUT_PRESET_ONLY_GREEN , PEAK_LUT_PRESET_ONLY_BLUE ,
  PEAK_LUT_PRESET_DIGITAL_GAIN2 , PEAK_LUT_PRESET_DIGITAL_BLACK_25_PERCENT , PEAK_LUT_PRESET_BINARIZE
}
 Enumeration for available LUT presets that can be applied. More...

Functions

peak_status peak_IPL_LUT_Enable (peak_camera_handle hCam, peak_bool enabled)
 Enable/disable whether the LUT should be applied to the subsequent image.
peak_bool peak_IPL_LUT_IsEnabled (peak_camera_handle hCam)
 Query whether LUT processing is enabled. If enabled, the LUT will be applied to the subsequent image.
peak_status peak_IPL_LUT_Preset_Set (peak_camera_handle hCam, peak_lut_selector selector, peak_lut_preset preset)
 Applies the given preset to the specified LUT.
peak_status peak_IPL_LUT_Value_Set (peak_camera_handle hCam, peak_lut_selector selector, peak_lut_channel channel, uint32_t index, uint32_t value)
 Sets a single LUT value for a given selector and channel at an offset.
peak_status peak_IPL_LUT_Value_Get (peak_camera_handle hCam, peak_lut_selector selector, peak_lut_channel channel, uint32_t index, uint32_t *value)
 Reads a single LUT value for a given selector and channel at an offset.
peak_status peak_IPL_LUT_ValueList_Set (peak_camera_handle hCam, peak_lut_selector selector, peak_lut_channel channel, uint32_t *values, size_t size)
 Sets all LUT values for a given selector and channel.
peak_status peak_IPL_LUT_ValueList_Get (peak_camera_handle hCam, peak_lut_selector selector, peak_lut_channel channel, uint32_t *values, size_t *size)
 Reads all LUT values for a given selector and channel.

Detailed Description

LUT related functions and types.

This feature is applied in the host.

In image processing, lookup tables (LUTs) are used to map input pixel values to new output values, enabling efficient transformations of image data. They are commonly used for tasks like color correction, contrast adjustment, and brightness modification. Instead of recalculating values for each pixel, LUTs allow quick retrieval of precomputed results, speeding up processing. LUTs are particularly effective in enhancing visual effects or applying filters without altering the image's underlying structure.

A custom lookup table (LUT) can be defined or one of several predefined LUTs can be applied. For all available predefined LUTs see peak_lut_preset.

The LUT can be configured independently for each bit depth. Depending on the image's bit depth, the corresponding LUT is applied. Ensure that the correct LUT is configured for the bit depth you intend to use.

Note
When processing monochrome images, only the red channel of the LUT is utilized, which may not produce the expected result.

Example on how to use the LUT feature:

// apply the rainbow preset for the 8 bit LUT
if (PEAK_ERROR(status))
{
// handle error
}
// enable LUT processing
if (PEAK_ERROR(status))
{
// handle error
}
// configure a custom 10 bit LUT (invert all channels)
uint32_t lutValues[1024];
for (uint32_t i = 0; i < 1024; i++)
{
lutValues[i] = 1023 - i;
}
if (PEAK_ERROR(status))
{
// handle error
}

Enumeration Type Documentation

◆ peak_lut_channel

Enumeration for specifying which channel/channels should be modified when configuring the LUT.

Since
1.12
Enumerator
PEAK_LUT_CHANNEL_RED 

Only operate on the red channel

PEAK_LUT_CHANNEL_GREEN 

Only operate on the green channel

PEAK_LUT_CHANNEL_BLUE 

Only operate on the blue channel

PEAK_LUT_CHANNEL_ALL 

Operate on all channels simultaniously

◆ peak_lut_preset

Enumeration for available LUT presets that can be applied.

Since
1.12
Enumerator
PEAK_LUT_PRESET_IDENTITY 

This is the default LUT which does not change any pixel values. Each input pixel value will be converted to the exact output pixel value. When choosing this preset no calculations will be performed.

PEAK_LUT_PRESET_INVERSE 

This LUT inverts all pixel values. The highest pixel value will be converted to the lowest one and vice versa.

PEAK_LUT_PRESET_JET 

This LUT creates a custom color mapping where the red, green, and blue channels gradually change across different ranges, producing a smooth transition from dark to light. It adjusts each color channel in a pattern that could be used for unique color grading or effects.

PEAK_LUT_PRESET_HOT 

This LUT creates a color transition where the red channel gradually increases, the green channel increases after the red, and finally, the blue channel increases in the last section. It results in a smooth shift from red to green and then to blue, producing a color gradient effect across the RGB channels.

PEAK_LUT_PRESET_RAINBOW 

This LUT creates a rainbow effect by smoothly transitioning the red, green, and blue channels through specific color ranges. It produces a gradual shift from red to green to blue, and then cycles back through the colors to create a full spectrum effect.

PEAK_LUT_PRESET_ONLY_RED 

This LUT will only allow red pixels to be shown. This is achieved by converting all pixel values of any other channel to 0.

PEAK_LUT_PRESET_ONLY_GREEN 

This LUT will only allow green pixels to be shown. This is achieved by converting all pixel values of any other channel to 0.

PEAK_LUT_PRESET_ONLY_BLUE 

This LUT will only allow blue pixels to be shown. This is achieved by converting all pixel values of any other channel to 0.

PEAK_LUT_PRESET_DIGITAL_GAIN2 

This LUT will multiply each pixel value by 2 resulting in a gain like adjustment.

PEAK_LUT_PRESET_DIGITAL_BLACK_25_PERCENT 

This LUT will apply a digital black function. See Digital Black for more information.

PEAK_LUT_PRESET_BINARIZE 

This LUT converts the image to black and white by clamping pixel values below the midpoint to 0 (black) and those above to the maximum value (white).

◆ peak_lut_selector

Enumeration for specifying which LUT should be used for LUT configuration.

Since
1.12
Enumerator
PEAK_LUT_8BIT 

Operate on the 8 bit LUT

PEAK_LUT_10BIT 

Operate on the 10 bit LUT

PEAK_LUT_12BIT 

Operate on the 12 bit LUT

Function Documentation

◆ peak_IPL_LUT_Enable()

peak_status peak_IPL_LUT_Enable ( peak_camera_handle hCam,
peak_bool enabled )

Enable/disable whether the LUT should be applied to the subsequent image.

Parameters
[in]hCamThe camera handle.
[in]enabledPEAK_TRUE if the LUT should be applied to the subsequent image, otherwise PEAK_FALSE
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.12

◆ peak_IPL_LUT_IsEnabled()

peak_bool peak_IPL_LUT_IsEnabled ( peak_camera_handle hCam)

Query whether LUT processing is enabled. If enabled, the LUT will be applied to the subsequent image.

Parameters
[in]hCamThe camera handle.
Returns
peak_bool PEAK_TRUE if the LUT processing is enabled, otherwise PEAK_FALSE.
Since
1.12

◆ peak_IPL_LUT_Preset_Set()

peak_status peak_IPL_LUT_Preset_Set ( peak_camera_handle hCam,
peak_lut_selector selector,
peak_lut_preset preset )

Applies the given preset to the specified LUT.

Parameters
[in]hCamThe camera handle.
[in]selectorIndicates the specific LUT for the operation.
[in]presetThe preset which should be applied to the selected LUT. See peak_lut_preset for details about the predefined LUTs.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_INVALID_PARAMETER selector or preset is an invalid value.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.12

◆ peak_IPL_LUT_Value_Get()

peak_status peak_IPL_LUT_Value_Get ( peak_camera_handle hCam,
peak_lut_selector selector,
peak_lut_channel channel,
uint32_t index,
uint32_t * value )

Reads a single LUT value for a given selector and channel at an offset.

Parameters
[in]hCamThe camera handle.
[in]selectorIndicates the specific LUT for the operation.
[in]channelIndicates the channel to read the value from. This value must not be PEAK_LUT_CHANNEL_ALL.
[in]indexThe index specifying the location where the value should be read.
[out]valuePointer to where the value is read to. The value is in the range between 0 and the maximum pixel value for the given bit depth. The bit depth depends on the specified selector.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_PARAMETER selector or channel is an invalid value or value is an invalid pointer.
PEAK_STATUS_OUT_OF_RANGE index is out of range.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.12

◆ peak_IPL_LUT_Value_Set()

peak_status peak_IPL_LUT_Value_Set ( peak_camera_handle hCam,
peak_lut_selector selector,
peak_lut_channel channel,
uint32_t index,
uint32_t value )

Sets a single LUT value for a given selector and channel at an offset.

Parameters
[in]hCamThe camera handle.
[in]selectorIndicates the specific LUT for the operation.
[in]channelIndicates the channel to which the operation should be applied.
[in]indexThe index specifying the location where the value should be written.
[in]valueThe value which should be written. The value must be in the range between 0 and the maximum pixel value for the given bit depth. The bit depth depends on the specified selector.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_PARAMETER selector or channel is an invalid value
PEAK_STATUS_OUT_OF_RANGE index or value is out of range.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.12

◆ peak_IPL_LUT_ValueList_Get()

peak_status peak_IPL_LUT_ValueList_Get ( peak_camera_handle hCam,
peak_lut_selector selector,
peak_lut_channel channel,
uint32_t * values,
size_t * size )

Reads all LUT values for a given selector and channel.

This function implements the Two Staged Data Query principle.

Parameters
[in]hCamThe camera handle.
[in]selectorIndicates the specific LUT for the operation.
[in]channelIndicates the channel to read the values from. This value must not be PEAK_LUT_CHANNEL_ALL.
[out]valuesPointer where the LUT values should be read to. Each value is in the range between 0 and the maximum pixel value for the given bit depth. The bit depth depends on the specified selector. If this parameter is NULL, size will contain the current number of LUT values.
values must be able to hold at least size elements.
[in,out]size
  • values equal NULL:
    out: number of elements values should be able to hold.
  • values unequal NULL:
    in: number of elements values holds. This value must align with the number of possible pixel values based on the specified selector.
    out: number of elements read to values
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_PARAMETER selector or channel is an invalid value or values or size is an invalid pointer.
PEAK_STATUS_OUT_OF_RANGE size is out of range.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.12

◆ peak_IPL_LUT_ValueList_Set()

peak_status peak_IPL_LUT_ValueList_Set ( peak_camera_handle hCam,
peak_lut_selector selector,
peak_lut_channel channel,
uint32_t * values,
size_t size )

Sets all LUT values for a given selector and channel.

Parameters
[in]hCamThe camera handle.
[in]selectorIndicates the specific LUT for the operation.
[in]channelIndicates the channel to which the operation should be applied.
[in]valuesA pointer to where the LUT values are stores. Each value must be in the range between 0 and the maximum pixel value for the given bit depth. The bit depth depends on the specified selector.
[in]sizeThe number of LUT values that are stored at values. This value must align with the number of possible pixel values based on the specified selector.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_PARAMETER selector or channel is an invalid value or values is an invalid pointer.
PEAK_STATUS_OUT_OF_RANGE any value of values or size is out of range.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Since
1.12