Package-level declarations

Types

Link copied to clipboard
expect interface ArrayCubemap : AutoCloseable

Array of Cubemap, all with the same ColorType, ColorFormat and other properties. Typically, used for efficient reflection probes, lighting and shadowing systems. This is a common interface to be implemented in various target languages.

actual interface ArrayCubemap : AutoCloseable
actual interface ArrayCubemap : AutoCloseable
Link copied to clipboard
class ArrayCubemapAttachment(    val index: Int,     val name: String?,     val arrayCubemap: ArrayCubemap,     val side: CubemapSide,     val layer: Int,     val level: Int) : ColorAttachment
Link copied to clipboard
class ArrayCubemapImageBinding(val arrayCubemap: ArrayCubemap, val level: Int, imageAccess: ImageAccess) : ImageBinding
Link copied to clipboard
expect abstract class ArrayTexture : AutoCloseable

Represents a texture with multiple layers, commonly referred to as an array texture. This abstract class defines properties and operations essential for managing the texture, including binding, filling, copying contents, and mipmap generation.

actual abstract class ArrayTexture : AutoCloseable
actual abstract class ArrayTexture : AutoCloseable
Link copied to clipboard
class ArrayTextureAttachment(val index: Int, val name: String?, val arrayTexture: ArrayTexture, val layer: Int, val level: Int) : ColorAttachment

Represents a color attachment that targets a specific layer and mip level of an array texture. This class extends ColorAttachment and provides a mechanism to associate an array texture's layer and level with a render target.

Link copied to clipboard
class ArrayTextureImageBinding(val arrayTexture: ArrayTexture, val level: Int, imageAccess: ImageAccess) : ImageBinding
Link copied to clipboard
class ArrayTextureLayerImageBinding(val arrayTexture: ArrayTexture, val level: Int, imageAccess: ImageAccess) : ImageBinding
Link copied to clipboard
Link copied to clipboard
open class BatchBuilder(val drawer: Drawer)
Link copied to clipboard

Used for controlling how pixels are blended together. The different modes can be used to simulate different kinds of effects like transparency, adding light, subtracting color and others.

Link copied to clipboard

An enumeration representing the memory alignment strategies for buffers.

Link copied to clipboard
sealed class BufferMultisample

Buffer multisample options

Link copied to clipboard

Represents different types of data primitives that can be stored in a buffer. Each type is associated with the number of components it contains, its size in bytes, and its alignment requirement in bytes.

Link copied to clipboard
interface BufferReader

Abstract class for writing data into a buffer. Provides methods for writing various types of data such as vectors, matrices, colors, and primitive types.

Link copied to clipboard
expect abstract class BufferTexture : AutoCloseable

Represents a texture buffer residing in the GPU. Buffer textures provide a mechanism for storing structured data that can be accessed in shaders as a one-dimensional texture.

actual abstract class BufferTexture : AutoCloseable
actual abstract class BufferTexture : AutoCloseable
Link copied to clipboard
class BufferTextureImageBinding(val bufferTexture: BufferTexture, imageAccess: ImageAccess) : ImageBinding
Link copied to clipboard
expect abstract class BufferTextureShadow : AutoCloseable
actual abstract class BufferTextureShadow : AutoCloseable
actual abstract class BufferTextureShadow : AutoCloseable
Link copied to clipboard
expect abstract class BufferWriter

Abstract class for writing data into a buffer. Provides methods for writing various types of data such as vectors, matrices, colors, and primitive types.

actual abstract class BufferWriter
actual abstract class BufferWriter
Link copied to clipboard
class ByteBufferReader(    val buffer: ByteBuffer,     val alignment: BufferAlignment = BufferAlignment.NONE,     val elementIterator: Iterator<ShaderStorageElement>?) : BufferReader
Link copied to clipboard
data class ChannelMask(val red: Boolean, val green: Boolean, val blue: Boolean, val alpha: Boolean)

Represents a mask for RGBA color channels.

Link copied to clipboard
data class CharacterPair(val left: Char, val right: Char)

A data class representing a pair of characters.

Link copied to clipboard
class CircleBatch(val geometry: VertexBuffer, val drawStyle: VertexBuffer) : AutoCloseable

Stored circle batch

Link copied to clipboard

Builder for stored circle batches

Link copied to clipboard
sealed class ColorAttachment

Color attachment for RenderTarget.

Link copied to clipboard
expect abstract class ColorBuffer : AutoCloseable

