@mbtech-nl/bitmap
Interfaces
| Interface | Description |
|---|---|
| FontMetrics | - |
| ImageRenderOptions | - |
| LabelBitmap | A 1-bit-per-pixel bitmap. Row-major, MSB-first within each byte. |
| MultiPlaneRenderOptions | - |
| PaletteEntry | One ink/foil colour the printer can place on the substrate. |
| PlaneRenderOptions | Per-plane pre-quantisation overrides. Each field, if omitted, falls back to MultiPlaneRenderOptions.defaults, then to that field's hard default (e.g. threshold: 128, dither: false, gamma: 1). |
| RawImageData | Raw RGBA image data, compatible with browser ImageData and @napi-rs/canvas ImageData. |
| TextRenderOptions | - |
Type Aliases
| Type Alias | Description |
|---|---|
| BuiltinFont | - |
| DitherMethod | - |
| LuminanceWeights | - |
Functions
| Function | Description |
|---|---|
| bitmapEquals | Compare two bitmaps for byte-equal equality. |
| bytesPerRow | Number of packed bytes used to store one row of widthPx pixels. |
| createBitmap | Allocate an empty (all-white) bitmap. |
| cropBitmap | Extract a rectangular sub-region from a bitmap. |
| flipHorizontal | Mirror a bitmap left-to-right. |
| flipVertical | Mirror a bitmap top-to-bottom. |
| floydSteinberg | Floyd–Steinberg error-diffusion dither. |
| getPixel | Read a single pixel from a packed 1bpp bitmap. |
| getRow | Copy one packed row of a bitmap. |
| invertBitmap | Swap black and white pixels. |
| iterRows | Iterate packed rows of a bitmap top-to-bottom. |
| measureText | Compute the dimensions a renderText call would produce, without allocating a bitmap. Empty strings return { widthPx: 0, heightPx }. |
| padBitmap | Add white margins around an existing bitmap. |
| renderImage | Convert RGBA pixel data to a packed 1bpp bitmap. |
| renderMultiPlaneImage | Convert RGBA pixel data into one 1bpp LabelBitmap per palette entry. |
| renderText | Render an ASCII string into a packed 1bpp bitmap using the bundled font. |
| rotateBitmap | Rotate a bitmap clockwise by 90, 180, or 270 degrees. |
| scaleBitmap | Resize a bitmap to a target height while preserving aspect ratio. |
| stackBitmaps | Concatenate bitmaps horizontally or vertically. |