Add blur/sharpen tool
This commit is contained in:
@@ -307,6 +307,7 @@ impl BrushEngine {
|
||||
RasterBlendMode::PatternStamp => 5u32,
|
||||
RasterBlendMode::DodgeBurn => 6u32,
|
||||
RasterBlendMode::Sponge => 7u32,
|
||||
RasterBlendMode::BlurSharpen => 8u32,
|
||||
};
|
||||
|
||||
let push_dab = |dabs: &mut Vec<GpuDab>,
|
||||
@@ -371,6 +372,8 @@ impl BrushEngine {
|
||||
(cr, cg, cb, tp[0], tp[1]),
|
||||
RasterBlendMode::DodgeBurn | RasterBlendMode::Sponge =>
|
||||
(tp[0], 0.0, 0.0, 0.0, 0.0),
|
||||
RasterBlendMode::BlurSharpen =>
|
||||
(tp[0], 0.0, 0.0, tp[1], 0.0),
|
||||
_ => (cr, cg, cb, 0.0, 0.0),
|
||||
};
|
||||
push_dab(&mut dabs, &mut bbox, ex, ey, r, o, cr2, cg2, cb2,
|
||||
@@ -494,6 +497,8 @@ impl BrushEngine {
|
||||
(cr, cg, cb, tp[0], tp[1]),
|
||||
RasterBlendMode::DodgeBurn | RasterBlendMode::Sponge =>
|
||||
(tp[0], 0.0, 0.0, 0.0, 0.0),
|
||||
RasterBlendMode::BlurSharpen =>
|
||||
(tp[0], 0.0, 0.0, tp[1], 0.0),
|
||||
_ => (cr, cg, cb, 0.0, 0.0),
|
||||
};
|
||||
push_dab(&mut dabs, &mut bbox,
|
||||
@@ -535,6 +540,8 @@ impl BrushEngine {
|
||||
(cr, cg, cb, tp[0], tp[1]),
|
||||
RasterBlendMode::DodgeBurn | RasterBlendMode::Sponge =>
|
||||
(tp[0], 0.0, 0.0, 0.0, 0.0),
|
||||
RasterBlendMode::BlurSharpen =>
|
||||
(tp[0], 0.0, 0.0, tp[1], 0.0),
|
||||
_ => (cr, cg, cb, 0.0, 0.0),
|
||||
};
|
||||
push_dab(&mut dabs, &mut bbox, ex, ey, r, o, cr2, cg2, cb2,
|
||||
|
||||
@@ -28,6 +28,8 @@ pub enum RasterBlendMode {
|
||||
DodgeBurn,
|
||||
/// Sponge: saturate or desaturate existing pixels
|
||||
Sponge,
|
||||
/// Blur / Sharpen: soften or crisp up existing pixels
|
||||
BlurSharpen,
|
||||
}
|
||||
|
||||
impl Default for RasterBlendMode {
|
||||
@@ -41,7 +43,7 @@ impl RasterBlendMode {
|
||||
/// use the brush color at all (clone, heal, dodge/burn, sponge).
|
||||
/// Used by brush_engine.rs to decide whether color_a should be 1.0 or stroke.color[3].
|
||||
pub fn uses_brush_color(self) -> bool {
|
||||
!matches!(self, Self::CloneStamp | Self::Healing | Self::DodgeBurn | Self::Sponge)
|
||||
!matches!(self, Self::CloneStamp | Self::Healing | Self::DodgeBurn | Self::Sponge | Self::BlurSharpen)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user