Package-level declarations

Types

Link copied to clipboard
typealias BaseBmpSlice = RectSlice<out Bitmap>
Link copied to clipboard
abstract class Bitmap(val width: Int, val height: Int, val bpp: Int, premultiplied: Boolean, val backingArray: Any?) : SizeableInt, Extra
Link copied to clipboard
class Bitmap1(val width: Int, val height: Int, data: ByteArray = ByteArray((width * height) divCeil 8), var palette: RgbaArray = RgbaArray(intArrayOf(Colors.TRANSPARENT.value, Colors.WHITE.value))) : BitmapIndexed
Link copied to clipboard
class Bitmap16(val width: Int, val height: Int, val data: ShortArray = ShortArray(width * height), val format: ColorFormat = RGBA_4444, premultiplied: Boolean = false) : Bitmap
Link copied to clipboard
class Bitmap2(val width: Int, val height: Int, data: ByteArray = ByteArray((width * height) divCeil 4), var palette: RgbaArray = RgbaArray(4)) : BitmapIndexed
Link copied to clipboard
class Bitmap32(val width: Int, val height: Int, val ints: IntArray = IntArray(width * height), premultiplied: Boolean = true) : Bitmap, Iterable<RGBA>
Link copied to clipboard
class Bitmap4(val width: Int, val height: Int, data: ByteArray = ByteArray(width * height / 2), var palette: RgbaArray = RgbaArray(16)) : BitmapIndexed
Link copied to clipboard
class Bitmap8(val width: Int, val height: Int, data: ByteArray = ByteArray(width * height), var palette: RgbaArray = RgbaArray(0x100)) : BitmapIndexed
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract class BitmapIndexed(val bpp: Int, val width: Int, val height: Int, var bytes: ByteArray = ByteArray(width * height / (8 / bpp)), var palette: RgbaArray = RgbaArray(1 shl bpp)) : Bitmap
Link copied to clipboard
object Bitmaps
Link copied to clipboard
typealias BitmapSlice<T> = RectSlice<T>
Link copied to clipboard
data class BitmapWithHotspot<T : Bitmap>(val bitmap: T, val hotspot: Vector2I)
Link copied to clipboard
Link copied to clipboard
typealias BmpSlice = RectSlice<out Bitmap>
Link copied to clipboard
typealias BmpSlice32 = RectSlice<out Bitmap32>
Link copied to clipboard
class DistanceBitmap(val width: Int, val height: Int, val d: FloatArray = FloatArray(width * height), val px: IntArray = IntArray(width * height), val py: IntArray = IntArray(width * height))
Link copied to clipboard
class FloatBitmap32(val width: Int, val height: Int, val data: FloatArray = FloatArray(width * height * 4), premultiplied: Boolean = false) : Bitmap
Link copied to clipboard
interface ForcedTexId
Link copied to clipboard
abstract class ForcedTexNativeImage(val width: Int, val height: Int, premultiplied: Boolean = true) : NativeImage, ForcedTexId
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open class MultiBitmap(val width: Int, val height: Int, val bitmaps: List<Bitmap>, premultiplied: Boolean = true) : Bitmap
Link copied to clipboard
abstract class NativeImage(val width: Int, val height: Int, val data: Any?, premultiplied: Boolean) : Bitmap
Link copied to clipboard
Link copied to clipboard
open class NinePatchBmpSlice(val content: BmpSlice, val info: NinePatchInfo, val bmpSlice: BmpSlice = content)
Link copied to clipboard
class NinePatchInfo(val xranges: List<Pair<Boolean, IntRange>>, val yranges: List<Pair<Boolean, IntRange>>, val width: Int, val height: Int, val content: BmpSlice? = null)
Link copied to clipboard
open class NullBitmap(val width: Int, val height: Int, premultiplied: Boolean = true) : Bitmap
Link copied to clipboard
open class Palette(val colors: RgbaArray, val names: Array<String?>? = null, val changeStart: Int = 0, val changeEnd: Int = 0)
Link copied to clipboard
object PSNR
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val <T : Bitmap> RectSlice<T>.bmp: T
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun Bitmap.asNinePatchSimple(left: Int, top: Int, right: Int, bottom: Int): NinePatchBmpSlice
fun BmpSlice.asNinePatchSimple(left: Int, top: Int, right: Int, bottom: Int): NinePatchBmpSlice
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Bitmap32Context2d(width: Int, height: Int, antialiased: Boolean = true, block: Context2d.() -> Unit): Bitmap32
Link copied to clipboard
fun <T : Bitmap> T.checkMatchDimensions(other: T): T
Link copied to clipboard
fun FloatArray2.clamp(min: Float, max: Float)
Link copied to clipboard
Link copied to clipboard
inline fun <T : Bitmap> T.context2d(antialiased: Boolean = true, doLock: Boolean = true, callback: Context2d.() -> Unit): T
Link copied to clipboard
fun FloatArray2.convertRange(minSrc: Float, maxSrc: Float, minDst: Float = 0.0f, maxDst: Float = 1.0f)
Link copied to clipboard
fun <T : Bitmap> T.createWithThisFormatTyped(width: Int, height: Int): T
Link copied to clipboard
fun Bitmap.distanceMap(out: DistanceBitmap = DistanceBitmap(width, height), thresold: Double = 0.5): DistanceBitmap
Link copied to clipboard
Link copied to clipboard
fun Bitmap32.expandBorder(areaTop: Int, areaLeft: Int, areaBottom: Int, areaRight: Int, border: Int)
Link copied to clipboard
fun <T : Bitmap> RectSlice<T>.extract(): T

