[−][src]Struct ndless_sdl::video::Surface
Fields
raw: *mut SDL_Surface
owned: bool
Methods
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]
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: impl Into<String>
) -> Result<Surface, String>
[src]
path: impl Into<String>
) -> Result<Surface, String>
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]
&self,
fmt: &PixelFormat,
flags: &[SurfaceFlag]
) -> Result<Surface, String>
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]
&self,
path: impl Into<String>
) -> bool
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]
&self,
src: &Surface,
src_rect: Option<Rect>,
dest_rect: Option<Rect>
) -> bool
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: impl Into<String>,
x: i32,
y: i32
)
[src]
&self,
font: &Font,
msg: impl Into<String>,
x: i32,
y: i32
)
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,