pub struct Surface {
pub raw: *mut SDL_Surface,
pub owned: bool,
}
Fields§
§raw: *mut SDL_Surface
§owned: bool
Implementations§
Source§impl Surface
impl Surface
pub fn new( surface_flags: &[SurfaceFlag], width: isize, height: isize, bpp: isize, rmask: u32, gmask: u32, bmask: u32, amask: u32, ) -> Result<Surface, String>
pub fn from_bmp(path: &Path) -> Result<Surface, String>
pub fn get_width(&self) -> u16
pub fn get_height(&self) -> u16
pub fn get_size(&self) -> (u16, u16)
pub fn get_rect(&self) -> Rect
pub fn update_rect(&self, rect: &Rect)
pub fn update_rects(&self, rects: &[Rect])
pub fn set_colors(&self, colors: &[Color]) -> bool
pub fn set_palette(&self, palettes: &[PaletteType], colors: &[Color]) -> bool
pub fn lock(&self) -> bool
Sourcepub fn with_lock<F: Fn(&mut [u8]) -> bool>(&self, f: F) -> bool
pub fn with_lock<F: Fn(&mut [u8]) -> bool>(&self, f: F) -> bool
Locks a surface so that the pixels can be directly accessed safely.
pub fn unlock(&self)
pub fn flip(&self) -> bool
pub fn convert( &self, fmt: &PixelFormat, flags: &[SurfaceFlag], ) -> Result<Surface, String>
pub fn display_format(&self) -> Result<Surface, String>
pub fn display_format_alpha(&self) -> Result<Surface, String>
pub fn save_bmp(&self, path: &Path) -> bool
pub fn set_alpha(&self, flags: &[SurfaceFlag], alpha: u8) -> bool
pub fn set_color_key(&self, flags: &[SurfaceFlag], color: Color) -> bool
pub fn set_clip_rect(&self, rect: &Rect)
pub fn get_clip_rect(&self) -> Rect
pub fn blit_rect( &self, src: &Surface, src_rect: Option<Rect>, dest_rect: Option<Rect>, ) -> bool
pub fn blit(&self, src: &Surface) -> bool
pub fn blit_at(&self, src: &Surface, x: i16, y: i16) -> bool
pub fn fill_rect(&self, rect: Option<Rect>, color: Color) -> bool
pub fn fill(&self, color: Color) -> bool
pub fn clear(&self) -> bool
Trait Implementations§
impl StructuralPartialEq for Surface
Auto Trait Implementations§
impl Freeze for Surface
impl RefUnwindSafe for Surface
impl !Send for Surface
impl !Sync for Surface
impl Unpin 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