[orx-color, orx-fx] turbo_colormap and spectral_zucconi6 provided as shader phrases (#338)

This commit is contained in:
Kazik Pogoda
2024-06-10 11:52:25 +02:00
committed by GitHub
parent ab0970ce49
commit f43a322cb0
28 changed files with 503 additions and 115 deletions

View File

@@ -0,0 +1,21 @@
import org.openrndr.application
import org.openrndr.draw.ColorType
import org.openrndr.draw.createEquivalent
import org.openrndr.draw.loadImage
import org.openrndr.extra.fx.colormap.GrayscaleColormap
import kotlin.math.sin
fun main() {
application {
program {
val colormap = GrayscaleColormap()
val image = loadImage("demo-data/images/image-001.png")
val colormapImage = image.createEquivalent(type = ColorType.FLOAT32)
extend {
colormap.curve = 1.0 + sin(seconds) * .5
colormap.apply(image, colormapImage)
drawer.image(colormapImage)
}
}
}
}

View File

@@ -0,0 +1,21 @@
import org.openrndr.application
import org.openrndr.draw.ColorType
import org.openrndr.draw.createEquivalent
import org.openrndr.draw.loadImage
import org.openrndr.extra.fx.colormap.SpectralZucconiColormap
import kotlin.math.sin
fun main() {
application {
program {
val colormap = SpectralZucconiColormap()
val image = loadImage("demo-data/images/image-001.png")
val colormapImage = image.createEquivalent(type = ColorType.FLOAT32)
extend {
colormap.curve = 1.0 + sin(seconds) * .5
colormap.apply(image, colormapImage)
drawer.image(colormapImage)
}
}
}
}

View File

@@ -0,0 +1,21 @@
import org.openrndr.application
import org.openrndr.draw.ColorType
import org.openrndr.draw.createEquivalent
import org.openrndr.draw.loadImage
import org.openrndr.extra.fx.colormap.TurboColormap
import kotlin.math.sin
fun main() {
application {
program {
val colormap = TurboColormap()
val image = loadImage("demo-data/images/image-001.png")
val colormapImage = image.createEquivalent(type = ColorType.FLOAT32)
extend {
colormap.curve = 1.0 + sin(seconds) * .5
colormap.apply(image, colormapImage)
drawer.image(colormapImage)
}
}
}
}