Remove unnecessary uses of "takeScreenshot" (#349)

This commit is contained in:
Abe Pazos
2024-09-02 12:15:44 +02:00
committed by GitHub
parent 141d1fa789
commit f713ca3a3d
25 changed files with 34 additions and 141 deletions

View File

@@ -1,6 +1,7 @@
import org.openrndr.application
import org.openrndr.draw.colorBuffer
import org.openrndr.draw.createEquivalent
import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extra.fx.distort.FluidDistort
import org.openrndr.extra.fx.patterns.Checkers
@@ -8,15 +9,21 @@ fun main() {
application {
program {
val fd = FluidDistort()
val checkers = Checkers()
val checkers = Checkers()
val image = colorBuffer(width, height)
val distorted = image.createEquivalent()
checkers.size = 64.0
checkers.apply(emptyArray(), image)
if (System.getProperty("takeScreenshot") == "true") {
extensions.filterIsInstance<SingleScreenshot>().forEach {
it.delayFrames = 150
}
}
extend {
fd.blend = mouse.position.x/width
// Ensure >0.01 for a better screenshot
fd.blend = (mouse.position.x / width).coerceAtLeast(0.01)
fd.apply(image, distorted)
drawer.image(distorted)
}

View File

@@ -20,12 +20,6 @@
// }
//
// program {
// if (System.getProperty("takeScreenshot") == "true") {
// extend(SingleScreenshot()) {
// this.outputFile = System.getProperty("screenshotPath")
// }
// }
//
// val gui = GUI()
// val c = compose {
// layer {