From 91c36f415c68cd78a0094e9603e938e7ac16b62e Mon Sep 17 00:00:00 2001 From: jracek Date: Tue, 11 Feb 2025 23:04:42 +0100 Subject: [PATCH] Nicolas played with AI and ImageProcessing now has summaries --- Runtime/ImageProcessing.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Runtime/ImageProcessing.cs b/Runtime/ImageProcessing.cs index c9ba073..be2497b 100644 --- a/Runtime/ImageProcessing.cs +++ b/Runtime/ImageProcessing.cs @@ -5,14 +5,35 @@ using UnityEngine; namespace PSXSplash.RuntimeCode { + + /// + /// The TextureQuantizer class provides methods to quantize a texture into a limited number of colors using K-Means clustering and Floyd-Steinberg dithering. + /// public class TextureQuantizer { + + /// + /// Represents the result of the quantization process, containing the indices of the quantized colors and the palette of unique colors. + /// public struct QuantizedResult { + /// + /// The indices of the quantized colors in the texture. + /// public int[,] Indices; + + /// + /// The palette of unique colors used in the quantized texture. + /// public List Palette; } + /// + /// Quantizes the given texture into a limited number of colors and dithers it. + /// + /// The texture to be quantized. + /// The maximum number of colors allowed in the quantized texture. + /// A QuantizedResult containing the indices of the quantized colors and the palette of unique colors. public static QuantizedResult Quantize(Texture2D texture, int maxColors) { int width = texture.width, height = texture.height;