Bitmap32

class Bitmap32(val width: Int, val height: Int, val ints: IntArray = IntArray(width * height), premultiplied: Boolean = true) : Bitmap, Iterable<RGBA>

Constructors

Link copied to clipboard
constructor(width: Int, height: Int, value: RGBA)
constructor(width: Int, height: Int, value: RgbaArray)
constructor(width: Int, height: Int, generator: (x: Int, y: Int) -> RGBA)
constructor(width: Int, height: Int, ints: IntArray = IntArray(width * height), premultiplied: Boolean = true)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val area: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val bpp: Int
Link copied to clipboard

Version of the content. lock+unlock mutates this version to allow for example to re-upload the bitmap to the GPU when synchronizing bitmaps into textures

Link copied to clipboard
Link copied to clipboard
open override var extra: ExtraType
Link copied to clipboard
Link copied to clipboard
val height: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Specifies whether mipmaps should be created for this Bitmap

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val size: SizeInt
Link copied to clipboard
val stride: Int
Link copied to clipboard
Link copied to clipboard
val width: Int

Functions

Link copied to clipboard
fun _draw(src: BmpSlice32, dx: Int = 0, dy: Int = 0, mix: Boolean)
fun _draw(src: Bitmap32, dx: Int, dy: Int, sleft: Int, stop: Int, sright: Int, sbottom: Int, mix: Boolean)
Link copied to clipboard
fun _drawPut(mix: Boolean, other: Bitmap32, _dx: Int = 0, _dy: Int = 0)
Link copied to clipboard
fun _drawUnchecked(src: Bitmap32, dx: Int, dy: Int, sleft: Int, stop: Int, sright: Int, sbottom: Int, mix: Boolean)
Link copied to clipboard
inline fun all(callback: (RGBA) -> Boolean): Boolean
Link copied to clipboard
inline fun any(callback: (RGBA) -> Boolean): Boolean
Link copied to clipboard
fun applyColorMatrix(matrix: Matrix4, x: Int = 0, y: Int = 0, width: Int = this.width - x, height: Int = this.height - y)
Link copied to clipboard
fun applyColorTransform(ct: ColorTransform, x: Int = 0, y: Int = 0, width: Int = this.width - x, height: Int = this.height - y)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Bitmap.asNinePatchSimple(left: Int, top: Int, right: Int, bottom: Int): NinePatchBmpSlice
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Bitmap32.border(r: Int, color: RGBA = Colors.BLACK): Bitmap32
Link copied to clipboard
fun Bitmap32.borderInline(r: Int, color: RGBA = Colors.BLACK)
Link copied to clipboard
fun Iterable<Cancellable>.cancel(e: Throwable = CancellationException(""))
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun clampWidth(x: Int): Int
Link copied to clipboard
fun clampX(x: Int): Int
Link copied to clipboard
fun clampY(y: Int): Int
Link copied to clipboard
Link copied to clipboard
open override fun clone(): Bitmap32
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun contentEquals(other: Bitmap): Boolean
Link copied to clipboard
open override fun contentHashCode(): Int
Link copied to clipboard
fun copy(srcX: Int, srcY: Int, dst: Bitmap, dstX: Int, dstY: Int, width: Int, height: Int)
Link copied to clipboard
fun copySliceWithBounds(left: Int, top: Int, right: Int, bottom: Int): Bitmap32
Link copied to clipboard
fun copySliceWithSize(x: Int, y: Int, width: Int, height: Int): Bitmap32
Link copied to clipboard
fun copyTo(other: Bitmap32): Bitmap32
Link copied to clipboard
open override fun copyUnchecked(srcX: Int, srcY: Int, dst: Bitmap, dstX: Int, dstY: Int, width: Int, height: Int)
Link copied to clipboard
open override fun createWithThisFormat(width: Int, height: Int): Bitmap
Link copied to clipboard
Link copied to clipboard
fun Bitmap.distanceMap(out: DistanceBitmap = DistanceBitmap(width, height), thresold: Double = 0.5): DistanceBitmap
Link copied to clipboard
fun draw(src: Bitmap32, dx: Int = 0, dy: Int = 0)
fun draw(src: BmpSlice32, dx: Int = 0, dy: Int = 0)
Link copied to clipboard
fun drawPixelMixed(x: Int, y: Int, c: RGBA)
Link copied to clipboard
fun Bitmap32.drawText(font: BitmapFont, str: String, pos: Point = Point.ZERO, color: RGBA = Colors.WHITE, size: Double = font.fontSize, alignment: TextAlignment = TextAlignment.TOP_LEFT): Bitmap32
Link copied to clipboard
fun drawUnoptimized(src: BmpSlice, dx: Int = 0, dy: Int = 0, mix: Boolean = true)
fun drawUnoptimized(src: Bitmap, dx: Int, dy: Int, sleft: Int, stop: Int, sright: Int, sbottom: Int, mix: Boolean)
Link copied to clipboard
fun Bitmap32.dropShadow(x: Int, y: Int, r: Int, color: RGBA = Colors.BLACK): Bitmap32
Link copied to clipboard
fun Bitmap32.dropShadowInplace(x: Int, y: Int, r: Int, color: RGBA = Colors.BLACK): Bitmap32
Link copied to clipboard
suspend fun Bitmap.encode(formats: ImageFormat = RegisteredImageFormats, props: ImageEncodingProps = ImageEncodingProps()): ByteArray
Link copied to clipboard
Link copied to clipboard
inline suspend fun <T> Iterable<Signal<T>>.executeAndWaitAnySignal(callback: () -> Unit): Pair<Signal<T>, T>
Link copied to clipboard
fun Bitmap32.expandBorder(areaTop: Int, areaLeft: Int, areaBottom: Int, areaRight: Int, border: Int)
Link copied to clipboard
fun extractBytes(format: ColorFormat = RGBA): ByteArray
Link copied to clipboard
fun extractChannel(channel: BitmapChannel, out: Bitmap8 = Bitmap8(width, height)): Bitmap8
Link copied to clipboard
fun fill(color: RGBA, x: Int = 0, y: Int = 0, width: Int = this.width - x, height: Int = this.height - y)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun flipX(): Bitmap

