ImageInfo

class ImageInfo(val colorInfo: ColorInfo, val width: Int, val height: Int)

Describes pixel dimensions and encoding. Bitmap, Image, Pixmap, and Surface can be created from ImageInfo. ImageInfo can be retrieved from Bitmap and Pixmap, but not from Image and Surface. For example, Image and Surface implementations may defer pixel depth, so may not completely specify ImageInfo.

ImageInfo contains dimensions, the pixel integral width and height. It encodes how pixel bits describe alpha, transparency; color components red, blue, and green; and ColorSpace, the range and linearity of colors.

Constructors

Link copied to clipboard
constructor(width: Int, height: Int, colorType: ColorType, alphaType: ColorAlphaType)
constructor(width: Int, height: Int, colorType: ColorType, alphaType: ColorAlphaType, colorSpace: ColorSpace?)
constructor(colorInfo: ColorInfo, width: Int, height: Int)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val height: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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

Returns minimum bytes per row, computed from pixel getWidth() and ColorType, which specifies getBytesPerPixel(). Bitmap maximum value for row bytes must fit in 31 bits.

Link copied to clipboard

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

Link copied to clipboard
val width: Int

Functions

Link copied to clipboard
fun computeByteSize(rowBytes: Int): Int

Returns storage required by pixel array, given ImageInfo dimensions, ColorType, and rowBytes. rowBytes is assumed to be at least as large as .getMinRowBytes.

Link copied to clipboard

Returns storage required by pixel array, given ImageInfo dimensions, and ColorType. Uses .getMinRowBytes to compute bytes for pixel row.

Link copied to clipboard
fun computeOffset(x: Int, y: Int, rowBytes: Long): Long

Returns byte offset of pixel from pixel base address.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun isRowBytesValid(rowBytes: Long): Boolean

Returns true if rowBytes is valid for this ImageInfo.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun withHeight(_height: Int): ImageInfo
Link copied to clipboard
fun withWidth(_width: Int): ImageInfo
Link copied to clipboard
fun withWidthHeight(width: Int, height: Int): ImageInfo