-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathFakeDithering.cs
More file actions
34 lines (30 loc) · 983 Bytes
/
FakeDithering.cs
File metadata and controls
34 lines (30 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
This file implements fake dithering, meaning NO dithering is done.
This is free and unencumbered software released into the public domain.
*/
using System;
using System.Numerics;
/// <summary>
/// Fake dithering doesn't do any dithering. It only does color reduction
/// </summary>
public sealed class FakeDitheringRGB<T> : DitheringErrorPushBase<T> where T : INumber<T>, IMinMaxValue<T>
{
/// <summary>
/// Constructor for fake dithering (no dither, just color reduction)
/// </summary>
/// <param name="colorfunc"></param>
/// <returns></returns>
public FakeDitheringRGB(ColorFunction colorfunc) : base(colorfunc, "No dithering", "_NONE")
{
}
/// <summary>
/// Push error method for Fake dithering
/// </summary>
/// <param name="x">X coordinate</param>
/// <param name="y">Y coordinate</param>
/// <param name="quantError">Quantization error</param>
override protected void PushError(int x, int y, double[] quantError)
{
// Don't do anything
}
}