FlipImageFloat

Struct FlipImageFloat 

Source
pub struct FlipImageFloat { /* private fields */ }
Expand description

2D FLIP image that stores a single float per pixel.

Implementations§

Source§

impl FlipImageFloat

Source

pub fn new(width: u32, height: u32) -> Self

Create a new image with the given dimensions and zeroed contents.

Source

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.
Source

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()]
Source

pub fn to_color3(&self) -> FlipImageRgb8

Converts the image to a color image by copying the single channel value to all 3 channels.

Source

pub fn to_vec(&self) -> Vec<f32>

Extracts the data from the image and returns it as a vector.

Data is returned in row-major order, from the top left, tightly packed.

Source

pub fn width(&self) -> u32

Returns the width of the image.

Source

pub fn height(&self) -> u32

Returns the height of the image.

Trait Implementations§

Source§

impl Clone for FlipImageFloat

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Drop for FlipImageFloat

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for FlipImageFloat

Source§

impl Sync for FlipImageFloat

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.