@guilhermebkel/scenec 0.2.0 → 0.2.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/README.md +22 -12
- package/dist/Adapters/FontAdapter.js +5 -1
- package/dist/Commands/BestCommand.d.ts +11 -0
- package/dist/Commands/BestCommand.js +73 -0
- package/dist/Commands/RenderCommand.d.ts +2 -0
- package/dist/Commands/RenderCommand.js +7 -0
- package/dist/Modules/BestModule.d.ts +41 -0
- package/dist/Modules/BestModule.js +159 -0
- package/dist/Modules/CompilationModule.d.ts +5 -0
- package/dist/Modules/CompilationModule.js +92 -19
- package/dist/Modules/CritiqueModule.d.ts +3 -0
- package/dist/Modules/CritiqueModule.js +60 -5
- package/dist/Protocols/AssetProtocol.d.ts +6 -1
- package/dist/Protocols/AssetProtocol.js +17 -1
- package/dist/Protocols/CommandProtocol.d.ts +2 -0
- package/dist/Protocols/CompilationProtocol.d.ts +27 -1
- package/dist/Protocols/CritiqueProtocol.d.ts +17 -1
- package/dist/Protocols/CritiqueProtocol.js +11 -1
- package/dist/Protocols/KitProtocol.d.ts +8 -2
- package/dist/Protocols/KitProtocol.js +8 -2
- package/dist/Protocols/PersonProtocol.d.ts +4 -0
- package/dist/Protocols/PersonProtocol.js +2 -0
- package/dist/Protocols/SceneProtocol.d.ts +204 -5
- package/dist/Protocols/SceneProtocol.js +60 -7
- package/dist/Resources/Assets/BaseAsset.d.ts +1 -0
- package/dist/Resources/Assets/BaseAsset.js +1 -0
- package/dist/Resources/Assets/BigPlantAsset.js +8 -1
- package/dist/Resources/Assets/BlackboardAsset.d.ts +11 -0
- package/dist/Resources/Assets/BlackboardAsset.js +20 -0
- package/dist/Resources/Assets/BushAsset.js +1 -1
- package/dist/Resources/Assets/ChairAsset.d.ts +5 -0
- package/dist/Resources/Assets/ChairAsset.js +23 -0
- package/dist/Resources/Assets/ChatBubbleAsset.d.ts +11 -0
- package/dist/Resources/Assets/ChatBubbleAsset.js +18 -0
- package/dist/Resources/Assets/CloudAsset.js +3 -1
- package/dist/Resources/Assets/ConfettiAsset.d.ts +10 -0
- package/dist/Resources/Assets/ConfettiAsset.js +18 -0
- package/dist/Resources/Assets/CursorAsset.d.ts +11 -0
- package/dist/Resources/Assets/CursorAsset.js +17 -0
- package/dist/Resources/Assets/DeskAsset.js +7 -2
- package/dist/Resources/Assets/FirstAidKitAsset.d.ts +10 -0
- package/dist/Resources/Assets/FirstAidKitAsset.js +19 -0
- package/dist/Resources/Assets/GlobeAsset.d.ts +10 -0
- package/dist/Resources/Assets/GlobeAsset.js +18 -0
- package/dist/Resources/Assets/HouseAsset.js +22 -6
- package/dist/Resources/Assets/LaptopAsset.js +5 -1
- package/dist/Resources/Assets/PlantAsset.js +1 -1
- package/dist/Resources/Assets/PodiumAsset.d.ts +11 -0
- package/dist/Resources/Assets/PodiumAsset.js +20 -0
- package/dist/Resources/Assets/RefrigeratorAsset.d.ts +11 -0
- package/dist/Resources/Assets/RefrigeratorAsset.js +21 -0
- package/dist/Resources/Assets/SinkAsset.d.ts +11 -0
- package/dist/Resources/Assets/SinkAsset.js +21 -0
- package/dist/Resources/Assets/SofaAsset.d.ts +5 -0
- package/dist/Resources/Assets/SofaAsset.js +30 -2
- package/dist/Resources/Assets/StarsAsset.d.ts +6 -0
- package/dist/Resources/Assets/StarsAsset.js +37 -24
- package/dist/Resources/Assets/StethoscopeAsset.d.ts +10 -0
- package/dist/Resources/Assets/StethoscopeAsset.js +18 -0
- package/dist/Resources/Assets/StoveAsset.d.ts +11 -0
- package/dist/Resources/Assets/StoveAsset.js +20 -0
- package/dist/Resources/Assets/ToggleAsset.d.ts +11 -0
- package/dist/Resources/Assets/ToggleAsset.js +21 -0
- package/dist/Resources/Assets/TreeAsset.d.ts +5 -0
- package/dist/Resources/Assets/TreeAsset.js +32 -7
- package/dist/Resources/Assets/WaterCoolerAsset.d.ts +11 -0
- package/dist/Resources/Assets/WaterCoolerAsset.js +20 -0
- package/dist/Resources/Assets/WhiteboardAsset.d.ts +10 -0
- package/dist/Resources/Assets/WhiteboardAsset.js +18 -0
- package/dist/Resources/Kits/BaseKit.d.ts +2 -1
- package/dist/Resources/Kits/BaseKit.js +1 -0
- package/dist/Resources/Kits/ClayKit.d.ts +9 -0
- package/dist/Resources/Kits/ClayKit.js +11 -0
- package/dist/Resources/Kits/DuotoneKit.d.ts +16 -0
- package/dist/Resources/Kits/DuotoneKit.js +18 -0
- package/dist/Resources/Kits/IsometricKit.d.ts +8 -0
- package/dist/Resources/Kits/IsometricKit.js +10 -0
- package/dist/Resources/Kits/OutlineKit.d.ts +3 -0
- package/dist/Resources/Kits/OutlineKit.js +1 -1
- package/dist/Resources/Kits/PaperKit.d.ts +2 -0
- package/dist/Resources/Kits/PaperKit.js +1 -0
- package/dist/Resources/Kits/PosterKit.d.ts +14 -0
- package/dist/Resources/Kits/PosterKit.js +16 -0
- package/dist/Resources/Kits/SketchKit.d.ts +2 -1
- package/dist/Resources/Kits/SketchKit.js +1 -0
- package/dist/Services/AssetService.js +29 -1
- package/dist/Services/BackgroundService.d.ts +10 -2
- package/dist/Services/BackgroundService.js +52 -11
- package/dist/Services/CatalogService.d.ts +1 -0
- package/dist/Services/CatalogService.js +8 -3
- package/dist/Services/ColorCritiqueService.d.ts +42 -0
- package/dist/Services/ColorCritiqueService.js +232 -0
- package/dist/Services/ContextService.js +9 -5
- package/dist/Services/DescriptionService.d.ts +2 -1
- package/dist/Services/DescriptionService.js +8 -2
- package/dist/Services/DetailService.d.ts +7 -0
- package/dist/Services/DetailService.js +18 -0
- package/dist/Services/FocusCritiqueService.d.ts +23 -0
- package/dist/Services/FocusCritiqueService.js +166 -0
- package/dist/Services/FramingService.d.ts +31 -0
- package/dist/Services/FramingService.js +108 -0
- package/dist/Services/GazeService.js +3 -1
- package/dist/Services/GroundDetailService.d.ts +50 -0
- package/dist/Services/GroundDetailService.js +115 -0
- package/dist/Services/KitService.d.ts +11 -2
- package/dist/Services/KitService.js +45 -10
- package/dist/Services/LightingService.d.ts +15 -0
- package/dist/Services/LightingService.js +124 -6
- package/dist/Services/PaletteService.d.ts +108 -0
- package/dist/Services/PaletteService.js +282 -0
- package/dist/Services/PieceService.d.ts +4 -0
- package/dist/Services/PieceService.js +28 -7
- package/dist/Services/PlacementService.js +7 -1
- package/dist/Services/PlaneBackgroundService.d.ts +4 -0
- package/dist/Services/PlaneBackgroundService.js +42 -3
- package/dist/Services/PlaneProjectionService.d.ts +4 -0
- package/dist/Services/PlaneProjectionService.js +33 -4
- package/dist/Services/RasterService.js +20 -3
- package/dist/Services/RidgeService.d.ts +31 -0
- package/dist/Services/RidgeService.js +85 -0
- package/dist/Services/ScaleCritiqueService.d.ts +11 -0
- package/dist/Services/ScaleCritiqueService.js +57 -0
- package/dist/Services/SkyDetailService.d.ts +39 -0
- package/dist/Services/SkyDetailService.js +95 -0
- package/dist/Services/{ContactCritiqueService.d.ts → TangentCritiqueService.d.ts} +10 -6
- package/dist/Services/TangentCritiqueService.js +136 -0
- package/dist/Services/TextService.d.ts +43 -3
- package/dist/Services/TextService.js +288 -32
- package/dist/Services/ThumbnailCritiqueService.d.ts +30 -0
- package/dist/Services/ThumbnailCritiqueService.js +130 -0
- package/dist/Utils/ColorUtil.d.ts +14 -0
- package/dist/Utils/ColorUtil.js +68 -5
- package/dist/Utils/DetailUtil.d.ts +7 -0
- package/dist/Utils/DetailUtil.js +15 -0
- package/dist/Utils/FontMetricsUtil.d.ts +7 -0
- package/dist/Utils/FontMetricsUtil.js +694 -0
- package/dist/Utils/OklabUtil.d.ts +18 -0
- package/dist/Utils/OklabUtil.js +89 -0
- package/dist/Utils/PersonArmUtil.d.ts +13 -1
- package/dist/Utils/PersonArmUtil.js +53 -5
- package/dist/Utils/PersonHeadUtil.js +3 -1
- package/dist/Utils/PersonOutfitUtil.d.ts +16 -0
- package/dist/Utils/PersonOutfitUtil.js +89 -13
- package/dist/Utils/PersonUtil.d.ts +2 -0
- package/dist/Utils/PersonUtil.js +14 -4
- package/dist/Utils/SanitizeUtil.js +1 -0
- package/dist/Utils/ShapeUtil.d.ts +9 -0
- package/dist/Utils/ShapeUtil.js +26 -0
- package/dist/Utils/TypesettingUtil.d.ts +17 -0
- package/dist/Utils/TypesettingUtil.js +92 -0
- package/dist/cli.js +32 -3
- package/dist/render.d.ts +3 -1
- package/dist/render.js +5 -0
- package/fonts/DMSerifDisplay-Regular.ttf +0 -0
- package/fonts/OFL.txt +2 -0
- package/fonts/PatrickHand-Regular.ttf +0 -0
- package/package.json +1 -1
- package/skills/draw-scene/SKILL.md +2 -1
- package/skills/draw-scene/recipes/carousel.yaml +1 -1
- package/skills/draw-scene/recipes/conference-keynote.yaml +43 -0
- package/skills/draw-scene/recipes/product-feature.yaml +41 -0
- package/skills/draw-scene/recipes/product-illustration.yaml +2 -1
- package/skills/draw-scene/references/catalog.md +19 -1
- package/skills/draw-scene/references/dsl.md +24 -6
- package/dist/Services/ContactCritiqueService.js +0 -101
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { Resvg } from "@resvg/resvg-js";
|
|
2
2
|
import { BalanceCritiqueService } from "../Services/BalanceCritiqueService.js";
|
|
3
|
-
import {
|
|
3
|
+
import { ColorCritiqueService } from "../Services/ColorCritiqueService.js";
|
|
4
4
|
import { CoverageCritiqueService } from "../Services/CoverageCritiqueService.js";
|
|
5
|
+
import { FocusCritiqueService } from "../Services/FocusCritiqueService.js";
|
|
5
6
|
import { RasterService } from "../Services/RasterService.js";
|
|
7
|
+
import { ScaleCritiqueService } from "../Services/ScaleCritiqueService.js";
|
|
6
8
|
import { SilhouetteCritiqueService } from "../Services/SilhouetteCritiqueService.js";
|
|
9
|
+
import { TangentCritiqueService } from "../Services/TangentCritiqueService.js";
|
|
10
|
+
import { ThumbnailCritiqueService } from "../Services/ThumbnailCritiqueService.js";
|
|
7
11
|
class CritiqueModule {
|
|
8
12
|
static ANALYSIS_WIDTH = 320;
|
|
13
|
+
static THUMBNAIL_WIDTH = 96;
|
|
9
14
|
static DEFS = /<defs>[\s\S]*?<\/defs>/;
|
|
10
15
|
static critique(input) {
|
|
11
|
-
const { width, height, head, bg, scene, objects, theme, scale, textRects, skip } = input;
|
|
16
|
+
const { width, height, head, bg, scene, objects, theme, scale, textRects, skip, focusId, horizon, setting } = input;
|
|
12
17
|
const factor = CritiqueModule.ANALYSIS_WIDTH / width;
|
|
13
18
|
const render = (inner) => new Resvg(`${head}${inner}</svg>`, {
|
|
14
19
|
fitTo: { mode: "width", value: CritiqueModule.ANALYSIS_WIDTH },
|
|
@@ -17,9 +22,13 @@ class CritiqueModule {
|
|
|
17
22
|
const defs = CritiqueModule.DEFS.exec(bg)?.[0] ?? "";
|
|
18
23
|
const layers = objects.filter((object) => !object.isIgnored).toSorted((first, second) => first.z - second.z).map((object) => ({
|
|
19
24
|
id: object.id,
|
|
25
|
+
asset: object.asset,
|
|
20
26
|
kind: object.kind,
|
|
21
27
|
related: object.related,
|
|
22
|
-
pixels: render(defs + object.body)
|
|
28
|
+
pixels: render(defs + object.body),
|
|
29
|
+
isFocus: object.isFocus ?? false,
|
|
30
|
+
height: object.height ?? 0,
|
|
31
|
+
depth: object.depth ?? null
|
|
23
32
|
}));
|
|
24
33
|
const raster = RasterService.build({
|
|
25
34
|
width: CritiqueModule.ANALYSIS_WIDTH,
|
|
@@ -27,16 +36,62 @@ class CritiqueModule {
|
|
|
27
36
|
factor,
|
|
28
37
|
fullPixels: render(scene),
|
|
29
38
|
backPixels: render(bg),
|
|
30
|
-
layers
|
|
39
|
+
layers,
|
|
40
|
+
horizonRatio: horizon,
|
|
41
|
+
setting,
|
|
42
|
+
focusId
|
|
31
43
|
});
|
|
44
|
+
const thumbnailMessages = skip.includes("thumbnail") ? [] : CritiqueModule.runThumbnailCritique(input, defs);
|
|
32
45
|
const messages = [
|
|
33
46
|
...CoverageCritiqueService.critique(raster, textRects, scale),
|
|
34
47
|
...BalanceCritiqueService.critique(raster, textRects),
|
|
35
48
|
...skip.includes("silhouette") ? [] : SilhouetteCritiqueService.critique(raster, theme),
|
|
36
|
-
...
|
|
49
|
+
...skip.includes("tangent") || skip.includes("contact") ? [] : TangentCritiqueService.critique(raster),
|
|
50
|
+
...skip.includes("focus") ? [] : FocusCritiqueService.critique(raster, focusId),
|
|
51
|
+
...skip.includes("color") ? [] : ColorCritiqueService.critique(raster),
|
|
52
|
+
...skip.includes("scale") ? [] : ScaleCritiqueService.critique(input),
|
|
53
|
+
...thumbnailMessages
|
|
37
54
|
];
|
|
38
55
|
return messages.map((message) => `art: ${message}`);
|
|
39
56
|
}
|
|
57
|
+
static runThumbnailCritique(input, defs) {
|
|
58
|
+
const { width, height, head, scene, objects, focusId, title } = input;
|
|
59
|
+
const thumbnailHeight = Math.max(1, Math.round(height * (CritiqueModule.THUMBNAIL_WIDTH / width)));
|
|
60
|
+
const renderThumbnail = (inner) => new Resvg(`${head}${inner}</svg>`, {
|
|
61
|
+
fitTo: { mode: "width", value: CritiqueModule.THUMBNAIL_WIDTH },
|
|
62
|
+
font: { loadSystemFonts: false }
|
|
63
|
+
}).render().pixels;
|
|
64
|
+
const focusTarget = CritiqueModule.findFocusObject(objects, focusId);
|
|
65
|
+
let focusObject;
|
|
66
|
+
if (focusTarget) {
|
|
67
|
+
focusObject = {
|
|
68
|
+
id: focusTarget.id,
|
|
69
|
+
pixels: renderThumbnail(defs + focusTarget.body)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
return ThumbnailCritiqueService.critique({
|
|
73
|
+
thumbnailPixels: renderThumbnail(scene),
|
|
74
|
+
thumbnailWidth: CritiqueModule.THUMBNAIL_WIDTH,
|
|
75
|
+
thumbnailHeight,
|
|
76
|
+
sceneWidth: width,
|
|
77
|
+
focusObject,
|
|
78
|
+
title
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
static findFocusObject(objects, focusId) {
|
|
82
|
+
if (focusId) {
|
|
83
|
+
const match = objects.find((object) => object.id === focusId || object.id.startsWith(`${focusId}_`));
|
|
84
|
+
if (match) {
|
|
85
|
+
return match;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const flagged = objects.find((object) => object.isFocus);
|
|
89
|
+
if (flagged) {
|
|
90
|
+
return flagged;
|
|
91
|
+
}
|
|
92
|
+
const people = objects.filter((object) => object.asset === "person" && !object.isIgnored);
|
|
93
|
+
return people.toSorted((first, second) => (second.height ?? 0) - (first.height ?? 0))[0];
|
|
94
|
+
}
|
|
40
95
|
}
|
|
41
96
|
export {
|
|
42
97
|
CritiqueModule
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { PersonParams } from "./PersonProtocol.js";
|
|
2
2
|
import type { Theme } from "./ThemeProtocol.js";
|
|
3
|
-
export declare const ASSET_IDS: readonly ["backpack", "ball", "balloons", "beach_towel", "bed", "bench", "bicycle", "big_plant", "bird", "board", "boat", "books", "bookshelf", "building", "burger", "bush", "cabinet", "cables", "cake", "cap", "car", "cat", "chair", "clock", "cloud", "coffee_machine", "counter", "cup", "desk", "desk_slab", "diploma", "dog", "drawer_unit", "fence", "figurine", "finish_flag", "floor_lamp", "flowers", "frame", "fruit_bowl", "glass_shelf", "headphones", "house", "lab", "lamp", "laptop", "laptop_open", "light_switch", "monitor", "moon", "mountain", "office_chair", "palm", "paper_cup", "pendant_lamp", "pennant", "person", "photo_frame", "pine", "pizza", "plant", "plastic_bag", "plate", "rolling_cart", "rug", "sandcastle", "school", "shelf_wall", "sofa", "stage", "star", "stars", "streetlight", "suitcase", "sun", "table", "trash_can", "tree", "trophy", "tumbler", "tv", "tv_stand", "umbrella", "university", "vase_flowers", "window"];
|
|
3
|
+
export declare const ASSET_IDS: readonly ["backpack", "ball", "balloons", "beach_towel", "bed", "bench", "bicycle", "big_plant", "bird", "blackboard", "board", "boat", "books", "bookshelf", "building", "burger", "bush", "cabinet", "cables", "cake", "cap", "car", "cat", "chair", "chat_bubble", "clock", "cloud", "coffee_machine", "confetti", "counter", "cup", "cursor", "desk", "desk_slab", "diploma", "dog", "drawer_unit", "fence", "figurine", "finish_flag", "first_aid_kit", "floor_lamp", "flowers", "frame", "fruit_bowl", "glass_shelf", "globe", "headphones", "house", "lab", "lamp", "laptop", "laptop_open", "light_switch", "monitor", "moon", "mountain", "office_chair", "palm", "paper_cup", "pendant_lamp", "pennant", "person", "photo_frame", "pine", "pizza", "plant", "plastic_bag", "plate", "podium", "refrigerator", "rolling_cart", "rug", "sandcastle", "school", "shelf_wall", "sink", "sofa", "stage", "star", "stars", "stethoscope", "stove", "streetlight", "suitcase", "sun", "table", "toggle", "trash_can", "tree", "trophy", "tumbler", "tv", "tv_stand", "umbrella", "university", "vase_flowers", "water_cooler", "whiteboard", "window"];
|
|
4
|
+
export declare const DETAIL_NAMES: readonly ["low", "mid", "high"];
|
|
5
|
+
export type DetailName = (typeof DETAIL_NAMES)[number];
|
|
4
6
|
export type AssetId = (typeof ASSET_IDS)[number];
|
|
5
7
|
export type Facing = "left" | "right";
|
|
6
8
|
export interface AssetParams extends PersonParams {
|
|
@@ -9,11 +11,13 @@ export interface AssetParams extends PersonParams {
|
|
|
9
11
|
width?: number;
|
|
10
12
|
height?: number;
|
|
11
13
|
facing?: Facing;
|
|
14
|
+
variant?: number | string;
|
|
12
15
|
floors?: number;
|
|
13
16
|
doors?: number;
|
|
14
17
|
drawers?: number;
|
|
15
18
|
thickness?: number;
|
|
16
19
|
seed?: number;
|
|
20
|
+
detail?: DetailName;
|
|
17
21
|
drop?: number;
|
|
18
22
|
style?: string;
|
|
19
23
|
frame?: string;
|
|
@@ -50,6 +54,7 @@ export interface LibraryAsset {
|
|
|
50
54
|
readonly width: number;
|
|
51
55
|
readonly height: number;
|
|
52
56
|
readonly tags?: readonly string[];
|
|
57
|
+
readonly variants?: readonly string[];
|
|
53
58
|
readonly top?: number;
|
|
54
59
|
readonly seat?: number;
|
|
55
60
|
readonly elevation?: number;
|
|
@@ -8,6 +8,7 @@ const ASSET_IDS = [
|
|
|
8
8
|
"bicycle",
|
|
9
9
|
"big_plant",
|
|
10
10
|
"bird",
|
|
11
|
+
"blackboard",
|
|
11
12
|
"board",
|
|
12
13
|
"boat",
|
|
13
14
|
"books",
|
|
@@ -22,11 +23,14 @@ const ASSET_IDS = [
|
|
|
22
23
|
"car",
|
|
23
24
|
"cat",
|
|
24
25
|
"chair",
|
|
26
|
+
"chat_bubble",
|
|
25
27
|
"clock",
|
|
26
28
|
"cloud",
|
|
27
29
|
"coffee_machine",
|
|
30
|
+
"confetti",
|
|
28
31
|
"counter",
|
|
29
32
|
"cup",
|
|
33
|
+
"cursor",
|
|
30
34
|
"desk",
|
|
31
35
|
"desk_slab",
|
|
32
36
|
"diploma",
|
|
@@ -35,11 +39,13 @@ const ASSET_IDS = [
|
|
|
35
39
|
"fence",
|
|
36
40
|
"figurine",
|
|
37
41
|
"finish_flag",
|
|
42
|
+
"first_aid_kit",
|
|
38
43
|
"floor_lamp",
|
|
39
44
|
"flowers",
|
|
40
45
|
"frame",
|
|
41
46
|
"fruit_bowl",
|
|
42
47
|
"glass_shelf",
|
|
48
|
+
"globe",
|
|
43
49
|
"headphones",
|
|
44
50
|
"house",
|
|
45
51
|
"lab",
|
|
@@ -62,19 +68,25 @@ const ASSET_IDS = [
|
|
|
62
68
|
"plant",
|
|
63
69
|
"plastic_bag",
|
|
64
70
|
"plate",
|
|
71
|
+
"podium",
|
|
72
|
+
"refrigerator",
|
|
65
73
|
"rolling_cart",
|
|
66
74
|
"rug",
|
|
67
75
|
"sandcastle",
|
|
68
76
|
"school",
|
|
69
77
|
"shelf_wall",
|
|
78
|
+
"sink",
|
|
70
79
|
"sofa",
|
|
71
80
|
"stage",
|
|
72
81
|
"star",
|
|
73
82
|
"stars",
|
|
83
|
+
"stethoscope",
|
|
84
|
+
"stove",
|
|
74
85
|
"streetlight",
|
|
75
86
|
"suitcase",
|
|
76
87
|
"sun",
|
|
77
88
|
"table",
|
|
89
|
+
"toggle",
|
|
78
90
|
"trash_can",
|
|
79
91
|
"tree",
|
|
80
92
|
"trophy",
|
|
@@ -84,10 +96,14 @@ const ASSET_IDS = [
|
|
|
84
96
|
"umbrella",
|
|
85
97
|
"university",
|
|
86
98
|
"vase_flowers",
|
|
99
|
+
"water_cooler",
|
|
100
|
+
"whiteboard",
|
|
87
101
|
"window"
|
|
88
102
|
];
|
|
103
|
+
const DETAIL_NAMES = ["low", "mid", "high"];
|
|
89
104
|
const ASSET_KINDS = ["ground", "surface", "any", "wall", "sky", "ceiling", "floor", "water"];
|
|
90
105
|
export {
|
|
91
106
|
ASSET_IDS,
|
|
92
|
-
ASSET_KINDS
|
|
107
|
+
ASSET_KINDS,
|
|
108
|
+
DETAIL_NAMES
|
|
93
109
|
};
|
|
@@ -2,7 +2,7 @@ import type { CritiqueName } from "./CritiqueProtocol.js";
|
|
|
2
2
|
import type { CompileResult } from "./ResultProtocol.js";
|
|
3
3
|
import type { KitStyle } from "./KitProtocol.js";
|
|
4
4
|
import type { AssetKind, LibraryAsset } from "./AssetProtocol.js";
|
|
5
|
-
import type { Canvas, SceneObject, SettingName } from "./SceneProtocol.js";
|
|
5
|
+
import type { Canvas, SceneObject, SettingName, TimeName } from "./SceneProtocol.js";
|
|
6
6
|
import type { Theme } from "./ThemeProtocol.js";
|
|
7
7
|
export type Depth = "far" | "mid" | "near";
|
|
8
8
|
export interface LayoutLines {
|
|
@@ -63,6 +63,18 @@ export interface CompilationContext {
|
|
|
63
63
|
lines: LayoutLines;
|
|
64
64
|
unit: number;
|
|
65
65
|
}
|
|
66
|
+
export interface LightShaft {
|
|
67
|
+
windowX: number;
|
|
68
|
+
windowY: number;
|
|
69
|
+
windowWidth: number;
|
|
70
|
+
windowHeight: number;
|
|
71
|
+
floorLeft: number;
|
|
72
|
+
floorRight: number;
|
|
73
|
+
}
|
|
74
|
+
export interface CelestialGlow {
|
|
75
|
+
cx: number;
|
|
76
|
+
cy: number;
|
|
77
|
+
}
|
|
66
78
|
export interface LightState {
|
|
67
79
|
source: number;
|
|
68
80
|
strength: number;
|
|
@@ -71,6 +83,9 @@ export interface LightState {
|
|
|
71
83
|
shadowRgb: [number, number, number];
|
|
72
84
|
isNight: boolean;
|
|
73
85
|
isHatch: boolean;
|
|
86
|
+
time?: TimeName;
|
|
87
|
+
shaft?: LightShaft | null;
|
|
88
|
+
celestialGlow?: CelestialGlow | null;
|
|
74
89
|
}
|
|
75
90
|
export interface HazeLevels {
|
|
76
91
|
far: number;
|
|
@@ -91,6 +106,13 @@ export interface CritiqueObject {
|
|
|
91
106
|
body: string;
|
|
92
107
|
related: string[];
|
|
93
108
|
isIgnored: boolean;
|
|
109
|
+
isFocus?: boolean;
|
|
110
|
+
depth?: Depth | null;
|
|
111
|
+
height?: number;
|
|
112
|
+
}
|
|
113
|
+
export interface CritiqueTitle {
|
|
114
|
+
content: string;
|
|
115
|
+
fontSize: number;
|
|
94
116
|
}
|
|
95
117
|
export interface CritiqueInput {
|
|
96
118
|
width: number;
|
|
@@ -103,6 +125,10 @@ export interface CritiqueInput {
|
|
|
103
125
|
textRects: TextRect[];
|
|
104
126
|
skip: CritiqueName[];
|
|
105
127
|
objects: CritiqueObject[];
|
|
128
|
+
horizon?: number;
|
|
129
|
+
setting?: SettingName;
|
|
130
|
+
focusId?: string;
|
|
131
|
+
title?: CritiqueTitle;
|
|
106
132
|
}
|
|
107
133
|
export interface CompilationOutput {
|
|
108
134
|
result: CompileResult;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { AssetKind } from "./AssetProtocol.js";
|
|
2
|
-
|
|
2
|
+
import type { SettingName } from "./SceneProtocol.js";
|
|
3
|
+
export declare const CRITIQUE_NAMES: readonly ["coverage", "balance", "silhouette", "contact", "tangent", "focus", "color", "scale", "thumbnail"];
|
|
3
4
|
export type CritiqueName = (typeof CRITIQUE_NAMES)[number];
|
|
5
|
+
export type CritiqueDepth = "far" | "mid" | "near";
|
|
4
6
|
export interface PixelBox {
|
|
5
7
|
left: number;
|
|
6
8
|
top: number;
|
|
@@ -9,11 +11,15 @@ export interface PixelBox {
|
|
|
9
11
|
}
|
|
10
12
|
export interface RasterObject {
|
|
11
13
|
id: string;
|
|
14
|
+
asset: string;
|
|
12
15
|
kind: AssetKind;
|
|
13
16
|
related: readonly string[];
|
|
14
17
|
alpha: Uint8Array;
|
|
15
18
|
area: number;
|
|
16
19
|
box: PixelBox;
|
|
20
|
+
isFocus: boolean;
|
|
21
|
+
height: number;
|
|
22
|
+
depth: CritiqueDepth | null;
|
|
17
23
|
}
|
|
18
24
|
export interface Raster {
|
|
19
25
|
width: number;
|
|
@@ -25,12 +31,19 @@ export interface Raster {
|
|
|
25
31
|
backLab: Float32Array;
|
|
26
32
|
objects: RasterObject[];
|
|
27
33
|
owner: Int16Array;
|
|
34
|
+
horizonRatio?: number;
|
|
35
|
+
setting?: SettingName;
|
|
36
|
+
focusId?: string;
|
|
28
37
|
}
|
|
29
38
|
export interface RasterLayer {
|
|
30
39
|
id: string;
|
|
40
|
+
asset: string;
|
|
31
41
|
kind: AssetKind;
|
|
32
42
|
related: readonly string[];
|
|
33
43
|
pixels: Uint8Array;
|
|
44
|
+
isFocus: boolean;
|
|
45
|
+
height: number;
|
|
46
|
+
depth: CritiqueDepth | null;
|
|
34
47
|
}
|
|
35
48
|
export interface RasterSource {
|
|
36
49
|
width: number;
|
|
@@ -39,4 +52,7 @@ export interface RasterSource {
|
|
|
39
52
|
fullPixels: Uint8Array;
|
|
40
53
|
backPixels: Uint8Array;
|
|
41
54
|
layers: RasterLayer[];
|
|
55
|
+
horizonRatio?: number;
|
|
56
|
+
setting?: SettingName;
|
|
57
|
+
focusId?: string;
|
|
42
58
|
}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
const CRITIQUE_NAMES = [
|
|
1
|
+
const CRITIQUE_NAMES = [
|
|
2
|
+
"coverage",
|
|
3
|
+
"balance",
|
|
4
|
+
"silhouette",
|
|
5
|
+
"contact",
|
|
6
|
+
"tangent",
|
|
7
|
+
"focus",
|
|
8
|
+
"color",
|
|
9
|
+
"scale",
|
|
10
|
+
"thumbnail"
|
|
11
|
+
];
|
|
2
12
|
export {
|
|
3
13
|
CRITIQUE_NAMES
|
|
4
14
|
};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { ThemeColorName } from "./ThemeProtocol.js";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const FONT_NAMES: readonly ["sans", "serif", "hand"];
|
|
3
|
+
export type FontName = (typeof FONT_NAMES)[number];
|
|
4
|
+
export declare const KIT_SCENE_NAMES: readonly ["riso", "sketch", "clay", "duotone", "poster"];
|
|
3
5
|
export type KitSceneName = (typeof KIT_SCENE_NAMES)[number];
|
|
4
6
|
export interface KitOutline {
|
|
5
7
|
w: number;
|
|
6
8
|
inner: number;
|
|
9
|
+
wobble?: number;
|
|
10
|
+
weight?: number;
|
|
11
|
+
detailRatio?: number;
|
|
7
12
|
}
|
|
8
13
|
export declare const KIT_TEXTURE_NAMES: readonly ["paper", "fiber"];
|
|
9
14
|
export type KitTextureName = (typeof KIT_TEXTURE_NAMES)[number];
|
|
@@ -21,6 +26,7 @@ export interface KitStyle {
|
|
|
21
26
|
readonly themeColorToColor?: Partial<Record<ThemeColorName, string>>;
|
|
22
27
|
readonly scene?: KitSceneName;
|
|
23
28
|
readonly hasDrop?: boolean;
|
|
29
|
+
readonly font?: FontName;
|
|
24
30
|
}
|
|
25
|
-
export declare const KIT_IDS: readonly ["flat", "hatch", "outline", "paper", "riso", "sketch"];
|
|
31
|
+
export declare const KIT_IDS: readonly ["flat", "hatch", "outline", "paper", "riso", "sketch", "clay", "duotone", "poster", "isometric"];
|
|
26
32
|
export type KitId = (typeof KIT_IDS)[number];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const
|
|
1
|
+
const FONT_NAMES = ["sans", "serif", "hand"];
|
|
2
|
+
const KIT_SCENE_NAMES = ["riso", "sketch", "clay", "duotone", "poster"];
|
|
2
3
|
const KIT_TEXTURE_NAMES = ["paper", "fiber"];
|
|
3
4
|
const KIT_LIGHT_MODES = ["none", "hatch"];
|
|
4
5
|
const KIT_IDS = [
|
|
@@ -7,9 +8,14 @@ const KIT_IDS = [
|
|
|
7
8
|
"outline",
|
|
8
9
|
"paper",
|
|
9
10
|
"riso",
|
|
10
|
-
"sketch"
|
|
11
|
+
"sketch",
|
|
12
|
+
"clay",
|
|
13
|
+
"duotone",
|
|
14
|
+
"poster",
|
|
15
|
+
"isometric"
|
|
11
16
|
];
|
|
12
17
|
export {
|
|
18
|
+
FONT_NAMES,
|
|
13
19
|
KIT_IDS,
|
|
14
20
|
KIT_LIGHT_MODES,
|
|
15
21
|
KIT_SCENE_NAMES,
|
|
@@ -2,6 +2,8 @@ export type Point = [number, number];
|
|
|
2
2
|
export interface PersonParams {
|
|
3
3
|
age?: string;
|
|
4
4
|
build?: string;
|
|
5
|
+
body?: string;
|
|
6
|
+
detail?: string;
|
|
5
7
|
height?: number | string;
|
|
6
8
|
skin?: string;
|
|
7
9
|
hair?: string;
|
|
@@ -38,6 +40,7 @@ export interface Arm {
|
|
|
38
40
|
}
|
|
39
41
|
export declare const AGE_NAMES: readonly ["child", "teen", "adult", "elder"];
|
|
40
42
|
export declare const BUILD_NAMES: readonly ["slim", "average", "broad", "heavy"];
|
|
43
|
+
export declare const BODY_NAMES: readonly ["chibi", "standard", "long"];
|
|
41
44
|
export declare const SKIN_NAMES: readonly ["light", "medium", "tan", "dark", "deep"];
|
|
42
45
|
export declare const HAIR_COLOR_NAMES: readonly ["black", "brown", "blonde", "red", "gray"];
|
|
43
46
|
export declare const HAIR_STYLE_NAMES: readonly ["long", "bun", "curly", "ponytail", "short", "bald"];
|
|
@@ -51,6 +54,7 @@ export declare const OUTFIT_NAMES: readonly ["tshirt", "sweater", "labcoat", "go
|
|
|
51
54
|
export declare const BOTTOM_NAMES: readonly ["pants", "shorts", "skirt", "dress"];
|
|
52
55
|
export type AgeName = (typeof AGE_NAMES)[number];
|
|
53
56
|
export type BuildName = (typeof BUILD_NAMES)[number];
|
|
57
|
+
export type BodyName = (typeof BODY_NAMES)[number];
|
|
54
58
|
export type SkinName = (typeof SKIN_NAMES)[number];
|
|
55
59
|
export type HairColorName = (typeof HAIR_COLOR_NAMES)[number];
|
|
56
60
|
export type HairStyleName = (typeof HAIR_STYLE_NAMES)[number];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const AGE_NAMES = ["child", "teen", "adult", "elder"];
|
|
2
2
|
const BUILD_NAMES = ["slim", "average", "broad", "heavy"];
|
|
3
|
+
const BODY_NAMES = ["chibi", "standard", "long"];
|
|
3
4
|
const SKIN_NAMES = ["light", "medium", "tan", "dark", "deep"];
|
|
4
5
|
const HAIR_COLOR_NAMES = ["black", "brown", "blonde", "red", "gray"];
|
|
5
6
|
const HAIR_STYLE_NAMES = ["long", "bun", "curly", "ponytail", "short", "bald"];
|
|
@@ -26,6 +27,7 @@ const BOTTOM_NAMES = ["pants", "shorts", "skirt", "dress"];
|
|
|
26
27
|
export {
|
|
27
28
|
AGE_NAMES,
|
|
28
29
|
BEND_NAMES,
|
|
30
|
+
BODY_NAMES,
|
|
29
31
|
BOTTOM_NAMES,
|
|
30
32
|
BUILD_NAMES,
|
|
31
33
|
EXPRESSION_NAMES,
|