Files
texturecraft/crates/compose/src/pattern_context.rs
T
Rebornim 7c28d4f5f5 Tile Generator image inputs
The Custom image input shape draws one of the pattern's input images in each tile, picked at random or by tile number, through the shape's tiling, angle, scale and turns; the background image shows under the shapes instead of the background value. Patterns read images through a PatternContext (its resolution and the image resources), which the compositor passes; procedural() keeps evaluating without images.
2026-11-17 16:27:37 +00:00

13 lines
636 B
Rust

//! What evaluating a pattern needs besides the texel: the resolution it is drawn at and the images it reads
use crate::store::ImageStore;
/// What a pattern reads beyond the texel's coordinates (fields can be added; build it with `..PatternContext::default()`)
#[derive(Clone, Copy, Default)]
pub struct PatternContext<'a> {
/// Texels per side of the image the pattern is drawn as over one repeat of the projection (see [`crate::pattern::pattern_pixels`]); None draws it exactly
pub pixels: Option<u32>,
/// The image resources a pattern's inputs name; None reads them as empty
pub images: Option<&'a ImageStore>,
}