pub struct IesProfile {
pub name: String,
pub vertical_angles: Vec<f32>,
pub horizontal_angles: Vec<f32>,
pub candela: Vec<Vec<f32>>,
pub max_candela: f32,
}Expand description
A light intensity profile loaded from an IES (Illuminating Engineering Society) file.
Stores a 2D lookup table of candela values by vertical/horizontal angle.
Fields§
§name: String§vertical_angles: Vec<f32>Vertical angles in degrees [0°, 180°].
horizontal_angles: Vec<f32>Horizontal angles in degrees [0°, 360°].
candela: Vec<Vec<f32>>Candela data: [horizontal][vertical] indexing.
max_candela: f32Maximum candela value for normalization.
Implementations§
Source§impl IesProfile
impl IesProfile
Sourcepub fn uniform(name: impl Into<String>) -> Self
pub fn uniform(name: impl Into<String>) -> Self
Create a fake IES profile (uniform sphere — equivalent to a point light).
Sourcepub fn downlight(name: impl Into<String>) -> Self
pub fn downlight(name: impl Into<String>) -> Self
Create a downward-biased profile (like a recessed ceiling fixture).
Sourcepub fn sample(&self, v_angle: f32, h_angle: f32) -> f32
pub fn sample(&self, v_angle: f32, h_angle: f32) -> f32
Sample the profile at the given vertical and horizontal angles (degrees).
Sourcepub fn evaluate_direction(&self, light_dir: Vec3, fixture_down: Vec3) -> f32
pub fn evaluate_direction(&self, light_dir: Vec3, fixture_down: Vec3) -> f32
Evaluate the profile factor for a light direction relative to the fixture.
light_dir is the direction FROM the light TO the surface.
Trait Implementations§
Source§impl Clone for IesProfile
impl Clone for IesProfile
Source§fn clone(&self) -> IesProfile
fn clone(&self) -> IesProfile
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for IesProfile
impl RefUnwindSafe for IesProfile
impl Send for IesProfile
impl Sync for IesProfile
impl Unpin for IesProfile
impl UnsafeUnpin for IesProfile
impl UnwindSafe for IesProfile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.