Skip to main content

Atmosphere

Struct Atmosphere 

Source
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

Source

pub const fn new(parameters: AtmosphereParameters) -> Self

Wraps explicit parameters; they are validated when the recipe is painted or rendered.

Source

pub fn fog(seed: u32) -> Self

A pale, low-contrast fog layer, denser near the bottom edge.

Source

pub fn dust(seed: u32) -> Self

Sparse warm HDR dust, suitable for Plus or Screen composition.

Source

pub fn light_leak(seed: u32) -> Self

Warm HDR light entering from the left edge.

Source

pub fn validate(&self) -> Result<(), ValidationError>

Validates the full recipe before noise evaluation or allocation.

Source

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.

Source

pub fn blend_mode(&self) -> BlendMode

Blend mode that composes this recipe without darkening: Screen for fog, Plus for HDR light.

Source

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.

Source

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.

Source

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>§

Source

pub fn validate(&self) -> Result<(), ValidationError>

Rejects nonfinite, unsupported or out-of-range recipe parameters.

Source

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.

Trait Implementations§

Source§

impl Clone for Atmosphere

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Atmosphere

Source§

impl Debug for Atmosphere

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for Atmosphere

Source§

type Target = AtmosphereParameters

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for Atmosphere

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl PartialEq for Atmosphere

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Atmosphere

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.