Inplace flips

Link copied to clipboard
open fun flipY(): Bitmap
Link copied to clipboard
inline fun forEach(sx: Int = 0, sy: Int = 0, width: Int = this.width - sx, height: Int = this.height - sy, callback: (n: Int, x: Int, y: Int) -> Unit)
Link copied to clipboard
operator fun get(x: Int, y: Int): RGBA
Link copied to clipboard
inline fun <T> Iterable<Vfs.Attribute>.get(): T?
operator fun Iterable<Xml>.get(name: String): Iterable<Xml>
Link copied to clipboard
open override fun getContext2d(antialiasing: Boolean): Context2d
Link copied to clipboard
open override fun getInt(x: Int, y: Int): Int

UNSAFE: Gets the color in the x, y coordinates in the internal format of this Bitmap

Link copied to clipboard
open override fun getRgba(x: Int, y: Int): RGBA

Gets the color v in the x, y coordinates in RGBA non-premultiplied

Link copied to clipboard
Link copied to clipboard
fun getRgbaClamped(x: Int, y: Int): RGBA
Link copied to clipboard
Link copied to clipboard
open override fun getRgbaPremultiplied(x: Int, y: Int): RGBAPremultiplied

Gets the color v in the x, y coordinates in RGBAPremultiplied

Link copied to clipboard
open override fun getRgbaRaw(x: Int, y: Int): RGBA

UNSAFE: Gets the color v in the x, y coordinates in the internal format of this Bitmap (either premultiplied or not)

