[−][src]Struct pbrt::textures::constant::ConstantTexture
Implements trait Texture to return the given value
.
Methods
impl<T> ConstantTexture<T> where
T: Debug,
[src]
T: Debug,
pub fn new(value: T) -> ConstantTexture<T>
[src]
Create a new ConstantTexture
with the given constant value
.
Examples
use pbrt::core::spectrum::Spectrum; use pbrt::core::texture::Texture; use pbrt::textures::constant::ConstantTexture; let t = ConstantTexture::new(10.); assert_eq!(10., t.evaluate(&Default::default())); let t = ConstantTexture::new(Spectrum::from_rgb([1., 0., 0.])); assert_eq!( Spectrum::from_rgb([1., 0., 0.]), t.evaluate(&Default::default()) );
Trait Implementations
impl<T: Clone> Clone for ConstantTexture<T> where
T: Debug,
[src]
T: Debug,
fn clone(&self) -> ConstantTexture<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Debug for ConstantTexture<T> where
T: Debug,
[src]
T: Debug,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Implements fmt that surfaces the relevant details for the ConstantTexture
.
impl<T> Texture<T> for ConstantTexture<T> where
T: Clone + Debug,
[src]
T: Clone + Debug,
fn evaluate(&self, _si: &SurfaceInteraction) -> T
[src]
Implements evaluate that just returns the same value for any SurfaceInteraction
Auto Trait Implementations
impl<T> RefUnwindSafe for ConstantTexture<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for ConstantTexture<T> where
T: Send,
T: Send,
impl<T> Sync for ConstantTexture<T> where
T: Sync,
T: Sync,
impl<T> Unpin for ConstantTexture<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for ConstantTexture<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,