pub struct Image { /* private fields */ }Implementations§
Source§impl Image
impl Image
pub fn new(shape: Shape, colorspace: ColorSpace) -> Self
pub fn from_data(data: Vec<u8>, shape: Shape, colorspace: ColorSpace) -> Self
pub fn swap(&mut self, idx_a: usize, idx_b: usize)
pub fn slice(&self, start: usize, end: usize) -> &[u8] ⓘ
pub fn mut_slice(&mut self, start: usize, end: usize) -> &mut [u8] ⓘ
pub fn width(&self) -> usize
pub fn height(&self) -> usize
pub fn size(&self) -> usize
pub fn crop(&self, topleft: Point, shape: Shape) -> Self
Sourcepub fn get_mut_pixel(&mut self, point: &Point) -> &mut [u8] ⓘ
pub fn get_mut_pixel(&mut self, point: &Point) -> &mut [u8] ⓘ
Same as get_pixel but just a mutable reference
pub fn set_pixel(&mut self, point: &Point, color: &Color) -> Result<(), Error>
Trait Implementations§
Source§impl Drawable<CircleParams> for Image
impl Drawable<CircleParams> for Image
Source§impl Drawable<RectParams> for Image
impl Drawable<RectParams> for Image
Source§impl Index<(usize, usize)> for Image
Overriding [] for 2D indexing.
impl Index<(usize, usize)> for Image
Overriding [] for 2D indexing.
§Returns an immutable reference to a given pixel
Source§impl Index<(usize, usize, usize)> for Image
Overriding [] for 3D indexing.
This is useful when you want to modify a specific channel
For example, to modify green channel,
image[(2, 2, 1)] = 255
Where 1 = the channel number.
impl Index<(usize, usize, usize)> for Image
Overriding [] for 3D indexing.
This is useful when you want to modify a specific channel
For example, to modify green channel,
image[(2, 2, 1)] = 255
Where 1 = the channel number.
See ColorSpace for more information on Channel Numbers
Source§impl Index<usize> for Image
Overriding [] for 1D indexing.
impl Index<usize> for Image
Overriding [] for 1D indexing.
§Returns an immutable reference to the requested Index
Source§impl IndexMut<usize> for Image
Overriding [] for 1D indexing.
impl IndexMut<usize> for Image
Overriding [] for 1D indexing.
§Returns a mutable reference to the requested Index
Source§impl Resizable<BiCubicParams> for Image
impl Resizable<BiCubicParams> for Image
Source§impl Resizable<BiLinearParams> for Image
impl Resizable<BiLinearParams> for Image
Source§impl Resizable<NearestNeighborParams> for Image
impl Resizable<NearestNeighborParams> for Image
Source§impl Rotatable<RotationType> for Image
impl Rotatable<RotationType> for Image
Auto Trait Implementations§
impl Freeze for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnwindSafe for Image
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more