Link copied to clipboard
fun getRgbaSampled(x: Float, y: Float, count: Int, row: RgbaArray)
Link copied to clipboard
fun Bitmap32.glow(r: Int, color: RGBA = Colors.BLACK): Bitmap32
Link copied to clipboard
fun Bitmap32.glowInplace(r: Int, color: RGBA = Colors.BLACK): Bitmap32
Link copied to clipboard
fun historiogram(channel: BitmapChannel, out: IntArray = IntArray(256)): IntArray
Link copied to clipboard
fun inBounds(x: Int, y: Int): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun index(x: Int, y: Int): Int
Link copied to clipboard
fun inside(x: Int, y: Int): Boolean
Link copied to clipboard
fun invert()
Link copied to clipboard
fun inverted(target: Bitmap32 = Bitmap32(width, height, this.premultiplied)): Bitmap32
Link copied to clipboard
open operator override fun iterator(): Iterator<RGBA>
Link copied to clipboard
Link copied to clipboard
open fun lock()
inline fun lock(rect: RectangleInt = this.rect, doLock: Boolean = true, block: () -> Unit): Int
Link copied to clipboard
Link copied to clipboard
fun mipmap(levels: Int): Bitmap32
Link copied to clipboard
Link copied to clipboard
fun oriented(orientation: ImageOrientation): Bitmap
Link copied to clipboard
fun Bitmap32.posterize(nbits: Int = 4): Bitmap32
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun put(src: Bitmap32, dx: Int = 0, dy: Int = 0)
fun put(src: BmpSlice32, dx: Int = 0, dy: Int = 0)
Link copied to clipboard
fun Bitmap.putSliceWithBorder(x: Int, y: Int, bmp: BmpSlice, border: Int = 1)
Link copied to clipboard
open fun readPixelsUnsafe(x: Int, y: Int, width: Int, height: Int, out: IntArray, offset: Int = 0)
Link copied to clipboard
fun Bitmap.readPixelsUnsafe(x: Int, y: Int, width: Int, height: Int): IntArray
Link copied to clipboard
fun Bitmap.resized(out: Bitmap, scale: ScaleMode, anchor: Anchor): Bitmap
fun Bitmap.resized(width: Int, height: Int, scale: ScaleMode, anchor: Anchor, native: Boolean = true): Bitmap
Link copied to clipboard
fun Bitmap.resizedUpTo(width: Int, height: Int, native: Boolean = true): Bitmap
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun rotated(rotation: ImageRotation): Bitmap
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun scaled(width: Int, height: Int, smooth: Boolean = true): Bitmap32

Creates a new Bitmap32 with the specified new dimensions widthxheight scaling the original content. The smooth parameter determines the quality of the interpolation. smooth=false will use a nearest neighborhood implementation.

Link copied to clipboard
fun scaleLinear(sx: Double, sy: Double = sx): Bitmap32
Link copied to clipboard
fun scaleNearest(sx: Int, sy: Int = sx): Bitmap32
Link copied to clipboard
fun Bitmap.sdf(out: DistanceBitmap = DistanceBitmap(width, height), thresold: Double = 0.5): DistanceBitmap
Link copied to clipboard
operator fun set(x: Int, y: Int, color: RGBA)
Link copied to clipboard
fun Bitmap32.setAlpha(value: Int)
Link copied to clipboard
inline fun setEach(sx: Int = 0, sy: Int = 0, width: Int = this.width - sx, height: Int = this.height - sy, callback: (x: Int, y: Int) -> RGBA)
Link copied to clipboard
inline fun setEachPremultiplied(sx: Int = 0, sy: Int = 0, width: Int = this.width - sx, height: Int = this.height - sy, callback: (x: Int, y: Int) -> RGBAPremultiplied)
Link copied to clipboard
open override fun setInt(x: Int, y: Int, color: Int)

UNSAFE: Sets the color color in the x, y coordinates in the internal format of this Bitmap

Link copied to clipboard
open override fun setRgba(x: Int, y: Int, v: RGBA)

Sets the color v in the x, y coordinates in RGBA non-premultiplied

open override fun setRgba(x: Int, y: Int, v: RGBAPremultiplied)

Sets the color v in the x, y coordinates in RGBAPremultiplied

Link copied to clipboard
fun setRgbaAtIndex(n: Int, color: RGBA)
Link copied to clipboard
open override fun setRgbaRaw(x: Int, y: Int, v: RGBA)

UNSAFE: Sets the color v in the x, y coordinates in the internal format of this Bitmap (either premultiplied or not)

