pic_scale

Struct ImageStore

source
pub struct ImageStore<'a, T, const N: usize>
where T: FromPrimitive + Clone + Copy + Debug,
{ pub channels: usize, pub width: usize, pub height: usize, /* private fields */ }
Expand description

Holds an image

§Arguments

N - count of channels

§Examples

ImageStore<u8, 4> - represents RGBA ImageStore<u8, 3> - represents RGB ImageStore<f32, 3> - represents RGB in f32 and etc

Fields§

§channels: usize

Channels in the image

§width: usize

Image width

§height: usize

Image height

Implementations§

source§

impl<T, const N: usize> ImageStore<'static, T, N>

source

pub fn new( slice_ref: Vec<T>, width: usize, height: usize, ) -> Result<ImageStore<'static, T, N>, String>

source

pub fn alloc(width: usize, height: usize) -> ImageStore<'static, T, N>

source§

impl<'a, T, const N: usize> ImageStore<'a, T, N>
where T: FromPrimitive + Clone + Copy + Debug,

source

pub fn get_size(&self) -> ImageSize

source

pub fn as_bytes(&self) -> &[T]

source

pub fn from_slice( slice_ref: &'a mut [T], width: usize, height: usize, ) -> Result<ImageStore<'a, T, N>, String>

source§

impl ImageStore<'_, u8, 4>

source

pub fn unpremultiply_alpha( &self, into: &mut ImageStore<'_, u8, 4>, pool: &Option<ThreadPool>, )

source

pub fn premultiply_alpha( &self, into: &mut ImageStore<'_, u8, 4>, pool: &Option<ThreadPool>, )

source§

impl ImageStore<'_, u16, 4>

source

pub fn unpremultiply_alpha( &self, into: &mut ImageStore<'_, u16, 4>, pool: &Option<ThreadPool>, )

source

pub fn premultiply_alpha( &self, into: &mut ImageStore<'_, u16, 4>, pool: &Option<ThreadPool>, )

source§

impl ImageStore<'_, f32, 4>

source

pub fn unpremultiply_alpha( &self, into: &mut ImageStore<'_, f32, 4>, pool: &Option<ThreadPool>, )

source

pub fn premultiply_alpha( &self, into: &mut ImageStore<'_, f32, 4>, pool: &Option<ThreadPool>, )

Trait Implementations§

source§

impl<'a, T, const N: usize> Debug for ImageStore<'a, T, N>
where T: FromPrimitive + Clone + Copy + Debug + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, T, const N: usize> Freeze for ImageStore<'a, T, N>

§

impl<'a, T, const N: usize> RefUnwindSafe for ImageStore<'a, T, N>
where T: RefUnwindSafe,

§

impl<'a, T, const N: usize> Send for ImageStore<'a, T, N>
where T: Send,

§

impl<'a, T, const N: usize> Sync for ImageStore<'a, T, N>
where T: Sync,

§

impl<'a, T, const N: usize> Unpin for ImageStore<'a, T, N>
where T: Unpin,

§

impl<'a, T, const N: usize> !UnwindSafe for ImageStore<'a, T, N>

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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
source§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.