mirror of https://github.com/SixLabors/ImageSharp
Browse Source
Former-commit-id: 7c34c72499a47b2d9e11f86d4b995bacfc02a585 Former-commit-id: 2d1151dc50f27a25c41b88f2882330602ebbf6d8 Former-commit-id: 25600ca90a236389fb2b1418465f01945755df17pull/17/head
26 changed files with 159 additions and 75 deletions
@ -0,0 +1,2 @@ |
|||||
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> |
||||
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=XY/@EntryIndexedValue">XY</s:String></wpf:ResourceDictionary> |
||||
@ -0,0 +1,26 @@ |
|||||
|
// <copyright file="EdgeDetector2DFilter.cs" company="James South">
|
||||
|
// Copyright (c) James South and contributors.
|
||||
|
// Licensed under the Apache License, Version 2.0.
|
||||
|
// </copyright>
|
||||
|
|
||||
|
namespace ImageProcessor.Filters |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Defines a filter that detects edges within an image using two
|
||||
|
/// one-dimensional matrices.
|
||||
|
/// </summary>
|
||||
|
public abstract class EdgeDetector2DFilter : Convolution2DFilter, IEdgeDetectorFilter |
||||
|
{ |
||||
|
/// <inheritdoc/>
|
||||
|
public bool Greyscale { get; set; } |
||||
|
|
||||
|
/// <inheritdoc/>
|
||||
|
protected override void OnApply(ImageBase source, Rectangle targetRectangle, Rectangle sourceRectangle) |
||||
|
{ |
||||
|
if (this.Greyscale) |
||||
|
{ |
||||
|
new GreyscaleBt709().Apply(source, source, sourceRectangle); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
// <copyright file="EdgeDetectorFilter.cs" company="James South">
|
||||
|
// Copyright (c) James South and contributors.
|
||||
|
// Licensed under the Apache License, Version 2.0.
|
||||
|
// </copyright>
|
||||
|
|
||||
|
namespace ImageProcessor.Filters |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Defines a filter that detects edges within an image using a single
|
||||
|
/// two dimensional matrix.
|
||||
|
/// </summary>
|
||||
|
public abstract class EdgeDetectorFilter : ConvolutionFilter, IEdgeDetectorFilter |
||||
|
{ |
||||
|
/// <inheritdoc/>
|
||||
|
public bool Greyscale { get; set; } |
||||
|
|
||||
|
/// <inheritdoc/>
|
||||
|
protected override void OnApply(ImageBase source, Rectangle targetRectangle, Rectangle sourceRectangle) |
||||
|
{ |
||||
|
if (this.Greyscale) |
||||
|
{ |
||||
|
new GreyscaleBt709().Apply(source, source, sourceRectangle); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
// <copyright file="IEdgeDetectorFilter.cs" company="James South">
|
||||
|
// Copyright (c) James South and contributors.
|
||||
|
// Licensed under the Apache License, Version 2.0.
|
||||
|
// </copyright>
|
||||
|
|
||||
|
namespace ImageProcessor.Filters |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Provides properties and methods allowing the detection of edges within an image.
|
||||
|
/// </summary>
|
||||
|
public interface IEdgeDetectorFilter : IImageProcessor |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Gets or sets a value indicating whether to convert the
|
||||
|
/// image to greyscale before performing edge detection.
|
||||
|
/// </summary>
|
||||
|
bool Greyscale { get; set; } |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue