Struct Image

Source
pub struct Image<T> {
    pub data: Vec<T>,
    pub width: usize,
    pub height: usize,
    pub channels: u8,
    pub transform: Transform,
}
Expand description

Represents the final RGB Image.

Fields§

§data: Vec<T>

Pixel data stored in a linear fashion.

§width: usize

Width of the image.

§height: usize

Height of the image.

§channels: u8

The number of color channels in the image.

We can assume this will be 3 for all non-obscure, modern cameras. See https://github.com/GraphiteEditor/Graphite/pull/1923#discussion_r1725070342 for more information.

§transform: Transform

The transformation required to orient the image correctly.

This will be Transform::Horizontal after the transform step is applied.

Implementations§

Source§

impl Image<u16>

Source

pub fn gamma_correction_fn( &self, histogram: &[[usize; 8192]; 3], ) -> impl Fn(Pixel) -> [u16; 3]

Source§

impl Image<u16>

Source

pub fn transform_iter( &self, ) -> (usize, usize, impl Iterator<Item = Pixel> + use<'_>)

Source§

impl Image<u16>

Source

pub fn apply(self, transform: impl PixelTransform) -> Image<u16>

Source

pub fn transform_and_apply(self, transform: impl PixelTransform) -> Image<u16>

Auto Trait Implementations§

§

impl<T> Freeze for Image<T>

§

impl<T> RefUnwindSafe for Image<T>
where T: RefUnwindSafe,

§

impl<T> Send for Image<T>
where T: Send,

§

impl<T> Sync for Image<T>
where T: Sync,

§

impl<T> Unpin for Image<T>
where T: Unpin,

§

impl<T> UnwindSafe for Image<T>
where T: UnwindSafe,

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