Skip to content

Commit 0aff3f6

Browse files
committed
[orx-boofcv] convert to Kotlin DSL
1 parent 8c5ccd6 commit 0aff3f6

File tree

5 files changed

+13
-32
lines changed

5 files changed

+13
-32
lines changed
Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1+
import ScreenshotsHelper.collectScreenshots
2+
13
sourceSets {
2-
demo {
4+
val main by getting { }
5+
val demo by creating {
36
java {
4-
srcDirs = ["src/demo/kotlin"]
7+
srcDir("src/demo/kotlin")
58
compileClasspath += main.getCompileClasspath()
69
runtimeClasspath += main.getRuntimeClasspath()
710
}
811
}
12+
collectScreenshots(project, demo) { }
913
}
1014

11-
def boofcvVersion = "0.37"
15+
val openrndrVersion: String by rootProject.extra
16+
val openrndrOS: String by rootProject.extra
17+
val boofcvVersion = "0.37"
18+
19+
val demoImplementation by configurations.getting {}
20+
val demoRuntimeOnly by configurations.getting {}
1221

1322
dependencies {
1423
api("org.boofcv:boofcv-core:$boofcvVersion")
@@ -17,4 +26,4 @@ dependencies {
1726
demoRuntimeOnly("org.openrndr:openrndr-gl3:$openrndrVersion")
1827
demoRuntimeOnly("org.openrndr:openrndr-gl3-natives-$openrndrOS:$openrndrVersion")
1928
demoImplementation(sourceSets.getByName("main").output)
20-
}
29+
}

orx-jvm/orx-boofcv/src/demo/kotlin/DemoContours01.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ import kotlin.math.sin
1616
fun main() {
1717
application {
1818
program {
19-
20-
// -- this block is for automation purposes only
21-
if (System.getProperty("takeScreenshot") == "true") {
22-
extend(SingleScreenshot()) {
23-
this.outputFile = System.getProperty("screenshotPath")
24-
}
25-
}
26-
2719
// Load an image, convert to BoofCV format using orx-boofcv
2820
val input = loadImage("demo-data/images/image-001.png").toGrayF32()
2921

orx-jvm/orx-boofcv/src/demo/kotlin/DemoResize01.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ import org.openrndr.extensions.SingleScreenshot
88
fun main() {
99
application {
1010
program {
11-
if (System.getProperty("takeScreenshot") == "true") {
12-
extend(SingleScreenshot()) {
13-
this.outputFile = System.getProperty("screenshotPath")
14-
}
15-
}
16-
1711
// Load an image, convert to BoofCV format using orx-boofcv
1812
val input = loadImage("demo-data/images/image-001.png")
1913

orx-jvm/orx-boofcv/src/demo/kotlin/DemoResize02.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ import org.openrndr.extensions.SingleScreenshot
88
fun main() {
99
application {
1010
program {
11-
if (System.getProperty("takeScreenshot") == "true") {
12-
extend(SingleScreenshot()) {
13-
this.outputFile = System.getProperty("screenshotPath")
14-
}
15-
}
16-
1711
// Load an image, convert to BoofCV format using orx-boofcv
1812
val input = loadImage("demo-data/images/image-001.png")
1913
val scaled = input.resizeTo(input.width / 3)

orx-jvm/orx-boofcv/src/demo/kotlin/DemoSimplified01.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ import org.openrndr.shape.toContour
2121
fun main() {
2222
application {
2323
program {
24-
25-
// -- this block is for automation purposes only
26-
if (System.getProperty("takeScreenshot") == "true") {
27-
extend(SingleScreenshot()) {
28-
this.outputFile = System.getProperty("screenshotPath")
29-
}
30-
}
31-
3224
// Create a buffer where to draw something for boofcv
3325
val rt = renderTarget(width, height) {
3426
colorBuffer()

0 commit comments

Comments
 (0)