Extract pixels in the same Bitmap format as the RectSlice.container, having into account RectSlice.padding and RectSlice.orientation

fun <T : Bitmap> T.extract(x: Int, y: Int, width: Int, height: Int): T
Link copied to clipboard

Extract pixels in the same Bitmap format as the RectSlice.container, without having into account RectSlice.padding nor RectSlice.orientation

Link copied to clipboard
inline fun FloatArray2.forEachValue(block: (x: Int, y: Int, v: Float) -> Unit)
Link copied to clipboard
fun FloatArray2.getMinMax(out: FloatArray = FloatArray(2)): FloatArray
Link copied to clipboard
fun BmpSlice.getRgba(x: Int, y: Int): RGBA

Gets a pixel in RGBA from the slice in x and y WITHOUT having into account orientation and padding

Link copied to clipboard
Link copied to clipboard

Same as getRgba but ignoring premultiplication and bound checks

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T : Bitmap> T.mipmaps(enable: Boolean = true): T

Enable or disable mipmap generation for this Bitmap

Link copied to clipboard
fun NativeImage(d: SizedDrawable, scaleX: Double = 1.0, scaleY: Double = scaleX): NativeImage
fun NativeImage(width: Int, height: Int, pixels: RgbaArray): NativeImage
fun NativeImage(width: Int, height: Int, pixels: RgbaPremultipliedArray): NativeImage
fun NativeImage(width: Int, height: Int, premultiplied: Boolean? = null): NativeImage
fun NativeImage(width: Int, height: Int, pixels: IntArray, premultiplied: Boolean? = null): NativeImage
fun NativeImage(width: Int, height: Int, d: Drawable, scaleX: Double = 1.0, scaleY: Double = scaleX): NativeImage
Link copied to clipboard
fun NativeImageContext2d(width: Int, height: Int, antialiased: Boolean = true, block: Context2d.() -> Unit): NativeImage
Link copied to clipboard
fun NativeImageOrBitmap32(width: Int, height: Int, native: Boolean = true, premultiplied: Boolean? = null): Bitmap
Link copied to clipboard
fun NativeImageOrBitmap32Context2d(width: Int, height: Int, antialiased: Boolean = true, native: Boolean = true, block: Context2d.() -> Unit): Bitmap
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Bitmap32.posterize(nbits: Int = 4): Bitmap32
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Bitmap.putSliceWithBorder(x: Int, y: Int, bmp: BmpSlice, border: Int = 1)
Link copied to clipboard
fun <T : Bitmap> T.putWithBorder(x: Int, y: Int, bmp: T, border: Int = 1)
Link copied to clipboard
fun SizedDrawable.raster(scaleX: Double = 1.0, scaleY: Double = scaleX): NativeImage
Link copied to clipboard
suspend fun VfsFile.readNinePatch(props: ImageDecodingProps = ImageDecodingProps.DEFAULT): NinePatchBmpSlice
Link copied to clipboard
fun BmpSlice.readPixels(x: Int, y: Int, width: Int, height: Int, out: RgbaArray = RgbaArray(width * height), offset: Int = 0): RgbaArray

