mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-21 20:08:15 +00:00
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.
13 lines
636 B
Rust
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>,
|
|
}
|