add orx-jvm demos to README.md

This commit is contained in:
Abe Pazos
2025-11-22 18:16:54 +00:00
parent 4af2ed3fed
commit 6024e62af0
3 changed files with 98 additions and 8 deletions

View File

@@ -26,7 +26,16 @@ this addon provides some helper functions to convert them to OPENRNDR types:
## Demos
### DemoContours01
Demonstrates how to convert a PNG image into `ShapeContour`s using BoofCV.
Two helper methods help convert data types between BoofCV and OPENRNDR.
The `ColorBuffer.toGrayF32()` method converts an OPENRNDR `ColorBuffer` to `GrayF32` format,
required by BoofCV.
The `.toShapeContours()` converts BoofCV contours to OPENRNDR `ShapeContour` instances.
The resulting contours are animated zooming in and out while their colors change slowly.
![DemoContours01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-boofcv/images/DemoContours01Kt.png)
@@ -34,7 +43,8 @@ this addon provides some helper functions to convert them to OPENRNDR types:
### DemoResize01
Demonstrates how to scale down images using the `resizeBy` BoofCV-based
method.
![DemoResize01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-boofcv/images/DemoResize01Kt.png)
@@ -42,7 +52,11 @@ this addon provides some helper functions to convert them to OPENRNDR types:
### DemoResize02
Demonstrates how to scale down images using the `resizeTo` BoofCV-based
method.
If only the `newWidth` or the `newHeight` arguments are specified,
the resizing happens maintaining the original aspect ratio.
![DemoResize02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-boofcv/images/DemoResize02Kt.png)
@@ -50,7 +64,16 @@ this addon provides some helper functions to convert them to OPENRNDR types:
### DemoSimplified01
When converting a `ColorBuffer` to `ShapeContour` instances using
`BoofCV`, simple shapes can have hundreds of segments and vertices.
This demo shows how to use the `simplify()` method to greatly
reduce the number of vertices.
Then it uses the simplified vertex lists to create smooth curves
(using `CatmullRomChain2`) and polygonal curves (using `ShapeContour.fromPoints`).
Study the console to learn about the number of segments before and after simplification.
![DemoSimplified01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-boofcv/images/DemoSimplified01Kt.png)

View File

@@ -178,7 +178,10 @@ import org.openrndr.extra.parameters.DoubleParameter
## Demos
### DemoAppearance01
A simple demonstration of a GUI for drawing some circles
Demonstrates how to customize the appearance of the GUI by using
`GUIAppearance()`.
In this demo, we make the GUI wider (400 pixels) and translucent.
![DemoAppearance01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoAppearance01Kt.png)
@@ -186,7 +189,7 @@ A simple demonstration of a GUI for drawing some circles
### DemoHide01
A simple demonstration of a GUI for drawing some circles
Demonstrates how to hide the GUI when the mouse pointer is outside of it.
![DemoHide01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoHide01Kt.png)
@@ -194,15 +197,38 @@ A simple demonstration of a GUI for drawing some circles
### DemoOptions01
A simple demonstration of a GUI with a drop down menu
A simple demonstration of a GUI with a drop-down menu.
The entries in the drop-down menu are taken from an `enum class`.
![DemoOptions01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoOptions01Kt.png)
[source code](src/demo/kotlin/DemoOptions01.kt)
### DemoOptions02
A simple demonstration of a GUI with a drop-down menu.
The entries in the drop-down menu are taken from an `enum class`.
The `enum class` entries contain both a name (used in the drop-down)
and a `ColorRGBa` instance (used for rendering).
![DemoOptions02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoOptions02Kt.png)
[source code](src/demo/kotlin/DemoOptions02.kt)
### DemoPath01
Demonstrates how to include a button for loading images in a GUI, and how to display
the loaded image.
The program applies the `@PathParameter` annotation to a `String` variable, which gets
rendered by the GUI as an image-picker button. Note the allowed file `extensions`.
This mechanism only updates the `String` containing the path of an image file.
The `watchingImagePath()` delegate property is used to automatically load an image
when its `String` argument changes.
![DemoPath01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoPath01Kt.png)
@@ -210,9 +236,11 @@ A simple demonstration of a GUI with a drop down menu
### DemoPresets01
Shows how to store and retrieve in-memory gui presets.
Shows how to store and retrieve in-memory GUI presets,
each containing two integer values and two colors.
Keyboard controls:
[Left Shift] + [0]..[9] => store current gui values to a preset
[Left Shift] + [0]..[9] => store current GUI values to a preset
[0]..[9] => recall a preset
![DemoPresets01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoPresets01Kt.png)
@@ -221,7 +249,17 @@ Keyboard controls:
### DemoSideCanvas01
A simple demonstration of a GUI for drawing some circles
Demonstrates the `GUI.enableSideCanvas` feature.
When set to true, the `GUI` provides a `canvas` property where one can draw.
The size of this canvas is the window size minus the GUI size.
That's why if we draw a circle at `drawer.width / 2.0` it is centered
on the `canvas`, not on the window.
This demo sets the window to resizable, so if you resize the window
you should see tha the circle stays at the center of the canvas.
![DemoSideCanvas01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoSideCanvas01Kt.png)
@@ -229,7 +267,15 @@ A simple demonstration of a GUI for drawing some circles
### DemoSimple01
A simple demonstration of a GUI for drawing some circles
Demonstrates how to create a simple GUI with 4 inputs:
- A `ColorParameter` which creates a color picker.
- A `DoubleParameter` to control the radius of a circle.
- A `Vector2Parameter` to set the position of that circle.
- A `DoubleListParameter` which sets the radii of six circles.
The demo also shows how to use the variables controlled by the GUI
inside the program, so changes to those variables affect
the rendering in real time.
![DemoSimple01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoSimple01Kt.png)
@@ -237,6 +283,10 @@ A simple demonstration of a GUI for drawing some circles
### DemoXYParameter
Demonstrates the use of the `@XYParameter` annotation applied to a `Vector2` variable.
This annotation creates an interactive XY control in a GUI that can be used to update
a `Vector2` variable. In this demo it sets the position of a circle.
![DemoXYParameterKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-gui/images/DemoXYParameterKt.png)

View File

@@ -42,7 +42,15 @@ More info about the web client:
## Demos
### DemoRabbitControl
Demonstrates how to use RabbitControl to create a web-based user interface for your program.
A `settings` object is created using the same syntax used for `orx-gui`, including
annotations for different variable types.
The program then passes these `settings` to the `RabbitControlServer`. A QR-code is displayed
to open the web user interface. A clickable URL is also displayed in the console.
Once the UI is visible in a web browser we can use it to control the OPENRNDR program.
![DemoRabbitControlKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-rabbit-control/images/DemoRabbitControlKt.png)
@@ -50,7 +58,10 @@ More info about the web client:
### DemoRabbitControlManualOverlay
Demonstrates how the QR-code pointing at the Rabbit Control web-based user interface
can be displayed and hidden manually.
To display the QR-code overlay in this demo, hold down the HOME key in the keyboard.
![DemoRabbitControlManualOverlayKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-rabbit-control/images/DemoRabbitControlManualOverlayKt.png)
@@ -58,6 +69,12 @@ More info about the web client:
### DemoRabbitHole
Starts the RabbitControlServer with a `Rabbithole` using the key 'orxtest'.
`Rabbithole` allows you to access your exposed parameters from Internet
connected computers that are not in the same network.
To use it with this example use 'orxtest' as the tunnel-name in https://rabbithole.rabbitcontrol.cc
![DemoRabbitHoleKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-jvm/orx-rabbit-control/images/DemoRabbitHoleKt.png)