[][src]Struct imaged::Image

pub struct Image<'a>(pub &'a mut Image, _);

Image type

Methods

impl<'a> Image<'a>[src]

pub fn as_mut_halide_buffer(&mut self) -> Result<Buffer, Error>[src]

Use the image as a mutable halide_buffer_t

pub fn as_halide_buffer(&self) -> Result<Buffer, Error>[src]

Use the image as a halide_buffer_t

NOTE: This buffer should only be used immutably, it is not safe to use the resulting Buffer as an output argument. Use as_mut_halide_buffer if you will be mutating the contents

impl<'a> Image<'a>[src]

pub fn read_default<P: AsRef<Path>>(path: P) -> Result<Image<'a>, Error>[src]

Read default colorspace/type from disk using ezimage

pub fn read<P: AsRef<Path>>(
    path: P,
    color: Color,
    t: Type
) -> Result<Image<'a>, Error>
[src]

Read from disk using ezimage

pub fn write<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>[src]

Write image to disk using ezimage

pub fn new(meta: Meta) -> Result<Self, Error>[src]

Allocate a new image

pub fn new_with_data<T, X: AsMut<[T]>>(
    meta: Meta,
    data: X
) -> Result<Self, Error>
[src]

Wrap existing data

pub fn new_like_with_color(&self, color: Color) -> Result<Self, Error>[src]

Create a new image similar to an existing image with the color changed

pub fn new_like_with_type(&self, t: Type) -> Result<Self, Error>[src]

Create a new image similar to an existing image with the type changed

pub fn meta(&self) -> &Meta[src]

Get metadata

pub fn shape(&self) -> (usize, usize, usize)[src]

Get image (width, height, channels)

pub fn get_type(&self) -> Type[src]

pub fn get_color(&self) -> Color[src]

pub fn elem_size(&self) -> usize[src]

Size of each channel in the underlying data

pub fn data_ptr(&self) -> *mut c_void[src]

Get a pointer to the underlying data

pub fn data<T>(&self) -> Result<&[T], Error>[src]

Get the underlying data as a slice

pub fn buffer(&self) -> Result<&[u8], Error>[src]

Get the underlying data as a byte slice

pub fn data_mut<T>(&mut self) -> Result<&mut [T], Error>[src]

Get the underlying data as a mutable slice

pub fn buffer_mut(&mut self) -> Result<&mut [u8], Error>[src]

Get the underlying data as a mutable byte slice

pub fn is_type<T>(&self) -> bool[src]

Determines if the image matches the type parameter T

pub fn at<T>(&mut self, x: usize, y: usize) -> Result<&mut [T], Error>[src]

Get a mutable reference to the data at position (x, y)

pub fn get_pixel(&self, x: usize, y: usize, px: &mut Pixel) -> bool[src]

Get the pixel at (x, y)

pub fn set_pixel(&self, x: usize, y: usize, px: &Pixel) -> bool[src]

Set the pixel at (x, y)

pub fn for_each<T, F: FnMut((usize, usize), &mut [T])>(
    &mut self,
    f: F
) -> Result<(), Error>
[src]

Iterate over each pixel and apply f

pub fn for_each2<T, F: FnMut((usize, usize), &mut [T], &[T])>(
    &mut self,
    other: &Image,
    f: F
) -> Result<(), Error>
[src]

Iterate over each pixel in two images of the same size and apply f

pub fn convert_in_place(&mut self, color: Color, t: Type) -> Result<(), Error>[src]

Convert an image colorspace in-place, overwriting the source image

pub fn convert_to(&self, dest: &mut Image) -> Result<(), Error>[src]

Convert an image colorspace based on the destination image type, allocating a new image

pub fn convert(&self, color: Color, t: Type) -> Result<Image, Error>[src]

Convert an image colorspace, allocating a new image

pub fn adjust_gamma(&self, g: f32) -> Result<(), Error>[src]

Gamma correctoin

pub fn convert_aces0(&self) -> Result<Image, Error>[src]

pub fn convert_aces1(&self) -> Result<Image, Error>[src]

pub fn convert_aces0_to_xyz(&self) -> Result<Image, Error>[src]

pub fn convert_aces1_to_xyz(&self) -> Result<Image, Error>[src]

pub fn scale(&self, x: f64, y: f64) -> Result<Image, Error>[src]

Scale an image using the given factor for each dimension

pub fn resize_to(&self, dest: &mut Image) -> Result<(), Error>[src]

Resize an image to match the destination image size

pub fn resize(&self, width: usize, height: usize) -> Result<Image, Error>[src]

Resize an image to the given size

pub fn clone<'b>(&self) -> Image<'b>[src]

Copy an image

pub fn each_pixel<F: FnMut(usize, usize, &mut Pixel) -> Result<bool, Error>>(
    &mut self,
    nthreads: Option<usize>,
    f: F
) -> Result<(), Error>
[src]

Iterate over each pixel in parallel rows

Trait Implementations

impl<'a> Drop for Image<'a>[src]

impl<'a> Send for Image<'a>[src]

impl<'a> Sync for Image<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Image<'a>

impl<'a> Unpin for Image<'a>

impl<'a> !UnwindSafe for Image<'a>

Blanket Implementations

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

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

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

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

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

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.