@mbtech-nl/bitmap / rotateBitmap
Function: rotateBitmap()
ts
function rotateBitmap(bitmap: LabelBitmap, degrees: 90 | 180 | 270): LabelBitmap;Defined in: transform.ts:50
Rotate a bitmap clockwise by 90, 180, or 270 degrees.
For 90 and 270 the output dimensions are swapped (widthPx and heightPx exchange). For 180 the dimensions are unchanged.
Parameters
| Parameter | Type | Description |
|---|---|---|
bitmap | LabelBitmap | Source bitmap. |
degrees | 90 | 180 | 270 | Rotation amount; 90, 180, or 270. |
Returns
A new bitmap; the input is not mutated.
Example
ts
const portrait = rotateBitmap(landscape, 90);