Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/looking-glass-bridge.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/looking-glass-bridge.js.map

Large diffs are not rendered by default.

351 changes: 180 additions & 171 deletions dist/looking-glass-bridge.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/looking-glass-bridge.mjs.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/schemas/defaults.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ export declare const QUILT_COLS: defaults;
export declare const QUILT_VIEW_COUNT: defaults;
export declare const GAUSSIAN_SIGMA: defaults;
export declare const FILTER_MODE: defaults;
export declare const AA_STRENGTH: defaults;
5 changes: 4 additions & 1 deletion dist/schemas/schema.parameters.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from "zod";
export declare const parameterNames: z.ZodUnion<[z.ZodLiteral<"focus">, z.ZodLiteral<"aspect">, z.ZodLiteral<"cols">, z.ZodLiteral<"rows">, z.ZodLiteral<"crop_pos_x">, z.ZodLiteral<"crop_pos_y">, z.ZodLiteral<"zoom">, z.ZodLiteral<"filter_mode">, z.ZodLiteral<"gaussian_sigma">, z.ZodLiteral<"depth_loc">, z.ZodLiteral<"depth_inversion">, z.ZodLiteral<"chroma_depth">, z.ZodLiteral<"depthiness">, z.ZodLiteral<"depth_cutoff">]>;
export declare const parameterNames: z.ZodUnion<[z.ZodLiteral<"focus">, z.ZodLiteral<"aspect">, z.ZodLiteral<"cols">, z.ZodLiteral<"rows">, z.ZodLiteral<"crop_pos_x">, z.ZodLiteral<"crop_pos_y">, z.ZodLiteral<"zoom">, z.ZodLiteral<"filter_mode">, z.ZodLiteral<"gaussian_sigma">, z.ZodLiteral<"depth_loc">, z.ZodLiteral<"depth_inversion">, z.ZodLiteral<"chroma_depth">, z.ZodLiteral<"depthiness">, z.ZodLiteral<"depth_cutoff">, z.ZodLiteral<"antiAliasingStrength">]>;
export declare const hologramParamMap: z.ZodObject<{
focus: z.ZodOptional<z.ZodNumber>;
aspect: z.ZodOptional<z.ZodNumber>;
Expand All @@ -15,6 +15,7 @@ export declare const hologramParamMap: z.ZodObject<{
chroma_depth: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
depthiness: z.ZodEffects<z.ZodNumber, number, number>;
depth_cutoff: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<0>]>>;
antiAliasingStrength: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
zoom: number;
filter_mode: number;
Expand All @@ -30,6 +31,7 @@ export declare const hologramParamMap: z.ZodObject<{
crop_pos_x?: number | undefined;
crop_pos_y?: number | undefined;
depth_cutoff?: 0 | 1 | undefined;
antiAliasingStrength?: number | undefined;
}, {
zoom: number;
filter_mode: number;
Expand All @@ -45,5 +47,6 @@ export declare const hologramParamMap: z.ZodObject<{
crop_pos_x?: number | undefined;
crop_pos_y?: number | undefined;
depth_cutoff?: 0 | 1 | undefined;
antiAliasingStrength?: number | undefined;
}>;
export type HologramParamMap = z.infer<typeof hologramParamMap>;
2 changes: 1 addition & 1 deletion dist/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/classes/client_BridgeClient.BridgeClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ Update the parameters of the current hologram

| Name | Type |
| :------ | :------ |
| `T` | extends ``"focus"`` \| ``"aspect"`` \| ``"cols"`` \| ``"rows"`` \| ``"crop_pos_x"`` \| ``"crop_pos_y"`` \| ``"zoom"`` \| ``"filter_mode"`` \| ``"gaussian_sigma"`` \| ``"depth_loc"`` \| ``"depth_inversion"`` \| ``"chroma_depth"`` \| ``"depthiness"`` \| ``"depth_cutoff"`` |
| `T` | extends ``"focus"`` \| ``"aspect"`` \| ``"cols"`` \| ``"rows"`` \| ``"crop_pos_x"`` \| ``"crop_pos_y"`` \| ``"zoom"`` \| ``"filter_mode"`` \| ``"gaussian_sigma"`` \| ``"depth_loc"`` \| ``"depth_inversion"`` \| ``"chroma_depth"`` \| ``"depthiness"`` \| ``"depth_cutoff"`` \| ``"antiAliasingStrength"`` |

#### Parameters

Expand All @@ -674,7 +674,7 @@ Update the parameters of the current hologram
| `«destructured»` | `Object` |
| › `name` | `string` |
| › `parameter` | `T` |
| › `value` | { `aspect?`: `number` ; `chroma_depth`: ``0`` \| ``1`` ; `cols?`: `number` ; `crop_pos_x?`: `number` ; `crop_pos_y?`: `number` ; `depth_cutoff?`: ``0`` \| ``1`` ; `depth_inversion`: ``0`` \| ``1`` ; `depth_loc`: ``0`` \| ``2`` \| ``1`` \| ``3`` ; `depthiness`: `number` = DEPTHINESS.range; `filter_mode`: `number` = FILTER\_MODE.range; `focus?`: `number` ; `gaussian_sigma`: `number` = GAUSSIAN\_SIGMA.range; `rows?`: `number` ; `zoom`: `number` = ZOOM.range }[`T`] |
| › `value` | { `antiAliasingStrength?`: `number` ; `aspect?`: `number` ; `chroma_depth`: ``0`` \| ``1`` ; `cols?`: `number` ; `crop_pos_x?`: `number` ; `crop_pos_y?`: `number` ; `depth_cutoff?`: ``0`` \| ``1`` ; `depth_inversion`: ``0`` \| ``1`` ; `depth_loc`: ``0`` \| ``2`` \| ``1`` \| ``3`` ; `depthiness`: `number` = DEPTHINESS.range; `filter_mode`: `number` = FILTER\_MODE.range; `focus?`: `number` ; `gaussian_sigma`: `number` = GAUSSIAN\_SIGMA.range; `rows?`: `number` ; `zoom`: `number` = ZOOM.range }[`T`] |

#### Returns

Expand Down
7 changes: 7 additions & 0 deletions docs/modules/schemas_defaults.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

### Variables

- [AA\_STRENGTH](schemas_defaults.md#aa_strength)
- [ASPECT](schemas_defaults.md#aspect)
- [COLUMNS](schemas_defaults.md#columns)
- [CROP\_POS\_X](schemas_defaults.md#crop_pos_x)
Expand All @@ -40,6 +41,12 @@ This helps prevent sending bridge values that are out of range.

## Variables

### AA\_STRENGTH

• `Const` **AA\_STRENGTH**: [`defaults`](../interfaces/schemas_defaults.defaults.md)

___

### ASPECT

• `Const` **ASPECT**: [`defaults`](../interfaces/schemas_defaults.defaults.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/schemas_schema_parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

### hologramParamMap

• `Const` **hologramParamMap**: `ZodObject`<{ `aspect`: `ZodOptional`<`ZodNumber`\> ; `chroma_depth`: `ZodUnion`<[`ZodLiteral`<``0``\>, `ZodLiteral`<``1``\>]\> ; `cols`: `ZodOptional`<`ZodNumber`\> ; `crop_pos_x`: `ZodOptional`<`ZodNumber`\> ; `crop_pos_y`: `ZodOptional`<`ZodNumber`\> ; `depth_cutoff`: `ZodOptional`<`ZodUnion`<[`ZodLiteral`<``1``\>, `ZodLiteral`<``0``\>]\>\> ; `depth_inversion`: `ZodUnion`<[`ZodLiteral`<``0``\>, `ZodLiteral`<``1``\>]\> ; `depth_loc`: `ZodUnion`<[`ZodLiteral`<``0``\>, `ZodLiteral`<``1``\>, `ZodLiteral`<``2``\>, `ZodLiteral`<``3``\>]\> ; `depthiness`: `ZodEffects`<`ZodNumber`, `number`, `number`\> = DEPTHINESS.range; `filter_mode`: `ZodEffects`<`ZodNumber`, `number`, `number`\> = FILTER\_MODE.range; `focus`: `ZodOptional`<`ZodNumber`\> ; `gaussian_sigma`: `ZodEffects`<`ZodNumber`, `number`, `number`\> = GAUSSIAN\_SIGMA.range; `rows`: `ZodOptional`<`ZodNumber`\> ; `zoom`: `ZodEffects`<`ZodNumber`, `number`, `number`\> = ZOOM.range }, ``"strip"``, `ZodTypeAny`, { `aspect?`: `number` ; `chroma_depth`: ``0`` \| ``1`` ; `cols?`: `number` ; `crop_pos_x?`: `number` ; `crop_pos_y?`: `number` ; `depth_cutoff?`: ``0`` \| ``1`` ; `depth_inversion`: ``0`` \| ``1`` ; `depth_loc`: ``0`` \| ``2`` \| ``1`` \| ``3`` ; `depthiness`: `number` = DEPTHINESS.range; `filter_mode`: `number` = FILTER\_MODE.range; `focus?`: `number` ; `gaussian_sigma`: `number` = GAUSSIAN\_SIGMA.range; `rows?`: `number` ; `zoom`: `number` = ZOOM.range }, { `aspect?`: `number` ; `chroma_depth`: ``0`` \| ``1`` ; `cols?`: `number` ; `crop_pos_x?`: `number` ; `crop_pos_y?`: `number` ; `depth_cutoff?`: ``0`` \| ``1`` ; `depth_inversion`: ``0`` \| ``1`` ; `depth_loc`: ``0`` \| ``2`` \| ``1`` \| ``3`` ; `depthiness`: `number` = DEPTHINESS.range; `filter_mode`: `number` = FILTER\_MODE.range; `focus?`: `number` ; `gaussian_sigma`: `number` = GAUSSIAN\_SIGMA.range; `rows?`: `number` ; `zoom`: `number` = ZOOM.range }\>
• `Const` **hologramParamMap**: `ZodObject`<{ `antiAliasingStrength`: `ZodOptional`<`ZodNumber`\> ; `aspect`: `ZodOptional`<`ZodNumber`\> ; `chroma_depth`: `ZodUnion`<[`ZodLiteral`<``0``\>, `ZodLiteral`<``1``\>]\> ; `cols`: `ZodOptional`<`ZodNumber`\> ; `crop_pos_x`: `ZodOptional`<`ZodNumber`\> ; `crop_pos_y`: `ZodOptional`<`ZodNumber`\> ; `depth_cutoff`: `ZodOptional`<`ZodUnion`<[`ZodLiteral`<``1``\>, `ZodLiteral`<``0``\>]\>\> ; `depth_inversion`: `ZodUnion`<[`ZodLiteral`<``0``\>, `ZodLiteral`<``1``\>]\> ; `depth_loc`: `ZodUnion`<[`ZodLiteral`<``0``\>, `ZodLiteral`<``1``\>, `ZodLiteral`<``2``\>, `ZodLiteral`<``3``\>]\> ; `depthiness`: `ZodEffects`<`ZodNumber`, `number`, `number`\> = DEPTHINESS.range; `filter_mode`: `ZodEffects`<`ZodNumber`, `number`, `number`\> = FILTER\_MODE.range; `focus`: `ZodOptional`<`ZodNumber`\> ; `gaussian_sigma`: `ZodEffects`<`ZodNumber`, `number`, `number`\> = GAUSSIAN\_SIGMA.range; `rows`: `ZodOptional`<`ZodNumber`\> ; `zoom`: `ZodEffects`<`ZodNumber`, `number`, `number`\> = ZOOM.range }, ``"strip"``, `ZodTypeAny`, { `antiAliasingStrength?`: `number` ; `aspect?`: `number` ; `chroma_depth`: ``0`` \| ``1`` ; `cols?`: `number` ; `crop_pos_x?`: `number` ; `crop_pos_y?`: `number` ; `depth_cutoff?`: ``0`` \| ``1`` ; `depth_inversion`: ``0`` \| ``1`` ; `depth_loc`: ``0`` \| ``2`` \| ``1`` \| ``3`` ; `depthiness`: `number` = DEPTHINESS.range; `filter_mode`: `number` = FILTER\_MODE.range; `focus?`: `number` ; `gaussian_sigma`: `number` = GAUSSIAN\_SIGMA.range; `rows?`: `number` ; `zoom`: `number` = ZOOM.range }, { `antiAliasingStrength?`: `number` ; `aspect?`: `number` ; `chroma_depth`: ``0`` \| ``1`` ; `cols?`: `number` ; `crop_pos_x?`: `number` ; `crop_pos_y?`: `number` ; `depth_cutoff?`: ``0`` \| ``1`` ; `depth_inversion`: ``0`` \| ``1`` ; `depth_loc`: ``0`` \| ``2`` \| ``1`` \| ``3`` ; `depthiness`: `number` = DEPTHINESS.range; `filter_mode`: `number` = FILTER\_MODE.range; `focus?`: `number` ; `gaussian_sigma`: `number` = GAUSSIAN\_SIGMA.range; `rows?`: `number` ; `zoom`: `number` = ZOOM.range }\>

___

Expand Down
12 changes: 10 additions & 2 deletions src/library/schemas/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,16 @@ export const GAUSSIAN_SIGMA: defaults = {

export const FILTER_MODE: defaults = {
min: 0,
max: 3,
range: numberRange(0, 3),
max: 7,
range: numberRange(0, 7),
type: "int",
defaultValue: 2,
}

export const AA_STRENGTH: defaults = {
min: -1,
max: 2,
range: numberRange(-1, 2),
type: "float",
defaultValue: 1,
}
2 changes: 2 additions & 0 deletions src/library/schemas/schema.parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const parameterNames = z.union([
z.literal("chroma_depth"),
z.literal("depthiness"),
z.literal("depth_cutoff"),
z.literal("antiAliasingStrength"),
])

export const hologramParamMap = z.object({
Expand All @@ -35,6 +36,7 @@ export const hologramParamMap = z.object({
chroma_depth: z.union([z.literal(0), z.literal(1)]),
depthiness: DEPTHINESS.range,
depth_cutoff: z.union([z.literal(1), z.literal(0)]).optional(),
antiAliasingStrength: z.number().optional(),
})

export type HologramParamMap = z.infer<typeof hologramParamMap>
9 changes: 9 additions & 0 deletions src/react-app/components/Playlist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ export function PlaylistUI({ playlist }: { playlist: Playlist }) {
defaultValue={defaults.FILTER_MODE.defaultValue}
numberType={defaults.FILTER_MODE.type}
/>
<UpdateParams
playlistName={playlist.name}
parameter="antiAliasingStrength"
min={defaults.AA_STRENGTH.min}
max={defaults.AA_STRENGTH.max}

defaultValue={defaults.AA_STRENGTH.defaultValue}
numberType={defaults.AA_STRENGTH.type}
/>
</div>
</div>
</div>
Expand Down
61 changes: 29 additions & 32 deletions src/react-app/components/updateParams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,44 +33,41 @@ export function UpdateParams({

return (
<>
<div style={{
display: "flex",
gap: "1rem",
flexDirection: "row",
alignItems: "center",
width: "100%",
paddingBottom: "1rem",
borderBottom: "2px solid white"
}}>{parameter}
<input
style={{width: "60px"}}
type="number"
value={value}
min={min}
max={max}
step={stepSize}
onChange={(e) => handleChange(parseFloat(e.target.value))}></input>
Value: {value.toFixed(2)}{" "}




<input
type="range"
value={value}
min={min}
max={max}
step={stepSize}
onChange={(e) => handleChange(parseFloat(e.target.value))}></input>

<button
<div
style={{
display: "flex",
gap: "1rem",
flexDirection: "row",
alignItems: "center",
width: "100%",
paddingBottom: "1rem",
borderBottom: "2px solid white",
}}>
{parameter}
<input
style={{ width: "60px" }}
type="number"
value={value}
min={min}
max={max}
step={stepSize}
onChange={(e) => handleChange(parseFloat(e.target.value))}></input>
Value: {value.toFixed(2)}{" "}
<input
type="range"
value={value}
min={min}
max={max}
step={stepSize}
onChange={(e) => handleChange(parseFloat(e.target.value))}></input>
<button
style={{ paddingLeft: "1rem", paddingRight: "1rem", display: "block", width: "180px" }}
onClick={() => {
handleChange(defaultValue)
}}>
reset
</button>
</div>
</div>
</>
)
}