canvas
canvas
Mojo package đźˇ
canvas
Modules
aa_area: Signed-area anti-aliasing for nonzero path and stroke fills.aa_crossing: Supersampled scanline coverage for anti-aliased path and polygon fills.batch: Rendering aCanvasbatch: the primitives recorded betweenbegin_batchandend_batch, drawn in one banded pass.batch_ops: What aCanvasbatch records: the op, the batch holding them, and the constructors for the ops with no geometry to gather.blend: Blend and composite modes: what a drawing operation does to the pixels already there, beyond the source-over every primitive uses by default.blur: Gaussian blur, approximated by three successive box blurs, anddraw_shadowed, the drop-shadow / glow composite built on it.bounds: ADrawTargetthat draws nothing and remembers where the ink would have gone:BoundsTarget.buffer: The pixel raster buffer at the core of the canvas package.color: RGBA color type and basic blending.compose: Compositing one canvas onto another: everything else in this package draws shapes into a buffer, and this draws a buffer into a buffer.fill_rule: Fill rules: howfill_polygon/fill_pathand their gradient variants decide which regions of a self-intersecting or multi-sub-path shape count as inside.geometry: Geometric types shared by the primitives that take more than a single (x, y) pair.gradient: Color gradients:LinearGradient,RadialGradientandConicGradient, consumed by the gradient fills in canvas.shapes.rects (fill_rect_gradient,fill_rect_radial_gradient) and path.mojo (fill_path_gradient,fill_path_radial_gradient,fill_path_conic_gradientand their_aavariants). Those are the only gradient-aware fills; circle/ellipse/polygon variants aren’t built, andConicGradienthas no rect fill of its own.machine: What the CPU this process is running on looks like, for the few thresholds that depend on it.mask: Alpha masks: a per-pixel coverage, 0-255, that a fill is painted through, a layer is composited through, or drawing is clipped to – the shape of an operation separated from how the shape was made.named_colors: Named colors: the CSS Color Module Level 3 / X11 “extended color keywords” list (https://www.w3.org/TR/css-color-3/#svg-color) plusREBECCAPURPLE(Level 4), asColorconstants, so a caller can writeCORNFLOWERBLUEinstead ofColor(100, 149, 237). Each name is the CSS keyword uppercased with no separators (CORNFLOWERBLUE, notCORNFLOWER_BLUE), so it matches the spec and any color picker directly. Both CSS spellings of the gray names (GRAY/GREY,DARKGRAY/DARKGREY, …) are included with identical values.path: A general path type: move/line/quadratic-curve/cubic-curve/arc-to/ close, built up through chained calls, then flattened into straight- line segments and handed to canvas.shapes’ polyline/polygon/fill machinery.pattern: Raster patterns as a fill source:PatternSource, aColorSource(gradient.mojo) that samples a smallCanvastile instead of projecting onto a gradient axis. Consumed byfill_path_pattern/fill_path_pattern_aa(path.mojo) andfill_rect_pattern(canvas.shapes.rects), the pattern-fill counterparts of the gradient fills those modules already carry.resize: Box-filter downsampling: shrink a Canvas by an integer factor, each output pixel the average of the corresponding factor x factor block of input pixels.workers: Helpers for splitting parallel passes into row bands, and the one place the library runs a band as a task.