Link copied to clipboard
fun setRow(y: Int, row: IntArray)
Link copied to clipboard
fun setRowChunk(x: Int, y: Int, data: RgbaArray, width: Int, increment: Int)
Link copied to clipboard
suspend fun Bitmap.showImageAndWait(kind: Int = 0)
Link copied to clipboard
fun Iterable<Xml>.str(name: String, defaultValue: String = ""): String
Link copied to clipboard
open fun swapColumns(x0: Int, x1: Int)
Link copied to clipboard
open override fun swapRows(y0: Int, y1: Int)
Link copied to clipboard
Link copied to clipboard
fun Bitmap.toAwt(out: BufferedImage = BufferedImage( width.coerceAtLeast(1), height.coerceAtLeast(1), if (this.premultiplied) BufferedImage.TYPE_INT_ARGB_PRE else BufferedImage.TYPE_INT_ARGB )): BufferedImage
fun Bitmap32.toAwt(out: BufferedImage = BufferedImage( width.coerceAtLeast(1), height.coerceAtLeast(1), if (this.premultiplied) BufferedImage.TYPE_INT_ARGB_PRE else BufferedImage.TYPE_INT_ARGB )): BufferedImage
Link copied to clipboard
inline fun Bitmap32.toBitmap1(): Bitmap1
inline fun Bitmap32.toBitmap1(func: (value: RGBA) -> Boolean): Bitmap1
Link copied to clipboard
open override fun toBMP32(): Bitmap32
Link copied to clipboard
Link copied to clipboard
fun Bitmap32.toCGImage(): CGImageRef?
Link copied to clipboard
suspend fun <T> Iterable<T>.toChannel(): ReceiveChannel<T>
Link copied to clipboard
fun Bitmap.toFloatBMP32(out: FloatBitmap32 = FloatBitmap32(width, height, premultiplied = premultiplied)): FloatBitmap32
Link copied to clipboard
Link copied to clipboard
fun Bitmap.toPaint(transform: Matrix = Matrix.IDENTITY, cycleX: CycleMethod = CycleMethod.NO_CYCLE, cycleY: CycleMethod = CycleMethod.NO_CYCLE, smooth: Boolean = true, units: GradientUnits = GradientUnits.OBJECT_BOUNDING_BOX): BitmapPaint
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun Bitmap.toUIImage(): UIImage
Link copied to clipboard
Link copied to clipboard
inline fun Bitmap.trace(): VectorPath
inline fun Bitmap32.trace(): VectorPath
inline fun Bitmap.trace(func: (RGBA) -> Boolean): VectorPath
inline fun Bitmap32.trace(func: (RGBA) -> Boolean): VectorPath
Link copied to clipboard
Link copied to clipboard
open fun transposed(): Bitmap

Creates a new bitmap with the rows and columns transposed

Link copied to clipboard
Link copied to clipboard
open fun unlock(rect: RectangleInt = this.rect): Int
Link copied to clipboard
inline fun updateColors(sx: Int = 0, sy: Int = 0, width: Int = this.width - sx, height: Int = this.height - sy, callback: (rgba: RGBA) -> RGBA)
Link copied to clipboard
inline fun updateColorsXY(sx: Int = 0, sy: Int = 0, width: Int = this.width - sx, height: Int = this.height - sy, callback: (x: Int, y: Int, rgba: RGBA) -> RGBA)
Link copied to clipboard
suspend fun Iterable<Signal<*>>.waitOne(): Any?
Link copied to clipboard
fun withColorTransform(ct: ColorTransform, x: Int = 0, y: Int = 0, width: Int = this.width - x, height: Int = this.height - y): Bitmap32
Link copied to clipboard
fun writeChannel(destination: BitmapChannel, input: Bitmap8)
fun writeChannel(destination: BitmapChannel, input: Bitmap32, source: BitmapChannel)
Link copied to clipboard
fun writeDecoded(color: ColorFormat, data: ByteArray, offset: Int = 0, littleEndian: Boolean = true): Bitmap32
Link copied to clipboard
open fun writePixelsUnsafe(x: Int, y: Int, width: Int, height: Int, out: IntArray, offset: Int = 0)
Link copied to clipboard
suspend fun Bitmap.writeTo(file: VfsFile, formats: ImageFormat = RegisteredImageFormats, props: ImageEncodingProps = ImageEncodingProps()): Long
Link copied to clipboard
fun xor(value: RGBA)
Link copied to clipboard
fun xored(value: RGBA, target: Bitmap32 = Bitmap32(width, height, this.premultiplied)): Bitmap32
Link copied to clipboard
Link copied to clipboard