Skip to main content

Crate hokusai

Crate hokusai 

Source
Expand description

Hokusai — pure Rust brush engine inspired by libmypaint.

Umbrella crate that re-exports the active backends based on cargo features.

Modules§

brush
The Brush value: a full configuration consumed by the stroke engine.
brushmodes
Pixel blending — port of libmypaint’s brushmodes.c.
color
Color types. Internal pipeline is linear sRGB; HSV is used at brush configuration boundaries (matches libmypaint).
evaluator
Setting evaluator: turn a Brush + normalized input values into the per-setting evaluated values needed by the dab loop.
fix15
Fixed-point pixel math matching libmypaint’s fix15 representation.
input
Brush inputs — drivers fed by the application each stroke_to call.
mapping
Per-setting input → value mapping (piecewise-linear, matches libmypaint).
myb
rng
libmypaint-compatible PRNG.
setting
Brush settings — 1:1 with libmypaint’s brushsettings.json keys.
spectral
Spectral upsampling / downsampling for libmypaint’s pigment-style “paint” blend mode.
state
Per-stroke mutable state. Mirrors libmypaint’s MyPaintBrush runtime fields so the stroke engine port can be a near-line-for-line translation.
stroke
Stroke engine — port of libmypaint’s mypaint_brush_stroke_to.
surface
TiledSurface abstraction and the Dab description passed to it.
tile
64×64 RGBA fix15 tile — matches libmypaint’s tiling so brush math, tile traversal order, and rounding behaviour can be made bit-identical.
tile_mem

Structs§

Brush
BrushState
Dab
InputMapping
SettingValue

Enums§

BrushInput
BrushSetting

Constants§

NUM_INPUTS
NUM_SETTINGS
TILE_SIZE

Traits§

TiledSurface

Type Aliases§

TilePixels
[y][x][rgba] in fix15 (premultiplied alpha, linear sRGB).