struct

PrismatIQ::ICOEntry

Inherits Struct < Value < Object

Represents a single icon entry (ICONDIRENTRY) within an ICO file.

Each ICO file can contain multiple icon images at different sizes and color depths. This struct captures the metadata for a single icon entry as defined in the Windows ICO file format specification.

ICO File Format

Offset | Size | Description
-------|------|-------------
0      | 1    | Width (0 = 256)
1      | 1    | Height (0 = 256)
2      | 1    | Color count (0 = 256+)
3      | 1    | Reserved (must be 0)
4      | 2    | Color planes
6      | 2    | Bits per pixel
8      | 4    | Size of image data in bytes
12     | 4    | Offset to image data from start of file

Constructors

from_slice(slice : Slice(UInt8), offset : Int) : ICOEntry
new(width : UInt8, height : UInt8, color_count : UInt8, reserved : UInt8, color_planes : UInt16, bit_count : UInt16, size_in_bytes : UInt32, image_offset : UInt32)

Instance methods

actual_height
actual_width
area
bit_count
color_count
color_planes
height
image_offset
reserved
size_in_bytes
to_s

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.

width