Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer based on canvas #1718

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ path = "./src/lib.rs"
[dependencies]
bytemuck = { version = "1.7.0", features = ["extern_crate_alloc"] } # includes cast_vec
byteorder = "1.3.2"
image-canvas = "0.4.1"
num-rational = { version = "0.4", default-features = false }
num-traits = "0.2.0"

gif = { version = "0.11.1", optional = true }
jpeg = { package = "jpeg-decoder", version = "0.2.1", default-features = false, optional = true }
png = { version = "0.17.0", optional = true }
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml.public-private-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ path = "./src/lib.rs"
[dependencies]
bytemuck = { version = "1.7.0", features = ["extern_crate_alloc"] } # includes cast_vec
byteorder = "1.3.2"
num-iter = "0.1.32"
image-canvas = "0.4.1"
num-rational = { version = "0.4", default-features = false }
num-traits = { version = "0.2.0", public = true }

gif = { version = "0.11.1", optional = true }
jpeg = { package = "jpeg-decoder", version = "0.2.1", default-features = false, optional = true }
png = { version = "0.17.0", optional = true }
Expand Down
5 changes: 5 additions & 0 deletions src/buffer.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
//! Contains the generic `ImageBuffer` struct.
#[path = "buffer/canvas.rs"]
mod canvas;

use num_traits::Zero;
use std::fmt;
use std::marker::PhantomData;
Expand All @@ -15,6 +18,8 @@ use crate::math::Rect;
use crate::traits::{EncodableLayout, Pixel, PixelWithColorType};
use crate::utils::expand_packed;

pub use self::canvas::{Canvas, CanvasLayout, UnknownCanvasTexelError};

/// Iterate over pixel refs.
pub struct Pixels<'a, P: Pixel + 'a>
where
Expand Down
Loading