mirror of https://github.com/SixLabors/ImageSharp
Browse Source
Former-commit-id: 9e5b8edfb049780f3f8a553f02b2fee20b29f91d Former-commit-id: 66241f9dd5f8be909f03d8b6435e86f69b3f95d4 Former-commit-id: b34b5df5f557b528d9dcea49e92d93532b984cb6af/merge-core
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