Represents a color buffer, which is an abstract resource used for storing image data and managing operations like mipmapping, filtering, and copying of image data. A ColorBuffer can be used in various scenarios such as rendering to textures or managing image storage in graphics applications.

actual abstract class ColorBuffer : AutoCloseable
actual abstract class ColorBuffer : AutoCloseable

representation for simple images stored on GPU memory

Link copied to clipboard
class ColorBufferAttachment(    val index: Int,     val name: String?,     val colorBuffer: ColorBuffer,     val level: Int,     val ownedByRenderTarget: Boolean) : ColorAttachment

Represents a color buffer attachment for a render target.

Link copied to clipboard
class ColorBufferImageBinding(val colorBuffer: ColorBuffer, val level: Int, imageAccess: ImageAccess) : ImageBinding
Link copied to clipboard
data class ColorBufferProxy(val url: String, val loader: ColorBufferLoader, val persistent: Boolean)
Link copied to clipboard
Link copied to clipboard

Color format enumeration

Link copied to clipboard

Color sampling enumeration

Link copied to clipboard

Color type enumeration

Link copied to clipboard

Represents a Compute Shader, which is a type of shader used for general-purpose GPU computations. A Compute Shader can bind images, buffers, and uniforms for processing data on the GPU.

Link copied to clipboard
data class ComputeStructure(    val structDefinitions: String? = null,     val uniforms: String? = null,     val buffers: String? = null,     val computeTransform: String,     val computePreamble: String,     val workGroupSize: IntVector3)
Link copied to clipboard
Link copied to clipboard
abstract class ComputeStyleManager
Link copied to clipboard
expect interface Cubemap : AutoCloseable

Represents a cubemap, which is a collection of six 2D textures arranged to form the faces of a cube. It is often used for environment mapping and skyboxes in 3D rendering.

actual interface Cubemap : AutoCloseable
actual interface Cubemap : AutoCloseable
Link copied to clipboard
class CubemapAttachment(val index: Int, val name: String?, val cubemap: Cubemap, val side: CubemapSide, val level: Int) : ColorAttachment

Represents a color attachment for a specific side of a cubemap in a render target.

Link copied to clipboard
class CubemapImageBinding(val cubemap: Cubemap, val level: Int, imageAccess: ImageAccess) : ImageBinding
Link copied to clipboard
class CubemapLayerImageBinding(val cubemap: Cubemap, val side: CubemapSide, val level: Int, imageAccess: ImageAccess) : ImageBinding
Link copied to clipboard

Represents the six sides of a cubemap, each associated with a forward and up direction.

Link copied to clipboard

Cull test pass condition enumeration

Link copied to clipboard

Represents a depth buffer used for rendering operations. A depth buffer stores depth information for rendered pixels, enabling depth testing in graphics applications. It may optionally include stencil information based on its format.

Link copied to clipboard

Depth format enumeration

Link copied to clipboard

Depth test pass condition enumeration

Link copied to clipboard
data class DrawContext(    val model: Matrix44,     val view: Matrix44,     val projection: Matrix44,     val width: Int,     val height: Int,     val contentScale: Double,     val modelViewScalingFactor: Double)

Represents the drawing context containing transformation matrices and additional parameters necessary to configure a rendering shader.

Link copied to clipboard
class Drawer(val driver: Driver)

The Drawer class is a utility that provides various drawing operations such as drawing shapes, transformations, and managing drawing states in a graphical rendering context. It serves as the primary interface for rendering graphics and provides control for styling and transformations.

Link copied to clipboard

Drawer configuration

Link copied to clipboard

Draw primitive type enumeration

Link copied to clipboard

Specifies if to optimize drawing for quality or performance.

Link copied to clipboard
data class DrawStyle(    var clip: Rectangle? = null,     var fill: ColorRGBa? = ColorRGBa.WHITE,     var stroke: ColorRGBa? = ColorRGBa.BLACK,     var lineCap: LineCap = LineCap.BUTT,     var lineJoin: LineJoin = LineJoin.MITER,     var strokeWeight: Double = 1.0,     var smooth: Boolean = true,     var miterLimit: Double = 4.0,     var quality: DrawQuality = DrawQuality.QUALITY,     var depthTestPass: DepthTestPass = DepthTestPass.ALWAYS,     var depthWrite: Boolean = false,     var blendMode: BlendMode = BlendMode.OVER,     var cullTestPass: CullTestPass = CullTestPass.ALWAYS,     var channelWriteMask: ChannelMask = ChannelMask(red = true, green = true, blue = true, alpha = true),     var alphaToCoverage: Boolean = false,     var shadeStyle: ShadeStyle? = null,     var fontMap: FontMap? = null,     var kerning: KernMode = KernMode.METRIC,     var textSetting: TextSettingMode = TextSettingMode.SUBPIXEL,     var stencil: StencilStyle = StencilStyle(),     var frontStencil: StencilStyle = stencil,     var backStencil: StencilStyle = stencil,     var colorMatrix: Matrix55 = Matrix55.IDENTITY)

