pub struct ImageFrame { /* private fields */ }Implementations§
Source§impl ImageFrame
impl ImageFrame
pub fn new(width: usize, height: usize) -> Self
pub fn from_pixels(width: usize, height: usize, pixels: Vec<Color>) -> Self
pub fn width(&self) -> usize
pub fn height(&self) -> usize
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn pixels(&self) -> &[Color]
pub fn get(&self, x: usize, y: usize) -> Color
pub fn set(&mut self, x: usize, y: usize, value: Color)
pub fn sample_clamped(&self, x: i32, y: i32) -> Color
pub fn sample_bilinear_clamped(&self, x: f32, y: f32) -> Color
pub fn to_rgba_image(&self) -> RgbaImage
pub fn encode_png(&self) -> Result<Vec<u8>>
pub fn save_png(&self, path: &Path) -> Result<()>
pub fn load_png(path: &Path) -> Result<Self>
pub fn crop(&self, bbox: BoundingBox) -> Self
Trait Implementations§
Source§impl Clone for ImageFrame
impl Clone for ImageFrame
Source§fn clone(&self) -> ImageFrame
fn clone(&self) -> ImageFrame
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ImageFrame
impl RefUnwindSafe for ImageFrame
impl Send for ImageFrame
impl Sync for ImageFrame
impl Unpin for ImageFrame
impl UnsafeUnpin for ImageFrame
impl UnwindSafe for ImageFrame
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