Leadtools.ImageProcessing.Color Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
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.

Syntax

Visual Basic (Declaration) 
Public Enum ApplyMathematicalLogicCommandFlags 
   Inherits Enum
Visual Basic (Usage)Copy Code
Dim instance As ApplyMathematicalLogicCommandFlags
C# 
public enum ApplyMathematicalLogicCommandFlags : Enum 
C++/CLI 
public enum class ApplyMathematicalLogicCommandFlags : public Enum 

Members

MemberDescription
Master All channels.
Red Red channel only.
Green Green channel only.
Blue Blue channel only.
ValueDoNothing No change.
ValueNot Invert the color, resulting in its complement.
ValueZero Change all bits to 0.
ValueOne Change all bits to 1.
OperationAnd Combine each pixel component value and the Factor property using a bitwise AND (&). (pixel = pixel & Factor)
OperationOr Combine each pixel component value and the Factor property using a bitwise OR (|). (pixel = pixel | Factor)
OperationXor Combine each pixel component value and the Factor property using a bitwise XOR (^). (pixel = 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) )
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) )
OperationAbsoluteDifference Calculate the Absolute difference between the Factor property and each pixel component value. (pixel = abs(pixel - Factor))
OperationMultiply Multiply each pixel component value by Factor/100. (pixel = pixel * Factor / 100)
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)
OperationAverage Use the average of the each pixel component value and the Factor property. (pixel = (pixel+Factor) / 2).
OperationMinimum Use the lesser of the pixel component values and the Factor property. (pixel = min(pixel, Factor) )
OperationMaximum Use the greater of the pixel component values and the Factor property. (pixel = max(pixel, Factor) )
ResultDoNothing No change.
ResultNot Invert the color, resulting in its complement.
ResultZero Change all bits to 0.
ResultOne Change all bits to 1.

Remarks

These flags have a FlagsAttribute attribute that allows a bitwise combination of its member values.

You can use a bitwise OR (|) to specify one flag from each group.

GroupFlags
Flags that indicate the channel that will be usedMaster, Red, Green, Blue
Flags that indicate how to treat the color valueValueDoNothing, ValueNot, ValueZero, ValueOne
Flags that indicate the mathematical operation to useOperationAnd, ValueNot, ValueZero, ValueOne, OperationAnd, OperationOr, OperationXor, OperationAdd, OperationSubtractFactor, OperationSubtractValue, OperationAbsoluteDifference, OperationMultiply, OperationDivisionByFactor, OperationDivisionByValue, OperationAverage, OperationMinimum, OperationMaximum
Flags that indicate how to treat the output valueResultDoNothing, 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: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also