A data class that controls the look of drawing operations including stroke and fill color, stroke weight and more.

Link copied to clipboard
interface DrawThread
Link copied to clipboard
open class Filter(shader: Shader? = null, watcher: ShaderWatcher? = null) : AutoCloseable

The Filter class represents a rendering filter used to process graphical content by applying shaders and other configurations. This class provides mechanisms to apply the filter to color buffers, manage shader parameters, and handle associated rendering operations such as clip rectangles and blending modes.

Link copied to clipboard
open class Filter1to1(shader: Shader? = null, watcher: ShaderWatcher? = null) : Filter

A filter that processes a single input texture and outputs a single result.

Link copied to clipboard
open class Filter2to1(shader: Shader? = null, watcher: ShaderWatcher? = null) : Filter

A class representing a 2-to-1 filter that applies a shader operation using two input sources and a single target output.

Link copied to clipboard
open class Filter3to1(shader: Shader? = null, watcher: ShaderWatcher? = null) : Filter

A filter implementation that processes three input color buffers and outputs to a single target color buffer.

Link copied to clipboard
open class Filter4to1(shader: Shader? = null, watcher: ShaderWatcher? = null) : Filter

A specialized filter that combines four input color buffers into one output color buffer.

Link copied to clipboard
class FontImageMap(    val texture: ColorBuffer,     val map: Map<Char, IntRectangle>,     val glyphMetrics: Map<Char, GlyphMetrics>,     val size: Double,     val contentScale: Double,     val ascenderLength: Double,     val descenderLength: Double,     val height: Double,     val leading: Double,     val name: String) : FontMap

A type of FontMap which keeps characters pre-rendered in a ColorBuffer texture at a specific font size.

Link copied to clipboard
data class FontImageMapDescriptor(val fontUrl: String, val size: Double, val alphabet: Set<Char>, val contentScale: Double)

A data class representing the descriptor for a font image map.

Link copied to clipboard
abstract class FontMap

Represents an abstract mapping of font characteristics and metrics.

Link copied to clipboard
abstract class FontVectorMap : FontMap

A type of FontMap which keeps characters stored as vector data. Good for displaying very large text and for displaying text at different scales, but in general less performant than FontImageMap because it is not pre-rendered.

Link copied to clipboard
data class GlyphMetrics(val advanceWidth: Double, val leftSideBearing: Double, val xBitmapShift: Double, val yBitmapShift: Double)

Represents the metrics of a glyph, which define its visual and positional characteristics in a font rendering context.

Link copied to clipboard
Link copied to clipboard
sealed class ImageBinding
Link copied to clipboard
data class ImageFileDetails(val width: Int, val height: Int, val channels: Int)

Details for an image

Link copied to clipboard

File format used while saving to file

Link copied to clipboard
typealias ImageFlag = BufferFlag
Link copied to clipboard
expect interface IndexBuffer : AutoCloseable

Represents an abstraction of an index buffer used in rendering operations.

actual interface IndexBuffer : AutoCloseable
actual interface IndexBuffer : AutoCloseable
Link copied to clipboard

Represents the type of index based on its size in bytes.

Link copied to clipboard
Link copied to clipboard
class LayeredArrayCubemapAttachment(val index: Int, val name: String?, val arrayCubemap: ArrayCubemap, val level: Int) : ColorAttachment
Link copied to clipboard
class LayeredArrayTextureAttachment(val index: Int, val name: String?, val arrayTexture: ArrayTexture, val level: Int) : ColorAttachment

Represents a specific color attachment for a layered array texture.

Link copied to clipboard
class LayeredCubemapAttachment(val index: Int, val name: String?, val cubemap: Cubemap, val level: Int) : ColorAttachment
Link copied to clipboard
class LayeredVolumeTextureAttachment(val index: Int, val name: String?, val volumeTexture: VolumeTexture, val level: Int) : ColorAttachment
Link copied to clipboard

Line cap enumeration

Link copied to clipboard

Line join enumeration

Link copied to clipboard

Texture filters for magnification

