pub struct FlipImageFloat { /* private fields */ }Expand description
2D FLIP image that stores a single float per pixel.
Implementations§
Source§impl FlipImageFloat
impl FlipImageFloat
Sourcepub fn new(width: u32, height: u32) -> Self
pub fn new(width: u32, height: u32) -> Self
Create a new image with the given dimensions and zeroed contents.
Sourcepub fn with_data(width: u32, height: u32, data: &[f32]) -> Self
pub fn with_data(width: u32, height: u32, data: &[f32]) -> Self
Creates a new image with the given dimensions and copies the data into it.
Data is expected in row-major order, from the top left, tightly packed.
§Panics
- If the data is not large enough to fill the image.
Sourcepub fn apply_color_lut(&self, value_mapping: &FlipImageRgb8) -> FlipImageRgb8
pub fn apply_color_lut(&self, value_mapping: &FlipImageRgb8) -> FlipImageRgb8
Applies the given 1D color lut to turn this single channel values into 3 channel values.
Applies the following algorithm to each pixel:
value_mapping[(pixel_value * 255).round() % value_mapping.width()]Sourcepub fn to_color3(&self) -> FlipImageRgb8
pub fn to_color3(&self) -> FlipImageRgb8
Converts the image to a color image by copying the single channel value to all 3 channels.
Trait Implementations§
Source§impl Clone for FlipImageFloat
impl Clone for FlipImageFloat
Source§impl Drop for FlipImageFloat
impl Drop for FlipImageFloat
impl Send for FlipImageFloat
impl Sync for FlipImageFloat
Auto Trait Implementations§
impl Freeze for FlipImageFloat
impl RefUnwindSafe for FlipImageFloat
impl Unpin for FlipImageFloat
impl UnwindSafe for FlipImageFloat
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