- Aurigma Graphics Mill 5.5 for .NET
- Introduction
- What's New?
- Overview of Features
- Getting Started
- Programming with Graphics Mill for .NET
- File Formats
- Graphics Mill for .NET Add-ons
- Class Library Reference
- Aurigma.GraphicsMill Namespace
- Aurigma.GraphicsMill.AjaxControls Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.Math Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.RedoUndo Namespace
- Aurigma.GraphicsMill.Codecs Namespace
- Aurigma.GraphicsMill.Drawing Namespace
- Aurigma.GraphicsMill.Licensing Namespace
- Aurigma.GraphicsMill.Transforms Namespace
- AddNoise Class
- AdjustHsl Class
- ApplyLut Class
- ApplyMatrixTransform Class
- BitmapTransform Class
- Blur Class
- BlurType Enumeration
- Brightness Class
- BrightnessContrast Class
- Buttonize Class
- ChannelBalance Class
- ColorManagementEngine Enumeration
- ColorQuantizationAlgorithm Enumeration
- ColorTransformationIntent Enumeration
- CombineMode Enumeration
- Combiner Class
- Contrast Class
- Crop Class
- Curves Class
- Cylindrize Class
- Direction Enumeration
- DistributionKind Enumeration
- DitheringType Enumeration
- EdgeDetect Class
- EdgeDetectMode Enumeration
- Emboss Class
- FadeType Enumeration
- FloodFill Class
- FloodFillMode Enumeration
- Glow Class
- HistogramEqualize Class
- InterpolationMode Enumeration
- Invert Class
- Levels Class
- Lut Class
- MaskedBitmapTransform Class
- Matrix Class
- MaximumFilter Class
- MedianFilter Class
- MinimumFilter Class
- Mosaic Class
- Orientation Enumeration
- PageCurl Class
- PerChannelBitmapTransform Class
- PixelFormatConverter Class
- RedEyeBlob Class
- RedEyeMask Class
- RedEyeRemoval Class
- RedEyeRemovalMode Enumeration
- Resize Class
- ResizeMode Enumeration
- Rotate Class
- RotateAndFlip Class
- Shadow Class
- Sharpen Class
- Solarize Class
- Spray Class
- SwapChannels Class
- Swirl Class
- Texturize Class
- Transparentize Class
- UnsharpMask Class
- Waddle Class
- WaterDrop Class
- Wave Class
- WaveType Enumeration
- Aurigma.GraphicsMill.WebControls Namespace
- Aurigma.GraphicsMill.WinControls Namespace
- GraphicsMill Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.Math Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.RedoUndo Namespace (Client Class Library)
- Samples
- Licensing
- Copyright Notices
Lut Class
This class represents look-up table (LUT) used for tone correction.
Namespace:
Aurigma.GraphicsMill.Transforms
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Syntax
<DefaultMemberAttribute("Item")> _
Public NotInheritable Class Lut _
Inherits LockableObject _
Implements ICloneable, IEnumerable
[DefaultMemberAttribute("Item")]
public sealed class Lut : LockableObject, ICloneable, IEnumerable
Remarks
Look-up tables are used in most tone correction algorithms. LUT defines a "luminosity function", in other words, a rule which translate channel luminosity to another value. Actually it is implemented as an array where entries means the luminosity values for channels which has luminosity equal to this entry index. To make it more clean, let's see the pseudocode for the algorithm which uses LUT:
' This is a pseudocode demonstrating
' how LUT works. Note, it is not an actual code and
' this syntax is not correct for Graphics Mill objects! It
' is just used for brevity.
' Let's assume that width and height - image dimension (both for input
' and output), channelCount - number of channels defined for bitmap pixel format
' (also the same in both bitmaps). LUT is specified look-up table
For i = 0 To height - 1
For j = 0 To width - 1
For k = 0 to channelCount - 1
outputBitmap(i, j, k) = LUT(inputBitmap(i, j, k))
Next
Next
Next
// This is a pseudocode demonstrating
// how LUT works. Note, it is not an actual code and
// this syntax is not correct for Graphics Mill objects! It
// is just used for brevity.
// Let's assume that width and height - image dimension (both for input
// and output), channelCount - number of channels defined for bitmap pixel format
// (also the same in both bitmaps). LUT is specified look-up table
for ( i = 0; i < height - 1; i++)
{
for ( j = 0; j < width - 1; j++)
{
for ( k = 0; k < channelCount - 1; k++)
{
outputBitmap[i, j, k] = LUT[inputBitmap[i, j, k]];
}
}
}
For LUT entries the following rules are true:
- Minimum value of the LUT entry is 0.
- Maximum value of the LUT entry is a maximum possible luminosity for target pixel format. If pixel format is not extended (i. e. it has 8 bits per channel), maximum value is 255. For extended pixel formats (16 bits per channel) maximum value is 65535.
- LUT has as much entries as maximum possible luminosity (for 8 bit per channel images it is 255, for 16 bits per channel images - 65535).
- If LUT is not define monotone increasing function, some pixel values will be inverted (at the decreasing function sections).
As LUT values depend on the target bitmap pixel format (saying more precisely, it depends on the channel bit depth), this class provides a property IsExtended. When you change it, the look-up table is resized either to 8-bit or 16-bit case. Besides of that each contrustor (instead of parameterless one) has argument specifying what bit depth to use.
If you create 16-bit LUT, then set IsExtended property to false (convert it to 8-bit), and after that set it back to true, LUT won't be the same as initially. Some information can be lost. It interpolates the missing entries linearly.
You can fill the LUT as if it is common array using property Item[Int32]. To check how much entries it actually has, use Length property. You can also create predefined LUTs using BuildXXX methods. For example, BuildEmpty(Boolean) method creates LUT filled with zeros. BuildFromSpline(PointF[], Boolean) method defines a LUT as a curve which passes specified array of points. BuildLinear(Single, Single, Boolean) method defines a LUT as a linear function with given parameters.