Link copied to clipboard

Texture filters used for minification

Link copied to clipboard
class ObservableHashmap<K, V>(val b: MutableMap<K, V>, val onChange: () -> Unit) : MutableMap<K, V>
Link copied to clipboard
class Parameter<R : Any>(    val parameterValues: MutableMap<String, Any>,     val parameterTypes: ObservableHashmap<String, String>,     val customName: String? = null,     initialValue: R? = null) : ReadWriteProperty<Any, R>

A class representing a parameter that supports getting and setting typed values with automatic type tracking.

Link copied to clipboard
class PointBatch(val geometry: VertexBuffer, val drawStyle: VertexBuffer)
Link copied to clipboard
Link copied to clipboard
class RectangleBatch(val geometry: VertexBuffer, val drawStyle: VertexBuffer) : AutoCloseable
Link copied to clipboard
Link copied to clipboard

Represents a rendering target for graphics operations, which can be used to handle color, depth, and stencil attachments with configurability for attributes such as width, height, content scaling, and multisampling.

Link copied to clipboard
class RenderTargetBuilder(renderTarget: RenderTarget)
Link copied to clipboard
class ResizableColorBuffer(    width: Int,     height: Int,     contentScale: Double = 1.0,     format: ColorFormat = ColorFormat.RGBa,     type: ColorType = defaultColorType(format),     multisample: BufferMultisample = BufferMultisample.Disabled,     levels: Int = 1,     session: Session? = Session.active) : AutoCloseable

A class representing a resizable color buffer, which can dynamically resize itself while maintaining color properties.

Link copied to clipboard
class ResizableRenderTarget(    width: Int,     height: Int,     contentScale: Double = 1.0,     multisample: BufferMultisample = BufferMultisample.Disabled,     session: Session?,     val builder: RenderTargetBuilder.() -> Unit) : AutoCloseable

A class that represents a render target capable of being resized dynamically.

Link copied to clipboard
class Session(val parent: Session?) : AutoCloseable

Represents a GPU resource management session. A session is responsible for tracking and managing GPU resources in a hierarchical manner. Sessions can be forked, creating child sessions, and ended, destroying all GPU resources associated with the session.

Link copied to clipboard
class SessionStatistics(    val renderTargets: Int,     val colorBuffers: Int,     val depthBuffers: Int,     val bufferTextures: Int,     val indexBuffers: Int,     val vertexBuffers: Int,     val shaders: Int,     val cubemaps: Int,     val arrayTextures: Int,     val computeShaders: Int,     val atomicCounterBuffers: Int,     val arrayCubemaps: Int,     val shaderStorageBuffers: Int)

Session statistics

Link copied to clipboard
Link copied to clipboard

Defines an interface for binding various types of GPU buffers to a shader by name.

Link copied to clipboard
Link copied to clipboard

Represents a shader storage buffer, which is an interface for managing GPU memory used for reading and writing data within shaders.

Link copied to clipboard

Represents a shadow interface for managing a shader storage buffer. The shadow allows operations such as uploading, downloading, and releasing resources, as well as providing a means to obtain a writer for structured buffer data manipulation.

Link copied to clipboard
sealed interface ShaderStorageElement

Represents an element in shader storage, typically used in GPU programming for storing data buffers. This interface defines the core properties of such an element, including its name, memory offset, and size when represented as an array.

Link copied to clipboard

Represents the format specification for a shader storage buffer. Defines the structure, primitives, and memory layout for data used in GPU programming.

Link copied to clipboard
data class ShaderStoragePrimitive(val name: String, val type: BufferPrimitiveType, val arraySize: Int = 1) : ShaderStorageElement

Represents a primitive element within a shader storage buffer. This class enables detailed definition of a primitive type and its properties such as the buffer primitive type, array size and memory offset.

Link copied to clipboard
data class ShaderStorageStruct(    val structName: String,     val name: String,     val elements: List<ShaderStorageElement>,     val arraySize: Int = 1) : ShaderStorageElement

Represents a structure within shader storage, typically used for organizing and grouping related shader storage elements.

