You are here: Start » Function Reference » Image » Image Look Up Tables » ApplyPixelLut

ApplyPixelLut
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationBasic |
Applies previously created Look Up transformation to provided image.
Syntax
void fil::ApplyPixelLut ( const fil::Image& inImage, ftl::Optional<const fil::Region&> inRoi, const fil::PixelLut& inLut, fil::Image& outImage )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
inImage | const Image& | Image to which LUT transformation will be applied | |
![]() |
inRoi | Optional<const Region&> | NIL | Range of pixels to be processed |
![]() |
inLut | const PixelLut& | LUT object, which defines transformation | |
![]() |
outImage | Image& | Transformed image |
Requirements
For input inImage only pixel formats are supported: 1⨯uint8, 1⨯int8, 1⨯uint16, 1⨯int16, 2⨯uint8, 2⨯int8, 2⨯uint16, 2⨯int16, 3⨯uint8, 3⨯int8, 3⨯uint16, 3⨯int16, 4⨯uint8, 4⨯int8, 4⨯uint16, 4⨯int16.
Read more about pixel formats in Image documentation.
Description
This filter will apply previously created (by i.e. CreatePowerLut) LookUp Table transformation to inImage. Type and depth of resulting outImage are determined by properties of inLut, which were fixed during creation of LUT.
Generally speaking, LookUp transform should only be applied to monochromatic images. However, ApplyPixelLut allows for transformation of color images, under special conditions:
- inLut has to be created for single channel output
- inImage has to be multichannel (its depth has to be greater than 1)
If those conditions are met, processing steps are as follows: input image is being split into separate channels, every channel is processed by inLut, resulting processed channels are being merged into outImage.
It also possible to apply multichannel LUT to multichannel image, however number of channels (depth) must match, i.e. one can apply LUT of depth 3 to color, 3-channel image.
ApplyPixelLut can work with images of type: INT8, UINT8, INT16, UINT16, INT32, REAL. Operation time can be longer with INT32 and REAL, because LUT is not cached in this case - all calculations are performed during each execution, as opposed to cached execution, when only copying of appropriate values is conducted.
Remarks
Please note, that one cannot apply custom LUT created for INT32 and REAL types. This would result in storing enormous array of data in-memory and would not be feasible.
Standard operations like PowerImage, CorrectGamma and LogarithmImage for images of type Int32 and Real are available in Image Point Transforms category.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Region exceeds an input image in ApplyPixelLut. |
DomainError | Not supported inImage pixel format in ApplyPixelLut. Supported formats: 1xUInt8, 1xInt8, 1xUInt16, 1xInt16, 2xUInt8, 2xInt8, 2xUInt16, 2xInt16, 3xUInt8, 3xInt8, 3xUInt16, 3xInt16, 4xUInt8, 4xInt8, 4xUInt16, 4xInt16. |
See Also
- ApplyPixelLut – Applies previously created Look Up transformation to provided image.
- CreatePowerLut – Creates Look Up Table for power operation on image pixels.
- CreateGammaCorrectionLut – Creates Look Up Table for gamma correction operation on image pixels.
- CreateLogarithmLut – Creates Look Up Table for logarithm operation on image pixels.