- 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.BuildLinear Method
Builds a LUT from linear function with given parameters.
Namespace:
Aurigma.GraphicsMill.Transforms
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Syntax
Parameters
- a
-
Type: System.Single
Value that specifies a parameter of the linear function (an angle of the line slope). See Remarks section for more details.
- b
-
Type: System.Single
Value that specifies b parameter of the linear function (a line shift relatively the origin of coordinates). See Remarks section for more details.
- extended
-
Type: System.Boolean
Value that specifies if LUTshould be build for extended (16 bits per channel) or non-extended (8 bits per channel) bitmaps. If it is true, LUT entries number is 65536 and maximum value is 65535, otherwise entries number is 256 and maximum value is 255.
Remarks
Linear functions are described with two parameters a and b in the following way:
f(x) = a * x + b
Argument a defines an angle of the line slope (to be more precise, it is a tangent of this angle). When this argument is 0, function degenerates to f(x) = b, and the line becomes parallel to the x-axis.
Argument b defines a shift of the line relatively the origin of coordinates, i. e. point (0, 0). When this argument is 0, function degenerates to f(x) = a*x, and the line passes through the origin of coordinates.
Quite often you have two points and need to build a line which connects them. Let's assume that these points are specified with coordinates (x1, y1) and (x2, y2) correspondingly. In this case you can calculate parameters a and b in the following way:
a = (y1 - y2) / (x1 - x2)
b = (y2 * x1 - y1 * x2) / (x1 - x2)
Draw attention, x1 and x2 cannot be equal to avoid division by zero. It means that you cannot specify a line which is absolutely parallel to y-axis. As a workaround, you should compare these values before a and b calculating, and if they are equal, add to one of them small number (e.g. 0.001). As LUT is a discrete function, it will cause no problem.
Linear function with a = 1 and b = 0 produces LUT which does not change an image (in other words, input luminosity values are mapped to the same output values). You can also create such LUT with BuildIdentical(Boolean) method.