pub struct TransferFunction2D { /* private fields */ }Expand description
A 2D transfer function mapping (scalar, gradient magnitude) to RGBA.
This is a practical building block for feature classification: for example, highlight bone-like CT values only when the gradient magnitude is high.
Implementations§
Source§impl TransferFunction2D
impl TransferFunction2D
Sourcepub fn with_background(self, rgba: [f64; 4]) -> Self
pub fn with_background(self, rgba: [f64; 4]) -> Self
Set the fallback RGBA returned when no region matches.
Sourcepub fn add_region(&mut self, region: TransferFunction2DRegion)
pub fn add_region(&mut self, region: TransferFunction2DRegion)
Add a region.
Sourcepub fn remove_region(
&mut self,
index: usize,
) -> Option<TransferFunction2DRegion>
pub fn remove_region( &mut self, index: usize, ) -> Option<TransferFunction2DRegion>
Remove the region at index, if it exists.
Sourcepub fn regions(&self) -> &[TransferFunction2DRegion]
pub fn regions(&self) -> &[TransferFunction2DRegion]
Borrow all configured regions.
Trait Implementations§
Source§impl Clone for TransferFunction2D
impl Clone for TransferFunction2D
Source§fn clone(&self) -> TransferFunction2D
fn clone(&self) -> TransferFunction2D
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 TransferFunction2D
impl Debug for TransferFunction2D
Source§impl Default for TransferFunction2D
impl Default for TransferFunction2D
Source§fn default() -> TransferFunction2D
fn default() -> TransferFunction2D
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TransferFunction2D
impl RefUnwindSafe for TransferFunction2D
impl Send for TransferFunction2D
impl Sync for TransferFunction2D
impl Unpin for TransferFunction2D
impl UnsafeUnpin for TransferFunction2D
impl UnwindSafe for TransferFunction2D
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