![]() |
IDS peak IPL v1.15.0
|
Applies a LUT to the input image data. More...
#include <peak_ipl/algorithm/peak_ipl_lut.hpp>
Public Types | |
| enum class | Channel { Red = 0 , Green = 1 , Blue = 2 , All = 3 } |
| Channel parameter to select the channel where the operation is applied. More... | |
| enum class | Selector { Lut_8Bit = 0 , Lut_10Bit = 1 , Lut_12Bit = 2 , Lut_16Bit = 3 } |
| Selector parameter to select to which LUT the operation is applied (8/10/12/16 bit LUT). During processing, the LUT is selected based on the pixel format. More... | |
| enum class | Preset { Identity = 0 , Inverse = 1 , Jet = 2 , Hot = 3 , Rainbow = 4 , OnlyRed = 5 , OnlyGreen = 6 , OnlyBlue = 7 , DigitalGain2 = 8 , DigitalBlack25Percent = 9 , Binarize = 10 } |
| Preset Selects a predefined LUT. More... | |
Public Member Functions | |
| Lut () | |
| Constructor for a new LUT instance. | |
| ~Lut () | |
| Destructor for the LUT instance. | |
| Lut (const Lut &other) | |
| Copy Constructor for a new LUT instance. | |
| Lut & | operator= (const Lut &other) |
| Copy assigment for LUT instance. | |
| Lut (Lut &&other) noexcept | |
| Move constructor for Lut instance. | |
| Lut & | operator= (Lut &&other) noexcept |
| Move assignment for Lut instance. | |
| uint32_t | LutValue (Selector selector, Channel channel, uint32_t index) const |
| Reads a single LUT value for a given selector and channel at an indexed position. | |
| void | SetLutValue (Selector selector, Channel channel, uint32_t index, uint32_t value) |
| Sets a single LUT value for a given selector and channel at an indexed position. | |
| std::vector< uint32_t > | AllLutValues (Selector selector, Channel channel) const |
| Reads all LUT values for a given selector and channel at once. | |
| void | SetAllLutValues (Selector selector, Channel channel, const std::vector< uint32_t > &values) |
| Sets all LUT values for a given selector and channel at once. | |
| void | SetLutPreset (Selector selector, Preset preset) |
| Applies the given preset (identity, inverse, ...) to the specified LUT. | |
| bool | IsPixelFormatSupported (PixelFormatName pixelFormatName) const |
| Returns whether the LUT supports the given pixel format. | |
| void | ProcessInPlace (Image &image) const |
| Applies the LUT to the given image in place that is, it will change the input image. | |
| Image | Process (const Image &inputImage) const |
| Applies the LUT to the given image. | |
Applies a LUT to the input image data.
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 enum class 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.
|
strong |
Channel parameter to select the channel where the operation is applied.
| Enumerator | |
|---|---|
| Red | Only operate on the red channel |
| Green | Only operate on the green channel |
| Blue | Only operate on the blue channel |
| All | Operate on all channels simultaniously |
|
strong |
Preset Selects a predefined LUT.
| Enumerator | |
|---|---|
| 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. |
| Inverse | This LUT inverts all pixel values. The highest pixel value will be converted to the lowest one and vice versa. |
| 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. |
| 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. |
| 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. |
| OnlyRed | This LUT will only allow red pixels to be shown. This is achieved by converting all pixel values of any other channel to 0. |
| OnlyGreen | This LUT will only allow green pixels to be shown. This is achieved by converting all pixel values of any other channel to 0. |
| OnlyBlue | This LUT will only allow blue pixels to be shown. This is achieved by converting all pixel values of any other channel to 0. |
| DigitalGain2 | This LUT will multiply each pixel value by 2 resulting in a gain like adjustment. |
| DigitalBlack25Percent | This LUT will apply a digital black function. See peak::ipl::GammaCorrector::SetDigitalBlack for more information. |
| Binarize | The 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). |
|
strong |
Selector parameter to select to which LUT the operation is applied (8/10/12/16 bit LUT). During processing, the LUT is selected based on the pixel format.
| Enumerator | |
|---|---|
| Lut_8Bit | Operate on the 8 bit LUT |
| Lut_10Bit | Operate on the 10 bit LUT |
| Lut_12Bit | Operate on the 12 bit LUT |
| Lut_16Bit | Operate on the 16 bit LUT |
|
inline |
Constructor for a new LUT instance.
Creates a new LUT instance.
|
inline |
Destructor for the LUT instance.
Destroys a LUT instance.
|
inline |
Copy Constructor for a new LUT instance.
Creates a new LUT instance.
| [in] | other | The other instance to acquire a reference for. |
|
inlinenoexcept |
Move constructor for Lut instance.
Moves the instance from other to this. Afterwards other is invalid.
| [in] | other | The other instance to move. |
|
inline |
Reads all LUT values for a given selector and channel at once.
| [in] | selector | The selected LUT (8, 10, 12, 16 bit) |
| [in] | channel | The channel where the new values are set |
| InvalidArgument | for values out of range or wrong vector size. |
|
inline |
Returns whether the LUT supports the given pixel format.
| [in] | pixelFormatName | The pixel format of interest. |
|
inline |
Reads a single LUT value for a given selector and channel at an indexed position.
| [in] | selector | The selected LUT (8, 10, 12, 16 bit) |
| [in] | channel | The channel from where the value is read |
| [in] | index | The index of the LUT value |
Copy assigment for LUT instance.
Acquires a reference from other to this instance. If this instance already has a reference, it will be destroyed.
| [in] | other | The other instance to acquire a reference for. |
Move assignment for Lut instance.
Moves the instance from other to this. Afterwards other is invalid.
| [in] | other | The other instance to move. |
Applies the LUT to the given image.
| [in] | inputImage | Image to process. |
| ImageFormatNotSupportedException | image has unsupported pixel format. |
|
inline |
Applies the LUT to the given image in place that is, it will change the input image.
| [in] | image | Image to process. |
| ImageFormatNotSupportedException | image has unsupported pixel format. |
|
inline |
Sets all LUT values for a given selector and channel at once.
| [in] | selector | The selected LUT (8, 10, 12, 16 bit) |
| [in] | channel | The channel where the new values are set |
| [in] | values | Vector with LUT values |
| InvalidArgument | for values out of range or wrong vector size. |
Applies the given preset (identity, inverse, ...) to the specified LUT.
| [in] | selector | The selected LUT (8, 10, 12, 16 bit) |
| [in] | preset | The predefined LUT to be set |
|
inline |
Sets a single LUT value for a given selector and channel at an indexed position.
| [in] | selector | The selected LUT (8, 10, 12, 16 bit) |
| [in] | channel | The channel where the new value is set |
| [in] | index | The index of the LUT value |
| [in] | value | The LUT value at indexed position to be set |
| InvalidArgument | for values or indexes out of range. |