@azphalt/importer-cube 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +19 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -8,6 +8,16 @@ import { writeAzp } from "@azphalt/azp";
|
|
|
8
8
|
import { parseCube } from "./parse-cube.js";
|
|
9
9
|
/** Manifest/format version this importer targets. */
|
|
10
10
|
const FORMAT = "0.1";
|
|
11
|
+
/** In-package path for the canonical dry/wet control panel. */
|
|
12
|
+
const PANEL_PATH = "ui/lut.json";
|
|
13
|
+
/**
|
|
14
|
+
* The canonical `lut` control: one `strength` slider bound to the well-known `strength` key
|
|
15
|
+
* (spec/extension-manifest.md § Canonical `lut` panel), so the dry/wet blend renders identically
|
|
16
|
+
* on every host.
|
|
17
|
+
*/
|
|
18
|
+
const STRENGTH_PANEL = {
|
|
19
|
+
controls: [{ type: "slider", key: "strength", label: "Strength", min: 0, max: 1, step: 0.01, default: 1 }],
|
|
20
|
+
};
|
|
11
21
|
/** Parse `cubeText`, then package it as a `.azp` with `licenseText` as the LICENSE. */
|
|
12
22
|
export function importCube(cubeText, licenseText, opts) {
|
|
13
23
|
const lut = parseCube(cubeText);
|
|
@@ -26,8 +36,13 @@ export function importCube(cubeText, licenseText, opts) {
|
|
|
26
36
|
{
|
|
27
37
|
type: "lut",
|
|
28
38
|
path: assetPath,
|
|
39
|
+
// A single `strength` slider bound to the well-known key, so every imported LUT ships a
|
|
40
|
+
// portable dry/wet control (spec/extension-manifest.md § Canonical `lut` panel).
|
|
41
|
+
ui: PANEL_PATH,
|
|
29
42
|
params: {
|
|
30
43
|
format: "cube",
|
|
44
|
+
// Normative dry/wet blend: `1` = full grade. See package-format.md § LUT application.
|
|
45
|
+
strength: 1,
|
|
31
46
|
dimensions: lut.dimensions,
|
|
32
47
|
size: lut.size,
|
|
33
48
|
domainMin: lut.domainMin,
|
|
@@ -39,7 +54,10 @@ export function importCube(cubeText, licenseText, opts) {
|
|
|
39
54
|
};
|
|
40
55
|
const result = writeAzp({
|
|
41
56
|
manifest,
|
|
42
|
-
payload: {
|
|
57
|
+
payload: {
|
|
58
|
+
[assetPath]: new TextEncoder().encode(cubeText),
|
|
59
|
+
[PANEL_PATH]: new TextEncoder().encode(JSON.stringify(STRENGTH_PANEL)),
|
|
60
|
+
},
|
|
43
61
|
license: licenseText,
|
|
44
62
|
});
|
|
45
63
|
return { ...result, lut };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azphalt/importer-cube",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@azphalt/azp": "0.1.
|
|
27
|
-
"@azphalt/
|
|
26
|
+
"@azphalt/azp": "0.1.1",
|
|
27
|
+
"@azphalt/azdk": "0.1.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"typescript": "^5.6.0",
|