[−][src]Struct ndless_sdl::video::Surface
Fields
raw: *mut SDL_Surface
owned: 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]
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]
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 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]
&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: &str, x: i32, y: i32)
[src]
Trait Implementations
impl Clone for Surface
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Surface
[src]
impl Drop for Surface
[src]
impl Graphics for Surface
[src]
fn draw_pixel(&self, point: Point, color: Color)
[src]
fn draw_horiz_line(&self, x1: i16, x2: i16, y: i16, color: Color)
[src]
fn draw_vert_line(&self, x: i16, y1: i16, y2: i16, color: Color)
[src]
fn draw_line(&self, point1: Point, point2: Point, color: Color)
[src]
fn draw_antialiased_line(&self, point1: Point, point2: Point, color: Color)
[src]
fn draw_thick_line(&self, point1: Point, point2: Point, width: u8, color: Color)
[src]
fn draw_rectangle(&self, point1: Point, point2: Point, color: Color)
[src]
fn draw_rounded_rectangle(
&self,
point1: Point,
point2: Point,
radius: i16,
color: Color
)
[src]
&self,
point1: Point,
point2: Point,
radius: i16,
color: Color
)
fn draw_filled_rectangle(&self, point1: Point, point2: Point, color: Color)
[src]
fn draw_rounded_filled_rectangle(
&self,
point1: Point,
point2: Point,
radius: i16,
color: Color
)
[src]
&self,
point1: Point,
point2: Point,
radius: i16,
color: Color
)
fn draw_circle(&self, center: Point, radius: i16, color: Color)
[src]
fn draw_filled_circle(&self, center: Point, radius: i16, color: Color)
[src]
fn draw_antialiased_circle(&self, center: Point, radius: i16, color: Color)
[src]
fn draw_arc(
&self,
center: Point,
radius: i16,
start: i16,
end: i16,
color: Color
)
[src]
&self,
center: Point,
radius: i16,
start: i16,
end: i16,
color: Color
)
fn draw_ellipse(
&self,
center: Point,
x_radius: i16,
y_radius: i16,
color: Color
)
[src]
&self,
center: Point,
x_radius: i16,
y_radius: i16,
color: Color
)
fn draw_filled_ellipse(
&self,
center: Point,
x_radius: i16,
y_radius: i16,
color: Color
)
[src]
&self,
center: Point,
x_radius: i16,
y_radius: i16,
color: Color
)
fn draw_antialiased_ellipse(
&self,
center: Point,
x_radius: i16,
y_radius: i16,
color: Color
)
[src]
&self,
center: Point,
x_radius: i16,
y_radius: i16,
color: Color
)
fn draw_pie(
&self,
center: Point,
radius: i16,
start: i16,
end: i16,
color: Color
)
[src]
&self,
center: Point,
radius: i16,
start: i16,
end: i16,
color: Color
)
fn draw_filled_pie(
&self,
center: Point,
radius: i16,
start: i16,
end: i16,
color: Color
)
[src]
&self,
center: Point,
radius: i16,
start: i16,
end: i16,
color: Color
)
fn draw_triangle(&self, points: [Point; 3], color: Color)
[src]
fn draw_filled_triangle(&self, points: [Point; 3], color: Color)
[src]
fn draw_antialiased_triangle(&self, points: [Point; 3], color: Color)
[src]
fn draw_polygon_list(&self, x_points: &[i16], y_points: &[i16], color: Color)
[src]
fn draw_filled_polygon_list(
&self,
x_points: &[i16],
y_points: &[i16],
color: Color
)
[src]
&self,
x_points: &[i16],
y_points: &[i16],
color: Color
)
fn draw_antialiased_polygon_list(
&self,
x_points: &[i16],
y_points: &[i16],
color: Color
)
[src]
&self,
x_points: &[i16],
y_points: &[i16],
color: Color
)
fn draw_textured_polygon_list(
&self,
x_points: &[i16],
y_points: &[i16],
texture: &Surface,
texture_offset: Point
)
[src]
&self,
x_points: &[i16],
y_points: &[i16],
texture: &Surface,
texture_offset: Point
)
fn draw_bezier_list(
&self,
x_points: &[i16],
y_points: &[i16],
interpolation: i32,
color: Color
)
[src]
&self,
x_points: &[i16],
y_points: &[i16],
interpolation: i32,
color: Color
)
fn draw_polygon(&self, points: &[Point], color: Color)
[src]
fn draw_filled_polygon(&self, points: &[Point], color: Color)
[src]
fn draw_antialiased_polygon(&self, points: &[Point], color: Color)
[src]
fn draw_textured_polygon(
&self,
points: &[Point],
texture: &Surface,
texture_offset: Point
)
[src]
&self,
points: &[Point],
texture: &Surface,
texture_offset: Point
)
fn draw_bezier(&self, points: &[Point], interpolation: i32, color: Color)
[src]
impl PartialEq<Surface> for Surface
[src]
impl StructuralPartialEq for Surface
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,