Revert accidentally pushed code

This reverts commit 3ef46bcc4e.
This commit is contained in:
Abe Pazos
2024-10-31 08:02:36 +01:00
parent db5ea1cdd2
commit 524635e1ad
4 changed files with 33 additions and 114 deletions

View File

@@ -1,8 +1,7 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.internal.os.OperatingSystem import org.gradle.internal.os.OperatingSystem
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
group = "org.openrndr.template" group = "org.openrndr.template"
version = "1.0.0" version = "1.0.0"
@@ -15,18 +14,14 @@ val orxFeatures = setOf<String>(
"orx-camera", "orx-camera",
// "orx-chataigne", // "orx-chataigne",
"orx-color", "orx-color",
// "orx-composition",
"orx-compositor", "orx-compositor",
// "orx-compute-graph", // "orx-compute-graph",
// "orx-compute-graph-nodes", // "orx-compute-graph-nodes",
"orx-delegate-magic", "orx-delegate-magic",
"orx-depth-camera-calibrator",
// "orx-dnk3", // "orx-dnk3",
// "orx-easing", // "orx-easing",
"orx-envelopes", "orx-envelopes",
// "orx-expression-evaluator", // "orx-expression-evaluator",
// "orx-fcurve",
// "orx-fft",
// "orx-file-watcher", // "orx-file-watcher",
"orx-fx", "orx-fx",
// "orx-git-archiver", // "orx-git-archiver",
@@ -39,7 +34,7 @@ val orxFeatures = setOf<String>(
// "orx-jumpflood", // "orx-jumpflood",
// "orx-kdtree", // "orx-kdtree",
// "orx-keyframer", // "orx-keyframer",
"orx-kinect-v1", // "orx-kinect-v1",
// "orx-kotlin-parser", // "orx-kotlin-parser",
// "orx-marching-squares", // "orx-marching-squares",
// "orx-mesh-generators", // "orx-mesh-generators",
@@ -62,11 +57,9 @@ val orxFeatures = setOf<String>(
"orx-shade-styles", "orx-shade-styles",
// "orx-shader-phrases", // "orx-shader-phrases",
"orx-shapes", "orx-shapes",
// "orx-svg",
// "orx-syphon", // "orx-syphon",
// "orx-temporal-blur", // "orx-temporal-blur",
// "orx-tensorflow", // "orx-tensorflow",
// "orx-text-writer",
// "orx-time-operators", // "orx-time-operators",
// "orx-timer", // "orx-timer",
// "orx-triangulation", // "orx-triangulation",
@@ -121,17 +114,6 @@ dependencies {
// implementation(libs.gson) // implementation(libs.gson)
// implementation(libs.csv) // implementation(libs.csv)
/* ORSL dependencies */
// implementation(libs.orsl.shader.generator)
// implementation(libs.orsl.extension.color)
// implementation(libs.orsl.extension.easing)
// implementation(libs.orsl.extension.gradient)
// implementation(libs.orsl.extension.noise)
// implementation(libs.orsl.extension.pbr)
// implementation(libs.orsl.extension.raymarching)
// implementation(libs.orsl.extension.sdf)
implementation(libs.kotlinx.coroutines.core) implementation(libs.kotlinx.coroutines.core)
implementation(libs.slf4j.api) implementation(libs.slf4j.api)
implementation(libs.kotlin.logging) implementation(libs.kotlin.logging)
@@ -157,15 +139,11 @@ dependencies {
// ------------------------------------------------------------------------------------------------------------------ // // ------------------------------------------------------------------------------------------------------------------ //
java { java {
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_11
}
kotlin {
compilerOptions {
languageVersion = KotlinVersion.KOTLIN_2_0
apiVersion = KotlinVersion.KOTLIN_2_0
jvmTarget = JvmTarget.JVM_17
} }
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "11"
} }
// ------------------------------------------------------------------------------------------------------------------ // // ------------------------------------------------------------------------------------------------------------------ //
@@ -174,7 +152,7 @@ project.setProperty("mainClassName", applicationMainClass)
application { application {
if (hasProperty("openrndr.application")) { if (hasProperty("openrndr.application")) {
mainClass = "${property("openrndr.application")}" mainClass.set("${property("openrndr.application")}")
} }
} }
@@ -213,7 +191,7 @@ tasks {
// ------------------------------------------------------------------------------------------------------------------ // // ------------------------------------------------------------------------------------------------------------------ //
tasks.register<Zip>("jpackageZip") { tasks.register<Zip>("jpackageZip") {
archiveFileName = "openrndr-application.zip" archiveFileName.set("openrndr-application.zip")
from("${layout.buildDirectory.get()}/jpackage") { from("${layout.buildDirectory.get()}/jpackage") {
include("**/*") include("**/*")
} }
@@ -231,14 +209,14 @@ runtime {
jvmArgs.add("-Duser.dir=${"$"}APPDIR/../Resources") jvmArgs.add("-Duser.dir=${"$"}APPDIR/../Resources")
} }
} }
options = listOf("--strip-debug", "--compress", "1", "--no-header-files", "--no-man-pages") options.set(listOf("--strip-debug", "--compress", "1", "--no-header-files", "--no-man-pages"))
modules = listOf("jdk.unsupported", "java.management", "java.desktop") modules.set(listOf("jdk.unsupported", "java.management", "java.desktop"))
} }
// ------------------------------------------------------------------------------------------------------------------ // // ------------------------------------------------------------------------------------------------------------------ //
tasks.register<org.openrndr.extra.gitarchiver.GitArchiveToMarkdown>("gitArchiveToMarkDown") { tasks.register<org.openrndr.extra.gitarchiver.GitArchiveToMarkdown>("gitArchiveToMarkDown") {
historySize = 20 historySize.set(20)
} }
// ------------------------------------------------------------------------------------------------------------------ // // ------------------------------------------------------------------------------------------------------------------ //
@@ -308,6 +286,7 @@ class Openrndr {
implementation(openrndr("openal")) implementation(openrndr("openal"))
runtimeOnly(openrndrNatives("openal")) runtimeOnly(openrndrNatives("openal"))
implementation(openrndr("application")) implementation(openrndr("application"))
implementation(openrndr("svg"))
implementation(openrndr("animatable")) implementation(openrndr("animatable"))
implementation(openrndr("extensions")) implementation(openrndr("extensions"))
implementation(openrndr("filter")) implementation(openrndr("filter"))

Binary file not shown.

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View File

@@ -1,91 +1,31 @@
import org.openrndr.application import org.openrndr.application
import org.openrndr.draw.ColorFormat import org.openrndr.color.ColorRGBa
import org.openrndr.draw.colorBuffer import org.openrndr.draw.loadFont
import org.openrndr.extra.fx.colormap.GrayscaleColormap import org.openrndr.draw.loadImage
import org.openrndr.extra.fx.colormap.SpectralZucconiColormap import org.openrndr.draw.tint
import org.openrndr.extra.fx.colormap.TurboColormap import kotlin.math.cos
import org.openrndr.extra.gui.GUI import kotlin.math.sin
import org.openrndr.extra.kinect.v1.Kinect1
import org.openrndr.extra.parameters.BooleanParameter
import org.openrndr.math.Vector2
/**
* Shows 4 different color representations of the depth map:
*
* * the original depth map stored as RED channel values
* * the same values expressed as gray tones
* * zucconi6 color map according to natural light dispersion as described
* by Alan Zucconi in
* [Improving the Rainbow](https://www.alanzucconi.com/2017/07/15/improving-the-rainbow/)
* article
* * turbo color map according to
* [Turbo, An Improved Rainbow Colormap for Visualization](https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html)
* by Google.
*
* Note: the values are normalized in range 0-1, not in meters.
* @see GrayscaleColormap
* @see SpectralZucconiColormap
* @see TurboColormap
*/
fun main() = application { fun main() = application {
val guiOffset = 200
configure { configure {
width = 2 * 640 + guiOffset width = 768
height = 2 * 480 height = 576
} }
program { program {
val kinect = extend(Kinect1()) val image = loadImage("data/images/pm5544.png")
val device = kinect.openDevice() val font = loadFont("data/fonts/default.otf", 64.0)
val camera = device.depthCamera
fun outputBuffer() = colorBuffer(
camera.resolution.x,
camera.resolution.y,
format = ColorFormat.RGB
)
val grayscaleColormap = GrayscaleColormap()
val spectralZucconiColormap = SpectralZucconiColormap()
val turboColormap = TurboColormap()
val grayscaleBuffer = outputBuffer()
val zucconiBuffer = outputBuffer()
val turboBuffer = outputBuffer()
@Suppress("unused")
val settings = object {
@BooleanParameter(label = "enabled", order = 0)
var enabled: Boolean
get() = camera.enabled
set(value) { camera.enabled = value }
@BooleanParameter(label = "flipH", order = 1)
var flipH: Boolean
get() = camera.flipH
set(value) { camera.flipH = value }
@BooleanParameter(label = "flipV", order = 2)
var flipV: Boolean
get() = camera.flipV
set(value) { camera.flipV = value }
}
camera.onFrameReceived { frame ->
grayscaleColormap.apply(frame, grayscaleBuffer)
spectralZucconiColormap.apply(frame, zucconiBuffer)
turboColormap.apply(frame, turboBuffer)
}
camera.enabled = true
extend(GUI()) {
persistState = false
compartmentsCollapsedByDefault = false
add(settings, label = "depth camera")
add(grayscaleColormap)
add(spectralZucconiColormap)
add(turboColormap)
}
extend { extend {
drawer.image(camera.currentFrame, guiOffset.toDouble(), 0.0) drawer.drawStyle.colorMatrix = tint(ColorRGBa.WHITE.shade(0.2))
drawer.image(grayscaleBuffer, guiOffset + camera.resolution.x.toDouble(), 0.0) drawer.image(image)
drawer.image(turboBuffer, guiOffset.toDouble(), camera.resolution.y.toDouble())
drawer.image(zucconiBuffer, Vector2(guiOffset.toDouble(), 0.0) + camera.resolution.vector2) drawer.fill = ColorRGBa.PINK
drawer.circle(cos(seconds) * width / 2.0 + width / 2.0, sin(0.5 * seconds) * height / 2.0 + height / 2.0, 140.0)
drawer.fontMap = font
drawer.fill = ColorRGBa.WHITE
drawer.text("OPENRNDR", width / 2.0, height / 2.0)
} }
} }
} }