ImageDrawer

The ImageDrawer class is responsible for rendering 2D images and texture layers onto a drawing surface. It supports rendering images using vertex and instance attributes, enabling efficient handling of multiple render operations. The class utilizes vertex and instance buffers, shaders, and configurable parameters for rendering images within specific geometric regions.

The class integrates with the rendering system and operates on ColorBuffer and ArrayTexture data sources. It supports rendering multiple rectangles or single instances with dynamic resizing of instance attributes based on the number of render requests.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun drawImage(drawContext: DrawContext, drawStyle: DrawStyle, colorBuffer: ColorBuffer, rectangles: List<Pair<Rectangle, Rectangle>>)

fun drawImage(    drawContext: DrawContext,     drawStyle: DrawStyle,     arrayTexture: ArrayTexture,     layers: List<Int>,     rectangles: List<Pair<Rectangle, Rectangle>>)

Draws an image using a supplied array texture, associated layer indices, and a list of source and target rectangles.

fun drawImage(drawContext: DrawContext, drawStyle: DrawStyle, colorBuffer: ColorBuffer, x: Double, y: Double, width: Double, height: Double)

Draws an image from a ColorBuffer onto a specified rectangular area on the canvas.

fun drawImage(    drawContext: DrawContext,     drawStyle: DrawStyle,     arrayTexture: ArrayTexture,     layer: Int,     x: Double,     y: Double,     width: Double,     height: Double)

Draws an image from an ArrayTexture onto a specified rectangular area on the canvas.