Expand description
Tip bitmaps for every brush file this workspace reads.
preview_abr, preview_brush and preview_brushset each take the whole
file as bytes and return one PreviewEntry per brush in file order,
available or not. A brush whose tip cannot be rendered is reported with a
reason rather than dropped, so a caller can lay out a complete grid.
Every function here is pure over &[u8]: no filesystem, no threads, so the
crate builds for wasm32-unknown-unknown.
Modules§
- procreate
- Reading Procreate
.brushand.brushsetarchives: the guarded zip and plist readers, theShape.pngdecoder and the two name/member lookups the preview API needs.
Structs§
Enums§
Constants§
Functions§
- can_
synthesize - decode_
tip_ image - Decode an imported brush-tip image (PNG/JPEG bytes) into a grayscale tip buffer. Alpha becomes intensity when the image has an alpha channel; otherwise luminance is inverted (dark = opaque), matching Photoshop’s convention.
- downsample
- Box-filter
bitmapso its larger side is at mostmax_side(>= 1). Returns a clone when it already fits. Average of the covered source pixels per destination pixel, the same filtergenerate_preview_pnguses. - generate_
contact_ sheet_ png - generate_
preview_ png - A 200 px RGBA thumbnail: black ink, alpha from the tip’s gray value.
- preview_
abr - Tips for a Photoshop
.abrpack. - preview_
brush - The tip of a single Procreate
.brush: one entry at index 0, read from the archive’s root rather than from a member directory. - preview_
brushset - Tips for a Procreate
.brushset. - synthesize_
computed_ tip - Rasterize a monochrome elliptical tip from computed-brush geometry.
- tip_
bitmap_ of - Both formats use the same polarity — a
Shape.pngis white=stamp coverage and aTipBitmapis 255=full ink — so the pixels are copied unchanged. - to_
grayscale