namespace Minint.Core.Models;
///
/// A single raster layer. Pixels are indices into the parent document's palette.
/// Array layout is row-major: Pixels[y * width + x].
///
public sealed class MinintLayer
{
public string Name { get; set; }
public bool IsVisible { get; set; }
///
/// Per-layer opacity (0 = fully transparent, 255 = fully opaque).
/// Used during compositing: effective alpha = paletteColor.A * Opacity / 255.
///
public byte Opacity { get; set; }
///
/// Palette indices, length must equal container Width * Height.
/// Index 0 = transparent by convention.
///
public int[] Pixels { get; }
public MinintLayer(string name, int pixelCount)
{
Name = name;
IsVisible = true;
Opacity = 255;
Pixels = new int[pixelCount];
}
///
/// Constructor for deserialization — accepts a pre-filled pixel buffer.
///
public MinintLayer(string name, bool isVisible, byte opacity, int[] pixels)
{
Name = name;
IsVisible = isVisible;
Opacity = opacity;
Pixels = pixels;
}
}