Link copied to clipboard
Link copied to clipboard
interface ShaderUniforms
Link copied to clipboard
expect class ShaderWatcher
actual class ShaderWatcher
actual class ShaderWatcher
Link copied to clipboard
Link copied to clipboard
data class ShadeStructure(    var structDefinitions: String? = null,     var uniforms: String? = null,     var attributes: String? = null,     var buffers: String? = null,     var vertexTransform: String? = null,     var geometryTransform: String? = null,     var fragmentTransform: String? = null,     var vertexPreamble: String? = null,     var geometryPreamble: String? = null,     var fragmentPreamble: String? = null,     var outputs: String? = null,     var varyingOut: String? = null,     var varyingIn: String? = null,     var varyingBridge: String? = null,     var suppressDefaultOutput: Boolean = false)
Link copied to clipboard
open class ShadeStyle(    var parameterValues: MutableMap<String, Any> = mutableMapOf(),     var textureBaseIndex: Int = 2) : StyleParameters, StyleBufferBindings, StyleImageBindings

Represents a customizable and composable style for shaders and rendering pipelines. This class allows defining transformations, preambles, and shader outputs as well as binding buffers and images for use in rendering.

Link copied to clipboard

A Filter that uses the ShadeStyle interface and language

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
expect class ShadeStyleGLSL

A collection of granules, or template functions for writing stylable shaders in GLSL. ShadeStyleGLSL is used in OPENRNDR's shader generators but is exposed to the user such that they too can write shader generators.

actual class ShadeStyleGLSL

A collection of granules, or template functions for writing stylable shaders in GLSL. ShadeStyleGLSL is used in OPENRNDR's shader generators but is exposed to the user such that they too can write shader generators.

actual class ShadeStyleGLSL

A collection of granules, or template functions for writing stylable shaders in GLSL. ShadeStyleGLSL is used in OPENRNDR's shader generators but is exposed to the user such that they too can write shader generators.

Link copied to clipboard
abstract class ShadeStyleManager(val name: String)
Link copied to clipboard
data class ShadeStyleOutput(val attachment: Int, val format: ColorFormat = ColorFormat.RGBa, val type: ColorType = ColorType.FLOAT32)

Represents the output configuration for a shading style.

Link copied to clipboard
Link copied to clipboard
data class StencilStyle(    var stencilFailOperation: StencilOperation = StencilOperation.KEEP,     var depthFailOperation: StencilOperation = StencilOperation.KEEP,     var depthPassOperation: StencilOperation = StencilOperation.KEEP,     var stencilTestMask: Int = 255,     var stencilTestReference: Int = 0,     var stencilWriteMask: Int = 255,     var stencilTest: StencilTest = StencilTest.DISABLED)

Represents a style for stencil operations and tests used in rendering pipelines.

Link copied to clipboard
Link copied to clipboard
open class Struct<T : Struct<T>>

Struct definition

Link copied to clipboard
class StructuredBuffer<T : Struct<T>>(val struct: T, val ssbo: ShaderStorageBuffer)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
interface StyleParameters

An interface designed to handle and manage shader style parameters. It provides functionality for associating named parameters with various data types and maintaining type information. These parameters are intended to be used in shader programming for configuring and managing graphical rendering styles.

Link copied to clipboard
Link copied to clipboard

Represents the target of a transformation within a graphical or computational system.

Link copied to clipboard
interface UniformBlock
Link copied to clipboard
data class UniformBlockLayout(val sizeInBytes: Int, val entries: Map<String, UniformDescription>)
Link copied to clipboard
data class UniformDescription(val name: String, val type: UniformType, val size: Int, val offset: Int, val stride: Int)
Link copied to clipboard
Link copied to clipboard
expect abstract class VertexBuffer : AutoCloseable

Represents a vertex buffer that stores vertex data in GPU memory and allows for efficient rendering operations. The vertex buffer conforms to a specific vertex format and supports various operations for writing, managing, and releasing vertex data resources.

actual abstract class VertexBuffer : AutoCloseable
actual abstract class VertexBuffer : AutoCloseable
Link copied to clipboard

Represents a shadow of a VertexBuffer that allows manipulation and synchronization of vertex data with a buffer residing in GPU memory. This interface provides methods to upload, download, and manage vertex data in a buffer.

Link copied to clipboard
data class VertexElement(val attribute: String, val offset: Int, val type: VertexElementType, val arraySize: Int)

Represents a single element within a vertex, describing the structure of vertex data in a graphics pipeline.

Link copied to clipboard

Enum class representing various types of vertex elements used in graphics programming.

Link copied to clipboard
class VertexFormat(val alignment: BufferAlignment = BufferAlignment.NONE)

VertexBuffer Layout describes how data is organized in the VertexBuffer

Link copied to clipboard
expect interface VolumeTexture : AutoCloseable

