Struct rich_sdl2_image_rust::surface::ImgSurface [−][src]
pub struct ImgSurface<'img> { /* fields omitted */ }Expand description
An image surface for the loaded picture.
Implementations
Constructs a new image surface from the file. The format will automatically determined if file_type is None. file_type is case-insensitive and can be one of these:
"TGA""CUR""ICO""BMP""GIF""JPG""LBM""PCX""PNG""PNM""SVG""TIF""XCF""XPM""XV""WEBP"
Panics
Panics if file_name or file_type is an empty string.
Trait Implementations
fn cloned(&self) -> Cloned
fn cloned(&self) -> Cloned
Clones the surface.
fn clipped(self, area: Rect) -> Clipped<Self>
fn clipped(self, area: Rect) -> Clipped<Self>
Clips the surface by area.
fn blend(self, mode: BlendMode) -> Blended<Self>
fn blend(self, mode: BlendMode) -> Blended<Self>
Changes blend mode of the surface.
fn color_mod(self, color: Rgb) -> ColorMod<Self>
fn color_mod(self, color: Rgb) -> ColorMod<Self>
Modifies the color of the surface.
Fills in the area with the color, or whole if area is None.
fn fill_rects(&self, areas: impl IntoIterator<Item = Rect>, color: Pixel)
fn fill_rects(&self, areas: impl IntoIterator<Item = Rect>, color: Pixel)
Fills in the areas with the color.
fn set_palette(&self, palette: &Palette)
fn set_palette(&self, palette: &Palette)
Overwrites the palette of the surface.
Copies src_area area in the surface into dst_pos on another surface.
fn rle(&mut self) -> Rle<'_, Self>
fn rle(&mut self) -> Rle<'_, Self>
Run-length encodes the surface.