pub struct Atmosphere { /* private fields */ }Expand description
Editable bounded recipe; sampling retains no playback or random state.
The parameters are shared with the core paint, and the recipe dereferences to them so
fields such as opacity remain directly editable. This type adds presets, baking and
blend-mode selection.
Implementations§
Source§impl Atmosphere
impl Atmosphere
Sourcepub const fn new(parameters: AtmosphereParameters) -> Self
pub const fn new(parameters: AtmosphereParameters) -> Self
Wraps explicit parameters; they are validated when the recipe is painted or rendered.
Sourcepub fn light_leak(seed: u32) -> Self
pub fn light_leak(seed: u32) -> Self
Warm HDR light entering from the left edge.
Sourcepub fn validate(&self) -> Result<(), ValidationError>
pub fn validate(&self) -> Result<(), ValidationError>
Validates the full recipe before noise evaluation or allocation.
Sourcepub fn paint(
&self,
canvas: PixelSize,
time: Time,
) -> Result<AtmospherePaint, ValidationError>
pub fn paint( &self, canvas: PixelSize, time: Time, ) -> Result<AtmospherePaint, ValidationError>
Captures the same recipe as an independently evaluated CPU/GPU paint.
Canvas pixels determine wavelength, drift and envelope coordinates; painted shape bounds map to that canvas. This does not bake or allocate an image.
Sourcepub fn blend_mode(&self) -> BlendMode
pub fn blend_mode(&self) -> BlendMode
Blend mode that composes this recipe without darkening: Screen for fog, Plus for HDR light.
Sourcepub fn overlay(
&self,
size: PixelSize,
time: Time,
limits: RasterLimits,
) -> Result<Node>
pub fn overlay( &self, size: PixelSize, time: Time, limits: RasterLimits, ) -> Result<Node>
Renders the recipe at an explicit time into a bilinear-sampled node using
Self::blend_mode. The node has the pixel size as its design size, so it
fills a canvas of the same dimensions.
Sourcepub fn render(
&self,
size: PixelSize,
time: Time,
limits: RasterLimits,
) -> Result<ImageAsset>
pub fn render( &self, size: PixelSize, time: Time, limits: RasterLimits, ) -> Result<ImageAsset>
Generates a full image at explicit time after pixel, byte and work admission.
Sourcepub fn render_region(
&self,
canvas: PixelSize,
origin: [u32; 2],
size: PixelSize,
time: Time,
limits: RasterLimits,
) -> Result<ImageAsset>
pub fn render_region( &self, canvas: PixelSize, origin: [u32; 2], size: PixelSize, time: Time, limits: RasterLimits, ) -> Result<ImageAsset>
Generates a base-level region using full-canvas envelope and global pixels. Adjacent regions match full-image base texels exactly; mipmaps are regional.
Methods from Deref<Target = AtmosphereParameters>§
Sourcepub fn validate(&self) -> Result<(), ValidationError>
pub fn validate(&self) -> Result<(), ValidationError>
Rejects nonfinite, unsupported or out-of-range recipe parameters.
Sourcepub fn sample(
&self,
pixel: [f64; 2],
canvas: PixelSize,
phase: [f64; 2],
) -> Result<[f64; 4], ValidationError>
pub fn sample( &self, pixel: [f64; 2], canvas: PixelSize, phase: [f64; 2], ) -> Result<[f64; 4], ValidationError>
Evaluates straight linear RGBA at an explicit canvas pixel coordinate.
The caller supplies canvas dimensions and advection phase; image generators and independent paint backends use these same mathematical definitions.