Represents a 3D texture, also known as a volume texture. A volume texture is a set of texture data stored in a 3D space, identified by its width, height, and depth dimensions. It can be used in various applications, such as 3D data visualization, texture maps for 3D objects, and more.

actual interface VolumeTexture : AutoCloseable
actual interface VolumeTexture : AutoCloseable
Link copied to clipboard
class VolumeTextureAttachment(val index: Int, val name: String?, val volumeTexture: VolumeTexture, val layer: Int, val level: Int) : ColorAttachment
Link copied to clipboard
class VolumeTextureImageBinding(val volumeTexture: VolumeTexture, val level: Int, imageAccess: ImageAccess) : ImageBinding
Link copied to clipboard
class VolumeTextureLayerImageBinding(val volumeTexture: VolumeTexture, val layer: Int, val level: Int, imageAccess: ImageAccess) : ImageBinding
Link copied to clipboard

Texture wrapping mode

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The default font map used for rendering text in the system. This variable represents an optional instance of FontImageMap, which contains the pre-rendered texture and associated metadata for specific font settings like size, character set, and metrics.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
actual val useContextBlock: Boolean = false
actual val useContextBlock: Boolean = false
Link copied to clipboard
actual val useStyleBlock: Boolean = false
actual val useStyleBlock: Boolean = false

Functions

Link copied to clipboard
fun arrayCubemap(    width: Int,     layers: Int,     format: ColorFormat = ColorFormat.RGBa,     type: ColorType = defaultColorType(format),     levels: Int = 1,     session: Session = Session.active): ArrayCubemap

Creates an array cubemap

Link copied to clipboard
fun arrayTexture(    width: Int,     height: Int,     layers: Int,     format: ColorFormat = ColorFormat.RGBa,     type: ColorType = defaultColorType(format),     levels: Int = 1,     session: Session = Session.active): ArrayTexture

Creates an array texture

Link copied to clipboard
fun bufferTexture(    elementCount: Int,     format: ColorFormat = ColorFormat.RGBa,     type: ColorType = ColorType.FLOAT32,     session: Session? = Session.active): BufferTexture

create a BufferTexture

Link copied to clipboard

Create a stored batch of circles

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun colorBuffer(    width: Int,     height: Int,     contentScale: Double = 1.0,     format: ColorFormat = ColorFormat.RGBa,     type: ColorType = defaultColorType(format),     multisample: BufferMultisample = BufferMultisample.Disabled,     levels: Int = 1,     session: Session? = Session.active): ColorBuffer

Creates a new color buffer with the specified dimensions and configuration.

Link copied to clipboard
fun computeShader1DExecuteSize(workGroupSize: IntVector3, dataSize: Int): IntVector3

Determines optimal size of ComputeShader execution for 1-dimensional data of variable size.

Link copied to clipboard

Determines optimal size of ComputeShader execution for 2-dimensional data of variable size.

Link copied to clipboard

Determines optimal size of ComputeShader execution for 3-dimensional data of variable size.

Link copied to clipboard
Link copied to clipboard
fun ColorBuffer.createEquivalent(    width: Int = this.width,     height: Int = this.height,     contentScale: Double = this.contentScale,     format: ColorFormat = this.format,     type: ColorType = this.type,     multisample: BufferMultisample = this.multisample,     levels: Int = this.levels): ColorBuffer

create an equivalent ColorBuffer, with the option to override attributes

Link copied to clipboard
fun cubemap(    width: Int,     format: ColorFormat = ColorFormat.RGBa,     type: ColorType = defaultColorType(format),     levels: Int = 1,     session: Session? = Session.active): Cubemap

Creates a cubemap texture with the specified parameters.

Link copied to clipboard

Determines the default color type based on the given color format.

Link copied to clipboard
fun depthBuffer(width: Int, height: Int, format: DepthFormat = DepthFormat.DEPTH24_STENCIL8, multisample: BufferMultisample): DepthBuffer

Creates a depth buffer with the specified dimensions, format, and multisampling configuration. A depth buffer is used in rendering to store depth information for pixels, with optional stencil buffer support depending on the depth format.

Link copied to clipboard

creates and starts a DrawThread

Link copied to clipboard
fun ComputeStyle.execute(width: Int = 1, height: Int = 1, depth: Int = 1)
Link copied to clipboard
fun filterShaderFromCode(fragmentShaderCode: String, name: String, includeShaderConfiguration: Boolean = true): Shader
Link copied to clipboard

Creates a Shader object by loading and compiling shader code from the provided URL.

Link copied to clipboard

