Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.6.21
|
[FlagsAttribute()] public enum ApplyMathematicalLogicCommandFlags : System.Enum, System.IComparable, System.IConvertible, System.IFormattable
'Declaration
<FlagsAttribute()> Public Enum ApplyMathematicalLogicCommandFlags Inherits System.Enum Implements System.IComparable, System.IConvertible, System.IFormattable
'Usage
Dim instance As ApplyMathematicalLogicCommandFlags
[FlagsAttribute()] public enum ApplyMathematicalLogicCommandFlags : System.IComparable, System.IConvertible, System.IFormattable
typedef NS_OPTIONS(NSUInteger, LTApplyMathematicalLogicCommandFlags)
public enum ApplyMathematicalLogicCommandFlags
Leadtools.ImageProcessing.Color.ApplyMathematicalLogicCommandFlags = function() { }; Leadtools.ImageProcessing.Color.ApplyMathematicalLogicCommandFlags.prototype = {<br/> Master = 0x00000000, ValueDoNothing = 0x00000000, OperationAnd = 0x00000000, ResultDoNothing = 0x00000000, Red = 0x00000001, Green = 0x00000002, Blue = 0x00000003, ValueNot = 0x00000010, ValueZero = 0x00000020, ValueOne = 0x00000030, OperationOr = 0x00000100, OperationXor = 0x00000200, OperationAdd = 0x00000300, OperationSubtractFactor = 0x00000400, OperationSubtractValue = 0x00000500, OperationAbsoluteDifference = 0x00000600, OperationMultiply = 0x00000700, OperationDivisionByFactor = 0x00000800, OperationDivisionByValue = 0x00000900, OperationAverage = 0x00000A00, OperationMinimum = 0x00000B00, OperationMaximum = 0x00000C00, ResultNot = 0x00001000, ResultZero = 0x00002000, ResultOne = 0x00003000, };
[FlagsAttribute()] public enum class ApplyMathematicalLogicCommandFlags : public System.Enum, System.IComparable, System.IConvertible, System.IFormattable
Value | Member | Description |
---|---|---|
0x00000000 | Master | All channels. |
0x00000000 | ValueDoNothing | No change. |
0x00000000 | OperationAnd | Combine each pixel component value and the Factor property using a bitwise AND (&). (pixel = pixel & Factor) |
0x00000000 | ResultDoNothing | No change. |
0x00000001 | Red | Red channel only. |
0x00000002 | Green | Green channel only. |
0x00000003 | Blue | Blue channel only. |
0x00000010 | ValueNot | Invert the color, resulting in its complement. |
0x00000020 | ValueZero | Change all bits to 0. |
0x00000030 | ValueOne | Change all bits to 1. |
0x00000100 | OperationOr | Combine each pixel component value and the Factor property using a bitwise OR (|). (pixel = pixel | Factor) |
0x00000200 | OperationXor | Combine each pixel component value and the Factor property using a bitwise XOR (^). (pixel = pixel ^ Factor) |
0x00000300 | OperationAdd | Add pixel component value to the Factor property, clamping the result to the maximum allowed pixel value. (pixel = min(pixel + Factor, MaximumPixelValue) ) |
0x00000400 | OperationSubtractFactor | Subtract each pixel component value from the Factor property, clamping the result to the allowed pixel range. (pixel = min(max(Factor - pixel, MinimumPixelValue), MaximumPixelValue) ) |
0x00000500 | OperationSubtractValue | Subtract the Factor property from each pixel component value, clamping the result to the allowed pixel range. (pixel = min(max(pixel - Factor), MinimumPixelValue, MaximumPixelValue) ) |
0x00000600 | OperationAbsoluteDifference | Calculate the Absolute difference between the Factor property and each pixel component value. (pixel = abs(pixel - Factor)) |
0x00000700 | OperationMultiply | Multiply each pixel component value by Factor/100. (pixel = pixel * Factor / 100) |
0x00000800 | OperationDivisionByFactor | Divide each pixel component value by Factor/100. An error will be returned if Factor = 0. (pixel = pixel * 100 / Factor) |
0x00000900 | OperationDivisionByValue | Divide the Factor property by each pixel value. If the pixel value is 0, the result is set to the maximum allowed pixel value. (pixel = pixel ? min(Factor / pixel, MaximumPixelValue) : MaximumPixelValue) |
0x00000A00 | OperationAverage | Use the average of the each pixel component value and the Factor property. (pixel = (pixel+Factor) / 2). |
0x00000B00 | OperationMinimum | Use the lesser of the pixel component values and the Factor property. (pixel = min(pixel, Factor) ) |
0x00000C00 | OperationMaximum | Use the greater of the pixel component values and the Factor property. (pixel = max(pixel, Factor) ) |
0x00001000 | ResultNot | Invert the color, resulting in its complement. |
0x00002000 | ResultZero | Change all bits to 0. |
0x00003000 | ResultOne | Change all bits to 1. |
You can use a bitwise OR (|) to specify one flag from each group.
Group | Flags |
Flags that indicate the channel that will be used | Master, Red, Green, Blue |
Flags that indicate how to treat the color value | ValueDoNothing, ValueNot, ValueZero, ValueOne |
Flags that indicate the mathematical operation to use | OperationAnd, ValueNot, ValueZero, ValueOne, OperationAnd, OperationOr, OperationXor, OperationAdd, OperationSubtractFactor, OperationSubtractValue, OperationAbsoluteDifference, OperationMultiply, OperationDivisionByFactor, OperationDivisionByValue, OperationAverage, OperationMinimum, OperationMaximum |
Flags that indicate how to treat the output value | ResultDoNothing, ResultNot, ResultZero, ResultOne |
In order to speed up widely used image processing filters in LEADTOOLS, the grayscale value (master channel) of a colored image is calculated using the following formulas:
#define CalcGrayValue(r, g, b) ((L_UCHAR)(((L_UCHAR) (((2 * (L_UINT) (r)) + (5 * (L_UINT) (g)) + (L_UINT) (b) + 4) / 8)))) #define CalcGrayValue16(r, g, b) ((L_UINT16) (((2 * (L_UINT32) (r)) + (5 * (L_UINT32) (g)) + (L_UINT32) (b) + 4) / 8)) #define CalcGrayValue32(r, g, b) ((L_UINT32) (((2 * (L_UINT32) (r)) + (5 * (L_UINT32) (g)) + (L_UINT32) (b) + 4) / 8))
System.Object
System.ValueType
System.Enum
Leadtools.ImageProcessing.Color.ApplyMathematicalLogicCommandFlags