pub struct Layers<IMG> { /* private fields */ }
Expand description
An ordered collection of Layer
s. There is always one active layer.
Implementations§
Source§impl<IMG: Bitmap> Layers<IMG>
impl<IMG: Bitmap> Layers<IMG>
Sourcepub fn active_index(&self) -> usize
pub fn active_index(&self) -> usize
Get the index of the active Layer
Sourcepub fn active_canvas(&self) -> &Canvas<IMG>
pub fn active_canvas(&self) -> &Canvas<IMG>
Sourcepub fn blended_area(&self, r: Rect<i32>) -> IMG
pub fn blended_area(&self, r: Rect<i32>) -> IMG
Get an image of an area (determined by a rectangle) of all Layer
s
blended together
Sourcepub fn get_mut(&mut self, index: usize) -> &mut Layer<IMG>
pub fn get_mut(&mut self, index: usize) -> &mut Layer<IMG>
Get a mutable reference to a Layer
by its index
Sourcepub fn canvas_at_mut(&mut self, index: usize) -> &mut Canvas<IMG>
pub fn canvas_at_mut(&mut self, index: usize) -> &mut Canvas<IMG>
Sourcepub fn active_canvas_mut(&mut self) -> &mut Canvas<IMG>
pub fn active_canvas_mut(&mut self) -> &mut Canvas<IMG>
Sourcepub fn resize_all(&mut self, size: Size<i32>) -> Vec<IMG>
pub fn resize_all(&mut self, size: Size<i32>) -> Vec<IMG>
Resize all Layer
s, returning the images that were there before the
resizing (used for undoing)
Sourcepub fn add_new_above(&mut self)
pub fn add_new_above(&mut self)
Add a new Layer
above all layers
Sourcepub fn add_at(&mut self, index: usize, layer: Layer<IMG>)
pub fn add_at(&mut self, index: usize, layer: Layer<IMG>)
Add a new Layer
at the specified index
Sourcepub fn set_visibility(&mut self, index: usize, visible: bool)
pub fn set_visibility(&mut self, index: usize, visible: bool)
Set whether the Layer
at the specified index is visible or not
Sourcepub fn set_opacity(&mut self, index: usize, opacity: u8)
pub fn set_opacity(&mut self, index: usize, opacity: u8)
Set the opacity (alpha) of the Layer
at the specified index
Trait Implementations§
Source§impl<'de, IMG> Deserialize<'de> for Layers<IMG>where
IMG: Deserialize<'de>,
impl<'de, IMG> Deserialize<'de> for Layers<IMG>where
IMG: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<IMG> Freeze for Layers<IMG>
impl<IMG> RefUnwindSafe for Layers<IMG>where
IMG: RefUnwindSafe,
impl<IMG> Send for Layers<IMG>where
IMG: Send,
impl<IMG> Sync for Layers<IMG>where
IMG: Sync,
impl<IMG> Unpin for Layers<IMG>where
IMG: Unpin,
impl<IMG> UnwindSafe for Layers<IMG>where
IMG: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more