Creates and returns a ShaderWatcher configured for the given fragment shader URL. The returned ShaderWatcher uses a predefined vertex shader code and the provided URL for the fragment shader.

Link copied to clipboard
fun imageProxy(file: File, queue: Boolean = true, persistent: Boolean = false): ColorBufferProxy
fun imageProxy(fileOrUrl: String, queue: Boolean = true, persistent: Boolean = false): ColorBufferProxy
Link copied to clipboard
fun indexBuffer(elementCount: Int, type: IndexType): IndexBuffer
Link copied to clipboard
fun ColorBuffer.isEquivalentTo(    other: ColorBuffer,     ignoreWidth: Boolean = false,     ignoreHeight: Boolean = false,     ignoreContentScale: Boolean = false,     ignoreFormat: Boolean = false,     ignoreType: Boolean = false,     ignoreMultisample: Boolean = false,     ignoreLevels: Boolean = false): Boolean

check if this ColorBuffer is equivalent to other

Link copied to clipboard
fun Drawer.isolated(function: Drawer.() -> Unit)

Executes a given function within an isolated context where transforms and styles are managed. Ensures that the applied transforms and styles are reverted after the function execution, maintaining isolation for the block of code.

Link copied to clipboard
fun Drawer.isolatedWithTarget(target: RenderTarget, function: Drawer.() -> Unit)

Executes the given function within an isolated drawing context bound to the specified render target.

Link copied to clipboard
fun DrawThread.launch(    context: CoroutineContext = this.dispatcher,     start: CoroutineStart = CoroutineStart.DEFAULT,     block: suspend CoroutineScope.() -> Unit): Job

launches a coroutine on the DrawThread

Link copied to clipboard
fun loadBufferTexture(    file: File,     formatHint: BufferTextureFileFormat? = BufferTextureFileFormat.ORB,     session: Session? = Session.active): BufferTexture

load a buffer texture from a file

fun loadBufferTexture(    url: URL,     formatHint: BufferTextureFileFormat? = BufferTextureFileFormat.ORB,     session: Session? = Session.active): BufferTexture

load a BufferTexture from a url

fun loadBufferTexture(    fileOrUrl: String,     formatHint: BufferTextureFileFormat? = BufferTextureFileFormat.ORB,     session: Session? = Session.active): BufferTexture

load a buffer texture from file or url

Link copied to clipboard
fun loadCubemap(data: CubemapImageData, session: Session? = Session.active): Cubemap

Loads a cubemap from the given CubemapImageData and returns the generated Cubemap instance. This function handles writing the six faces of the cubemap and can optionally use a specified rendering session.

fun loadCubemap(fileOrUrl: String, formatHint: ImageFileFormat? = ImageFileFormat.DDS, session: Session? = Session.active): Cubemap
Link copied to clipboard
fun loadFont(    fileOrUrl: String,     size: Double,     characterSet: Set<Char> = defaultFontmapCharacterSet,     contentScale: Double = 1.0,     fontScaler: (Face) -> Double = ::fontHeightScaler): FontImageMap
Link copied to clipboard
expect fun loadImage(    fileOrUrl: String,     formatHint: ImageFileFormat? = ImageFileFormat.guessFromExtension(fileOrUrl.split(".").last()),     allowSRGB: Boolean = true,     loadMipmaps: Boolean = true,     session: Session? = Session.active): ColorBuffer

load an image from a file or url encoded as String, also accepts base64 encoded data urls

fun loadImage(    buffer: MPPBuffer,     name: String? = null,     formatHint: ImageFileFormat? = null,     allowSRGB: Boolean = true,     session: Session? = Session.active): ColorBuffer
actual fun loadImage(fileOrUrl: String, formatHint: ImageFileFormat?, allowSRGB: Boolean, loadMipmaps: Boolean, session: Session?): ColorBuffer

load an image from a file or url encoded as String, also accepts base64 encoded data urls

fun loadImage(    file: File,     formatHint: ImageFileFormat? = ImageFileFormat.guessFromExtension(file.extension),     allowSRGB: Boolean = true,     loadMipmaps: Boolean = true,     session: Session? = Session.active): ColorBuffer

load an image from File

fun loadImage(    url: URL,     formatHint: ImageFileFormat? = ImageFileFormat.guessFromExtension(url.toExternalForm().split(".").lastOrNull()),     allowSRGB: Boolean = true,     loadMipmaps: Boolean = true,     session: Session? = Session.active): ColorBuffer

load an image from an url

