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;