mirror of
https://github.com/bend-n/fimg.git
synced 2024-12-22 10:28:21 -06:00
seal Cloner* traits
This commit is contained in:
parent
214f25bbab
commit
5293fe3d77
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "fimg"
|
name = "fimg"
|
||||||
version = "0.4.5"
|
version = "0.4.6"
|
||||||
authors = ["bend-n <bend.n@outlook.com>"]
|
authors = ["bend-n <bend.n@outlook.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
|
@ -15,8 +15,16 @@ pub trait OverlayAt<W> {
|
||||||
unsafe fn overlay_at(&mut self, with: &W, x: u32, y: u32) -> &mut Self;
|
unsafe fn overlay_at(&mut self, with: &W, x: u32, y: u32) -> &mut Self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Sealant module
|
||||||
|
mod sealed {
|
||||||
|
/// Seals the cloner traits
|
||||||
|
pub trait Sealed {}
|
||||||
|
}
|
||||||
|
use sealed::Sealed;
|
||||||
|
impl<const N: usize> Sealed for ImageCloner<'_, N> {}
|
||||||
|
|
||||||
/// [`OverlayAt`] but owned
|
/// [`OverlayAt`] but owned
|
||||||
pub trait ClonerOverlayAt<const W: usize, const C: usize> {
|
pub trait ClonerOverlayAt<const W: usize, const C: usize>: Sealed {
|
||||||
/// Overlay with => self at coordinates x, y, without blending, and returning a new image.
|
/// Overlay with => self at coordinates x, y, without blending, and returning a new image.
|
||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
|
@ -35,7 +43,7 @@ pub trait Overlay<W> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// [`Overlay`] but owned
|
/// [`Overlay`] but owned
|
||||||
pub trait ClonerOverlay<const W: usize, const C: usize> {
|
pub trait ClonerOverlay<const W: usize, const C: usize>: Sealed {
|
||||||
/// Overlay with => self (does not blend)
|
/// Overlay with => self (does not blend)
|
||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in a new issue