pub struct DepthOfField {
pub focus_distance: f64,
pub f_stop: f64,
pub focal_length: f64,
pub max_radius: f64,
pub perspective: bool,
}Expand description
Thin-lens circle of confusion and optional depth-dependent perspective/parallax.
Fields§
§focus_distance: f64Camera-to-focus distance, greater than focal length.
f_stop: f64Positive aperture f-number.
focal_length: f64Positive focal length in scene units.
max_radius: f64Finite nonnegative maximum blur radius in design units.
perspective: boolApply pinhole perspective and depth-scaled camera translation.
Implementations§
Source§impl DepthOfField
impl DepthOfField
Sourcepub fn validate(self) -> Result<(), ValidationError>
pub fn validate(self) -> Result<(), ValidationError>
Validates physical lens parameters.
Sourcepub fn radius(self, depth: f64) -> Result<f64, ValidationError>
pub fn radius(self, depth: f64) -> Result<f64, ValidationError>
Radius is exactly zero at focus; extreme finite depths remain capped.
Sourcepub fn capture(
self,
context: &SceneContext<'_>,
view: Camera,
planes: impl IntoIterator<Item = DepthPlane>,
) -> Result<Node, ValidationError>
pub fn capture( self, context: &SceneContext<'_>, view: Camera, planes: impl IntoIterator<Item = DepthPlane>, ) -> Result<Node, ValidationError>
Orders far planes before near planes, then applies the camera to each plane.
Trait Implementations§
Source§impl Clone for DepthOfField
impl Clone for DepthOfField
impl Copy for DepthOfField
Source§impl Debug for DepthOfField
impl Debug for DepthOfField
Source§impl PartialEq for DepthOfField
impl PartialEq for DepthOfField
impl StructuralPartialEq for DepthOfField
Auto Trait Implementations§
impl Forget for DepthOfField
impl Freeze for DepthOfField
impl Move for DepthOfField
impl RefUnwindSafe for DepthOfField
impl Send for DepthOfField
impl Sync for DepthOfField
impl Unpin for DepthOfField
impl UnsafeUnpin for DepthOfField
impl UnwindSafe for DepthOfField
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