Fixes and move to jvmDemo (#286)
This commit is contained in:
26
orx-fx/src/jvmDemo/kotlin/DemoDitherLumaHalftone01.kt
Normal file
26
orx-fx/src/jvmDemo/kotlin/DemoDitherLumaHalftone01.kt
Normal file
@@ -0,0 +1,26 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.draw.createEquivalent
|
||||
import org.openrndr.draw.loadImage
|
||||
import org.openrndr.extra.fx.dither.LumaHalftone
|
||||
import org.openrndr.math.mod_
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
val image = loadImage("demo-data/images/image-001.png")
|
||||
val filteredImage = image.createEquivalent()
|
||||
val lumaHalftone = LumaHalftone()
|
||||
extend {
|
||||
lumaHalftone.rotation = -15.0
|
||||
lumaHalftone.freq0 = 100.0
|
||||
lumaHalftone.gain1 = 1.0
|
||||
lumaHalftone.threshold = 0.5
|
||||
lumaHalftone.phase0 = seconds*0.1
|
||||
lumaHalftone.phase1 = -seconds*0.1
|
||||
lumaHalftone.apply(image, filteredImage)
|
||||
lumaHalftone.invert = seconds.mod_(2.0) < 1.0
|
||||
drawer.image(filteredImage)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user