All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.dsl.functions.Sampler2DFunctions.kt Maven / Gradle / Ivy

package org.openrndr.orsl.shadergenerator.dsl.functions

import org.openrndr.orsl.shadergenerator.dsl.*
import org.openrndr.orsl.shadergenerator.dsl.Generator
import org.openrndr.math.IntVector2
import org.openrndr.math.Vector2
import org.openrndr.math.Vector4
import kotlin.jvm.JvmName

@Suppress("INAPPLICABLE_JVM_NAME")
interface Sampler2DFunctions : Generator {

    @JvmName("getSs2Sv2")
    operator fun Symbol.get(uv: Symbol): Symbol =
        functionSymbol(this, uv, "texture($0, $1)")

    @JvmName("getSs2Sv2Sd")
    operator fun Symbol.get(uv: Symbol, lod: Symbol): Symbol =
        Function3Symbol(p0 = this, p1 = uv, p2 = lod, function = "textureLod($0, $1, $2)", type = "vec4")

    @JvmName("sizeSs2Vi")
    fun Symbol.size(level: Int = 0): Symbol =
        functionSymbol(this, level, "textureSize($0, $1)")

    @JvmName("fetchSs2Sv2Vi")
    fun Symbol.fetch(uv: Symbol, lod: Int): Symbol =
        Function3Symbol(p0 = this, p1 = uv, v2 = lod, function = "texelFetch($0, $1, $2)", type = "vec4")
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy