Codec

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
open val bytesPerPixel: Int

Returns number of bytes per pixel required by ColorType. Returns zero if colorType is ColorType.UNKNOWN.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Return the number of frames in the image.

Link copied to clipboard

Return info about all the frames in the image.

Link copied to clipboard
open val height: Int

Returns pixel row count.

Link copied to clipboard
open override val imageInfo: ImageInfo
Link copied to clipboard
expect open val isClosed: Boolean

Check if underlying resource is closed.

Link copied to clipboard
open val isEmpty: Boolean

Returns true if either getWidth() or getHeight() are zero.

Link copied to clipboard
open val isOpaque: Boolean

Returns true if ColorAlphaType is set to hint that all pixels are opaque; their alpha value is implicitly or explicitly 1.0. If true, and all pixels are not opaque, Skia may draw incorrectly.

Link copied to clipboard

Return the number of times to repeat, if this image is animated. This number does not include the first play through of each frame. For example, a repetition count of 4 means that each frame is played 5 times and then the animation stops.

Link copied to clipboard
open val shiftPerPixel: Int

Returns bit shift converting row bytes to row pixels. Returns zero for ColorType.UNKNOWN.

Link copied to clipboard
Link copied to clipboard
open val width: Int

Returns pixel count in each row. Should be equal or less than getRowBytes() / getImageInfo().getBytesPerPixel().

Functions

Link copied to clipboard
expect open fun close()

Free underlying native resource, peer is useless afterwards.

Link copied to clipboard

Return info about a single frame.

Link copied to clipboard
fun readPixels(bitmap: Bitmap?): Codec

Decodes an image into a bitmap.

fun readPixels(bitmap: Bitmap?, frame: Int): Codec
fun readPixels(bitmap: Bitmap?, frame: Int, priorFrame: Int): Codec

Decodes a frame in a multi-frame image into a bitmap.

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