pub struct Pixels { /* private fields */ }Implementations§
Source§impl Pixels
impl Pixels
pub fn new(width: u32, height: u32) -> Pixels
pub fn filled(width: u32, height: u32, color: Color) -> Pixels
pub fn from_rgba( width: u32, height: u32, data: impl Into<Vec<u8>>, ) -> Option<Pixels>
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn is_empty(&self) -> bool
pub fn id(&self) -> u64
pub fn revision(&self) -> u64
pub fn pixel_count(&self) -> usize
pub fn data(&self) -> &[u8] ⓘ
pub fn data_mut(&mut self) -> &mut [u8] ⓘ
pub fn into_data(self) -> Vec<u8> ⓘ
pub fn index(&self, x: i32, y: i32) -> Option<usize>
pub fn contains(&self, x: i32, y: i32) -> bool
pub fn get(&self, x: i32, y: i32) -> Option<Color>
pub fn set(&mut self, x: i32, y: i32, color: Color) -> bool
pub fn blend(&mut self, x: i32, y: i32, color: Color) -> bool
pub fn fill(&mut self, color: Color)
pub fn fill_rect(&mut self, rect: Rect, color: Color) -> Rect
pub fn blend_rect(&mut self, rect: Rect, color: Color) -> Rect
pub fn blit(&mut self, src: &Pixels, dx: i32, dy: i32) -> Rect
pub fn blend_from(&mut self, src: &Pixels, dx: i32, dy: i32) -> Rect
pub fn clear(&mut self)
pub fn crop(&self, rect: Rect) -> Pixels
pub fn flip_horizontal(&mut self)
pub fn flip_vertical(&mut self)
pub fn rotate180(&mut self)
pub fn resize_nearest(&self, width: u32, height: u32) -> Pixels
pub fn resize_bilinear(&self, width: u32, height: u32) -> Pixels
pub fn thumbnail(&self, max_dim: u32) -> Pixels
pub fn scaled_to_fit(&self, max_dim: u32) -> Option<Pixels>
pub fn sample_nearest(&self, fx: f32, fy: f32) -> Color
pub fn sample_bilinear(&self, fx: f32, fy: f32) -> Color
pub fn for_each_pixel(&mut self, f: impl FnMut(i32, i32, Color) -> Color)
pub fn map(&self, f: impl FnMut(i32, i32, Color) -> Color) -> Pixels
pub fn grayscale(&self) -> Pixels
pub fn inverted(&self) -> Pixels
pub fn tinted(&self, color: Color) -> Pixels
pub fn multiply_alpha(&self, factor: f32) -> Pixels
pub fn has_alpha(&self) -> bool
pub fn opaque_bounds(&self) -> Option<Rect>
pub fn to_source(&self) -> ImageSource
pub fn into_source(self) -> ImageSource
Trait Implementations§
impl Eq for Pixels
Auto Trait Implementations§
impl Freeze for Pixels
impl RefUnwindSafe for Pixels
impl Send for Pixels
impl Sync for Pixels
impl Unpin for Pixels
impl UnsafeUnpin for Pixels
impl UnwindSafe for Pixels
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