Trait simple_blit::Surface
source · pub trait Surface<T> {
// Required methods
fn surface_size(&self) -> Size;
fn surface_get(&self, pt: Point) -> Option<&T>;
// Provided methods
fn sub_surface(&self, offset: Point, size: Size) -> SubSurface<&Self, T>
where Self: Sized { ... }
fn offset_surface(&self, offset: Point) -> SubSurface<&Self, T>
where Self: Sized { ... }
fn sub_surface_mut(
&mut self,
offset: Point,
size: Size,
) -> SubSurface<&mut Self, T>
where Self: Sized { ... }
fn offset_surface_mut(&mut self, offset: Point) -> SubSurface<&mut Self, T>
where Self: Sized { ... }
fn into_sub_surface(self, offset: Point, size: Size) -> SubSurface<Self, T>
where Self: Sized { ... }
fn into_offset_surface(self, offset: Point) -> SubSurface<Self, T>
where Self: Sized { ... }
}Expand description
2D immutable surface trait.
Required Methods§
sourcefn surface_size(&self) -> Size
fn surface_size(&self) -> Size
Surface size.
sourcefn surface_get(&self, pt: Point) -> Option<&T>
fn surface_get(&self, pt: Point) -> Option<&T>
Get a value at (pt.x, pt.y).
Provided Methods§
sourcefn sub_surface(&self, offset: Point, size: Size) -> SubSurface<&Self, T>where
Self: Sized,
fn sub_surface(&self, offset: Point, size: Size) -> SubSurface<&Self, T>where
Self: Sized,
Create a SubSurface that only uses a rectangular part of this surface.
sourcefn offset_surface(&self, offset: Point) -> SubSurface<&Self, T>where
Self: Sized,
fn offset_surface(&self, offset: Point) -> SubSurface<&Self, T>where
Self: Sized,
Create a SubSurface that only uses a rectangular part of this surface starting from (offset.x, offset.y).
sourcefn sub_surface_mut(
&mut self,
offset: Point,
size: Size,
) -> SubSurface<&mut Self, T>where
Self: Sized,
fn sub_surface_mut(
&mut self,
offset: Point,
size: Size,
) -> SubSurface<&mut Self, T>where
Self: Sized,
Create a SubSurface that only uses a rectangular part of this surface.
sourcefn offset_surface_mut(&mut self, offset: Point) -> SubSurface<&mut Self, T>where
Self: Sized,
fn offset_surface_mut(&mut self, offset: Point) -> SubSurface<&mut Self, T>where
Self: Sized,
Create a SubSurface that only uses a rectangular part of this surface starting from (offset.x, offset.y).
sourcefn into_sub_surface(self, offset: Point, size: Size) -> SubSurface<Self, T>where
Self: Sized,
fn into_sub_surface(self, offset: Point, size: Size) -> SubSurface<Self, T>where
Self: Sized,
Create a SubSurface that only uses a rectangular part of this surface.
sourcefn into_offset_surface(self, offset: Point) -> SubSurface<Self, T>where
Self: Sized,
fn into_offset_surface(self, offset: Point) -> SubSurface<Self, T>where
Self: Sized,
Create a SubSurface that only uses a rectangular part of this surface starting from (offset.x, offset.y).