Package-level declarations
Types
Visual configuration for the selection chrome — the accent-colored box and handles DrawBox paints around selected elements. All sizes are in Dp and stay a constant on-screen size regardless of zoom.
Functions
Decode an encoded image payload (PNG / JPEG / WebP) into an ImageBitmap usable by the renderer. Returns null if the bytes can't be decoded; the caller renders a placeholder instead of crashing. Implementations are platform-specific because the host graphics stack drives decoding:
Decode an encoded image payload (PNG / JPEG / WebP) into an ImageBitmap usable by the renderer. Returns null if the bytes can't be decoded; the caller renders a placeholder instead of crashing. Implementations are platform-specific because the host graphics stack drives decoding:
Decode an encoded image payload (PNG / JPEG / WebP) into an ImageBitmap usable by the renderer. Returns null if the bytes can't be decoded; the caller renders a placeholder instead of crashing. Implementations are platform-specific because the host graphics stack drives decoding:
Decode an encoded image payload (PNG / JPEG / WebP) into an ImageBitmap usable by the renderer. Returns null if the bytes can't be decoded; the caller renders a placeholder instead of crashing. Implementations are platform-specific because the host graphics stack drives decoding:
Shared between the js and wasmJs targets. Both run on top of Skiko for the canvas backend, so the encoded-bytes → ImageBitmap path is identical — org.jetbrains.skia.Image.makeFromEncoded(...).toComposeImageBitmap() works on both. Keeping a single actual here avoids the maintenance cost of two identical files and the risk of one drifting from the other.
Decode and downsample bytes to fit within targetWidth × targetHeight while preserving aspect ratio. The returned bitmap's longer side may be smaller than targetWidth / targetHeight if the shorter axis hits the cap first, but never larger.
Decode and downsample bytes to fit within targetWidth × targetHeight while preserving aspect ratio. The returned bitmap's longer side may be smaller than targetWidth / targetHeight if the shorter axis hits the cap first, but never larger.
Decode and downsample bytes to fit within targetWidth × targetHeight while preserving aspect ratio. The returned bitmap's longer side may be smaller than targetWidth / targetHeight if the shorter axis hits the cap first, but never larger.
Decode and downsample bytes to fit within targetWidth × targetHeight while preserving aspect ratio. The returned bitmap's longer side may be smaller than targetWidth / targetHeight if the shorter axis hits the cap first, but never larger.
Decode and downsample bytes to fit within targetWidth × targetHeight while preserving aspect ratio. The returned bitmap's longer side may be smaller than targetWidth / targetHeight if the shorter axis hits the cap first, but never larger.
Main drawing canvas composable supporting both freehand drawing and geometric shapes.
Encode an ImageBitmap as PNG bytes, or null if encoding fails. The inverse of decodeImageBitmap; used by io.ak1.drawbox.domain.usecase.PngExporter to turn a rasterized scene into a file-ready payload. Implementations are platform-specific because the host graphics stack drives encoding:
Encode an ImageBitmap as PNG bytes, or null if encoding fails. The inverse of decodeImageBitmap; used by io.ak1.drawbox.domain.usecase.PngExporter to turn a rasterized scene into a file-ready payload. Implementations are platform-specific because the host graphics stack drives encoding:
Encode an ImageBitmap as PNG bytes, or null if encoding fails. The inverse of decodeImageBitmap; used by io.ak1.drawbox.domain.usecase.PngExporter to turn a rasterized scene into a file-ready payload. Implementations are platform-specific because the host graphics stack drives encoding:
Shared between the js and wasmJs targets — both run on Skiko, so the ImageBitmap → PNG-bytes path is identical. Mirrors decodeImageBitmap's single shared web actual to avoid two files drifting apart.