LEADTOOLS Image Processing (Leadtools.ImageProcessing.Color assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
ApplyMathematicalLogicCommandFlags Enumeration
See Also  



Enumeration flags that identify the channel that will be used, the treatment of the input pixel values, the mathematical operation, and the treatment of the output pixel values. Supported in Silverlight, Windows Phone 7

Syntax

Visual Basic (Declaration) 
<FlagsAttribute()>
Public Enum ApplyMathematicalLogicCommandFlags 
   Inherits System.Enum
   Implements IComparableIConvertibleIFormattable 
Visual Basic (Usage)Copy Code
Dim instance As ApplyMathematicalLogicCommandFlags
C# 
[FlagsAttribute()]
public enum ApplyMathematicalLogicCommandFlags : System.Enum, IComparableIConvertibleIFormattable  
C++/CLI 
[FlagsAttribute()]
public enum class ApplyMathematicalLogicCommandFlags : public System.Enum, IComparableIConvertibleIFormattable  

Members

MemberDescription
BlueBlue channel only.
GreenGreen channel only.
MasterAll channels.
OperationAbsoluteDifferenceCalculate the Absolute difference between the Factor property and each pixel component value. (pixel = abs(pixel - Factor))
OperationAddAdd pixel component value to the Factor property, clamping the result to the maximum allowed pixel value. (pixel = min(pixel + Factor, MaximumPixelValue) )
OperationAndCombine each pixel component value and the Factor property using a bitwise AND (&). (pixel = pixel & Factor)
OperationAverageUse the average of the each pixel component value and the Factor property. (pixel = (pixel+Factor) / 2).
OperationDivisionByFactorDivide each pixel component value by Factor/100. An error will be returned if Factor = 0. (pixel = pixel * 100 / Factor)
OperationDivisionByValueDivide 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)
OperationMaximumUse the greater of the pixel component values and the Factor property. (pixel = max(pixel, Factor) )
OperationMinimumUse the lesser of the pixel component values and the Factor property. (pixel = min(pixel, Factor) )
OperationMultiplyMultiply each pixel component value by Factor/100. (pixel = pixel * Factor / 100)
OperationOrCombine each pixel component value and the Factor property using a bitwise OR (|). (pixel = pixel | Factor)
OperationSubtractFactorSubtract each pixel component value from the Factor property, clamping the result to the allowed pixel range. (pixel = min(max(Factor - pixel, MinimumPixelValue), MaximumPixelValue) )
OperationSubtractValueSubtract the Factor property from each pixel component value, clamping the result to the allowed pixel range. (pixel = min(max(pixel - Factor), MinimumPixelValue, MaximumPixelValue) )
OperationXorCombine each pixel component value and the Factor property using a bitwise XOR (^). (pixel = pixel ^ Factor)
RedRed channel only.
ResultDoNothingNo change.
ResultNotInvert the color, resulting in its complement.
ResultOneChange all bits to 1.
ResultZeroChange all bits to 0.
ValueDoNothingNo change.
ValueNotInvert the color, resulting in its complement.
ValueOneChange all bits to 1.
ValueZeroChange all bits to 0.

Remarks

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 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.

Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         Leadtools.ImageProcessing.Color.ApplyMathematicalLogicCommandFlags

Requirements

Target Platforms: Silverlight, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)

See Also