@mbtech-nl/bitmap / getRow
Function: getRow()
ts
function getRow(bitmap: LabelBitmap, y: number): Uint8Array;Defined in: encode.ts:19
Copy one packed row of a bitmap.
Returns a fresh Uint8Array of length bytesPerRow(bitmap.widthPx) — useful for writing a single row to a transport buffer. For zero-copy iteration over every row, use iterRows.
Parameters
| Parameter | Type | Description |
|---|---|---|
bitmap | LabelBitmap | Source bitmap. |
y | number | Row index (0 ≤ y < bitmap.heightPx). |
Returns
Uint8Array
Throws
If y is out of bounds.
Example
ts
const firstRow = getRow(bitmap, 0);