| Visual Basic (Declaration) | |
|---|---|
<FlagsAttribute()> Public Enum ApplyMathematicalLogicCommandFlags Inherits System.Enum Implements IComparable, IConvertible, IFormattable | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As ApplyMathematicalLogicCommandFlags | |
| C# | |
|---|---|
[FlagsAttribute()] public enum ApplyMathematicalLogicCommandFlags : System.Enum, IComparable, IConvertible, IFormattable | |
| C++/CLI | |
|---|---|
[FlagsAttribute()] public enum class ApplyMathematicalLogicCommandFlags : public System.Enum, IComparable, IConvertible, IFormattable | |
| Member | Description |
|---|---|
| Blue | Blue channel only. |
| Green | Green channel only. |
| Master | All channels. |
| OperationAbsoluteDifference | Calculate the Absolute difference between the Factor property and each pixel component value. (pixel = abs(pixel - Factor)) |
| OperationAdd | Add pixel component value to the Factor property, clamping the result to the maximum allowed pixel value. (pixel = min(pixel + Factor, MaximumPixelValue) ) |
| OperationAnd | Combine each pixel component value and the Factor property using a bitwise AND (&). (pixel = pixel & Factor) |
| OperationAverage | Use the average of the each pixel component value and the Factor property. (pixel = (pixel+Factor) / 2). |
| OperationDivisionByFactor | Divide each pixel component value by Factor/100. An error will be returned if Factor = 0. (pixel = pixel * 100 / Factor) |
| 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) |
| OperationMaximum | Use the greater of the pixel component values and the Factor property. (pixel = max(pixel, Factor) ) |
| OperationMinimum | Use the lesser of the pixel component values and the Factor property. (pixel = min(pixel, Factor) ) |
| OperationMultiply | Multiply each pixel component value by Factor/100. (pixel = pixel * Factor / 100) |
| OperationOr | Combine each pixel component value and the Factor property using a bitwise OR (|). (pixel = pixel | Factor) |
| 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) ) |
| 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) ) |
| OperationXor | Combine each pixel component value and the Factor property using a bitwise XOR (^). (pixel = pixel ^ Factor) |
| Red | Red channel only. |
| ResultDoNothing | No change. |
| ResultNot | Invert the color, resulting in its complement. |
| ResultOne | Change all bits to 1. |
| ResultZero | Change all bits to 0. |
| ValueDoNothing | No change. |
| ValueNot | Invert the color, resulting in its complement. |
| ValueOne | Change all bits to 1. |
| ValueZero | Change all bits to 0. |
These flags have a System.FlagsAttribute attribute that allows a bitwise combination of its member values.
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 |
- The way MinimumPixelValue and MaximumPixelValue are calculated depends on the bits per pixel and whether the image is signed or unsigned:
- if the image is unsigned (most common):
- MaximumPixelValue will be : 255 (8-bit), 4095 (12-bit) or 65535 (16-bit)
- MinimumPixelValue = 0
- if the image is signed (rare case):
- MaximumPixelValue will be : 127 (8-bit), 2047 (12-bit) or 32767 (16-bit)
- MinimumPixelValue will be -128 (8-bit), -2048 (12-bit) or -32768 (16-bit)
- if the image is unsigned (most common):
- If the Flags property is set to OperationAnd, OperationOr, OperationXor, OperationAdd, OperationMulitply, OperationMaximum, OperationMinimum, OperationDivisionByValue, or OperationSubtractValue, the valid range of the Factor property is from MinimumPixelValue to MaximumPixelValue.
- If the Flags property is set to OperationSubtract, OperationDifference, or OperationAverage, the valid range of the Factor property is from 2 * MinimumPixelValue to 2 * MaximumPixelValue.
System.Object
System.ValueType
System.Enum
Leadtools.ImageProcessing.Color.ApplyMathematicalLogicCommandFlags
Target Platforms: Silverlight, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)
Copy Code