KgpImageData
Namespace: Hex1b
Assembly: Hex1b.dll
Stores transmitted image data for the Kitty Graphics Protocol. Images are identified by ID and may be displayed via multiple placements.
public sealed class KgpImageDataInheritance
Object → KgpImageData
Constructors
KgpImageData(uint, uint, byte[], uint, uint, KgpFormat)
Creates a new KGP image data entry from raw pixel data.
Parameters:
imageId(UInt32): The image ID assigned by the client or allocated by the terminal.imageNumber(UInt32): The image number (I key), or 0 if unspecified.data(Byte[]): The raw decoded pixel data.width(UInt32): Image width in pixels.height(UInt32): Image height in pixels.format(KgpFormat): The pixel format of the stored data.
public KgpImageData(uint imageId, uint imageNumber, byte[] data, uint width, uint height, KgpFormat format)Properties
ContentHash
SHA256 hash of the data for content-addressable deduplication.
Returns: Byte[]
public byte[] ContentHash { get; }Data
The raw decoded pixel data (after base64 decoding, before decompression).
Returns: Byte[]
public byte[] Data { get; }Format
The pixel format of the stored data.
Returns: KgpFormat
public KgpFormat Format { get; }Height
Image height in pixels.
Returns: UInt32
public uint Height { get; }ImageId
The image ID assigned by the client or allocated by the terminal.
Returns: UInt32
public uint ImageId { get; }ImageNumber
The image number (I key), if specified. 0 means unspecified.
Returns: UInt32
public uint ImageNumber { get; }Is4ByteAligned
Whether pixels are 4-byte aligned (RGBA or PNG).
Returns: Boolean
public bool Is4ByteAligned { get; }Width
Image width in pixels.
Returns: UInt32
public uint Width { get; }Methods
IsDataSizeValid()
Validates that the data size matches the expected size for the given format and dimensions.
Returns: Boolean
public bool IsDataSizeValid()