openrndr / org.openrndr.draw / ColorBuffer

ColorBuffer

interface ColorBuffer

Properties

bounds

open val bounds: Rectangle

contentScale

abstract val contentScale: Double

the content scale of the ColorBuffer

effectiveHeight

open val effectiveHeight: Int

the height of the ColorBuffer in pixels

effectiveWidth

open val effectiveWidth: Int

the width of the ColorBuffer in pixels

filterMag

abstract var filterMag: MagnifyingFilter

the filter to use when display at sizes larger than the original

filterMin

abstract var filterMin: MinifyingFilter

the filter to use when displaying at sizes smaller than the original

flipV

abstract var flipV: Boolean

should the v coordinate be flipped because the ColorBuffer contents are stored upside-down?

format

abstract val format: ColorFormat

height

abstract val height: Int

the height of the ColorBuffer in device units

multisample

abstract val multisample: BufferMultisample

the multisampling method used for this ColorBuffer

shadow

abstract val shadow: ColorBufferShadow

type

abstract val type: ColorType

width

abstract val width: Int

the width of the ColorBuffer in device units

wrapU

abstract var wrapU: WrapMode

the wrapping mode to use in the horizontal direction

wrapV

abstract var wrapV: WrapMode

the wrapping mode to use in the vertical direction

Functions

bind

abstract fun bind(unit: Int): Unit

binds the colorbuffer to a texture unit, internal API

destroy

abstract fun destroy(): Unit

destroys the underlying ColorBuffer resources

filter

open fun filter(filterMin: MinifyingFilter, filterMag: MagnifyingFilter): Unit

sets the ColorBuffer filter for minifying and magnification

generateMipmaps

abstract fun generateMipmaps(): Unit

generates mipmaps from the top-level mipmap

read

abstract fun read(buffer: ByteBuffer): Unit

resolveTo

abstract fun resolveTo(target: ColorBuffer): Unit

resolves (or copies) to a non-multisampled color buffer

saveToFile

abstract fun saveToFile(file: File, fileFormat: FileFormat = guessFromExtension(file)): Unit

save the ColorBuffer to File

write

abstract fun write(buffer: ByteBuffer): Unit

Companion Object Functions

create

fun create(width: Int, height: Int, contentScale: Double = 1.0, format: ColorFormat = ColorFormat.RGBa, type: ColorType = ColorType.UINT8, multisample: BufferMultisample = BufferMultisample.Disabled): ColorBuffer

fromFile

fun fromFile(file: File): ColorBuffer
fun fromFile(filename: String): ColorBuffer

fromUrl

fun fromUrl(url: String): ColorBuffer

Inheritors

ColorBufferGL3

class ColorBufferGL3 : ColorBuffer