[][src]Struct image2::ImageBuf

pub struct ImageBuf<T: Type, C: Color> { /* fields omitted */ }

Image implementation using Vec<T> to store data

Methods

impl<T: Type, C: Color> ImageBuf<T, C>[src]

pub fn new(width: usize, height: usize) -> Self[src]

Create a new ImageBuf with the given size

pub fn inner(self) -> Vec<T>[src]

Convert the ImageBuf back to the underlying data buffer

pub fn new_like(&self) -> Self[src]

Create a new image with the same type, shape and color as an existing image

pub fn new_like_with_type<U: Type>(&self) -> ImageBuf<U, C>[src]

Create a new image with the given type and the same shape and color

pub fn new_like_with_color<D: Color>(&self) -> ImageBuf<T, D>[src]

Create a new image with the given color and the same shape and type

pub fn new_from(width: usize, height: usize, data: Vec<T>) -> Self[src]

Create a new image from existing data

Note: This function does not do bounds checking, so you need to ensure that data is the correct length to handle the specified width and height

Trait Implementations

impl<T: Type, C: Color> Image<T, C> for ImageBuf<T, C>[src]

impl<T: Clone + Type, C: Clone + Color> Clone for ImageBuf<T, C>[src]

impl<T: PartialEq + Type, C: PartialEq + Color> PartialEq<ImageBuf<T, C>> for ImageBuf<T, C>[src]

impl<T: Debug + Type, C: Debug + Color> Debug for ImageBuf<T, C>[src]

impl<T: Type, C: Color> StructuralPartialEq for ImageBuf<T, C>[src]

impl<T: Type, C: Color> Serialize for ImageBuf<T, C> where
    T: Serialize
[src]

impl<'de, T: Type, C: Color> Deserialize<'de> for ImageBuf<T, C> where
    T: Deserialize<'de>, 
[src]

Auto Trait Implementations

impl<T, C> Send for ImageBuf<T, C>

impl<T, C> Sync for ImageBuf<T, C>

impl<T, C> Unpin for ImageBuf<T, C> where
    C: Unpin,
    T: Unpin

impl<T, C> UnwindSafe for ImageBuf<T, C> where
    C: UnwindSafe,
    T: UnwindSafe

impl<T, C> RefUnwindSafe for ImageBuf<T, C> where
    C: RefUnwindSafe,
    T: RefUnwindSafe

Blanket Implementations

impl<T, U, I> Convert<T, Rgb, U, Rgba> for I where
    I: Image<T, Rgb>,
    T: Type,
    U: Type
[src]

impl<T, U, I> Convert<T, Rgba, U, Rgb> for I where
    I: Image<T, Rgba>,
    T: Type,
    U: Type
[src]

impl<T, U, I> Convert<T, Rgb, U, Gray> for I where
    I: Image<T, Rgb>,
    T: Type,
    U: Type
[src]

impl<T, U, I> Convert<T, Rgba, U, Gray> for I where
    I: Image<T, Rgba>,
    T: Type,
    U: Type
[src]

impl<T, U, I> Convert<T, Gray, U, Rgb> for I where
    I: Image<T, Gray>,
    T: Type,
    U: Type
[src]

impl<T, U, I> Convert<T, Gray, U, Rgba> for I where
    I: Image<T, Gray>,
    T: Type,
    U: Type
[src]

impl<T, U, I> Convert<T, Rgb, U, Bgr> for I where
    I: Image<T, Rgb>,
    T: Type,
    U: Type
[src]

impl<T, U, I> Convert<T, Bgr, U, Rgb> for I where
    I: Image<T, Bgr>,
    T: Type,
    U: Type
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]