Pre-1.0: signatures are not frozen. Generated from rustdoc JSON of the compiled crate; rustdoc JSON format version 60. Only public items are listed.
Procedural noise surfaces: a noise field mapped through a colour ramp into
an image, with optional film grain, painted as an ordinary
[aster_ui::Recording] (the same route as every other effect image).
Speed model:
- The field is generated at a reduced internal resolution (about
[
Surface::budget] samples; smooth fields are upscaled bilinearly by the renderer, so a full-screen aurora costs a few milliseconds, not a million noise evaluations). - Frames are cached on a thread-local LRU keyed on every parameter plus
the time quantum (
timeis snapped to1 / fpsseconds), so an unchanged frame is a hash lookup. [cache_stats] exposes hits and misses. - Film grain is a pool of 256x256 tiles (8 variants per amount) drawn with
Nearestsampling, so animating it costs no per-pixel work after warm-up.
Output is deterministic: identical inputs give byte-identical pixels (see
[crate::noise] for the float guarantee).
Structs
structaster_blueprint::noise_surface::Surface
pub struct Surface { /* see fields */ }A fully resolved surface description (colours are plain sRGB8).
Public fields
| field | type | |
|---|---|---|
kind | SurfaceKind | |
seed | u32 | |
scale | f64 | Logical px per noise lattice unit (feature size). |
fractal | noise::Fractal | |
stops | Vec<(f64, [u8; 4])> | Colour ramp stops (position 0..=1, rgba), sorted by position. |
speed | f64 | Lattice units per second along the time axis (0 = still). |
time | f64 | Seconds, snapped to 1 / fps. |
fps | u32 | Frame quantum: time snaps to multiples of 1 / fps (default 30). |
detail | Option<f64> | Internal px per sample (None = automatic from [Self::budget]). |
budget | u32 | Target number of internal samples when detail is automatic. |
grain | f64 | Film grain amount 0..=1 (0 = none). |
grain_fps | u32 | |
corner | f64 | Rounded-corner radius in px (baked into the alpha). |
warp | f64 | Domain-warp strength (Warp) or gradient distortion (Aurora). |
contrast | f64 | Contrast about the ramp middle (1 = unchanged). |
Methods
fn new(kind: SurfaceKind) -> Self— A surface ofkindwith a black-to-white ramp and sensible defaults.fn quantized_time(&self) -> f64—timesnapped to the frame quantum.fn field(&self, px: f64, py: f64, w: f64, h: f64) -> f64— The0..=1field value at logical position(px, py)of awxhsurface.fn lut(&self) -> [[u8; 4]; 256]— 256-entry colour lookup of the ramp.fn grid(&self, w: f64, h: f64) -> (usize, usize)— Internal sample grid(iw, ih)for awxhsurface.fn pixels(&self, w: f64, h: f64) -> (usize, usize, Vec<u8>)— Generate the RGBA pixels of the field at its internal resolution.fn signature(&self, w: f64, h: f64) -> u64— A hash of everything [Surface::recording] draws for awxhsurface: the field (its cache key, so the frame quantum is in it), the grain amount and the grain frame. Equal hashes, equal pictures.fn image(&self, w: f64, h: f64) -> Result<Arc<ImageResource>, Error>— The (cached) image of the field alone.fn recording(&self, w: f64, h: f64) -> Result<Recording, Error>— A recording ofwxhlogical px: the field (bilinear) plus grain.
Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq
Enums
enumaster_blueprint::noise_surface::SurfaceKind
pub enum SurfaceKind { Value, Perlin, Simplex, Cellular, Edges, Fbm, Ridged, Turbulence, Warp, Aurora }What field a surface shows.
Methods
const ALL: [SurfaceKind; 10]— Every kind, incore.noise.surface.v1kindindex order.fn from_index(v: f64) -> Option<Self>— The kind for a graphkindindex (0value ...9aurora).fn name(self) -> &'static str— A short stable name ("fbm","edges", ...).
Variants
ValuePerlinSimplexCellular— Cellular F1 distance.Edges— CellularF2 - F1: bright cell borders.FbmRidgedTurbulenceWarp— Domain-warped fBm (marble / smoke).Aurora— A vertical gradient bent by slow flowing noise (aurora backgrounds).
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
Functions
fnaster_blueprint::noise_surface::cache_stats
pub fn cache_stats() -> (u64, u64)(hits, misses) of this thread's frame cache since [clear_cache].
fnaster_blueprint::noise_surface::clear_cache
pub fn clear_cache()Drop this thread's cached frames and grain tiles and zero [cache_stats].
fnaster_blueprint::noise_surface::even_stops
pub fn even_stops(colors: &[[u8; 4]]) -> Vec<(f64, [u8; 4])>Evenly spaced stops for colors (a single colour is flat).
fnaster_blueprint::noise_surface::grain_commands
pub fn grain_commands(rec: &mut aster_ui::Recorder, w: f64, h: f64, amount: f64, seed: u32, time: f64, fps: u32) -> Result<(), aster_ui::Error>Append film-grain tile commands covering a w x h box to rec (at most
one command per 256 px tile). time selects the frame at fps frames/second.
fnaster_blueprint::noise_surface::grain_recording
pub fn grain_recording(w: f64, h: f64, amount: f64, seed: u32, time: f64, fps: u32) -> Result<aster_ui::Recording, aster_ui::Error>A grain-only recording (core.noise.grain.v1, [crate::ui::noise::grain]).
fnaster_blueprint::noise_surface::grain_signature
pub fn grain_signature(w: f64, h: f64, amount: f64, seed: u32, time: f64, fps: u32) -> u64A hash of what [grain_recording] draws.
fnaster_blueprint::noise_surface::ramp_lut
pub fn ramp_lut(stops: &[(f64, [u8; 4])]) -> [[u8; 4]; 256]Piecewise-linear colour ramp sampled at 256 points (straight sRGB8 blend).
Constants
constaster_blueprint::noise_surface::MAX_EDGE
pub const MAX_EDGE: f64Largest surface edge in logical px (Err(Capacity) beyond).