[FlagsAttribute()]
public enum CombineCommandFlags
Value | Member | Description |
---|---|---|
0x00000000 | ResultMaster | 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)) |
0x00000000 | SourceNop | No change. |
0x00000000 | SourceMaster | Perform the operation on all channels. |
0x00000000 | DestinationMaster | Perform the operation on all channels. |
0x00000000 | DestinationNop | No change. |
0x00000000 | OperationAnd | Combine each set of bytes using a bitwise AND. |
0x00000000 | ResultNop | No change. |
0x00000001 | SourceNot | Invert the color, resulting in its complement. |
0x00000002 | Source0 | Change all bits to 0. |
0x00000003 | Source1 | Change all bits to 1. |
0x00000010 | DestinationNot | Invert the color, resulting in its complement. |
0x00000020 | Destination0 | Change all bits to 0. |
0x00000030 | Destination1 | Change all bits to 1. |
0x00000100 | OperationOr | Combine each set of bytes using a bitwise OR. |
0x00000120 | SourceCopy | Copy source to destination. |
0x00000200 | OperationXor | Combine each set of bytes using a bitwise exclusive OR (^). |
0x00000300 | OperationAdd | Add the byte values, allowing a maximum of 255. |
0x00000400 | OperationSubtractSource | Subtract the source from the destination, allowing a minimum of 0. |
0x00000500 | OperationSubtractDestination | Subtract the destination from the source, allowing a minimum of 0. |
0x00000600 | OperationMultiply | Multiply the byte values, allowing a maximum of 255. The result is calculated as follows: result = (source * destination) / 255. |
0x00000700 | OperationDivideSource | 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. |
0x00000800 | OperationDivideDestination | 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. |
0x00000900 | OperationAverage | Use the average of the two values. |
0x00000A00 | OperationMinimum | Use the lesser of the two values. |
0x00000B00 | OperationMaximum | Use the greater of the two values. |
0x00000C00 | AbsoluteDifference | Calculate the Absolute difference between the two values. |
0x00001000 | ResultNot | Invert the color, resulting in its complement. |
0x00002000 | Result0 | Change all bits to 0. |
0x00003000 | Result1 | Change all bits to 1. |
0x00010000 | SourceRed | Perform the operation on the red channel. |
0x00020000 | SourceGreen | Perform the operation on the green channel. |
0x00030000 | SourceBlue | Perform the operation on the blue channel. |
0x00100000 | DestinationRed | Perform the operation on the red channel. |
0x00200000 | DestinationGreen | Perform the operation on the green channel. |
0x00300000 | DestinationBlue | Perform the operation on the blue channel. |
0x01000000 | ResultRed | Perform the operation on the red channel. |
0x02000000 | ResultGreen | Perform the operation on the green channel. |
0x03000000 | ResultBlue | Perform the operation on the blue channel. |
0x04000000 | RawCombine | Perform a raw combine. |
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.