PrismatIQ::ICOFile
Inherits PrismatIQ::BinaryReader < Reference < Object
ICOFile: Main class for parsing and processing ICO (icon) files
This class encapsulates all ICO file processing, providing a clean interface for reading ICO files, selecting the best icon entry, and extracting pixel data. It supports both modern PNG-encoded entries and legacy BMP/DIB formats.
Usage
ico = ICOFile.from_path("app.ico")
if ico.valid?
pixels = ico.to_rgba
width = ico.width
height = ico.height
end
Constants
MAX_ENTRY_SIZE = 50000000_i64
Constructors
new(data : Slice(UInt8), config : Config = Config.default)
Class methods
from_path(path : String, config : Config = Config.default) : ICOFile | Nil
from_slice(data : Slice(UInt8), config : Config = Config.default) : ICOFile | Nil
Instance methods
best_bmp_entry
best_png_entry
entries
entry_count
height
to_image
to_rgba
valid?
width