ImageGear .NET v25.2 - Updated
TransformWithLUT Method
Example 




ImageGear.Core Assembly > ImageGear.Processing Namespace > ImGearRasterProcessing Class : TransformWithLUT Method
Page to apply the LUT to.
Multichannel LUT that shall be applied.
Applies lookup tables to each channel of the image, optionally changing channel depths.
Syntax
'Declaration
 
Public Shared Sub TransformWithLUT( _
   ByVal page As ImGearRasterPage, _
   ByVal LUT As ImGearMultichannelLUT _
) 
'Usage
 
Dim page As ImGearRasterPage
Dim LUT As ImGearMultichannelLUT
 
ImGearRasterProcessing.TransformWithLUT(page, LUT)
public static void TransformWithLUT( 
   ImGearRasterPage page,
   ImGearMultichannelLUT LUT
)
public: static void TransformWithLUT( 
   ImGearRasterPage* page,
   ImGearMultichannelLUT* LUT
) 
public:
static void TransformWithLUT( 
   ImGearRasterPage^ page,
   ImGearMultichannelLUT^ LUT
) 

Parameters

page
Page to apply the LUT to.
LUT
Multichannel LUT that shall be applied.
Remarks
This method applies a multichannel lookup table to each channel of the image, optionally changing channel depths.

Number of single-channel LUTs in the multichannel LUT must match number of image channels. Input depth of each single-channel LUT must match the depth of corresponding channel. Depths of image channels after transform are determined by output depths of the coresponding single-channel LUTs.

Example
// Make sure the image is gray.
if (!ImGearRasterProcessing.ImageIsGray(igRasterPage))
    return;
// Create a LUT to convert image from 8bit to 4bit while also inverting.
ImGearMultichannelLUT igMultichannelLUT = new ImGearMultichannelLUT(
    igRasterPage.DIB.ChannelCount, 8, 4);
for (int i = 0; i < 255; ++i )
{
    igMultichannelLUT[0][i] = 15 - (i / 16);
}
// Transform the image with the LUT.
ImGearRasterProcessing.TransformWithLUT(igRasterPage,igMultichannelLUT);
' Make sure the image is gray.
If Not ImGearRasterProcessing.ImageIsGray(igRasterPage) Then
    Return
End If
' Create a LUT to convert image from 8bit to 4bit while also inverting.
Dim igMultichannelLUT As New ImGearMultichannelLUT(igRasterPage.DIB.ChannelCount, 8, 4)
For i As Integer = 0 To 254
    igMultichannelLUT(0)(i) = 15 - (i / 16)
Next
' Transform the image with the LUT.
ImGearRasterProcessing.TransformWithLUT(igRasterPage, igMultichannelLUT)
See Also

Reference

ImGearRasterProcessing Class
ImGearRasterProcessing Members
ImGearRasterPage Class
ImGearMultichannelLUT Class

Is this page helpful?
Yes No
Thanks for your feedback.