getBlackRow

abstract fun getBlackRow(y: Int, row: BitArray?): BitArray

Converts one row of luminance data to 1 bit data. May actually do the conversion, or return cached data. Callers should assume this method is expensive and call it as seldom as possible. This method is intended for decoding 1D barcodes and may choose to apply sharpening. For callers which only examine one row of pixels at a time, the same BitArray should be reused and passed in with each call for performance. However it is legal to keep more than one row at a time if needed.

Return

The array of bits for this row (true means black).

Parameters

y

The row to fetch, which must be in [0, bitmap height)

row

An optional preallocated array. If null or too small, it will be ignored. If used, the Binarizer will call BitArray.clear(). Always use the returned object.

Throws

if row can't be binarized