add demos to README.md
This commit is contained in:
@@ -50,156 +50,300 @@ Two color spaces are added: `ColorHSLUVa` and `ColorHPLUVa`, they are an impleme
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
### colormap/DemoSpectralZucconiColormap
|
||||
[source code](src/jvmDemo/kotlin/colormap/DemoSpectralZucconiColormap.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/colormap/DemoSpectralZucconiColormap.kt)
|
||||
|
||||
### colormap/DemoSpectralZucconiColormapPhrase
|
||||
[source code](src/jvmDemo/kotlin/colormap/DemoSpectralZucconiColormapPhrase.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/colormap/DemoSpectralZucconiColormapPhrase.kt)
|
||||
|
||||
### colormap/DemoSpectralZucconiColormapPlot
|
||||
[source code](src/jvmDemo/kotlin/colormap/DemoSpectralZucconiColormapPlot.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/colormap/DemoSpectralZucconiColormapPlot.kt)
|
||||
|
||||
### colormap/DemoTurboColormap
|
||||
[source code](src/jvmDemo/kotlin/colormap/DemoTurboColormap.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/colormap/DemoTurboColormap.kt)
|
||||
|
||||
### colormap/DemoTurboColormapPhrase
|
||||
[source code](src/jvmDemo/kotlin/colormap/DemoTurboColormapPhrase.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/colormap/DemoTurboColormapPhrase.kt)
|
||||
|
||||
### colormap/DemoTurboColormapPlot
|
||||
[source code](src/jvmDemo/kotlin/colormap/DemoTurboColormapPlot.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
### colormatrix/DemoColorMatrix01
|
||||
[source code](src/jvmDemo/kotlin/colormatrix/DemoColorMatrix01.kt)
|
||||
[source code](src/jvmDemo/kotlin/colormap/DemoTurboColormapPlot.kt)
|
||||
|
||||
### colormatrix/DemoColorMatrix01
|
||||
|
||||
This demo modifies the displayed image in each grid cell
|
||||
using color matrix transformations to demonstrate color channel inversions based on
|
||||
the grid cell's index. The image is adjusted to fit within each grid cell while maintaining
|
||||
alignment.
|
||||
|
||||
Functionality:
|
||||
- Loads an image from the specified file path.
|
||||
- Splits the drawing area into an evenly spaced 4x2 grid.
|
||||
- Applies different color matrix inversions (red, green, blue) based on the position index.
|
||||
- Fits the image into each grid cell while providing horizontal alignment adjustments.
|
||||

|
||||
|
||||
### colormatrix/DemoColorMatrix02
|
||||
[source code](src/jvmDemo/kotlin/colormatrix/DemoColorMatrix02.kt)
|
||||
[source code](src/jvmDemo/kotlin/colormatrix/DemoColorMatrix01.kt)
|
||||
|
||||
### colormatrix/DemoColorMatrix02
|
||||
|
||||
This demo modifies the displayed image in each grid cell
|
||||
using color matrix transformations to demonstrate color channel inversions based on
|
||||
the grid cell's index. The image is adjusted to fit within each grid cell while maintaining
|
||||
alignment.
|
||||
|
||||
Functionality:
|
||||
- Loads an image from the specified file path.
|
||||
- Splits the drawing area into an evenly spaced 4x2 grid.
|
||||
- Applies different color matrix inversions (red, green, blue) based on the position index.
|
||||
- Fits the image into each grid cell while providing horizontal alignment adjustments.
|
||||

|
||||
|
||||
### colormatrix/DemoColorMatrix03
|
||||
[source code](src/jvmDemo/kotlin/colormatrix/DemoColorMatrix03.kt)
|
||||
[source code](src/jvmDemo/kotlin/colormatrix/DemoColorMatrix02.kt)
|
||||
|
||||
### colormatrix/DemoColorMatrix03
|
||||
|
||||
Entry point for an application demonstrating the use of color matrix transformations on an image.
|
||||
|
||||
The program initializes a graphical application with a resolution of 720x720 pixels
|
||||
and processes an image to display it in a series of grid cells, applying a hue shift
|
||||
transformation based on the index of each cell.
|
||||
|
||||
Key features:
|
||||
- Loads an image from a specified file path.
|
||||
- Configures the drawing area to consist of a horizontal grid with 16 cells.
|
||||
- Applies a color tint transformation utilizing the red channel, shifting its hue progressively
|
||||
per cell index to create a colorful gradient effect.
|
||||
- Adjusts the positions of the images within each grid cell for aesthetic alignment.
|
||||

|
||||
|
||||
### colormatrix/DemoColorMatrix04
|
||||
[source code](src/jvmDemo/kotlin/colormatrix/DemoColorMatrix04.kt)
|
||||
[source code](src/jvmDemo/kotlin/colormatrix/DemoColorMatrix03.kt)
|
||||
|
||||
### colormatrix/DemoColorMatrix04
|
||||
|
||||
Entry point of a graphical application that demonstrates the use of color matrix
|
||||
transformations on an image displayed within a grid layout.
|
||||
|
||||
Overview:
|
||||
- Initializes a window with a resolution of 720x720 pixels.
|
||||
- Loads an image from the specified file path.
|
||||
- Splits the drawing canvas into a 7x1 grid of cells.
|
||||
- In each grid cell, applies custom grayscale transformations to the image using
|
||||
a color matrix. The grayscale transformation coefficients for red, green, and blue
|
||||
channels are computed based on the index of the grid cell.
|
||||
- Displays the adjusted image in each grid cell with horizontal alignment modifications
|
||||
to position the images dynamically based on their index within the grid.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/colormatrix/DemoColorMatrix04.kt)
|
||||
|
||||
### colorRange/DemoColorRange01
|
||||
[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange01.kt)
|
||||
|
||||
### colorRange/DemoColorRange02
|
||||
[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange02.kt)
|
||||
|
||||
### colorRange/DemoColorRange03
|
||||
[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange03.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange03.kt)
|
||||
|
||||
### colorRange/DemoColorRange04
|
||||
[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange04.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
### DemoColorPalette01
|
||||
[source code](src/jvmDemo/kotlin/DemoColorPalette01.kt)
|
||||
[source code](src/jvmDemo/kotlin/colorRange/DemoColorRange04.kt)
|
||||
|
||||
### DemoColorPalette01
|
||||
|
||||
Demonstrates the creation of color palettes using various available methods
|
||||

|
||||
|
||||
### DemoColorPalette02
|
||||
[source code](src/jvmDemo/kotlin/DemoColorPalette02.kt)
|
||||
[source code](src/jvmDemo/kotlin/DemoColorPalette01.kt)
|
||||
|
||||
### DemoColorPalette02
|
||||
|
||||
By default, generated palettes contain colors of varying hue
|
||||
but similar brightness and saturation.
|
||||
Here we alter the brightness of each color using .shade() for
|
||||
an increased dynamic range.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoColorPalette02.kt)
|
||||
|
||||
### DemoColorPlane01
|
||||
[source code](src/jvmDemo/kotlin/DemoColorPlane01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoColorPlane01.kt)
|
||||
|
||||
### DemoColorPlane02
|
||||
[source code](src/jvmDemo/kotlin/DemoColorPlane02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
### DemoColorSequence01
|
||||
[source code](src/jvmDemo/kotlin/DemoColorSequence01.kt)
|
||||
[source code](src/jvmDemo/kotlin/DemoColorPlane02.kt)
|
||||
|
||||
### DemoColorSequence01
|
||||
|
||||
A demo that demonstrates 3D objects with custom shading and color gradients.
|
||||
|
||||
The application setup involves:
|
||||
- Configuring the application window dimensions.
|
||||
- Creating a color gradient using `ColorSequence` and converting it to a `ColorBuffer` for shading purposes.
|
||||
- Defining a 3D sphere mesh with specified resolution.
|
||||
|
||||
The rendering process includes:
|
||||
- Setting up an orbital camera extension to provide an interactive 3D view.
|
||||
- Applying a custom fragment shader with a palette-based shading style.
|
||||
- Rendering a grid of 3D spheres, each transformed and rotated to create a dynamic pattern.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoColorSequence01.kt)
|
||||
|
||||
### DemoDeltaE
|
||||
[source code](src/jvmDemo/kotlin/DemoDeltaE.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoDeltaE.kt)
|
||||
|
||||
### DemoFettePalette01
|
||||
[source code](src/jvmDemo/kotlin/DemoFettePalette01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoFettePalette01.kt)
|
||||
|
||||
### DemoFettePalette02
|
||||
[source code](src/jvmDemo/kotlin/DemoFettePalette02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoFettePalette02.kt)
|
||||
|
||||
### DemoHSLUV01
|
||||
[source code](src/jvmDemo/kotlin/DemoHSLUV01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoHSLUV01.kt)
|
||||
|
||||
### DemoHSLUV02
|
||||
[source code](src/jvmDemo/kotlin/DemoHSLUV02.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoHSLUV02.kt)
|
||||
|
||||
### DemoHueTools01
|
||||
[source code](src/jvmDemo/kotlin/DemoHueTools01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoHueTools01.kt)
|
||||
|
||||
### DemoMixSpectral01
|
||||
[source code](src/jvmDemo/kotlin/DemoMixSpectral01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoMixSpectral01.kt)
|
||||
|
||||
### DemoOKHSV01
|
||||
[source code](src/jvmDemo/kotlin/DemoOKHSV01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/DemoOKHSV01.kt)
|
||||
|
||||
### DemoXSLUV01
|
||||
[source code](src/jvmDemo/kotlin/DemoXSLUV01.kt)
|
||||
|
||||
|
||||

