![]() |
IDS peak comfortC v1.13.0
|
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. | |
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.
Example on how to use the LUT feature:
| enum peak_lut_channel |
Enumeration for specifying which channel/channels should be modified when configuring the LUT.
| enum peak_lut_preset |
Enumeration for available LUT presets that can be applied.
| 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). |
| enum peak_lut_selector |
| 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.
| [in] | hCam | The camera handle. |
| [in] | enabled | PEAK_TRUE if the LUT should be applied to the subsequent image, otherwise PEAK_FALSE |
hCam is an invalid camera handle. | 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.
| [in] | hCam | The camera handle. |
| 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.
| [in] | hCam | The camera handle. |
| [in] | selector | Indicates the specific LUT for the operation. |
| [in] | preset | The preset which should be applied to the selected LUT. See peak_lut_preset for details about the predefined LUTs. |
hCam is an invalid camera handle. selector or preset is an invalid value. | 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.
| [in] | hCam | The camera handle. |
| [in] | selector | Indicates the specific LUT for the operation. |
| [in] | channel | Indicates the channel to read the value from. This value must not be PEAK_LUT_CHANNEL_ALL. |
| [in] | index | The index specifying the location where the value should be read. |
| [out] | value | Pointer 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. |
selector or channel is an invalid value or value is an invalid pointer. index is out of range. hCam is an invalid camera handle. | 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.
| [in] | hCam | The camera handle. |
| [in] | selector | Indicates the specific LUT for the operation. |
| [in] | channel | Indicates the channel to which the operation should be applied. |
| [in] | index | The index specifying the location where the value should be written. |
| [in] | value | The 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. |
selector or channel is an invalid value index or value is out of range. hCam is an invalid camera handle. | 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.
| [in] | hCam | The camera handle. |
| [in] | selector | Indicates the specific LUT for the operation. |
| [in] | channel | Indicates the channel to read the values from. This value must not be PEAK_LUT_CHANNEL_ALL. |
| [out] | values | Pointer 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 |
|
selector or channel is an invalid value or values or size is an invalid pointer. size is out of range. hCam is an invalid camera handle. | 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.
| [in] | hCam | The camera handle. |
| [in] | selector | Indicates the specific LUT for the operation. |
| [in] | channel | Indicates the channel to which the operation should be applied. |
| [in] | values | A 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] | size | The 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. |
selector or channel is an invalid value or values is an invalid pointer. values or size is out of range. hCam is an invalid camera handle.