KittyImageData class final
Immutable RGBA pixel buffer and grid placement metadata for a Kitty image.
Constructors
- KittyImageData({required int imageId, required int pixelWidth, required int pixelHeight, required Uint8List rgbaPixels, required int gridCols, required int gridRows, int version = 0, int format = 32})
-
Creates a KittyImageData descriptor.
const
- KittyImageData.fromPng({required int imageId, required int pixelWidth, required int pixelHeight, required Uint8List pngBytes, required int gridCols, required int gridRows, int version = 0})
-
Creates a KittyImageData descriptor from pre-compressed PNG bytes (
f=100).factory
Properties
- format → int
-
Format flag: 32 for RGBA8888, 100 for PNG.
final
- gridCols → int
-
Target placement width in terminal columns.
final
- gridRows → int
-
Target placement height in terminal rows.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- imageId → int
-
Unique 32-bit Kitty image ID (
1..0xFFFFFFFF).final - pixelHeight → int
-
Source image height in pixels.
final
- pixelWidth → int
-
Source image width in pixels.
final
- rgbaPixels → Uint8List
-
Raw RGBA8888 or PNG pixel bytes.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- version → int
-
Optional version counter incremented when pixel contents change for the same imageId.
final
Methods
-
copyWith(
{int? imageId, int? pixelWidth, int? pixelHeight, Uint8List? rgbaPixels, int? gridCols, int? gridRows, int? version, int? format}) → KittyImageData - Returns a copy of this KittyImageData with updated fields.
-
isSameContentAs(
KittyImageData other) → bool -
Returns whether
otherhas identical image metadata, grid size, version, format, and underlying rgbaPixels buffer identity. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toApcSequence(
{int chunkSize = 4096, bool compress = false}) → String -
Encodes the Kitty Graphics
APCupload (a=t,f=...) and virtual placement (a=p,U=1) sequences for CLI terminals. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
buildCapabilityQuery(
{int queryId = 31}) → String -
Builds a Kitty Graphics capability query sequence (
a=q).