library: document texture module
This commit is contained in:
parent
94ab40413a
commit
ce1b8eeaaa
|
@ -1,3 +1,5 @@
|
|||
//! Various texture implementations
|
||||
|
||||
use super::core::LinearColor;
|
||||
use super::Point2D;
|
||||
use serde::Deserialize;
|
||||
|
@ -5,6 +7,7 @@ use serde::Deserialize;
|
|||
/// All the existing `Texture` implementation.
|
||||
#[serde(tag = "type")]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[allow(missing_docs)]
|
||||
#[enum_dispatch::enum_dispatch]
|
||||
#[derive(Debug, PartialEq, Deserialize)]
|
||||
pub enum TextureEnum {
|
||||
|
|
|
@ -10,6 +10,16 @@ pub struct UniformTexture {
|
|||
}
|
||||
|
||||
impl UniformTexture {
|
||||
/// Creates a new `UniformTexture`.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # use pathtracer::texture::UniformTexture;
|
||||
/// # use pathtracer::core::LinearColor;
|
||||
/// #
|
||||
/// let uni_text = UniformTexture::new(LinearColor::new(0.5, 0.5, 0.5));
|
||||
/// ```
|
||||
pub fn new(color: LinearColor) -> Self {
|
||||
UniformTexture { color }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue