pub struct Surface {
pub px: Vec<u8>,
pub w: i32,
pub h: i32,
pub stride: i32,
pub fmt: u8,
pub flags: u8,
pub opac: u8,
pub blend: u8,
}Expand description
pixels of one image: rows of stride bytes (4 per pixel, A8: 1)
Fields§
§px: Vec<u8>§w: i32§h: i32§stride: i32§fmt: u8§flags: u8§opac: u8§blend: u8Implementations§
Source§impl Surface
impl Surface
Sourcepub fn new(w: i32, h: i32, fmt: u8) -> Surface
pub fn new(w: i32, h: i32, fmt: u8) -> Surface
zeroed pixels, stride 64-byte aligned; sides outside 0..65536 give an empty surface (surf_alloc fails). Byte lengths beyond the target’s addressable allocation size also give an empty surface, before allocating pixels.
Sourcepub fn try_new(w: i32, h: i32, fmt: u8) -> Option<Surface>
pub fn try_new(w: i32, h: i32, fmt: u8) -> Option<Surface>
like new, but None (instead of an empty surface or an abort) when the size is
invalid or the memory is not there (try_zeroed). For sizes that come from a file or
from the user.
Sourcepub fn new_a8_packed(w: i32, h: i32) -> Surface
pub fn new_a8_packed(w: i32, h: i32) -> Surface
a tightly packed A8 surface (glyph masks: stride = w)
Trait Implementations§
Auto Trait Implementations§
impl Forget for Surface
impl Freeze for Surface
impl RefUnwindSafe for Surface
impl Send for Surface
impl Sync for Surface
impl Unpin for Surface
impl UnsafeUnpin for Surface
impl UnwindSafe for Surface
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