ImageInfo

class ImageInfo(val format: ImageFormat, val width: Int, val height: Int, val bitDepth: Int, val hasAlpha: Boolean, val frameCount: Int, val loopCount: Int, val orientation: Orientation, val isDecodable: Boolean, val unsupportedReason: String? = null)

What a file says about itself, read from its header alone: no pixel decode, no multi-megabyte allocation. This is what you want for laying out a grid before the images arrive, rejecting an upload that's 20000 px wide, or deciding whether a decoder should claim a file at all.

val info = KiteImage.probe(bytes)
if (info.width * info.height > budget) reject()
grid.reserve(info.displayWidth, info.displayHeight) // orientation applied

Cost is proportional to the header, not the image: a few hundred bytes for PNG/JPEG/BMP/TIFF/WebP. GIF and APNG walk the frame structure (skipping every compressed byte) so frameCount is exact rather than a guess.

Constructors

Link copied to clipboard
constructor(format: ImageFormat, width: Int, height: Int, bitDepth: Int, hasAlpha: Boolean, frameCount: Int, loopCount: Int, orientation: Orientation, isDecodable: Boolean, unsupportedReason: String? = null)

Properties

Link copied to clipboard

bits per channel as stored (8 for most things, 1..16 for PNG/TIFF)

Link copied to clipboard

height after orientation is applied.

Link copied to clipboard

width after orientation is applied: what the user will actually see.

Link copied to clipboard

the container, same value KiteImage.detect returns

Link copied to clipboard

number of animation frames; 1 for stills

Link copied to clipboard

the file declares an alpha channel or transparency. This is what the container says, not a pixel scan: an RGBA PNG whose pixels are all opaque still reports true. Use KiteBitmap.hasTransparency for the truth.

Link copied to clipboard
val height: Int

stored pixel height, before orientation

Link copied to clipboard

True when frameCount> 1.

Link copied to clipboard

whether this build's KiteImage.decode can actually produce pixels for this file. False means the format or a specific feature isn't implemented; unsupportedReason names it.

Link copied to clipboard

animation loop count, NETSCAPE/APNG semantics (0 = forever); 1 for stills

Link copied to clipboard

the EXIF orientation, Orientation.Normal when absent

Link copied to clipboard

human-readable reason when isDecodable is false

Link copied to clipboard
val width: Int

stored pixel width, before orientation

Functions

Link copied to clipboard
open override fun toString(): String