actual fun loadImage(fileOrUrl: String, formatHint: ImageFileFormat?, allowSRGB: Boolean, loadMipmaps: Boolean, session: Session?): ColorBuffer

load an image from a file or url encoded as String, also accepts base64 encoded data urls

Link copied to clipboard
expect suspend fun loadImageSuspend(    fileOrUrl: String,     formatHint: ImageFileFormat? = null,     allowSRGB: Boolean = true,     session: Session? = Session.active): ColorBuffer
actual suspend fun loadImageSuspend(fileOrUrl: String, formatHint: ImageFileFormat?, allowSRGB: Boolean, session: Session?): ColorBuffer
actual suspend fun loadImageSuspend(fileOrUrl: String, formatHint: ImageFileFormat?, allowSRGB: Boolean, session: Session?): ColorBuffer
Link copied to clipboard
inline fun <T : Struct<T>> StyleParameters.parameter(name: String, value: T)
inline fun <T : Struct<T>> StyleParameters.parameter(name: String, value: Array<T>)
Link copied to clipboard
fun <T> persistent(builder: () -> T): T

Mark a GPU resource or code that uses GPU resources as persistent

Link copied to clipboard

Create a stored batch of points

Link copied to clipboard

Probes an image file or URL to retrieve its details such as dimensions and channels.

Link copied to clipboard

Create a stored batch of rectangles

Link copied to clipboard
inline fun <T : Struct<T>> StyleBufferBindings.registerStructuredBuffer(    name: String,     access: BufferAccess = BufferAccess.READ_WRITE,     flags: Set<BufferFlag> = emptySet())
Link copied to clipboard
fun renderTarget(    width: Int,     height: Int,     contentScale: Double = 1.0,     multisample: BufferMultisample = BufferMultisample.Disabled,     session: Session? = Session.active,     builder: RenderTargetBuilder.() -> Unit): RenderTarget

Creates a new render target with the specified dimensions and properties.

Link copied to clipboard
fun resizableColorBuffer(    width: Int,     height: Int,     contentScale: Double = 1.0,     format: ColorFormat = ColorFormat.RGBa,     type: ColorType = defaultColorType(format),     multisample: BufferMultisample = BufferMultisample.Disabled,     levels: Int = 1,     session: Session? = Session.active): ResizableColorBuffer

Creates a resizable color buffer with the specified dimensions and properties.

Link copied to clipboard
fun resizableRenderTarget(    width: Int,     height: Int,     contentScale: Double,     multisample: BufferMultisample = BufferMultisample.Disabled,     session: Session? = Session.active,     builder: RenderTargetBuilder.() -> Unit): ResizableRenderTarget
Link copied to clipboard
fun session(code: () -> Unit)

Runs code inside a (short-lived) session

Link copied to clipboard

Creates a shader storage buffer based on the given format.

Link copied to clipboard

Constructs a new ShaderStorageFormat instance and allows the caller to configure it using a lambda.

Link copied to clipboard
Link copied to clipboard
fun shadeStyle(builder: ShadeStyle.() -> Unit): ShadeStyle

Creates and returns a new instance of ShadeStyle, configured using the provided builder function.

Link copied to clipboard
inline fun <F> shadeStyleType(): String
Link copied to clipboard
inline fun <F> shadeStyleTypeOrNull(): String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <T : Struct<out T>> Struct<out T>.typeDef(name: String = T::class.simpleName!!, bufferDefinition: Boolean = false): String
Link copied to clipboard
fun <T : Struct<T>> Struct<T>.typeDefImpl(name: String, bufferDefinition: Boolean = false): String
Link copied to clipboard
fun vertexBuffer(vertexFormat: VertexFormat, vertexCount: Int, session: Session? = Session.active): VertexBuffer

VertexBuffer builder function.

Link copied to clipboard
fun vertexFormat(alignment: BufferAlignment = BufferAlignment.NONE, builder: VertexFormat.() -> Unit): VertexFormat

Creates a new instance of VertexFormat using a specified alignment and a builder block to configure its attributes.

Link copied to clipboard
fun volumeTexture(    width: Int,     height: Int,     depth: Int,     format: ColorFormat = ColorFormat.RGBa,     type: ColorType = defaultColorType(format),     levels: Int = 1,     session: Session? = Session.active): VolumeTexture
Link copied to clipboard
fun BufferWriter.write(drawStyle: DrawStyle)

Writes the specified DrawStyle properties to the buffer. This includes linearized fill color, linearized stroke color, and an adjusted stroke weight based on the presence and transparency of the stroke.