[orx-boofcv] convert to Kotlin DSL
This commit is contained in:
@@ -1,14 +1,23 @@
|
|||||||
|
import ScreenshotsHelper.collectScreenshots
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
demo {
|
val main by getting { }
|
||||||
|
val demo by creating {
|
||||||
java {
|
java {
|
||||||
srcDirs = ["src/demo/kotlin"]
|
srcDir("src/demo/kotlin")
|
||||||
compileClasspath += main.getCompileClasspath()
|
compileClasspath += main.getCompileClasspath()
|
||||||
runtimeClasspath += main.getRuntimeClasspath()
|
runtimeClasspath += main.getRuntimeClasspath()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
collectScreenshots(project, demo) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
def boofcvVersion = "0.37"
|
val openrndrVersion: String by rootProject.extra
|
||||||
|
val openrndrOS: String by rootProject.extra
|
||||||
|
val boofcvVersion = "0.37"
|
||||||
|
|
||||||
|
val demoImplementation by configurations.getting {}
|
||||||
|
val demoRuntimeOnly by configurations.getting {}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api("org.boofcv:boofcv-core:$boofcvVersion")
|
api("org.boofcv:boofcv-core:$boofcvVersion")
|
||||||
@@ -17,4 +26,4 @@ dependencies {
|
|||||||
demoRuntimeOnly("org.openrndr:openrndr-gl3:$openrndrVersion")
|
demoRuntimeOnly("org.openrndr:openrndr-gl3:$openrndrVersion")
|
||||||
demoRuntimeOnly("org.openrndr:openrndr-gl3-natives-$openrndrOS:$openrndrVersion")
|
demoRuntimeOnly("org.openrndr:openrndr-gl3-natives-$openrndrOS:$openrndrVersion")
|
||||||
demoImplementation(sourceSets.getByName("main").output)
|
demoImplementation(sourceSets.getByName("main").output)
|
||||||
}
|
}
|
||||||
@@ -16,14 +16,6 @@ import kotlin.math.sin
|
|||||||
fun main() {
|
fun main() {
|
||||||
application {
|
application {
|
||||||
program {
|
program {
|
||||||
|
|
||||||
// -- this block is for automation purposes only
|
|
||||||
if (System.getProperty("takeScreenshot") == "true") {
|
|
||||||
extend(SingleScreenshot()) {
|
|
||||||
this.outputFile = System.getProperty("screenshotPath")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load an image, convert to BoofCV format using orx-boofcv
|
// Load an image, convert to BoofCV format using orx-boofcv
|
||||||
val input = loadImage("demo-data/images/image-001.png").toGrayF32()
|
val input = loadImage("demo-data/images/image-001.png").toGrayF32()
|
||||||
|
|
||||||
|
|||||||
@@ -8,12 +8,6 @@ import org.openrndr.extensions.SingleScreenshot
|
|||||||
fun main() {
|
fun main() {
|
||||||
application {
|
application {
|
||||||
program {
|
program {
|
||||||
if (System.getProperty("takeScreenshot") == "true") {
|
|
||||||
extend(SingleScreenshot()) {
|
|
||||||
this.outputFile = System.getProperty("screenshotPath")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load an image, convert to BoofCV format using orx-boofcv
|
// Load an image, convert to BoofCV format using orx-boofcv
|
||||||
val input = loadImage("demo-data/images/image-001.png")
|
val input = loadImage("demo-data/images/image-001.png")
|
||||||
|
|
||||||
|
|||||||
@@ -8,12 +8,6 @@ import org.openrndr.extensions.SingleScreenshot
|
|||||||
fun main() {
|
fun main() {
|
||||||
application {
|
application {
|
||||||
program {
|
program {
|
||||||
if (System.getProperty("takeScreenshot") == "true") {
|
|
||||||
extend(SingleScreenshot()) {
|
|
||||||
this.outputFile = System.getProperty("screenshotPath")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load an image, convert to BoofCV format using orx-boofcv
|
// Load an image, convert to BoofCV format using orx-boofcv
|
||||||
val input = loadImage("demo-data/images/image-001.png")
|
val input = loadImage("demo-data/images/image-001.png")
|
||||||
val scaled = input.resizeTo(input.width / 3)
|
val scaled = input.resizeTo(input.width / 3)
|
||||||
|
|||||||
@@ -21,14 +21,6 @@ import org.openrndr.shape.toContour
|
|||||||
fun main() {
|
fun main() {
|
||||||
application {
|
application {
|
||||||
program {
|
program {
|
||||||
|
|
||||||
// -- this block is for automation purposes only
|
|
||||||
if (System.getProperty("takeScreenshot") == "true") {
|
|
||||||
extend(SingleScreenshot()) {
|
|
||||||
this.outputFile = System.getProperty("screenshotPath")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a buffer where to draw something for boofcv
|
// Create a buffer where to draw something for boofcv
|
||||||
val rt = renderTarget(width, height) {
|
val rt = renderTarget(width, height) {
|
||||||
colorBuffer()
|
colorBuffer()
|
||||||
|
|||||||
Reference in New Issue
Block a user