←Select platform

CombineCommandFlags Enumeration

Summary
Enumeration that indicates the treatment of the source, treatment of the destination, the operation to use when combining the data, and the treatment of the resulting image. The flags apply only to the defined rectangles (not necessarily the whole image). This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Syntax
C#
Objective-C
C++/CLI
Java
Python
[FlagsAttribute()] 
public enum CombineCommandFlags   
typedef NS_OPTIONS(NSUInteger, LTCombineCommandFlags) 
public final class CombineCommandFlags 
    extends java.lang.Enum<CombineCommandFlags> 
[FlagsAttribute()] 
public enum class CombineCommandFlags   
class CombineCommandFlags(Enum): 
   DestinationNop = 0 
   DestinationNop = 0 
   DestinationNop = 0 
   DestinationNop = 0 
   DestinationNop = 0 
   DestinationNop = 0 
   DestinationNop = 0 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, SourceNot = 1 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, Source0 = 2 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, Source1 = 3 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, DestinationNot = 16 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, Destination0 = 32 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, Destination1 = 48 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, OperationOr = 256 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, SourceCopy = 288 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, OperationXor = 512 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, OperationAdd = 768 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, OperationSubtractSource = 1024 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, OperationSubtractDestination = 1280 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, OperationMultiply = 1536 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, OperationDivideSource = 1792 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, OperationDivideDestination = 2048 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, OperationAverage = 2304 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, OperationMinimum = 2560 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, OperationMaximum = 2816 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, AbsoluteDifference = 3072 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, ResultNot = 4096 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, Result0 = 8192 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, Result1 = 12288 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, SourceRed = 65536 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, SourceGreen = 131072 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, SourceBlue = 196608 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, DestinationRed = 1048576 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, DestinationGreen = 2097152 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, DestinationBlue = 3145728 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, ResultRed = 16777216 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, ResultGreen = 33554432 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, ResultBlue = 50331648 
   SourceMaster, DestinationMaster, SourceNop, OperationAnd, ResultNop, ResultMaster, RawCombine = 67108864 
Members
ValueMemberDescription
0x00000000ResultMaster Perform the operation on all channels.

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

0x00000000SourceNop No change.
0x00000000SourceMaster Perform the operation on all channels.
0x00000000DestinationMaster Perform the operation on all channels.
0x00000000DestinationNop No change.
0x00000000OperationAnd Combine each set of bytes using a bitwise AND.
0x00000000ResultNop No change.
0x00000001SourceNot Invert the color, resulting in its complement.
0x00000002Source0 Change all bits to 0.
0x00000003Source1 Change all bits to 1.
0x00000010DestinationNot Invert the color, resulting in its complement.
0x00000020Destination0 Change all bits to 0.
0x00000030Destination1 Change all bits to 1.
0x00000100OperationOr Combine each set of bytes using a bitwise OR.
0x00000120SourceCopy Copy source to destination.
0x00000200OperationXor Combine each set of bytes using a bitwise exclusive OR (^).
0x00000300OperationAdd Add the byte values, allowing a maximum of 255.
0x00000400OperationSubtractSource Subtract the source from the destination, allowing a minimum of 0.
0x00000500OperationSubtractDestination Subtract the destination from the source, allowing a minimum of 0.
0x00000600OperationMultiply Multiply the byte values, allowing a maximum of 255. The result is calculated as follows: result = (source * destination) / 255.
0x00000700OperationDivideSource Divide the destination by the source. If source > 0, then the result is calculated as follows: result = min( (destination / source) * 255, 255 ). Otherwise, if source = 0, then result = 255.
0x00000800OperationDivideDestination Divide the source by the destination. If dest > 0, then the result is calculated as follows: result = min( (source / destination) * 255, 255 ). Otherwise, if destination = 0, then result = 255.
0x00000900OperationAverage Use the average of the two values.
0x00000A00OperationMinimum Use the lesser of the two values.
0x00000B00OperationMaximum Use the greater of the two values.
0x00000C00AbsoluteDifference Calculate the Absolute difference between the two values.
0x00001000ResultNot Invert the color, resulting in its complement.
0x00002000Result0 Change all bits to 0.
0x00003000Result1 Change all bits to 1.
0x00010000SourceRed Perform the operation on the red channel.
0x00020000SourceGreen Perform the operation on the green channel.
0x00030000SourceBlue Perform the operation on the blue channel.
0x00100000DestinationRed Perform the operation on the red channel.
0x00200000DestinationGreen Perform the operation on the green channel.
0x00300000DestinationBlue Perform the operation on the blue channel.
0x01000000ResultRed Perform the operation on the red channel.
0x02000000ResultGreen Perform the operation on the green channel.
0x03000000ResultBlue Perform the operation on the blue channel.
0x04000000RawCombine Perform a raw combine.
Remarks

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

Group Flags
Flags that define treatment of the source rectangle SourceNop, SourceNot, Source0, Source1
Flags that define treatment of the destination rectangle DestinationNop, DestinationNot, Destination0, Destination1
Flags that define the operation to use when combining the data OperationAnd, OperationOr, OperationXor, OperationAdd, OperationSubtractSource, OperationSubtractDestination, OperationMultiply, OperationDivideSource, OperationDivideDestination, OperationAverage, OperationMinimum, OperationMaximum, AbsoluteDifference
Flags that define treatment of the resulting image rectangle ResultNop, ResultNot, Result0, Result1
Flags that define the channel of the source image rectangle SourceMaster, SourceRed, SourceGreen, SourceBlue
Flags that define the channel of the destination image rectangle DestinationMaster, DestinationRed, DestinationGreen, DestinationBlue
Flags that define the channel of the resulting image rectangle ResultMaster, ResultRed, ResultGreen, ResultBlue

The flags will work with the following order: First the operations on source and destination rectangles will take effect then the combining operation will be implemented, then the operation on result rectangle will take effect. For more information, refer to Flags for the CombineCommand.

Requirements

Target Platforms

Help Version 22.0.2023.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.ImageProcessing.Effects Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.