mirror of https://github.com/SixLabors/ImageSharp
Browse Source
Former-commit-id: 532b3bb4f629e1f61451c1549f855617245c6b34 Former-commit-id: 70f1bfd3db4addc970722242bf3f153958cc91c4 Former-commit-id: e3087704f67c536e89c807e5e1f89f81b67cbb6faf/merge-core
9 changed files with 104 additions and 110 deletions
@ -1,35 +0,0 @@ |
|||
// <copyright file="Invert.cs" company="James South">
|
|||
// Copyright © James South and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
// </copyright>
|
|||
|
|||
namespace ImageProcessor.Filters |
|||
{ |
|||
/// <summary>
|
|||
/// Inverts the colors of the image.
|
|||
/// </summary>
|
|||
public class Invert : ColorMatrixFilter |
|||
{ |
|||
/// <summary>
|
|||
/// The inversion matrix.
|
|||
/// TODO: With gamma adjustment enabled this leaves the image too bright.
|
|||
/// </summary>
|
|||
private static readonly ColorMatrix Matrix = new ColorMatrix( |
|||
new[] |
|||
{ |
|||
new float[] { -1, 0, 0, 0, 0 }, |
|||
new float[] { 0, -1, 0, 0, 0 }, |
|||
new float[] { 0, 0, -1, 0, 0 }, |
|||
new float[] { 0, 0, 0, 1, 0 }, |
|||
new float[] { 1, 1, 1, 0, 1 } |
|||
}); |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="Invert"/> class.
|
|||
/// </summary>
|
|||
public Invert() |
|||
: base(Matrix, false) |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue