[−][src]Struct imaged::Image
Image type
Implementations
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]
path: P,
color: Color,
t: Type
) -> Result<Image<'a>, Error>
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]
meta: Meta,
data: X
) -> Result<Self, Error>
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]
&mut self,
f: F
) -> Result<(), Error>
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]
&mut self,
other: &Image,
f: F
) -> Result<(), Error>
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]
&mut self,
nthreads: Option<usize>,
f: F
) -> Result<(), Error>
Iterate over each pixel in parallel rows
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,