|
||||
|
||||
### histogram/DemoHistogram01
|
||||
[source code](src/jvmDemo/kotlin/histogram/DemoHistogram01.kt)
|
||||
[source code](src/jvmDemo/kotlin/DemoXSLUV01.kt)
|
||||
|
||||
### histogram/DemoHistogram01
|
||||
|
||||
package histogram
|
||||
|
||||
import org.openrndr.application
|
||||
import org.openrndr.draw.loadImage
|
||||
import org.openrndr.extra.color.statistics.calculateHistogramRGB
|
||||
|
||||
/*
|
||||
Demonstrates how to generate a palette with the top 32 colors
|
||||
of a loaded image, sorted by luminosity. The colors are displayed
|
||||
as rectangles overlayed on top of the image.
|
||||

|
||||
|
||||
### histogram/DemoHistogram02
|
||||
[source code](src/jvmDemo/kotlin/histogram/DemoHistogram02.kt)
|
||||
[source code](src/jvmDemo/kotlin/histogram/DemoHistogram01.kt)
|
||||
|
||||
### histogram/DemoHistogram02
|
||||
|
||||
package histogram
|
||||
|
||||
import org.openrndr.application
|
||||
import org.openrndr.draw.loadImage
|
||||
import org.openrndr.extra.color.statistics.calculateHistogramRGB
|
||||
import kotlin.math.pow
|
||||
|
||||
/*
|
||||
Show the color histogram of an image using non-uniform weighting,
|
||||
prioritizing bright colors.
|
||||

|
||||
|
||||
### histogram/DemoHistogram03
|
||||
[source code](src/jvmDemo/kotlin/histogram/DemoHistogram03.kt)
|
||||
[source code](src/jvmDemo/kotlin/histogram/DemoHistogram02.kt)
|
||||
|
||||
### histogram/DemoHistogram03
|
||||
|
||||
package histogram
|
||||
|
||||
import org.openrndr.application
|
||||
import org.openrndr.draw.loadImage
|
||||
import org.openrndr.extra.color.statistics.calculateHistogramRGB
|
||||
|
||||
/*
|
||||
Create a simple grid-like composition based on colors sampled from image.
|
||||
The cells are 32 by 32 pixels in size and are filled with a random sample
|
||||
taken from the color histogram of the image.
|
||||
|
||||
Note: due to its random nature the resulting animation contains flickering colors.
|
||||

|
||||
|
||||
[source code](src/jvmDemo/kotlin/histogram/DemoHistogram03.kt)
|
||||
|
||||
Reference in New Issue
Block a user