mirror of
https://github.com/DarthAffe/HPPH.git
synced 2026-11-09 18:36:34 +00:00
Changed current quantization method name to SimpleColorPalette, added placeholder for a more quality focused implementation
This commit is contained in:
1 parent
15981f82d6
commit
c897b34690
13 files changed
+436
-86
No files matched your search
@@ -37,6 +37,17 @@ internal class Quantize : IGeneratorFeature
|
||||
return result;
|
||||
}
|
||||
|
||||
unsafe IColor[] IColorFormat.CreateSimpleColorPalette(ReadOnlySpan<byte> data, int paletteSize)
|
||||
{
|
||||
Color{{colorFormat.Format}}[] colors = PixelHelper.CreateSimpleColorPalette<Color{{colorFormat.Format}}>(MemoryMarshal.Cast<byte, Color{{colorFormat.Format}}>(data), paletteSize);
|
||||
|
||||
IColor[] result = new IColor[colors.Length];
|
||||
for(int i = 0; i < colors.Length; i++)
|
||||
result[i] = colors[i];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
""";
|
||||
@@ -50,6 +61,7 @@ internal class Quantize : IGeneratorFeature
|
||||
public partial interface IColorFormat
|
||||
{
|
||||
internal IColor[] CreateColorPalette(ReadOnlySpan<byte> data, int paletteSize);
|
||||
internal IColor[] CreateSimpleColorPalette(ReadOnlySpan<byte> data, int paletteSize);
|
||||
}
|
||||
""";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user