54 lines
2.3 KiB
JavaScript
54 lines
2.3 KiB
JavaScript
import { Slider } from "./slider.js"
|
|
import { Select } from "./select.js"
|
|
import { RowHeader } from "./row-header.js"
|
|
import { TextInput } from "./text-input.js"
|
|
import { ColorInput } from "./color-input.js"
|
|
|
|
function makeSliders()
|
|
{
|
|
const sliders = {
|
|
subpixelOptions: new RowHeader("global options"),
|
|
mode: new Select("mode", ["supersampling", "subpixel"]),
|
|
scale: new Slider("scale", 0.0, 0.01),
|
|
translateX: new Slider("translate x", -1, 1),
|
|
translateY: new Slider("translate y", -1, 1),
|
|
multisampleCount: new Slider("multisampleCount", 1, 4, 1),
|
|
|
|
distanceThreshold: new Slider("distance threshold", 0.25, 0.75),
|
|
distanceScale: new Slider("distance scale", 0.0, 20.0),
|
|
aliasingEnable: new Slider("aliasing enable", 0, 1, 1),
|
|
|
|
text: new TextInput("text"),
|
|
insideColor: new ColorInput("inside color", "#ffffff"),
|
|
outlineColor: new ColorInput("outline color", "#000000"),
|
|
|
|
subpixelOptions: new RowHeader("subpixel mode options"),
|
|
subpixelEnable: new Slider("subpixel enable", 0, 1, 1),
|
|
subpixelStrength: new Slider("subpixel strength", 0.0, 1.0),
|
|
subpixelOffset: new Slider("subpixel offset", 0.0, 10.0),
|
|
|
|
supersamplingOptions: new RowHeader("supersampling mode options"),
|
|
supersampleCount: new Slider("supersample count", 1.0, 15.0, 7),
|
|
supersampleOffset: new Slider("supersample offset", 0.0, 10.0),
|
|
outlineThreshold: new Slider("outline threshold", 0.0, 1.0),
|
|
outlineScale: new Slider("outline scale", 0.0, 20.0),
|
|
|
|
//colorMix: new Slider("color mix", 0.0, 1.0),
|
|
//colorScale: new Slider("color scale", 0.0, 10.0),
|
|
//colorOffset: new Slider("color offset", 0.0, 3.1415),
|
|
};
|
|
|
|
/*
|
|
const defaults = {"color scale":"148","bone length":"32","outline scale":"37","dist. threshold":"562","velocity acc.":"385","translate x":"464","outline threshold":"433","translate y":"495","bone count":"40","outline offset":"482","scale":"229","outline. threshold":"512","color offset":"118","distance offset":"676","threshold offset":"265","velocity damp.":"796","distance scale":"404","threshold scale":"739","color mix":"0"};
|
|
for (let slider of Object.values(sliders)) {
|
|
if (slider.label in defaults) {
|
|
slider.input.value = defaults[slider.label];
|
|
}
|
|
}
|
|
*/
|
|
|
|
return sliders;
|
|
}
|
|
|
|
export { makeSliders };
|