Skip to main content

Logical conjunction

Makes a logical conjunction between masks.

🎭 Mask options and parameters of and method

and method performs a logical conjunction between bits of two masks.

It works like this:

let mask = new Mask(3, 3, data: new Uint8Array([1, 1, 1, 1, 1, 1, 0, 0, 0]));
let mask2 = new Mask(3, 3, data: new Uint8Array([0, 0, 0, 1, 1, 1, 1, 1, 1]));
const andMask = mask.and(mask2);
// expect andMask to equal [0,0,0,1,1,1,0,0,0]
caution

Masks must have the same size for compatibility reasons.

Parameters and default values

  • mask

  • options

Options

PropertyRequiredDefault value
outno-