Add ApplicationPreload mechanism to collectScreenshots
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
|
||||
project.ext.lwjglVersion = "3.2.3"
|
||||
def osArch = System.getProperty("os.arch")
|
||||
project.ext.arch = osArch.startsWith("armv8") || osArch.contains("64") ? "x86-64" : "x86"
|
||||
|
||||
//switch ( OperatingSystem.current() ) {
|
||||
// case OperatingSystem.WINDOWS:
|
||||
// project.ext.OS = "windows"
|
||||
// break
|
||||
// case OperatingSystem.LINUX:
|
||||
// project.ext.OS = "linux"
|
||||
// break
|
||||
// case OperatingSystem.MAC_OS:
|
||||
// project.ext.OS = "macos"
|
||||
// break
|
||||
//}
|
||||
project.ext.OS = "linux"
|
||||
|
||||
class LwjglRule implements ComponentMetadataRule { //val os: String, val arch: String, val classifier: String)
|
||||
private def nativeVariants = [
|
||||
[os: OperatingSystemFamily.LINUX, arch: "arm32", classifier: "natives-linux-arm32"],
|
||||
[os: OperatingSystemFamily.LINUX, arch: "arm64", classifier: "natives-linux-arm64"],
|
||||
[os: OperatingSystemFamily.LINUX, arch: "x86-64", classifier: "natives-linux"],
|
||||
[os: OperatingSystemFamily.WINDOWS, arch: "x86", classifier: "natives-windows-x86"],
|
||||
[os: OperatingSystemFamily.WINDOWS, arch: "x86-64", classifier: "natives-windows"],
|
||||
[os: OperatingSystemFamily.MACOS, arch: "x86-64", classifier: "natives-macos"]
|
||||
]
|
||||
|
||||
@javax.inject.Inject
|
||||
ObjectFactory getObjects() { }
|
||||
|
||||
void execute(ComponentMetadataContext context) {
|
||||
context.details.withVariant("runtime") {
|
||||
attributes {
|
||||
attributes.attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, objects.named(OperatingSystemFamily, "none"))
|
||||
attributes.attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE, objects.named(MachineArchitecture, "none"))
|
||||
}
|
||||
}
|
||||
nativeVariants.each { variantDefinition ->
|
||||
context.details.addVariant("${variantDefinition.classifier}-runtime", "runtime") {
|
||||
attributes {
|
||||
attributes.attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, objects.named(OperatingSystemFamily, variantDefinition.os))
|
||||
attributes.attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE, objects.named(MachineArchitecture, variantDefinition.arch))
|
||||
}
|
||||
withFiles {
|
||||
addFile("${context.details.id.name}-${context.details.id.version}-${variantDefinition.classifier}.jar")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,36 @@ plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
val preload by creating {
|
||||
this.java {
|
||||
srcDir("src/preload/kotlin")
|
||||
}
|
||||
}
|
||||
val main by getting {
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30")
|
||||
val preloadImplementation by configurations.getting { }
|
||||
preloadImplementation("org.openrndr:openrndr-application:0.5.1-SNAPSHOT")
|
||||
preloadImplementation("org.openrndr:openrndr-extensions:0.5.1-SNAPSHOT")
|
||||
}
|
||||
|
||||
tasks.all {
|
||||
println(this.name)
|
||||
|
||||
}
|
||||
tasks.getByName("compileKotlin").dependsOn("compilePreloadKotlin")
|
||||
@@ -1,5 +1,17 @@
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.file.DirectoryProperty
|
||||
import org.gradle.api.file.FileCollection
|
||||
import org.gradle.api.file.FileType
|
||||
import org.gradle.api.provider.ListProperty
|
||||
import org.gradle.api.provider.Property
|
||||
import org.gradle.api.tasks.*
|
||||
import org.gradle.kotlin.dsl.register
|
||||
import org.gradle.work.Incremental
|
||||
import org.gradle.work.InputChanges
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmCompilation
|
||||
import java.io.File
|
||||
import java.net.URLClassLoader
|
||||
import javax.inject.Inject
|
||||
|
||||
abstract class CollectScreenshotsTask @Inject constructor() : DefaultTask() {
|
||||
@get:Incremental
|
||||
@@ -22,6 +34,11 @@ abstract class CollectScreenshotsTask @Inject constructor() : DefaultTask() {
|
||||
}
|
||||
@TaskAction
|
||||
fun execute(inputChanges: InputChanges) {
|
||||
val preloadClass = File(project.rootProject.projectDir, "buildSrc/build/classes/kotlin/preload")
|
||||
require(preloadClass.exists()) {
|
||||
"preload class not found: '${preloadClass.absolutePath}'"
|
||||
|
||||
}
|
||||
inputChanges.getFileChanges(inputDir).forEach { change ->
|
||||
if (change.fileType == FileType.DIRECTORY) return@forEach
|
||||
if (change.file.extension == "class" && !(change.file.name.contains("$"))) {
|
||||
@@ -29,21 +46,19 @@ abstract class CollectScreenshotsTask @Inject constructor() : DefaultTask() {
|
||||
if (klassName.dropLast(2) in ignore.get())
|
||||
return@forEach
|
||||
|
||||
val cp = (runtimeDependencies.get().map { it.toURI().toURL() } + inputDir.get().asFile.toURI().toURL())
|
||||
val cp = (runtimeDependencies.get().map { it.toURI().toURL() } +
|
||||
inputDir.get().asFile.toURI().toURL()
|
||||
)
|
||||
.toTypedArray()
|
||||
|
||||
val ucl = URLClassLoader(cp)
|
||||
|
||||
|
||||
|
||||
|
||||
val klass = ucl.loadClass(klassName)
|
||||
println("Collecting screenshot for ${klassName} ${klass}")
|
||||
|
||||
val mainMethod = klass.getMethod("main")
|
||||
println(mainMethod)
|
||||
project.javaexec {
|
||||
this.classpath += project.files(inputDir.get().asFile)
|
||||
this.classpath += project.files(inputDir.get().asFile, preloadClass)
|
||||
this.classpath += runtimeDependencies.get()
|
||||
this.mainClass.set(klassName)
|
||||
this.workingDir(project.rootProject.projectDir)
|
||||
@@ -84,7 +99,9 @@ object ScreenshotsHelper {
|
||||
task.inputDir.set(output.classesDirs.first())
|
||||
task.runtimeDependencies.set(runtimeDependencyFiles)
|
||||
task.config()
|
||||
task.dependsOn(this.compileKotlinTask)
|
||||
return task
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.file.DirectoryProperty
|
||||
import org.gradle.api.file.FileType
|
||||
import org.gradle.api.provider.Property
|
||||
import org.gradle.api.tasks.*
|
||||
import org.gradle.work.ChangeType
|
||||
import org.gradle.work.Incremental
|
||||
import org.gradle.work.InputChanges
|
||||
import org.gradle.workers.WorkerExecutor
|
||||
import javax.inject.Inject
|
||||
|
||||
abstract class EmbedShadersTask : DefaultTask() {
|
||||
@@ -28,6 +37,7 @@ abstract class EmbedShadersTask : DefaultTask() {
|
||||
|
||||
@TaskAction
|
||||
fun execute(inputChanges: InputChanges) {
|
||||
|
||||
inputChanges.getFileChanges(inputDir).forEach { change ->
|
||||
if (change.fileType == FileType.DIRECTORY) return@forEach
|
||||
val name = "${namePrefix.get()}${change.file.nameWithoutExtension.replace("-", "_")}"
|
||||
18
buildSrc/src/preload/kotlin/ApplicationPreload.kt
Normal file
18
buildSrc/src/preload/kotlin/ApplicationPreload.kt
Normal file
@@ -0,0 +1,18 @@
|
||||
package org.openrndr
|
||||
|
||||
import org.openrndr.ApplicationPreload
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
|
||||
class Preload : ApplicationPreload() {
|
||||
override fun onConfiguration(configuration: Configuration) {
|
||||
// configuration.width = 1280
|
||||
// configuration.height = 720
|
||||
}
|
||||
override fun onProgramSetup(program: Program) {
|
||||
println("installing single screenshot extension at 0")
|
||||
program.extensions.add(0, SingleScreenshot().apply {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
setup(program)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
import Orx_embed_shaders_gradle.EmbedShadersTask
|
||||
import EmbedShadersTask
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
kotlin("plugin.serialization")
|
||||
id("orx.embed-shaders")
|
||||
}
|
||||
|
||||
val kotlinxSerializationVersion: String by rootProject.extra
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import Orx_collect_screenshots_gradle.ScreenshotsHelper.collectScreenshots
|
||||
import ScreenshotsHelper.collectScreenshots
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
kotlin("plugin.serialization")
|
||||
id("orx.collect-screenshots")
|
||||
}
|
||||
|
||||
val kotlinxSerializationVersion: String by rootProject.extra
|
||||
|
||||
@@ -16,13 +16,6 @@ fun main() {
|
||||
|
||||
}
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val mesh = sphereMesh(8, 8, radius = 0.1)
|
||||
|
||||
val instanceData = vertexBuffer(
|
||||
@@ -32,8 +25,7 @@ fun main() {
|
||||
},
|
||||
90 * 100
|
||||
)
|
||||
|
||||
|
||||
println(extensions.size)
|
||||
extend(Orbital())
|
||||
|
||||
extend {
|
||||
|
||||
@@ -15,12 +15,6 @@ fun main() {
|
||||
height = 800
|
||||
}
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
val mesh = sphereMesh(8, 8, radius = 0.1)
|
||||
|
||||
val instanceData = vertexBuffer(
|
||||
|
||||
@@ -12,12 +12,6 @@ import org.openrndr.shape.Rectangle
|
||||
|
||||
fun main() = application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
val numColors = 10
|
||||
val colorLists = listOf(
|
||||
ColorRGBa.PINK..ColorRGBa.BLUE.toHSVa() blend numColors,
|
||||
|
||||
@@ -11,12 +11,6 @@ import org.openrndr.extras.color.spaces.toHSLUVa
|
||||
|
||||
fun main() = application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
val cs = colorSequence(0.0 to ColorRGBa.PINK,
|
||||
0.5 to ColorRGBa.BLUE,
|
||||
|
||||
@@ -11,12 +11,6 @@ import org.openrndr.extras.color.spaces.toXSLUVa
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.WHITE)
|
||||
|
||||
|
||||
@@ -21,13 +21,6 @@ fun main() {
|
||||
|
||||
}
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val mesh = sphereMesh(8, 8, radius = 0.1)
|
||||
|
||||
extend(Orbital())
|
||||
|
||||
@@ -14,12 +14,6 @@ import org.openrndr.shape.Rectangle
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
val font = loadFont("demo-data/fonts/IBMPlexMono-Regular.ttf", 26.0)
|
||||
extend {
|
||||
drawer.stroke = null
|
||||
|
||||
@@ -23,13 +23,6 @@ fun main() {
|
||||
}
|
||||
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.GRAY)
|
||||
val color = ColorRGBa.RED
|
||||
|
||||
@@ -7,12 +7,6 @@ import org.openrndr.extras.color.statistics.calculateHistogramRGB
|
||||
|
||||
fun main() = application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
val useColors = 32
|
||||
val image = loadImage("demo-data/images/image-001.png")
|
||||
|
||||
|
||||
@@ -8,12 +8,6 @@ import kotlin.math.pow
|
||||
|
||||
fun main() = application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
val image = loadImage("demo-data/images/image-001.png")
|
||||
// -- here we use non-uniform weighting, such that bright colors are prioritized
|
||||
val histogram = calculateHistogramRGB(image, weighting = {
|
||||
|
||||
@@ -7,12 +7,6 @@ import org.openrndr.extras.color.statistics.calculateHistogramRGB
|
||||
|
||||
fun main() = application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
val image = loadImage("demo-data/images/image-001.png")
|
||||
val histogram = calculateHistogramRGB(image)
|
||||
extend {
|
||||
|
||||
@@ -39,13 +39,6 @@ fun main() {
|
||||
}
|
||||
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val arcs = (0..4).map { Arc(it * 90.0 - 45.0, 50.0, 90.0, 50.0) }.split(5)
|
||||
|
||||
extend {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import Orx_collect_screenshots_gradle.ScreenshotsHelper.collectScreenshots
|
||||
import ScreenshotsHelper.collectScreenshots
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
kotlin("plugin.serialization")
|
||||
id("orx.collect-screenshots")
|
||||
}
|
||||
|
||||
val kotlinxSerializationVersion: String by rootProject.extra
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import Orx_collect_screenshots_gradle.ScreenshotsHelper.collectScreenshots
|
||||
import ScreenshotsHelper.collectScreenshots
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
kotlin("plugin.serialization")
|
||||
id("orx.collect-screenshots")
|
||||
}
|
||||
|
||||
val kotlinxSerializationVersion: String by rootProject.extra
|
||||
|
||||
@@ -23,13 +23,6 @@ fun main() {
|
||||
drawer.lineSegment(0.0, 40.0, 400.0, 40.0)
|
||||
drawer.lineSegment(0.0, 20.0, 400.0, 20.0)
|
||||
}
|
||||
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
extend {
|
||||
drawer.stroke = ColorRGBa.WHITE
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import Orx_collect_screenshots_gradle.ScreenshotsHelper.collectScreenshots
|
||||
import Orx_embed_shaders_gradle.EmbedShadersTask
|
||||
|
||||
import ScreenshotsHelper.collectScreenshots
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
kotlin("plugin.serialization")
|
||||
id("orx.embed-shaders")
|
||||
id("orx.collect-screenshots")
|
||||
}
|
||||
|
||||
val kotlinxSerializationVersion: String by rootProject.extra
|
||||
|
||||
@@ -9,15 +9,6 @@ import kotlin.math.sin
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.delayFrames = 60
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
// In this buffer we will draw some simple shapes
|
||||
val dry = renderTarget(width / 3, height / 3) {
|
||||
colorBuffer()
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import Orx_embed_shaders_gradle.EmbedShadersTask
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
kotlin("plugin.serialization")
|
||||
id("orx.embed-shaders")
|
||||
}
|
||||
|
||||
val kotlinxSerializationVersion: String by rootProject.extra
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import Orx_embed_shaders_gradle.EmbedShadersTask
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
kotlin("plugin.serialization")
|
||||
id("orx.embed-shaders")
|
||||
}
|
||||
|
||||
val kotlinxSerializationVersion: String by rootProject.extra
|
||||
|
||||
@@ -12,12 +12,6 @@ fun main() {
|
||||
height = 720
|
||||
}
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val points = MutableList(1000) {
|
||||
Vector2(Math.random() * width, Math.random() * height)
|
||||
}
|
||||
|
||||
@@ -13,14 +13,6 @@ fun main() {
|
||||
program {
|
||||
var time = 0.0
|
||||
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.delayFrames = 120
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// By default OPENRNDR clears the canvas on each animation
|
||||
// frame. NoClear disables that behavior, letting you
|
||||
|
||||
@@ -190,6 +190,11 @@ val v8 = billow(seed, x, y, z, ::perlinLinear, octaves, lacunarity, gain)
|
||||

|
||||
|
||||

|
||||
|
||||
### DemoGradientPerturb2D
|
||||
[source code](src/demo/kotlin/DemoGradientPerturb2D.kt)
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
sourceSets {
|
||||
demo {
|
||||
java {
|
||||
srcDirs = ["src/demo/kotlin"]
|
||||
compileClasspath += main.getCompileClasspath()
|
||||
runtimeClasspath += main.getRuntimeClasspath()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(":orx-shader-phrases")
|
||||
implementation project(":orx-parameters")
|
||||
|
||||
demoImplementation(project(":orx-camera"))
|
||||
demoImplementation("org.openrndr:openrndr-application:$openrndrVersion")
|
||||
demoImplementation("org.openrndr:openrndr-extensions:$openrndrVersion")
|
||||
|
||||
demoRuntimeOnly("org.openrndr:openrndr-gl3:$openrndrVersion")
|
||||
demoRuntimeOnly("org.openrndr:openrndr-gl3-natives-$openrndrOS:$openrndrVersion")
|
||||
demoImplementation(sourceSets.getByName("main").output)
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import ScreenshotsHelper.collectScreenshots
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
kotlin("plugin.serialization")
|
||||
@@ -28,6 +30,7 @@ kotlin {
|
||||
implementation(compilations["main"]!!.output.allOutputs)
|
||||
}
|
||||
}
|
||||
collectScreenshots { }
|
||||
}
|
||||
}
|
||||
compilations.all {
|
||||
|
||||
@@ -11,22 +11,12 @@ import org.openrndr.extra.noise.withVector2Output
|
||||
import org.openrndr.extra.noise.gradient
|
||||
import org.openrndr.shape.contour
|
||||
|
||||
typealias IDDD_D = ((Int, Double, Double, Double) -> Double)
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
}
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val c = simplex3D.perturb({v->v})::class
|
||||
println(c)
|
||||
println(IDDD_D::perturb)
|
||||
val n = simplex3D.withVector2Output().gradient()
|
||||
extend {
|
||||
drawer.stroke = null
|
||||
|
||||
@@ -7,17 +7,11 @@ import org.openrndr.extra.noise.simplex
|
||||
import org.openrndr.math.Vector2
|
||||
import kotlin.math.absoluteValue
|
||||
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
val cb = colorBuffer(width, height)
|
||||
val shad = cb.shadow
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
for (y in 0 until height) {
|
||||
for (x in 0 until width) {
|
||||
|
||||
@@ -12,11 +12,6 @@ fun main() {
|
||||
program {
|
||||
val cb = colorBuffer(width, height)
|
||||
val shad = cb.shadow
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
for (y in 0 until height) {
|
||||
for (x in 0 until width) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.noise.poissonDiskSampling
|
||||
import org.openrndr.math.Vector2
|
||||
import org.openrndr.shape.Circle
|
||||
@@ -8,14 +7,7 @@ import org.openrndr.shape.Circle
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
var points = poissonDiskSampling(200.0, 200.0, 5.0, 10)
|
||||
|
||||
val rectPoints = points.map { Circle(Vector2(100.0, 100.0) + it, 3.0) }
|
||||
|
||||
points = poissonDiskSampling(200.0, 200.0, 5.0, 10, true) { w: Double, h: Double, v: Vector2 ->
|
||||
@@ -26,7 +18,6 @@ fun main() {
|
||||
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.BLACK)
|
||||
|
||||
drawer.stroke = null
|
||||
drawer.fill = ColorRGBa.PINK
|
||||
drawer.circles(rectPoints)
|
||||
|
||||
@@ -11,11 +11,6 @@ fun main() = application {
|
||||
height = 720
|
||||
}
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
drawer.stroke = null
|
||||
drawer.fill = ColorRGBa.PINK
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import Orx_collect_screenshots_gradle.ScreenshotsHelper.collectScreenshots
|
||||
import ScreenshotsHelper.collectScreenshots
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
kotlin("plugin.serialization")
|
||||
id("orx.collect-screenshots")
|
||||
}
|
||||
|
||||
val kotlinxSerializationVersion: String by rootProject.extra
|
||||
|
||||
@@ -16,12 +16,6 @@ fun main() {
|
||||
title = "QuadTree"
|
||||
}
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val box = Rectangle.fromCenter(Vector2(400.0), 750.0)
|
||||
|
||||
val points = (0 until 1_000).map {
|
||||
|
||||
@@ -16,12 +16,6 @@ fun main() {
|
||||
title = "QuadTree"
|
||||
}
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val box = Rectangle.fromCenter(Vector2(400.0), 750.0)
|
||||
|
||||
val points = (0 until 100).map {
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import Orx_collect_screenshots_gradle.ScreenshotsHelper.collectScreenshots
|
||||
import ScreenshotsHelper.collectScreenshots
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
kotlin("plugin.serialization")
|
||||
id("orx.embed-shaders")
|
||||
id("orx.collect-screenshots")
|
||||
}
|
||||
|
||||
val kotlinxSerializationVersion: String by rootProject.extra
|
||||
|
||||
@@ -17,12 +17,6 @@ fun main() {
|
||||
height = 500
|
||||
}
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
// Create gradients with initial colors
|
||||
val gradients = listOf(
|
||||
RadialGradient(ColorRGBa.PINK, ColorRGBa.WHITE),
|
||||
|
||||
@@ -10,11 +10,6 @@ import kotlin.math.cos
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
drawer.shadeStyle = linearGradient(
|
||||
ColorRGBa.RED.toOKLABa(),
|
||||
|
||||
@@ -20,12 +20,6 @@ import kotlin.math.cos
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val numPoints = 8
|
||||
val gradient = NPointGradient(Array(numPoints) {
|
||||
ColorXSVa(it * 360.0 / numPoints, 1.0, 1.0).toRGBa()
|
||||
|
||||
@@ -18,12 +18,6 @@ import kotlin.math.sin
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val numPoints = 8
|
||||
val gradient = NPointLinearGradient(Array(numPoints) {
|
||||
ColorXSVa(it * 360.0 / numPoints, 1.0, 1.0).toRGBa()
|
||||
|
||||
@@ -15,12 +15,6 @@ import kotlin.random.Random
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val gradient = NPointRadialGradient(arrayOf(
|
||||
ColorRGBa.PINK.opacify(0.0),
|
||||
ColorRGBa.PINK, ColorRGBa.WHITE, ColorRGBa.PINK,
|
||||
|
||||
@@ -8,11 +8,6 @@ import kotlin.math.cos
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
drawer.shadeStyle = radialGradient(
|
||||
ColorRGBa.PINK,
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import Orx_embed_shaders_gradle.EmbedShadersTask
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
kotlin("plugin.serialization")
|
||||
id("orx.embed-shaders")
|
||||
}
|
||||
|
||||
val kotlinxSerializationVersion: String by rootProject.extra
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import Orx_collect_screenshots_gradle.ScreenshotsHelper.collectScreenshots
|
||||
import ScreenshotsHelper.collectScreenshots
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
kotlin("plugin.serialization")
|
||||
id("orx.collect-screenshots")
|
||||
}
|
||||
|
||||
val kotlinxSerializationVersion: String by rootProject.extra
|
||||
|
||||
@@ -21,12 +21,6 @@ fun main() {
|
||||
height = 800
|
||||
}
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
// helper to get screen locations using normalized uv values
|
||||
fun pos(u: Double, v: Double) = drawer.bounds.position(u, v)
|
||||
val c0 = LineSegment(pos(0.1, 0.1), pos(0.9, 0.1))
|
||||
|
||||
@@ -21,12 +21,6 @@ fun main() {
|
||||
height = 800
|
||||
}
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val c = Circle(width / 2.0, height / 2.0, 350.0).contour
|
||||
val bp = bezierPatch(c)
|
||||
|
||||
|
||||
@@ -21,12 +21,6 @@ fun main() {
|
||||
height = 800
|
||||
}
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val bp = bezierPatch(
|
||||
Circle(width / 2.0, height / 2.0, 350.0).contour
|
||||
)
|
||||
|
||||
@@ -18,12 +18,6 @@ fun main() {
|
||||
height = 800
|
||||
}
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val bp = bezierPatch(
|
||||
Circle(drawer.bounds.center, 350.0).contour
|
||||
//Rectangle.fromCenter(drawer.bounds.center, 550.0).contour
|
||||
|
||||
@@ -28,13 +28,6 @@ fun main() {
|
||||
multisample = WindowMultisample.SampleCount(8)
|
||||
}
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
multisample = BufferMultisample.SampleCount(8)
|
||||
}
|
||||
}
|
||||
|
||||
val c0 = Segment3D(Vector3(-5.0, 0.0, -9.0), Vector3(5.0, 0.0, -9.0))
|
||||
val c1 = Segment3D(Vector3(-5.0, -5.0, -3.0), Vector3(5.0, -5.0, -3.0))
|
||||
val c2 = Segment3D(Vector3(-5.0, 5.0, 3.0), Vector3(5.0, 5.0, 3.0))
|
||||
|
||||
@@ -8,11 +8,6 @@ import org.openrndr.shape.Circle
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.PINK)
|
||||
val bp = bezierPatch(
|
||||
|
||||
@@ -14,11 +14,6 @@ fun main() {
|
||||
height = 720
|
||||
}
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.BLACK)
|
||||
val bp2 = bezierPatch(
|
||||
|
||||
@@ -22,11 +22,6 @@ fun main() {
|
||||
height = 720
|
||||
}
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.BLACK)
|
||||
val colors = listOf(
|
||||
|
||||
@@ -23,12 +23,6 @@ fun main() {
|
||||
height = 800
|
||||
}
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val c0 = Circle(width / 3.0, height / 2.0, 150.0).contour
|
||||
val bp0 = bezierPatch(c0)
|
||||
|
||||
|
||||
@@ -10,11 +10,6 @@ fun main() {
|
||||
height = 800
|
||||
}
|
||||
program {
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
drawer.fill = ColorRGBa.WHITE.opacify(0.25)
|
||||
drawer.stroke = ColorRGBa.PINK
|
||||
|
||||
@@ -8,12 +8,6 @@ import kotlin.math.cos
|
||||
|
||||
fun main() = application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
drawer.fill = ColorRGBa.PINK
|
||||
drawer.stroke = ColorRGBa.WHITE
|
||||
|
||||
@@ -7,12 +7,6 @@ import kotlin.math.sin
|
||||
|
||||
fun main() = application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
drawer.fill = ColorRGBa.PINK
|
||||
drawer.stroke = ColorRGBa.WHITE
|
||||
|
||||
@@ -9,12 +9,6 @@ import kotlin.math.sin
|
||||
|
||||
fun main() = application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
drawer.fill = ColorRGBa.PINK
|
||||
drawer.stroke = ColorRGBa.WHITE
|
||||
|
||||
@@ -6,12 +6,6 @@ import kotlin.math.cos
|
||||
|
||||
fun main() = application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
drawer.fill = ColorRGBa.WHITE
|
||||
drawer.stroke = ColorRGBa.PINK
|
||||
|
||||
Reference in New Issue
Block a user