Skip to content

@mbtech-nl/bitmap / bitmapEquals

Function: bitmapEquals()

ts
function bitmapEquals(a: LabelBitmap, b: LabelBitmap): boolean;

Defined in: encode.ts:108

Compare two bitmaps for byte-equal equality.

Returns true only when dimensions match and every byte of data is identical. Useful for snapshot tests; not appropriate for visual similarity (use getPixel or a perceptual diff for that).

Parameters

ParameterType
aLabelBitmap
bLabelBitmap

Returns

boolean

Example

ts
expect(bitmapEquals(actual, expected)).toBe(true);

Released under the MIT License.