pub struct OpacityTransferFunction { /* private fields */ }Expand description
A piecewise-linear opacity transfer function.
Maps a scalar value to an opacity in [0.0, 1.0].
Control points are stored sorted by scalar value.
§VTK Equivalent
vtkPiecewiseFunction used as vtkVolumeProperty::ScalarOpacity.
Implementations§
Source§impl OpacityTransferFunction
impl OpacityTransferFunction
Sourcepub fn linear_ramp(scalar_min: f64, scalar_max: f64) -> Self
pub fn linear_ramp(scalar_min: f64, scalar_max: f64) -> Self
Create a linear ramp: fully transparent at scalar_min, fully opaque at scalar_max.
Sourcepub fn add_point(&mut self, scalar: f64, opacity: f64)
pub fn add_point(&mut self, scalar: f64, opacity: f64)
Add or replace a control point.
opacity is clamped to [0, 1].
Sourcepub fn remove_point(&mut self, scalar: f64, epsilon: f64)
pub fn remove_point(&mut self, scalar: f64, epsilon: f64)
Remove a control point within epsilon of scalar.
Trait Implementations§
Source§impl Clone for OpacityTransferFunction
impl Clone for OpacityTransferFunction
Source§fn clone(&self) -> OpacityTransferFunction
fn clone(&self) -> OpacityTransferFunction
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 moreSource§impl Debug for OpacityTransferFunction
impl Debug for OpacityTransferFunction
Auto Trait Implementations§
impl Freeze for OpacityTransferFunction
impl RefUnwindSafe for OpacityTransferFunction
impl Send for OpacityTransferFunction
impl Sync for OpacityTransferFunction
impl Unpin for OpacityTransferFunction
impl UnsafeUnpin for OpacityTransferFunction
impl UnwindSafe for OpacityTransferFunction
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