@startuml oz-p1-container-domain-classes title ОЗ.П1 — структура графического контейнера и представление цвета пикселя\n(модуль Minint.Core.Models) skinparam classAttributeIconSize 0 skinparam shadowing false class MinintContainer <<графический контейнер>> { + Width : int + Height : int + Documents : List~MinintDocument~ {readOnly} + PixelCount : int <> -- + MinintContainer(width, height) + AddNewDocument(name : string) : MinintDocument } class MinintDocument <<кадр / документ>> { + Name : string + FrameDelayMs : uint + Palette : List~RgbaColor~ {readOnly} + Layers : List~MinintLayer~ {readOnly} + IndexByteWidth : int <> -- + MinintDocument(name : string) + FindColorCached(color : RgbaColor) : int + EnsureColorCached(color : RgbaColor) : int + InvalidatePaletteCache() : void } class MinintLayer <<растровый слой>> { + Name : string + IsVisible : bool + Opacity : byte + Pixels : int[] {readOnly} -- + MinintLayer(name, pixelCount) } class RgbaColor <> { + R : byte + G : byte + B : byte + A : byte -- {static} Transparent : RgbaColor + ToPackedRgba() : uint + ToPackedArgb() : uint {static} FromPackedRgba(packed : uint) : RgbaColor } MinintContainer "1" *-- "0..*" MinintDocument : содержит MinintDocument "1" *-- "0..*" MinintLayer : содержит MinintDocument "1" *-- "1..*" RgbaColor : Palette MinintLayer ..> RgbaColor : Pixels[i] — индекс\nв Palette документа note bottom of MinintLayer Логический «пиксель» слоя в памяти — целочисленный **индекс** в палитре документа. Полное описание цвета — элемент **RgbaColor** в **MinintDocument.Palette**. end note note right of MinintContainer Общие для всех документов размеры холста (**Width**, **Height**). Число ячеек растра: **PixelCount** = Width × Height. end note @enduml