[orx-color, orx-fx] turbo_colormap and spectral_zucconi6 provided as shader phrases (#338)
This commit is contained in:
21
orx-fx/src/jvmDemo/kotlin/DemoColormapGrayscale.kt
Normal file
21
orx-fx/src/jvmDemo/kotlin/DemoColormapGrayscale.kt
Normal 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
orx-fx/src/jvmDemo/kotlin/DemoColormapSpectralZucconi.kt
Normal file
21
orx-fx/src/jvmDemo/kotlin/DemoColormapSpectralZucconi.kt
Normal 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
orx-fx/src/jvmDemo/kotlin/DemoColormapTurbo.kt
Normal file
21
orx-fx/src/jvmDemo/kotlin/DemoColormapTurbo.kt
Normal 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user