Skip to content

Commit 6b6db2c

Browse files
committed
add experimental filter/convolution module
1 parent 3643abe commit 6b6db2c

17 files changed

Lines changed: 1027 additions & 101 deletions

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ Versions prior to v0.7 are not tagged/released on GitHub.
4343
- Add `TextLayout::with_capacity`
4444
- Add `TextLayout::at(x, y)` as a shortcut to `TextLayout::new().with_position(x, y)`
4545
- Add `{Linear, Radial, Conic}Gradient::with_colors` and `{Linear, Radial, Conic}Gradient::with_colors_and_positions`
46+
- Implement `FromIterator<P>` and `FromIterator<(P, f64)>` for `LinearGradient`, `RadialGradient`, and `ConicGradient`
47+
- This allows you to create a gradient from an iterator of colors or an iterator of `(color, position)` pairs
48+
- Add `Image::from_fill`
4649

4750
## v0.10.3 (2024-09-23)
4851
- Fix GIF encoding issues as produced in [#38](https://github.com/jay3332/ril/issues/38)

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ image = "^0"
4343
imageproc = "^0.23"
4444
rusttype = "^0.9"
4545

46+
[profile.test]
47+
inherits = "release"
48+
4649
[[bench]]
4750
path = "benches/invert.rs"
4851
name = "invert"

src/encode.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,12 @@ impl<C: Default, P: Pixel> DerefMut for EncoderMetadataWithConfig<C, P> {
446446
/// ```no_run
447447
/// use std::fs::File;
448448
/// use std::time::Duration;
449+
/// use ril::colors::{RED, BLUE};
449450
/// use ril::encodings::png::PngEncoder;
450451
/// use ril::prelude::*;
451452
///
452453
/// const HALF_SECOND: Duration = Duration::from_millis(500);
453454
///
454-
/// const RED: Rgb = Rgb::new(255, 0, 0);
455-
/// const BLUE: Rgb = Rgb::new(0, 0, 255);
456-
///
457455
/// fn main() -> ril::Result<()> {
458456
/// let mut writer = File::create("output.png")?;
459457
/// // Prepare metadata. The PNG encoder requires we anticipate the frame count prior to encoding:

src/fill.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Includes the [`Fill`] and [`IntoFill`] traits and primitive fill types such as [`SolidFill`].
2-
//!
2+
//!
33
//! You should almost never need use a fill type directly since methods that take fills usually
44
//! allow anything that implements [`IntoFill`], which includes things such as [`Pixel`]s for solid
55
//! fills, [`gradient`][crate::gradient] types, and even [`Image`]s for image fills.
@@ -79,7 +79,7 @@ impl<P: Pixel> SolidFill<P> {
7979
Self(color)
8080
}
8181

82-
/// Returns a the color (represented as a [`Pixel`]) of the fill.
82+
/// Returns the color (represented as a [`Pixel`]) of the fill.
8383
#[must_use]
8484
pub const fn color(&self) -> P {
8585
self.0

0 commit comments

Comments
 (0)