Reads pixels in region without having into account RectSlice.orientation or RectSlice.padding

Link copied to clipboard
fun Bitmap.readPixelsUnsafe(x: Int, y: Int, width: Int, height: Int): IntArray

fun BmpSlice.readPixelsUnsafe(x: Int, y: Int, width: Int, height: Int, out: IntArray = IntArray(width * height), offset: Int = 0): IntArray

Sets a pixel in RGBA from the slice in x and y with the color RectSlice.value WITHOUT having into account RectSlice.orientation and RectSlice.padding

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
fun FloatArray2.scale(scale: Float = 1.0f)
Link copied to clipboard
fun Bitmap.sdf(out: DistanceBitmap = DistanceBitmap(width, height), thresold: Double = 0.5): DistanceBitmap
Link copied to clipboard
fun Bitmap32.setAlpha(value: Int)
Link copied to clipboard
fun BmpSlice.setRgba(x: Int, y: Int, value: RGBA)

Sets a pixel in RGBA from the slice in x and y with the color value WITHOUT having into account orientation and padding

Link copied to clipboard
fun BmpSlice.setRgbaOriented(x: Int, y: Int, value: RGBA)
Link copied to clipboard
fun BmpSlice.setRgbaRawUnsafe(x: Int, y: Int, value: RGBA)

Same as setRgba but ignoring premultiplication and bound checks

Link copied to clipboard
fun <T : Bitmap> T.slice(bounds: RectangleInt = RectangleInt(0, 0, width, height), name: String? = null, orientation: ImageOrientation = ImageOrientation.ROTATE_0, padding: MarginInt = MarginInt.ZERO): RectSlice<T>
fun <T : SizeableInt> SliceCoordsWithBase<T>.slice(bounds: RectangleInt = RectangleInt(0, 0, width, height), name: String? = null, orientation: ImageOrientation = ImageOrientation.ROTATE_0, padding: MarginInt = MarginInt.ZERO): RectSlice<T>
Link copied to clipboard
fun <T : Bitmap> T.sliceWithBounds(left: Int, top: Int, right: Int, bottom: Int, name: String? = null, orientation: ImageOrientation = ImageOrientation.ROTATE_0, padding: MarginInt = MarginInt.ZERO): RectSlice<T>
Link copied to clipboard
fun <T : Bitmap> T.sliceWithSize(x: Int, y: Int, width: Int, height: Int, name: String? = null, orientation: ImageOrientation = ImageOrientation.ROTATE_0, padding: MarginInt = MarginInt.ZERO): RectSlice<T>
Link copied to clipboard
Link copied to clipboard
inline fun Bitmap32.toBitmap1(): Bitmap1
inline fun Bitmap32.toBitmap1(func: (value: RGBA) -> Boolean): Bitmap1
Link copied to clipboard
Link copied to clipboard
fun Bitmap.toFloatBMP32(out: FloatBitmap32 = FloatBitmap32(width, height, premultiplied = premultiplied)): FloatBitmap32
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun FloatArray2.updateValues(block: (x: Int, y: Int, value: Float) -> Float)