PNG

object PNG : ImageFormat

Types

Link copied to clipboard
Link copied to clipboard
class DecodingContext(val header: PNG.Header)
Link copied to clipboard
class Header(val width: Int, val height: Int, val bitsPerChannel: Int, val colorspace: PNG.Colorspace, val compressionmethod: Int, val filtermethod: Int, val interlacemethod: Int)
Link copied to clipboard
data class InterlacedPass(val startingRow: Int, val startingCol: Int, val rowIncrement: Int, val colIncrement: Int, val blockHeight: Int, val blockWidth: Int)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val MAGIC1: Int
Link copied to clipboard
const val MAGIC2: Int = 218765834
Link copied to clipboard

Functions

Link copied to clipboard
fun applyFilter(filter: Int, p: UByteArrayInt, c: UByteArrayInt, bpp: Int, size: Int = c.size)
Link copied to clipboard
fun check(s: SyncStream, props: ImageDecodingProps = ImageDecodingProps.DEFAULT): Boolean
Link copied to clipboard
suspend fun decode(file: VfsFile): Bitmap
open suspend override fun decode(file: VfsFile, props: ImageDecodingProps): Bitmap
suspend fun decode(s: AsyncStream, props: ImageDecodingProps = ImageDecodingProps.DEFAULT): Bitmap
suspend fun decode(s: AsyncStream, filename: String): Bitmap
fun decode(s: SyncStream, props: ImageDecodingProps = ImageDecodingProps.DEFAULT): Bitmap

fun decode(data: ByteArray, props: ImageDecodingProps = ImageDecodingProps.DEFAULT): Bitmap

Decodes a given data byte array to a bitmap based on the image format with optional extra prop properties.

Link copied to clipboard
open override fun decodeHeader(s: SyncStream, props: ImageDecodingProps): ImageInfo?
Link copied to clipboard
suspend fun decodeHeaderSuspend(file: VfsFile, props: ImageDecodingProps = ImageDecodingProps.DEFAULT): ImageInfo?
open suspend fun decodeHeaderSuspend(s: AsyncStream, props: ImageDecodingProps = ImageDecodingProps.DEFAULT): ImageInfo?
Link copied to clipboard
open suspend override fun decodeSuspend(data: ByteArray, props: ImageDecodingProps): Bitmap
Link copied to clipboard
fun encode(bitmap: Bitmap, props: ImageEncodingProps = ImageEncodingProps("unknown")): ByteArray
fun encode(image: ImageData, props: ImageEncodingProps = ImageEncodingProps("unknown")): ByteArray
fun encode(frames: List<ImageFrame>, props: ImageEncodingProps = ImageEncodingProps("unknown")): ByteArray
Link copied to clipboard
open suspend override fun encodeSuspend(image: ImageDataContainer, props: ImageEncodingProps): ByteArray
Link copied to clipboard
suspend fun ImageFormatEncoder.encodeSuspend(bitmap: Bitmap, props: ImageEncodingProps = ImageEncodingProps("unknown")): ByteArray
Link copied to clipboard
Link copied to clipboard
fun paethPredictor(a: Int, b: Int, c: Int): Int
Link copied to clipboard
operator fun ImageFormat.plus(format: ImageFormat): ImageFormat
operator fun ImageFormat.plus(formats: List<ImageFormat>): ImageFormat
Link copied to clipboard
suspend fun read(file: VfsFile): Bitmap
suspend fun read(file: VfsFile, props: ImageDecodingProps = ImageDecodingProps.DEFAULT): ImageData
fun read(s: SyncStream, props: ImageDecodingProps = ImageDecodingProps.DEFAULT): Bitmap
fun read(s: SyncStream, filename: String = "unknown"): Bitmap
fun read(s: ByteArray, props: ImageDecodingProps = ImageDecodingProps.DEFAULT): Bitmap
fun read(s: ByteArray, filename: String): Bitmap
Link copied to clipboard
open override fun readImage(s: SyncStream, props: ImageDecodingProps): ImageData
Link copied to clipboard
open fun readImageContainer(s: SyncStream, props: ImageDecodingProps = ImageDecodingProps.DEFAULT): ImageDataContainer
Link copied to clipboard
fun ImageFormat.toProps(props: ImageDecodingProps = ImageDecodingProps.DEFAULT): ImageDecodingProps
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
Link copied to clipboard
open override fun writeImage(image: ImageData, s: SyncStream, props: ImageEncodingProps)