Skip to main content

gltf_reader/
texture.rs

1use alloc::borrow::Cow;
2use ownable::IntoOwned;
3use serde::Deserialize;
4
5use crate::image::Image;
6use crate::sampler::Sampler;
7use crate::{Extensions, Extras, Idx};
8
9/// A texture and it's sampler.
10#[derive(Debug, Clone, Deserialize, IntoOwned)]
11pub struct Texture<'a> {
12    /// The user-defined name of this object.
13    #[serde(borrow)]
14    pub name: Option<Cow<'a, str>>,
15
16    /// The index of the image used by this texture
17    pub source: Option<Idx<Image<'static>>>,
18    /// The index of the sampler used by this texture.
19    pub sampler: Option<Idx<Sampler<'static>>>,
20
21    #[serde(borrow)]
22    pub extensions: Option<Extensions<'a>>,
23    #[serde(borrow)]
24    pub extras: Option<Extras<'a>>,
25}