Declaration: TMetaData.CombinePixMasks(SourceMasks: TIntArray; Destination: integer; Combination: TMaskCombination): integer;
Combines all masks listed in the array SourceMasks by the logical operator specified in Combination and outputs the results to the Destination mask. The Combination parameter may either be mcOR or mcAND. If any of the source masks is specified by a negative number the corresponding mask is inverted before combining it. The function returns the following error codes:
 0 .... everything OK
-1 ... one or several of the source masks do not exist
-2 ... the destination mask does not exist
-3 ... one of the source masks is equal to the destination mask
Example: The statement CombinePixMasks ([-3 1 -4], 10, mcAND) combines the masks 3, 1 and 4 by a logical AND and outputs the results to mask 10. The masks 3 and 4 are inverted before the combination is calculated. Thus the resulting mask is calculated according to the following logic equation:
M10 := not M3 and M1 and not M4.

Hint: In order to directly access the metadata of the currently loaded dataset you can use the pre-declared global variable MData.