RLE

class RLE(val capacity: Int = 7)

Run-Length Encoding. Allows to generate and emit RLE chunks.

Constructors

Link copied to clipboard
constructor(capacity: Int = 7)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val capacity: Int = 7
Link copied to clipboard
val count: Int

Number of RLE chunks

Link copied to clipboard

RAW data in chunks of three values: start, count and data

Functions

Link copied to clipboard
fun clear()

Resets this RLE to start from scratch

Link copied to clipboard
fun emit(start: Int, count: Int, value: Int)

Emits an RLE chunk starting in start with count elements repeated of the specified value

Link copied to clipboard
inline fun fastForEach(block: (n: Int, start: Int, count: Int, value: Int) -> Unit)

Iterates over the RLE chunks emitting in function block the number of the chunk, the start of the chunk, its size, and the repeated value

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