[][src]Struct ndless_sdl::video::Surface

pub struct Surface {
    pub raw: *mut SDL_Surface,
    pub owned: bool,
}

Fields

raw: *mut SDL_Surfaceowned: bool

Implementations

impl Surface[src]

pub fn new(
    surface_flags: &[SurfaceFlag],
    width: isize,
    height: isize,
    bpp: isize,
    rmask: u32,
    gmask: u32,
    bmask: u32,
    amask: u32
) -> Result<Surface, String>
[src]

pub fn from_bmp(path: impl Into<String>) -> Result<Surface, String>[src]

pub fn get_width(&self) -> u16[src]

pub fn get_height(&self) -> u16[src]

pub fn get_size(&self) -> (u16, u16)[src]

pub fn get_rect(&self) -> Rect[src]

pub fn update_rect(&self, rect: Rect)[src]

pub fn update_rects(&self, rects: &[Rect])[src]

pub fn set_colors(&self, colors: &[Color]) -> bool[src]

pub fn set_palette(&self, palettes: &[PaletteType], colors: &[Color]) -> bool[src]

pub fn lock(&self) -> bool[src]

pub fn with_lock<F: Fn(&mut [u8]) -> bool>(&self, f: F) -> bool[src]

Locks a surface so that the pixels can be directly accessed safely.

pub fn unlock(&self)[src]

pub fn flip(&self) -> bool[src]

pub fn convert(
    &self,
    fmt: &PixelFormat,
    flags: &[SurfaceFlag]
) -> Result<Surface, String>
[src]

pub fn try_clone(&self) -> Result<Surface, String>[src]

pub fn display_format(&self) -> Result<Surface, String>[src]

pub fn display_format_alpha(&self) -> Result<Surface, String>[src]

pub fn save_bmp(&self, path: impl Into<String>) -> bool[src]

pub fn set_alpha(&self, flags: &[SurfaceFlag], alpha: u8) -> bool[src]

pub fn set_color_key(&self, flags: &[SurfaceFlag], color: Color) -> bool[src]

pub fn set_clip_rect(&self, rect: Rect)[src]

pub fn get_clip_rect(&self) -> Rect[src]

pub fn blit_rect(
    &self,
    src: &Surface,
    src_rect: Option<Rect>,
    dest_rect: Option<Rect>
) -> bool
[src]

pub fn blit(&self, src: &Surface) -> bool[src]

pub fn blit_at(&self, src: &Surface, x: i16, y: i16) -> bool[src]

pub fn fill_rect(&self, rect: Option<Rect>, color: Color) -> bool[src]

pub fn fill(&self, color: Color) -> bool[src]

pub fn clear(&self) -> bool[src]

pub fn draw_str(&self, font: &Font, msg: &str, x: i32, y: i32)[src]

Trait Implementations

impl Clone for Surface[src]

impl Debug for Surface[src]

impl Drop for Surface[src]

impl Graphics for Surface[src]

impl PartialEq<Surface> for Surface[src]

impl StructuralPartialEq for Surface[src]

Auto Trait Implementations

impl !Send for Surface

impl !Sync for Surface

impl Unpin for Surface

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.