hyperframes 0.4.7 → 0.4.8
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/cli.js +1444 -222
- package/package.json +4 -4
package/dist/cli.js
CHANGED
|
@@ -54,7 +54,7 @@ var VERSION;
|
|
|
54
54
|
var init_version = __esm({
|
|
55
55
|
"src/version.ts"() {
|
|
56
56
|
"use strict";
|
|
57
|
-
VERSION = true ? "0.4.
|
|
57
|
+
VERSION = true ? "0.4.8" : "0.0.0-dev";
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
|
|
@@ -3479,6 +3479,7 @@ var init_media = __esm({
|
|
|
3479
3479
|
const timedTagPositions = [];
|
|
3480
3480
|
for (const tag of tags) {
|
|
3481
3481
|
if (tag.name === "video" || tag.name === "audio") continue;
|
|
3482
|
+
if (readAttr(tag.raw, "data-composition-id")) continue;
|
|
3482
3483
|
if (readAttr(tag.raw, "data-start")) {
|
|
3483
3484
|
timedTagPositions.push({
|
|
3484
3485
|
name: tag.name,
|
|
@@ -4695,7 +4696,7 @@ var init_hyperframeLinter = __esm({
|
|
|
4695
4696
|
});
|
|
4696
4697
|
|
|
4697
4698
|
// ../core/src/compiler/rewriteSubCompPaths.ts
|
|
4698
|
-
import {
|
|
4699
|
+
import { posix } from "path";
|
|
4699
4700
|
function isAbsoluteOrSpecial(val) {
|
|
4700
4701
|
return !val || val.startsWith("http://") || val.startsWith("https://") || val.startsWith("//") || val.startsWith("data:") || val.startsWith("#");
|
|
4701
4702
|
}
|
|
@@ -4736,10 +4737,11 @@ function rewriteCssAssetUrls(cssText, compSrcPath) {
|
|
|
4736
4737
|
return `url(${quote || ""}${rewritten}${quote || ""})`;
|
|
4737
4738
|
});
|
|
4738
4739
|
}
|
|
4739
|
-
var PATH_ATTRS, CSS_URL_RE;
|
|
4740
|
+
var join, resolve, dirname, PATH_ATTRS, CSS_URL_RE;
|
|
4740
4741
|
var init_rewriteSubCompPaths = __esm({
|
|
4741
4742
|
"../core/src/compiler/rewriteSubCompPaths.ts"() {
|
|
4742
4743
|
"use strict";
|
|
4744
|
+
({ join, resolve, dirname } = posix);
|
|
4743
4745
|
PATH_ATTRS = ["src", "href"];
|
|
4744
4746
|
CSS_URL_RE = /\burl\(\s*(["']?)([^)"']+)\1\s*\)/g;
|
|
4745
4747
|
}
|
|
@@ -15167,7 +15169,7 @@ var init_facades = __esm({
|
|
|
15167
15169
|
});
|
|
15168
15170
|
|
|
15169
15171
|
// ../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/element.js
|
|
15170
|
-
var Level0, level0,
|
|
15172
|
+
var Level0, level0, HTMLElement2;
|
|
15171
15173
|
var init_element3 = __esm({
|
|
15172
15174
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/element.js"() {
|
|
15173
15175
|
"use strict";
|
|
@@ -15192,7 +15194,7 @@ var init_element3 = __esm({
|
|
|
15192
15194
|
element.addEventListener(type, value, false);
|
|
15193
15195
|
}
|
|
15194
15196
|
};
|
|
15195
|
-
|
|
15197
|
+
HTMLElement2 = class extends Element2 {
|
|
15196
15198
|
static get observedAttributes() {
|
|
15197
15199
|
return [];
|
|
15198
15200
|
}
|
|
@@ -15730,7 +15732,7 @@ var init_template_element = __esm({
|
|
|
15730
15732
|
init_register_html_class();
|
|
15731
15733
|
init_element3();
|
|
15732
15734
|
tagName = "template";
|
|
15733
|
-
HTMLTemplateElement = class extends
|
|
15735
|
+
HTMLTemplateElement = class extends HTMLElement2 {
|
|
15734
15736
|
constructor(ownerDocument) {
|
|
15735
15737
|
super(ownerDocument, tagName);
|
|
15736
15738
|
const content = this.ownerDocument.createDocumentFragment();
|
|
@@ -15754,7 +15756,7 @@ var init_html_element = __esm({
|
|
|
15754
15756
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/html-element.js"() {
|
|
15755
15757
|
"use strict";
|
|
15756
15758
|
init_element3();
|
|
15757
|
-
HTMLHtmlElement = class extends
|
|
15759
|
+
HTMLHtmlElement = class extends HTMLElement2 {
|
|
15758
15760
|
constructor(ownerDocument, localName = "html") {
|
|
15759
15761
|
super(ownerDocument, localName);
|
|
15760
15762
|
}
|
|
@@ -15768,8 +15770,8 @@ var init_text_element = __esm({
|
|
|
15768
15770
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/text-element.js"() {
|
|
15769
15771
|
"use strict";
|
|
15770
15772
|
init_element3();
|
|
15771
|
-
({ toString } =
|
|
15772
|
-
TextElement = class extends
|
|
15773
|
+
({ toString } = HTMLElement2.prototype);
|
|
15774
|
+
TextElement = class extends HTMLElement2 {
|
|
15773
15775
|
get innerHTML() {
|
|
15774
15776
|
return this.textContent;
|
|
15775
15777
|
}
|
|
@@ -15862,7 +15864,7 @@ var init_frame_element = __esm({
|
|
|
15862
15864
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/frame-element.js"() {
|
|
15863
15865
|
"use strict";
|
|
15864
15866
|
init_element3();
|
|
15865
|
-
HTMLFrameElement = class extends
|
|
15867
|
+
HTMLFrameElement = class extends HTMLElement2 {
|
|
15866
15868
|
constructor(ownerDocument, localName = "frame") {
|
|
15867
15869
|
super(ownerDocument, localName);
|
|
15868
15870
|
}
|
|
@@ -15879,7 +15881,7 @@ var init_i_frame_element = __esm({
|
|
|
15879
15881
|
init_attributes();
|
|
15880
15882
|
init_element3();
|
|
15881
15883
|
tagName3 = "iframe";
|
|
15882
|
-
HTMLIFrameElement = class extends
|
|
15884
|
+
HTMLIFrameElement = class extends HTMLElement2 {
|
|
15883
15885
|
constructor(ownerDocument, localName = tagName3) {
|
|
15884
15886
|
super(ownerDocument, localName);
|
|
15885
15887
|
}
|
|
@@ -15938,7 +15940,7 @@ var init_object_element = __esm({
|
|
|
15938
15940
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/object-element.js"() {
|
|
15939
15941
|
"use strict";
|
|
15940
15942
|
init_element3();
|
|
15941
|
-
HTMLObjectElement = class extends
|
|
15943
|
+
HTMLObjectElement = class extends HTMLElement2 {
|
|
15942
15944
|
constructor(ownerDocument, localName = "object") {
|
|
15943
15945
|
super(ownerDocument, localName);
|
|
15944
15946
|
}
|
|
@@ -15952,7 +15954,7 @@ var init_head_element = __esm({
|
|
|
15952
15954
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/head-element.js"() {
|
|
15953
15955
|
"use strict";
|
|
15954
15956
|
init_element3();
|
|
15955
|
-
HTMLHeadElement = class extends
|
|
15957
|
+
HTMLHeadElement = class extends HTMLElement2 {
|
|
15956
15958
|
constructor(ownerDocument, localName = "head") {
|
|
15957
15959
|
super(ownerDocument, localName);
|
|
15958
15960
|
}
|
|
@@ -15966,7 +15968,7 @@ var init_body_element = __esm({
|
|
|
15966
15968
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/body-element.js"() {
|
|
15967
15969
|
"use strict";
|
|
15968
15970
|
init_element3();
|
|
15969
|
-
HTMLBodyElement = class extends
|
|
15971
|
+
HTMLBodyElement = class extends HTMLElement2 {
|
|
15970
15972
|
constructor(ownerDocument, localName = "body") {
|
|
15971
15973
|
super(ownerDocument, localName);
|
|
15972
15974
|
}
|
|
@@ -17547,7 +17549,7 @@ var init_time_element = __esm({
|
|
|
17547
17549
|
init_attributes();
|
|
17548
17550
|
init_register_html_class();
|
|
17549
17551
|
init_element3();
|
|
17550
|
-
HTMLTimeElement = class extends
|
|
17552
|
+
HTMLTimeElement = class extends HTMLElement2 {
|
|
17551
17553
|
constructor(ownerDocument, localName = "time") {
|
|
17552
17554
|
super(ownerDocument, localName);
|
|
17553
17555
|
}
|
|
@@ -17571,7 +17573,7 @@ var init_field_set_element = __esm({
|
|
|
17571
17573
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/field-set-element.js"() {
|
|
17572
17574
|
"use strict";
|
|
17573
17575
|
init_element3();
|
|
17574
|
-
HTMLFieldSetElement = class extends
|
|
17576
|
+
HTMLFieldSetElement = class extends HTMLElement2 {
|
|
17575
17577
|
constructor(ownerDocument, localName = "fieldset") {
|
|
17576
17578
|
super(ownerDocument, localName);
|
|
17577
17579
|
}
|
|
@@ -17585,7 +17587,7 @@ var init_embed_element = __esm({
|
|
|
17585
17587
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/embed-element.js"() {
|
|
17586
17588
|
"use strict";
|
|
17587
17589
|
init_element3();
|
|
17588
|
-
HTMLEmbedElement = class extends
|
|
17590
|
+
HTMLEmbedElement = class extends HTMLElement2 {
|
|
17589
17591
|
constructor(ownerDocument, localName = "embed") {
|
|
17590
17592
|
super(ownerDocument, localName);
|
|
17591
17593
|
}
|
|
@@ -17599,7 +17601,7 @@ var init_hr_element = __esm({
|
|
|
17599
17601
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/hr-element.js"() {
|
|
17600
17602
|
"use strict";
|
|
17601
17603
|
init_element3();
|
|
17602
|
-
HTMLHRElement = class extends
|
|
17604
|
+
HTMLHRElement = class extends HTMLElement2 {
|
|
17603
17605
|
constructor(ownerDocument, localName = "hr") {
|
|
17604
17606
|
super(ownerDocument, localName);
|
|
17605
17607
|
}
|
|
@@ -17613,7 +17615,7 @@ var init_progress_element = __esm({
|
|
|
17613
17615
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/progress-element.js"() {
|
|
17614
17616
|
"use strict";
|
|
17615
17617
|
init_element3();
|
|
17616
|
-
HTMLProgressElement = class extends
|
|
17618
|
+
HTMLProgressElement = class extends HTMLElement2 {
|
|
17617
17619
|
constructor(ownerDocument, localName = "progress") {
|
|
17618
17620
|
super(ownerDocument, localName);
|
|
17619
17621
|
}
|
|
@@ -17627,7 +17629,7 @@ var init_paragraph_element = __esm({
|
|
|
17627
17629
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/paragraph-element.js"() {
|
|
17628
17630
|
"use strict";
|
|
17629
17631
|
init_element3();
|
|
17630
|
-
HTMLParagraphElement = class extends
|
|
17632
|
+
HTMLParagraphElement = class extends HTMLElement2 {
|
|
17631
17633
|
constructor(ownerDocument, localName = "p") {
|
|
17632
17634
|
super(ownerDocument, localName);
|
|
17633
17635
|
}
|
|
@@ -17641,7 +17643,7 @@ var init_table_element = __esm({
|
|
|
17641
17643
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/table-element.js"() {
|
|
17642
17644
|
"use strict";
|
|
17643
17645
|
init_element3();
|
|
17644
|
-
HTMLTableElement = class extends
|
|
17646
|
+
HTMLTableElement = class extends HTMLElement2 {
|
|
17645
17647
|
constructor(ownerDocument, localName = "table") {
|
|
17646
17648
|
super(ownerDocument, localName);
|
|
17647
17649
|
}
|
|
@@ -17655,7 +17657,7 @@ var init_frame_set_element = __esm({
|
|
|
17655
17657
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/frame-set-element.js"() {
|
|
17656
17658
|
"use strict";
|
|
17657
17659
|
init_element3();
|
|
17658
|
-
HTMLFrameSetElement = class extends
|
|
17660
|
+
HTMLFrameSetElement = class extends HTMLElement2 {
|
|
17659
17661
|
constructor(ownerDocument, localName = "frameset") {
|
|
17660
17662
|
super(ownerDocument, localName);
|
|
17661
17663
|
}
|
|
@@ -17669,7 +17671,7 @@ var init_li_element = __esm({
|
|
|
17669
17671
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/li-element.js"() {
|
|
17670
17672
|
"use strict";
|
|
17671
17673
|
init_element3();
|
|
17672
|
-
HTMLLIElement = class extends
|
|
17674
|
+
HTMLLIElement = class extends HTMLElement2 {
|
|
17673
17675
|
constructor(ownerDocument, localName = "li") {
|
|
17674
17676
|
super(ownerDocument, localName);
|
|
17675
17677
|
}
|
|
@@ -17683,7 +17685,7 @@ var init_base_element = __esm({
|
|
|
17683
17685
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/base-element.js"() {
|
|
17684
17686
|
"use strict";
|
|
17685
17687
|
init_element3();
|
|
17686
|
-
HTMLBaseElement = class extends
|
|
17688
|
+
HTMLBaseElement = class extends HTMLElement2 {
|
|
17687
17689
|
constructor(ownerDocument, localName = "base") {
|
|
17688
17690
|
super(ownerDocument, localName);
|
|
17689
17691
|
}
|
|
@@ -17697,7 +17699,7 @@ var init_data_list_element = __esm({
|
|
|
17697
17699
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/data-list-element.js"() {
|
|
17698
17700
|
"use strict";
|
|
17699
17701
|
init_element3();
|
|
17700
|
-
HTMLDataListElement = class extends
|
|
17702
|
+
HTMLDataListElement = class extends HTMLElement2 {
|
|
17701
17703
|
constructor(ownerDocument, localName = "datalist") {
|
|
17702
17704
|
super(ownerDocument, localName);
|
|
17703
17705
|
}
|
|
@@ -17714,7 +17716,7 @@ var init_input_element = __esm({
|
|
|
17714
17716
|
init_attributes();
|
|
17715
17717
|
init_element3();
|
|
17716
17718
|
tagName5 = "input";
|
|
17717
|
-
HTMLInputElement = class extends
|
|
17719
|
+
HTMLInputElement = class extends HTMLElement2 {
|
|
17718
17720
|
constructor(ownerDocument, localName = tagName5) {
|
|
17719
17721
|
super(ownerDocument, localName);
|
|
17720
17722
|
}
|
|
@@ -17767,7 +17769,7 @@ var init_param_element = __esm({
|
|
|
17767
17769
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/param-element.js"() {
|
|
17768
17770
|
"use strict";
|
|
17769
17771
|
init_element3();
|
|
17770
|
-
HTMLParamElement = class extends
|
|
17772
|
+
HTMLParamElement = class extends HTMLElement2 {
|
|
17771
17773
|
constructor(ownerDocument, localName = "param") {
|
|
17772
17774
|
super(ownerDocument, localName);
|
|
17773
17775
|
}
|
|
@@ -17781,7 +17783,7 @@ var init_media_element = __esm({
|
|
|
17781
17783
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/media-element.js"() {
|
|
17782
17784
|
"use strict";
|
|
17783
17785
|
init_element3();
|
|
17784
|
-
HTMLMediaElement = class extends
|
|
17786
|
+
HTMLMediaElement = class extends HTMLElement2 {
|
|
17785
17787
|
constructor(ownerDocument, localName = "media") {
|
|
17786
17788
|
super(ownerDocument, localName);
|
|
17787
17789
|
}
|
|
@@ -17795,7 +17797,7 @@ var init_audio_element = __esm({
|
|
|
17795
17797
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/audio-element.js"() {
|
|
17796
17798
|
"use strict";
|
|
17797
17799
|
init_element3();
|
|
17798
|
-
HTMLAudioElement = class extends
|
|
17800
|
+
HTMLAudioElement = class extends HTMLElement2 {
|
|
17799
17801
|
constructor(ownerDocument, localName = "audio") {
|
|
17800
17802
|
super(ownerDocument, localName);
|
|
17801
17803
|
}
|
|
@@ -17811,7 +17813,7 @@ var init_heading_element = __esm({
|
|
|
17811
17813
|
init_register_html_class();
|
|
17812
17814
|
init_element3();
|
|
17813
17815
|
tagName6 = "h1";
|
|
17814
|
-
HTMLHeadingElement = class extends
|
|
17816
|
+
HTMLHeadingElement = class extends HTMLElement2 {
|
|
17815
17817
|
constructor(ownerDocument, localName = tagName6) {
|
|
17816
17818
|
super(ownerDocument, localName);
|
|
17817
17819
|
}
|
|
@@ -17826,7 +17828,7 @@ var init_directory_element = __esm({
|
|
|
17826
17828
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/directory-element.js"() {
|
|
17827
17829
|
"use strict";
|
|
17828
17830
|
init_element3();
|
|
17829
|
-
HTMLDirectoryElement = class extends
|
|
17831
|
+
HTMLDirectoryElement = class extends HTMLElement2 {
|
|
17830
17832
|
constructor(ownerDocument, localName = "dir") {
|
|
17831
17833
|
super(ownerDocument, localName);
|
|
17832
17834
|
}
|
|
@@ -17840,7 +17842,7 @@ var init_quote_element = __esm({
|
|
|
17840
17842
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/quote-element.js"() {
|
|
17841
17843
|
"use strict";
|
|
17842
17844
|
init_element3();
|
|
17843
|
-
HTMLQuoteElement = class extends
|
|
17845
|
+
HTMLQuoteElement = class extends HTMLElement2 {
|
|
17844
17846
|
constructor(ownerDocument, localName = "quote") {
|
|
17845
17847
|
super(ownerDocument, localName);
|
|
17846
17848
|
}
|
|
@@ -17894,7 +17896,7 @@ var init_canvas_element = __esm({
|
|
|
17894
17896
|
init_element3();
|
|
17895
17897
|
({ createCanvas } = import_canvas.default);
|
|
17896
17898
|
tagName7 = "canvas";
|
|
17897
|
-
HTMLCanvasElement = class extends
|
|
17899
|
+
HTMLCanvasElement = class extends HTMLElement2 {
|
|
17898
17900
|
constructor(ownerDocument, localName = tagName7) {
|
|
17899
17901
|
super(ownerDocument, localName);
|
|
17900
17902
|
this[IMAGE] = createCanvas(300, 150);
|
|
@@ -17930,7 +17932,7 @@ var init_legend_element = __esm({
|
|
|
17930
17932
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/legend-element.js"() {
|
|
17931
17933
|
"use strict";
|
|
17932
17934
|
init_element3();
|
|
17933
|
-
HTMLLegendElement = class extends
|
|
17935
|
+
HTMLLegendElement = class extends HTMLElement2 {
|
|
17934
17936
|
constructor(ownerDocument, localName = "legend") {
|
|
17935
17937
|
super(ownerDocument, localName);
|
|
17936
17938
|
}
|
|
@@ -17947,7 +17949,7 @@ var init_option_element = __esm({
|
|
|
17947
17949
|
init_attributes();
|
|
17948
17950
|
init_register_html_class();
|
|
17949
17951
|
tagName8 = "option";
|
|
17950
|
-
HTMLOptionElement = class extends
|
|
17952
|
+
HTMLOptionElement = class extends HTMLElement2 {
|
|
17951
17953
|
constructor(ownerDocument, localName = tagName8) {
|
|
17952
17954
|
super(ownerDocument, localName);
|
|
17953
17955
|
}
|
|
@@ -17979,7 +17981,7 @@ var init_span_element = __esm({
|
|
|
17979
17981
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/span-element.js"() {
|
|
17980
17982
|
"use strict";
|
|
17981
17983
|
init_element3();
|
|
17982
|
-
HTMLSpanElement = class extends
|
|
17984
|
+
HTMLSpanElement = class extends HTMLElement2 {
|
|
17983
17985
|
constructor(ownerDocument, localName = "span") {
|
|
17984
17986
|
super(ownerDocument, localName);
|
|
17985
17987
|
}
|
|
@@ -17993,7 +17995,7 @@ var init_meter_element = __esm({
|
|
|
17993
17995
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/meter-element.js"() {
|
|
17994
17996
|
"use strict";
|
|
17995
17997
|
init_element3();
|
|
17996
|
-
HTMLMeterElement = class extends
|
|
17998
|
+
HTMLMeterElement = class extends HTMLElement2 {
|
|
17997
17999
|
constructor(ownerDocument, localName = "meter") {
|
|
17998
18000
|
super(ownerDocument, localName);
|
|
17999
18001
|
}
|
|
@@ -18007,7 +18009,7 @@ var init_video_element = __esm({
|
|
|
18007
18009
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/video-element.js"() {
|
|
18008
18010
|
"use strict";
|
|
18009
18011
|
init_element3();
|
|
18010
|
-
HTMLVideoElement = class extends
|
|
18012
|
+
HTMLVideoElement = class extends HTMLElement2 {
|
|
18011
18013
|
constructor(ownerDocument, localName = "video") {
|
|
18012
18014
|
super(ownerDocument, localName);
|
|
18013
18015
|
}
|
|
@@ -18021,7 +18023,7 @@ var init_table_cell_element = __esm({
|
|
|
18021
18023
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/table-cell-element.js"() {
|
|
18022
18024
|
"use strict";
|
|
18023
18025
|
init_element3();
|
|
18024
|
-
HTMLTableCellElement = class extends
|
|
18026
|
+
HTMLTableCellElement = class extends HTMLElement2 {
|
|
18025
18027
|
constructor(ownerDocument, localName = "td") {
|
|
18026
18028
|
super(ownerDocument, localName);
|
|
18027
18029
|
}
|
|
@@ -18052,7 +18054,7 @@ var init_output_element = __esm({
|
|
|
18052
18054
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/output-element.js"() {
|
|
18053
18055
|
"use strict";
|
|
18054
18056
|
init_element3();
|
|
18055
|
-
HTMLOutputElement = class extends
|
|
18057
|
+
HTMLOutputElement = class extends HTMLElement2 {
|
|
18056
18058
|
constructor(ownerDocument, localName = "output") {
|
|
18057
18059
|
super(ownerDocument, localName);
|
|
18058
18060
|
}
|
|
@@ -18066,7 +18068,7 @@ var init_table_row_element = __esm({
|
|
|
18066
18068
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/table-row-element.js"() {
|
|
18067
18069
|
"use strict";
|
|
18068
18070
|
init_element3();
|
|
18069
|
-
HTMLTableRowElement = class extends
|
|
18071
|
+
HTMLTableRowElement = class extends HTMLElement2 {
|
|
18070
18072
|
constructor(ownerDocument, localName = "tr") {
|
|
18071
18073
|
super(ownerDocument, localName);
|
|
18072
18074
|
}
|
|
@@ -18080,7 +18082,7 @@ var init_data_element = __esm({
|
|
|
18080
18082
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/data-element.js"() {
|
|
18081
18083
|
"use strict";
|
|
18082
18084
|
init_element3();
|
|
18083
|
-
HTMLDataElement = class extends
|
|
18085
|
+
HTMLDataElement = class extends HTMLElement2 {
|
|
18084
18086
|
constructor(ownerDocument, localName = "data") {
|
|
18085
18087
|
super(ownerDocument, localName);
|
|
18086
18088
|
}
|
|
@@ -18094,7 +18096,7 @@ var init_menu_element = __esm({
|
|
|
18094
18096
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/menu-element.js"() {
|
|
18095
18097
|
"use strict";
|
|
18096
18098
|
init_element3();
|
|
18097
|
-
HTMLMenuElement = class extends
|
|
18099
|
+
HTMLMenuElement = class extends HTMLElement2 {
|
|
18098
18100
|
constructor(ownerDocument, localName = "menu") {
|
|
18099
18101
|
super(ownerDocument, localName);
|
|
18100
18102
|
}
|
|
@@ -18112,7 +18114,7 @@ var init_select_element = __esm({
|
|
|
18112
18114
|
init_element3();
|
|
18113
18115
|
init_node_list();
|
|
18114
18116
|
tagName10 = "select";
|
|
18115
|
-
HTMLSelectElement = class extends
|
|
18117
|
+
HTMLSelectElement = class extends HTMLElement2 {
|
|
18116
18118
|
constructor(ownerDocument, localName = tagName10) {
|
|
18117
18119
|
super(ownerDocument, localName);
|
|
18118
18120
|
}
|
|
@@ -18156,7 +18158,7 @@ var init_br_element = __esm({
|
|
|
18156
18158
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/br-element.js"() {
|
|
18157
18159
|
"use strict";
|
|
18158
18160
|
init_element3();
|
|
18159
|
-
HTMLBRElement = class extends
|
|
18161
|
+
HTMLBRElement = class extends HTMLElement2 {
|
|
18160
18162
|
constructor(ownerDocument, localName = "br") {
|
|
18161
18163
|
super(ownerDocument, localName);
|
|
18162
18164
|
}
|
|
@@ -18173,7 +18175,7 @@ var init_button_element = __esm({
|
|
|
18173
18175
|
init_attributes();
|
|
18174
18176
|
init_element3();
|
|
18175
18177
|
tagName11 = "button";
|
|
18176
|
-
HTMLButtonElement = class extends
|
|
18178
|
+
HTMLButtonElement = class extends HTMLElement2 {
|
|
18177
18179
|
constructor(ownerDocument, localName = tagName11) {
|
|
18178
18180
|
super(ownerDocument, localName);
|
|
18179
18181
|
}
|
|
@@ -18208,7 +18210,7 @@ var init_map_element = __esm({
|
|
|
18208
18210
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/map-element.js"() {
|
|
18209
18211
|
"use strict";
|
|
18210
18212
|
init_element3();
|
|
18211
|
-
HTMLMapElement = class extends
|
|
18213
|
+
HTMLMapElement = class extends HTMLElement2 {
|
|
18212
18214
|
constructor(ownerDocument, localName = "map") {
|
|
18213
18215
|
super(ownerDocument, localName);
|
|
18214
18216
|
}
|
|
@@ -18222,7 +18224,7 @@ var init_opt_group_element = __esm({
|
|
|
18222
18224
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/opt-group-element.js"() {
|
|
18223
18225
|
"use strict";
|
|
18224
18226
|
init_element3();
|
|
18225
|
-
HTMLOptGroupElement = class extends
|
|
18227
|
+
HTMLOptGroupElement = class extends HTMLElement2 {
|
|
18226
18228
|
constructor(ownerDocument, localName = "optgroup") {
|
|
18227
18229
|
super(ownerDocument, localName);
|
|
18228
18230
|
}
|
|
@@ -18236,7 +18238,7 @@ var init_d_list_element = __esm({
|
|
|
18236
18238
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/d-list-element.js"() {
|
|
18237
18239
|
"use strict";
|
|
18238
18240
|
init_element3();
|
|
18239
|
-
HTMLDListElement = class extends
|
|
18241
|
+
HTMLDListElement = class extends HTMLElement2 {
|
|
18240
18242
|
constructor(ownerDocument, localName = "dl") {
|
|
18241
18243
|
super(ownerDocument, localName);
|
|
18242
18244
|
}
|
|
@@ -18300,7 +18302,7 @@ var init_font_element = __esm({
|
|
|
18300
18302
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/font-element.js"() {
|
|
18301
18303
|
"use strict";
|
|
18302
18304
|
init_element3();
|
|
18303
|
-
HTMLFontElement = class extends
|
|
18305
|
+
HTMLFontElement = class extends HTMLElement2 {
|
|
18304
18306
|
constructor(ownerDocument, localName = "font") {
|
|
18305
18307
|
super(ownerDocument, localName);
|
|
18306
18308
|
}
|
|
@@ -18314,7 +18316,7 @@ var init_div_element = __esm({
|
|
|
18314
18316
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/div-element.js"() {
|
|
18315
18317
|
"use strict";
|
|
18316
18318
|
init_element3();
|
|
18317
|
-
HTMLDivElement = class extends
|
|
18319
|
+
HTMLDivElement = class extends HTMLElement2 {
|
|
18318
18320
|
constructor(ownerDocument, localName = "div") {
|
|
18319
18321
|
super(ownerDocument, localName);
|
|
18320
18322
|
}
|
|
@@ -18331,7 +18333,7 @@ var init_link_element = __esm({
|
|
|
18331
18333
|
init_attributes();
|
|
18332
18334
|
init_element3();
|
|
18333
18335
|
tagName13 = "link";
|
|
18334
|
-
HTMLLinkElement = class extends
|
|
18336
|
+
HTMLLinkElement = class extends HTMLElement2 {
|
|
18335
18337
|
constructor(ownerDocument, localName = tagName13) {
|
|
18336
18338
|
super(ownerDocument, localName);
|
|
18337
18339
|
}
|
|
@@ -18387,7 +18389,7 @@ var init_slot_element = __esm({
|
|
|
18387
18389
|
init_element3();
|
|
18388
18390
|
init_register_html_class();
|
|
18389
18391
|
tagName14 = "slot";
|
|
18390
|
-
HTMLSlotElement = class extends
|
|
18392
|
+
HTMLSlotElement = class extends HTMLElement2 {
|
|
18391
18393
|
constructor(ownerDocument, localName = tagName14) {
|
|
18392
18394
|
super(ownerDocument, localName);
|
|
18393
18395
|
}
|
|
@@ -18438,7 +18440,7 @@ var init_form_element = __esm({
|
|
|
18438
18440
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/form-element.js"() {
|
|
18439
18441
|
"use strict";
|
|
18440
18442
|
init_element3();
|
|
18441
|
-
HTMLFormElement = class extends
|
|
18443
|
+
HTMLFormElement = class extends HTMLElement2 {
|
|
18442
18444
|
constructor(ownerDocument, localName = "form") {
|
|
18443
18445
|
super(ownerDocument, localName);
|
|
18444
18446
|
}
|
|
@@ -18455,7 +18457,7 @@ var init_image_element = __esm({
|
|
|
18455
18457
|
init_attributes();
|
|
18456
18458
|
init_element3();
|
|
18457
18459
|
tagName15 = "img";
|
|
18458
|
-
HTMLImageElement = class extends
|
|
18460
|
+
HTMLImageElement = class extends HTMLElement2 {
|
|
18459
18461
|
constructor(ownerDocument, localName = tagName15) {
|
|
18460
18462
|
super(ownerDocument, localName);
|
|
18461
18463
|
}
|
|
@@ -18514,7 +18516,7 @@ var init_pre_element = __esm({
|
|
|
18514
18516
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/pre-element.js"() {
|
|
18515
18517
|
"use strict";
|
|
18516
18518
|
init_element3();
|
|
18517
|
-
HTMLPreElement = class extends
|
|
18519
|
+
HTMLPreElement = class extends HTMLElement2 {
|
|
18518
18520
|
constructor(ownerDocument, localName = "pre") {
|
|
18519
18521
|
super(ownerDocument, localName);
|
|
18520
18522
|
}
|
|
@@ -18528,7 +18530,7 @@ var init_u_list_element = __esm({
|
|
|
18528
18530
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/u-list-element.js"() {
|
|
18529
18531
|
"use strict";
|
|
18530
18532
|
init_element3();
|
|
18531
|
-
HTMLUListElement = class extends
|
|
18533
|
+
HTMLUListElement = class extends HTMLElement2 {
|
|
18532
18534
|
constructor(ownerDocument, localName = "ul") {
|
|
18533
18535
|
super(ownerDocument, localName);
|
|
18534
18536
|
}
|
|
@@ -18545,7 +18547,7 @@ var init_meta_element = __esm({
|
|
|
18545
18547
|
init_register_html_class();
|
|
18546
18548
|
init_attributes();
|
|
18547
18549
|
tagName16 = "meta";
|
|
18548
|
-
HTMLMetaElement = class extends
|
|
18550
|
+
HTMLMetaElement = class extends HTMLElement2 {
|
|
18549
18551
|
constructor(ownerDocument, localName = tagName16) {
|
|
18550
18552
|
super(ownerDocument, localName);
|
|
18551
18553
|
}
|
|
@@ -18592,7 +18594,7 @@ var init_picture_element = __esm({
|
|
|
18592
18594
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/picture-element.js"() {
|
|
18593
18595
|
"use strict";
|
|
18594
18596
|
init_element3();
|
|
18595
|
-
HTMLPictureElement = class extends
|
|
18597
|
+
HTMLPictureElement = class extends HTMLElement2 {
|
|
18596
18598
|
constructor(ownerDocument, localName = "picture") {
|
|
18597
18599
|
super(ownerDocument, localName);
|
|
18598
18600
|
}
|
|
@@ -18606,7 +18608,7 @@ var init_area_element = __esm({
|
|
|
18606
18608
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/area-element.js"() {
|
|
18607
18609
|
"use strict";
|
|
18608
18610
|
init_element3();
|
|
18609
|
-
HTMLAreaElement = class extends
|
|
18611
|
+
HTMLAreaElement = class extends HTMLElement2 {
|
|
18610
18612
|
constructor(ownerDocument, localName = "area") {
|
|
18611
18613
|
super(ownerDocument, localName);
|
|
18612
18614
|
}
|
|
@@ -18620,7 +18622,7 @@ var init_o_list_element = __esm({
|
|
|
18620
18622
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/o-list-element.js"() {
|
|
18621
18623
|
"use strict";
|
|
18622
18624
|
init_element3();
|
|
18623
|
-
HTMLOListElement = class extends
|
|
18625
|
+
HTMLOListElement = class extends HTMLElement2 {
|
|
18624
18626
|
constructor(ownerDocument, localName = "ol") {
|
|
18625
18627
|
super(ownerDocument, localName);
|
|
18626
18628
|
}
|
|
@@ -18634,7 +18636,7 @@ var init_table_caption_element = __esm({
|
|
|
18634
18636
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/table-caption-element.js"() {
|
|
18635
18637
|
"use strict";
|
|
18636
18638
|
init_element3();
|
|
18637
|
-
HTMLTableCaptionElement = class extends
|
|
18639
|
+
HTMLTableCaptionElement = class extends HTMLElement2 {
|
|
18638
18640
|
constructor(ownerDocument, localName = "caption") {
|
|
18639
18641
|
super(ownerDocument, localName);
|
|
18640
18642
|
}
|
|
@@ -18651,7 +18653,7 @@ var init_anchor_element = __esm({
|
|
|
18651
18653
|
init_attributes();
|
|
18652
18654
|
init_element3();
|
|
18653
18655
|
tagName17 = "a";
|
|
18654
|
-
HTMLAnchorElement = class extends
|
|
18656
|
+
HTMLAnchorElement = class extends HTMLElement2 {
|
|
18655
18657
|
constructor(ownerDocument, localName = tagName17) {
|
|
18656
18658
|
super(ownerDocument, localName);
|
|
18657
18659
|
}
|
|
@@ -18699,7 +18701,7 @@ var init_label_element = __esm({
|
|
|
18699
18701
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/label-element.js"() {
|
|
18700
18702
|
"use strict";
|
|
18701
18703
|
init_element3();
|
|
18702
|
-
HTMLLabelElement = class extends
|
|
18704
|
+
HTMLLabelElement = class extends HTMLElement2 {
|
|
18703
18705
|
constructor(ownerDocument, localName = "label") {
|
|
18704
18706
|
super(ownerDocument, localName);
|
|
18705
18707
|
}
|
|
@@ -18713,7 +18715,7 @@ var init_unknown_element = __esm({
|
|
|
18713
18715
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/unknown-element.js"() {
|
|
18714
18716
|
"use strict";
|
|
18715
18717
|
init_element3();
|
|
18716
|
-
HTMLUnknownElement = class extends
|
|
18718
|
+
HTMLUnknownElement = class extends HTMLElement2 {
|
|
18717
18719
|
constructor(ownerDocument, localName = "unknown") {
|
|
18718
18720
|
super(ownerDocument, localName);
|
|
18719
18721
|
}
|
|
@@ -18727,7 +18729,7 @@ var init_mod_element = __esm({
|
|
|
18727
18729
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/mod-element.js"() {
|
|
18728
18730
|
"use strict";
|
|
18729
18731
|
init_element3();
|
|
18730
|
-
HTMLModElement = class extends
|
|
18732
|
+
HTMLModElement = class extends HTMLElement2 {
|
|
18731
18733
|
constructor(ownerDocument, localName = "mod") {
|
|
18732
18734
|
super(ownerDocument, localName);
|
|
18733
18735
|
}
|
|
@@ -18741,7 +18743,7 @@ var init_details_element = __esm({
|
|
|
18741
18743
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/details-element.js"() {
|
|
18742
18744
|
"use strict";
|
|
18743
18745
|
init_element3();
|
|
18744
|
-
HTMLDetailsElement = class extends
|
|
18746
|
+
HTMLDetailsElement = class extends HTMLElement2 {
|
|
18745
18747
|
constructor(ownerDocument, localName = "details") {
|
|
18746
18748
|
super(ownerDocument, localName);
|
|
18747
18749
|
}
|
|
@@ -18758,7 +18760,7 @@ var init_source_element = __esm({
|
|
|
18758
18760
|
init_attributes();
|
|
18759
18761
|
init_element3();
|
|
18760
18762
|
tagName18 = "source";
|
|
18761
|
-
HTMLSourceElement = class extends
|
|
18763
|
+
HTMLSourceElement = class extends HTMLElement2 {
|
|
18762
18764
|
constructor(ownerDocument, localName = tagName18) {
|
|
18763
18765
|
super(ownerDocument, localName);
|
|
18764
18766
|
}
|
|
@@ -18799,7 +18801,7 @@ var init_track_element = __esm({
|
|
|
18799
18801
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/track-element.js"() {
|
|
18800
18802
|
"use strict";
|
|
18801
18803
|
init_element3();
|
|
18802
|
-
HTMLTrackElement = class extends
|
|
18804
|
+
HTMLTrackElement = class extends HTMLElement2 {
|
|
18803
18805
|
constructor(ownerDocument, localName = "track") {
|
|
18804
18806
|
super(ownerDocument, localName);
|
|
18805
18807
|
}
|
|
@@ -18813,7 +18815,7 @@ var init_marquee_element = __esm({
|
|
|
18813
18815
|
"../../node_modules/.bun/linkedom@0.18.12/node_modules/linkedom/esm/html/marquee-element.js"() {
|
|
18814
18816
|
"use strict";
|
|
18815
18817
|
init_element3();
|
|
18816
|
-
HTMLMarqueeElement = class extends
|
|
18818
|
+
HTMLMarqueeElement = class extends HTMLElement2 {
|
|
18817
18819
|
constructor(ownerDocument, localName = "marquee") {
|
|
18818
18820
|
super(ownerDocument, localName);
|
|
18819
18821
|
}
|
|
@@ -18895,7 +18897,7 @@ var init_html_classes = __esm({
|
|
|
18895
18897
|
init_track_element();
|
|
18896
18898
|
init_marquee_element();
|
|
18897
18899
|
HTMLClasses = {
|
|
18898
|
-
HTMLElement,
|
|
18900
|
+
HTMLElement: HTMLElement2,
|
|
18899
18901
|
HTMLTemplateElement,
|
|
18900
18902
|
HTMLHtmlElement,
|
|
18901
18903
|
HTMLScriptElement,
|
|
@@ -19526,7 +19528,7 @@ var init_document2 = __esm({
|
|
|
19526
19528
|
return element;
|
|
19527
19529
|
}
|
|
19528
19530
|
}
|
|
19529
|
-
return new
|
|
19531
|
+
return new HTMLElement2(ownerDocument, localName);
|
|
19530
19532
|
};
|
|
19531
19533
|
HTMLDocument = class extends Document2 {
|
|
19532
19534
|
constructor() {
|
|
@@ -20804,6 +20806,13 @@ async function initTransparentBackground(page) {
|
|
|
20804
20806
|
await client.send("Emulation.setDefaultBackgroundColorOverride", {
|
|
20805
20807
|
color: { r: 0, g: 0, b: 0, a: 0 }
|
|
20806
20808
|
});
|
|
20809
|
+
await page.evaluate((styleId) => {
|
|
20810
|
+
if (document.getElementById(styleId)) return;
|
|
20811
|
+
const style = document.createElement("style");
|
|
20812
|
+
style.id = styleId;
|
|
20813
|
+
style.textContent = "html,body,[data-composition-id]{background:transparent !important;background-color:transparent !important;background-image:none !important;}";
|
|
20814
|
+
document.head.appendChild(style);
|
|
20815
|
+
}, TRANSPARENT_BG_STYLE_ID);
|
|
20807
20816
|
}
|
|
20808
20817
|
async function captureAlphaPng(page, width, height) {
|
|
20809
20818
|
const client = await getCdpSession(page);
|
|
@@ -20817,6 +20826,56 @@ async function captureAlphaPng(page, width, height) {
|
|
|
20817
20826
|
});
|
|
20818
20827
|
return Buffer.from(result.data, "base64");
|
|
20819
20828
|
}
|
|
20829
|
+
async function applyDomLayerMask(page, showIds, extraHideIds) {
|
|
20830
|
+
await page.evaluate(
|
|
20831
|
+
(args) => {
|
|
20832
|
+
const existing = document.getElementById(args.styleId);
|
|
20833
|
+
if (existing) existing.remove();
|
|
20834
|
+
const showSelectors = [];
|
|
20835
|
+
for (const id of args.show) {
|
|
20836
|
+
const escaped = CSS.escape(id);
|
|
20837
|
+
showSelectors.push(`#${escaped}`, `#${escaped} *`);
|
|
20838
|
+
const renderEscaped = CSS.escape(`__render_frame_${id}__`);
|
|
20839
|
+
showSelectors.push(`#${renderEscaped}`, `#${renderEscaped} *`);
|
|
20840
|
+
}
|
|
20841
|
+
const massHideRule = "body *{visibility:hidden !important;}";
|
|
20842
|
+
const showRule = showSelectors.length === 0 ? "" : `${showSelectors.join(",")}{visibility:visible !important;}`;
|
|
20843
|
+
const style = document.createElement("style");
|
|
20844
|
+
style.id = args.styleId;
|
|
20845
|
+
style.textContent = `${massHideRule}
|
|
20846
|
+
${showRule}`;
|
|
20847
|
+
document.head.appendChild(style);
|
|
20848
|
+
for (const id of args.hide) {
|
|
20849
|
+
const el = document.getElementById(id);
|
|
20850
|
+
if (el) {
|
|
20851
|
+
el.style.setProperty("visibility", "hidden", "important");
|
|
20852
|
+
}
|
|
20853
|
+
const img = document.getElementById(`__render_frame_${id}__`);
|
|
20854
|
+
if (img) {
|
|
20855
|
+
img.style.setProperty("visibility", "hidden", "important");
|
|
20856
|
+
}
|
|
20857
|
+
}
|
|
20858
|
+
},
|
|
20859
|
+
{ show: showIds, hide: extraHideIds, styleId: DOM_LAYER_MASK_STYLE_ID }
|
|
20860
|
+
);
|
|
20861
|
+
}
|
|
20862
|
+
async function removeDomLayerMask(page, extraHideIds) {
|
|
20863
|
+
await page.evaluate(
|
|
20864
|
+
(args) => {
|
|
20865
|
+
const style = document.getElementById(args.styleId);
|
|
20866
|
+
if (style) style.remove();
|
|
20867
|
+
for (const id of args.hide) {
|
|
20868
|
+
const el = document.getElementById(id);
|
|
20869
|
+
if (el) {
|
|
20870
|
+
el.style.removeProperty("visibility");
|
|
20871
|
+
}
|
|
20872
|
+
const img = document.getElementById(`__render_frame_${id}__`);
|
|
20873
|
+
if (img) img.style.removeProperty("visibility");
|
|
20874
|
+
}
|
|
20875
|
+
},
|
|
20876
|
+
{ hide: extraHideIds, styleId: DOM_LAYER_MASK_STYLE_ID }
|
|
20877
|
+
);
|
|
20878
|
+
}
|
|
20820
20879
|
async function injectVideoFramesBatch(page, updates) {
|
|
20821
20880
|
if (updates.length === 0) return;
|
|
20822
20881
|
await page.evaluate(
|
|
@@ -20857,6 +20916,7 @@ async function injectVideoFramesBatch(page, updates) {
|
|
|
20857
20916
|
img.style.objectPosition = computedStyle.objectPosition;
|
|
20858
20917
|
img.style.zIndex = computedStyle.zIndex;
|
|
20859
20918
|
for (const property of visualProperties) {
|
|
20919
|
+
if (property === "opacity") continue;
|
|
20860
20920
|
if (sourceIsStatic && (property === "top" || property === "left" || property === "right" || property === "bottom" || property === "inset")) {
|
|
20861
20921
|
continue;
|
|
20862
20922
|
}
|
|
@@ -20909,7 +20969,7 @@ async function syncVideoFrameVisibility(page, activeVideoIds) {
|
|
|
20909
20969
|
}
|
|
20910
20970
|
}, activeVideoIds);
|
|
20911
20971
|
}
|
|
20912
|
-
var cdpSessionCache, lastFrameCache, PENDING_FRAME_RETRIES;
|
|
20972
|
+
var cdpSessionCache, lastFrameCache, PENDING_FRAME_RETRIES, TRANSPARENT_BG_STYLE_ID, DOM_LAYER_MASK_STYLE_ID;
|
|
20913
20973
|
var init_screenshotService = __esm({
|
|
20914
20974
|
"../engine/src/services/screenshotService.ts"() {
|
|
20915
20975
|
"use strict";
|
|
@@ -20917,6 +20977,8 @@ var init_screenshotService = __esm({
|
|
|
20917
20977
|
cdpSessionCache = /* @__PURE__ */ new WeakMap();
|
|
20918
20978
|
lastFrameCache = /* @__PURE__ */ new WeakMap();
|
|
20919
20979
|
PENDING_FRAME_RETRIES = 5;
|
|
20980
|
+
TRANSPARENT_BG_STYLE_ID = "__hf_transparent_bg__";
|
|
20981
|
+
DOM_LAYER_MASK_STYLE_ID = "__hf_dom_layer_mask__";
|
|
20920
20982
|
}
|
|
20921
20983
|
});
|
|
20922
20984
|
|
|
@@ -22311,10 +22373,10 @@ import { join as join20, extname as extname4 } from "path";
|
|
|
22311
22373
|
import { Readable } from "stream";
|
|
22312
22374
|
import { finished } from "stream/promises";
|
|
22313
22375
|
function getFilenameFromUrl(url) {
|
|
22314
|
-
const
|
|
22376
|
+
const hash2 = createHash("md5").update(url).digest("hex").slice(0, 12);
|
|
22315
22377
|
const urlObj = new URL(url);
|
|
22316
22378
|
const ext = extname4(urlObj.pathname) || ".mp4";
|
|
22317
|
-
return `download_${
|
|
22379
|
+
return `download_${hash2}${ext}`;
|
|
22318
22380
|
}
|
|
22319
22381
|
async function downloadToTemp(url, destDir, timeoutMs = 3e5) {
|
|
22320
22382
|
const cachedPath = downloadPathCache.get(url);
|
|
@@ -22921,14 +22983,103 @@ async function queryElementStacking(page, nativeHdrVideoIds) {
|
|
|
22921
22983
|
}
|
|
22922
22984
|
return 0;
|
|
22923
22985
|
}
|
|
22986
|
+
function getEffectiveBorderRadius(node) {
|
|
22987
|
+
function resolveRadius(value, el) {
|
|
22988
|
+
if (value.includes("%")) {
|
|
22989
|
+
const pct = parseFloat(value) / 100;
|
|
22990
|
+
const htmlEl = el;
|
|
22991
|
+
const w = htmlEl.offsetWidth || 0;
|
|
22992
|
+
const h3 = htmlEl.offsetHeight || 0;
|
|
22993
|
+
return pct * Math.min(w, h3);
|
|
22994
|
+
}
|
|
22995
|
+
return parseFloat(value) || 0;
|
|
22996
|
+
}
|
|
22997
|
+
const selfCs = window.getComputedStyle(node);
|
|
22998
|
+
const selfRadii = [
|
|
22999
|
+
resolveRadius(selfCs.borderTopLeftRadius, node),
|
|
23000
|
+
resolveRadius(selfCs.borderTopRightRadius, node),
|
|
23001
|
+
resolveRadius(selfCs.borderBottomRightRadius, node),
|
|
23002
|
+
resolveRadius(selfCs.borderBottomLeftRadius, node)
|
|
23003
|
+
];
|
|
23004
|
+
if (selfRadii[0] > 0 || selfRadii[1] > 0 || selfRadii[2] > 0 || selfRadii[3] > 0) {
|
|
23005
|
+
return selfRadii;
|
|
23006
|
+
}
|
|
23007
|
+
let current = node.parentElement;
|
|
23008
|
+
while (current) {
|
|
23009
|
+
const cs = window.getComputedStyle(current);
|
|
23010
|
+
if (cs.overflow !== "visible") {
|
|
23011
|
+
const tl = resolveRadius(cs.borderTopLeftRadius, current);
|
|
23012
|
+
const tr = resolveRadius(cs.borderTopRightRadius, current);
|
|
23013
|
+
const brr = resolveRadius(cs.borderBottomRightRadius, current);
|
|
23014
|
+
const bl = resolveRadius(cs.borderBottomLeftRadius, current);
|
|
23015
|
+
if (tl > 0 || tr > 0 || brr > 0 || bl > 0) {
|
|
23016
|
+
return [tl, tr, brr, bl];
|
|
23017
|
+
}
|
|
23018
|
+
}
|
|
23019
|
+
current = current.parentElement;
|
|
23020
|
+
}
|
|
23021
|
+
return [0, 0, 0, 0];
|
|
23022
|
+
}
|
|
23023
|
+
function getEffectiveOpacity(node) {
|
|
23024
|
+
let opacity = 1;
|
|
23025
|
+
let current = node;
|
|
23026
|
+
while (current) {
|
|
23027
|
+
const cs = window.getComputedStyle(current);
|
|
23028
|
+
const val = parseFloat(cs.opacity);
|
|
23029
|
+
opacity *= Number.isNaN(val) ? 1 : val;
|
|
23030
|
+
current = current.parentElement;
|
|
23031
|
+
}
|
|
23032
|
+
return opacity;
|
|
23033
|
+
}
|
|
23034
|
+
function getViewportMatrix(node) {
|
|
23035
|
+
const chain = [];
|
|
23036
|
+
let current = node;
|
|
23037
|
+
while (current instanceof HTMLElement) {
|
|
23038
|
+
chain.push(current);
|
|
23039
|
+
const next = current.offsetParent ?? current.parentElement;
|
|
23040
|
+
if (next === current) break;
|
|
23041
|
+
current = next;
|
|
23042
|
+
}
|
|
23043
|
+
let mat = new DOMMatrix();
|
|
23044
|
+
for (let i2 = chain.length - 1; i2 >= 0; i2--) {
|
|
23045
|
+
const htmlEl = chain[i2];
|
|
23046
|
+
if (!htmlEl) continue;
|
|
23047
|
+
mat = mat.translate(htmlEl.offsetLeft, htmlEl.offsetTop);
|
|
23048
|
+
const cs = window.getComputedStyle(htmlEl);
|
|
23049
|
+
if (cs.transform && cs.transform !== "none") {
|
|
23050
|
+
const origin = cs.transformOrigin.split(" ");
|
|
23051
|
+
const ox = resolveLength(origin[0] ?? "0", htmlEl.offsetWidth);
|
|
23052
|
+
const oy = resolveLength(origin[1] ?? "0", htmlEl.offsetHeight);
|
|
23053
|
+
try {
|
|
23054
|
+
const t3 = new DOMMatrix(cs.transform);
|
|
23055
|
+
if (Number.isFinite(t3.a) && Number.isFinite(t3.b) && Number.isFinite(t3.c) && Number.isFinite(t3.d) && Number.isFinite(t3.e) && Number.isFinite(t3.f)) {
|
|
23056
|
+
mat = mat.translate(ox, oy).multiply(t3).translate(-ox, -oy);
|
|
23057
|
+
}
|
|
23058
|
+
} catch {
|
|
23059
|
+
}
|
|
23060
|
+
}
|
|
23061
|
+
}
|
|
23062
|
+
return mat.toString();
|
|
23063
|
+
}
|
|
23064
|
+
function resolveLength(value, basis) {
|
|
23065
|
+
if (value.endsWith("%")) {
|
|
23066
|
+
const pct = parseFloat(value) / 100;
|
|
23067
|
+
return Number.isFinite(pct) ? pct * basis : 0;
|
|
23068
|
+
}
|
|
23069
|
+
const n = parseFloat(value);
|
|
23070
|
+
return Number.isFinite(n) ? n : 0;
|
|
23071
|
+
}
|
|
22924
23072
|
for (const el of elements) {
|
|
22925
23073
|
const id = el.id;
|
|
22926
23074
|
if (!id) continue;
|
|
22927
23075
|
const rect = el.getBoundingClientRect();
|
|
22928
23076
|
const style = window.getComputedStyle(el);
|
|
22929
23077
|
const zIndex = getEffectiveZIndex(el);
|
|
22930
|
-
const
|
|
23078
|
+
const isHdrEl = hdrSet.has(id);
|
|
23079
|
+
const opacityStartNode = isHdrEl ? el.parentElement : el;
|
|
23080
|
+
const opacity = opacityStartNode ? getEffectiveOpacity(opacityStartNode) : 1;
|
|
22931
23081
|
const visible = style.visibility !== "hidden" && style.display !== "none" && rect.width > 0 && rect.height > 0;
|
|
23082
|
+
const htmlEl = el instanceof HTMLElement ? el : null;
|
|
22932
23083
|
results.push({
|
|
22933
23084
|
id,
|
|
22934
23085
|
zIndex,
|
|
@@ -22936,9 +23087,16 @@ async function queryElementStacking(page, nativeHdrVideoIds) {
|
|
|
22936
23087
|
y: Math.round(rect.y),
|
|
22937
23088
|
width: Math.round(rect.width),
|
|
22938
23089
|
height: Math.round(rect.height),
|
|
23090
|
+
layoutWidth: htmlEl?.offsetWidth || Math.round(rect.width),
|
|
23091
|
+
layoutHeight: htmlEl?.offsetHeight || Math.round(rect.height),
|
|
22939
23092
|
opacity,
|
|
22940
23093
|
visible,
|
|
22941
|
-
isHdr: hdrSet.has(id)
|
|
23094
|
+
isHdr: hdrSet.has(id),
|
|
23095
|
+
// For HDR elements, use the full accumulated viewport matrix so the
|
|
23096
|
+
// affine blit can apply rotation/scale/translate properly. For DOM
|
|
23097
|
+
// elements, the element-level transform is sufficient for reference.
|
|
23098
|
+
transform: isHdrEl ? getViewportMatrix(el) : style.transform || "none",
|
|
23099
|
+
borderRadius: isHdrEl ? getEffectiveBorderRadius(el) : [0, 0, 0, 0]
|
|
22942
23100
|
});
|
|
22943
23101
|
}
|
|
22944
23102
|
return results;
|
|
@@ -23862,6 +24020,99 @@ function blitRgb48leRegion(canvas, source, dx, dy, sw, sh, canvasWidth, canvasHe
|
|
|
23862
24020
|
}
|
|
23863
24021
|
}
|
|
23864
24022
|
}
|
|
24023
|
+
function blitRgb48leAffine(canvas, source, matrix, srcW, srcH, canvasW, canvasH, opacity, borderRadius) {
|
|
24024
|
+
const a = matrix[0];
|
|
24025
|
+
const b = matrix[1];
|
|
24026
|
+
const c2 = matrix[2];
|
|
24027
|
+
const d = matrix[3];
|
|
24028
|
+
const tx = matrix[4];
|
|
24029
|
+
const ty = matrix[5];
|
|
24030
|
+
if (a === void 0 || b === void 0 || c2 === void 0 || d === void 0 || tx === void 0 || ty === void 0)
|
|
24031
|
+
return;
|
|
24032
|
+
const det = a * d - b * c2;
|
|
24033
|
+
if (Math.abs(det) < 1e-10) return;
|
|
24034
|
+
const invA = d / det;
|
|
24035
|
+
const invB = -b / det;
|
|
24036
|
+
const invC = -c2 / det;
|
|
24037
|
+
const invD = a / det;
|
|
24038
|
+
const invTx = -(invA * tx + invC * ty);
|
|
24039
|
+
const invTy = -(invB * tx + invD * ty);
|
|
24040
|
+
const op = opacity ?? 1;
|
|
24041
|
+
const hasMask = borderRadius !== void 0;
|
|
24042
|
+
const corners = [
|
|
24043
|
+
[tx, ty],
|
|
24044
|
+
[a * srcW + tx, b * srcW + ty],
|
|
24045
|
+
[c2 * srcH + tx, d * srcH + ty],
|
|
24046
|
+
[a * srcW + c2 * srcH + tx, b * srcW + d * srcH + ty]
|
|
24047
|
+
];
|
|
24048
|
+
let minX = canvasW, maxX = 0, minY = canvasH, maxY = 0;
|
|
24049
|
+
for (const corner of corners) {
|
|
24050
|
+
const cx = corner[0] ?? 0;
|
|
24051
|
+
const cy = corner[1] ?? 0;
|
|
24052
|
+
if (cx < minX) minX = cx;
|
|
24053
|
+
if (cx > maxX) maxX = cx;
|
|
24054
|
+
if (cy < minY) minY = cy;
|
|
24055
|
+
if (cy > maxY) maxY = cy;
|
|
24056
|
+
}
|
|
24057
|
+
const startX = Math.max(0, Math.floor(minX));
|
|
24058
|
+
const endX = Math.min(canvasW, Math.ceil(maxX));
|
|
24059
|
+
const startY = Math.max(0, Math.floor(minY));
|
|
24060
|
+
const endY = Math.min(canvasH, Math.ceil(maxY));
|
|
24061
|
+
for (let dy = startY; dy < endY; dy++) {
|
|
24062
|
+
for (let dx = startX; dx < endX; dx++) {
|
|
24063
|
+
const sx = invA * dx + invC * dy + invTx;
|
|
24064
|
+
const sy = invB * dx + invD * dy + invTy;
|
|
24065
|
+
if (sx < 0 || sy < 0 || sx >= srcW || sy >= srcH) continue;
|
|
24066
|
+
let effectiveOp = op;
|
|
24067
|
+
if (hasMask) {
|
|
24068
|
+
const ma = roundedRectAlpha(sx, sy, srcW, srcH, borderRadius);
|
|
24069
|
+
if (ma <= 0) continue;
|
|
24070
|
+
effectiveOp *= ma;
|
|
24071
|
+
}
|
|
24072
|
+
const x0 = Math.floor(sx);
|
|
24073
|
+
const y0 = Math.floor(sy);
|
|
24074
|
+
const fx = sx - x0;
|
|
24075
|
+
const fy = sy - y0;
|
|
24076
|
+
const x1 = Math.min(x0 + 1, srcW - 1);
|
|
24077
|
+
const y1 = Math.min(y0 + 1, srcH - 1);
|
|
24078
|
+
const off00 = (y0 * srcW + x0) * 6;
|
|
24079
|
+
const off10 = (y0 * srcW + x1) * 6;
|
|
24080
|
+
const off01 = (y1 * srcW + x0) * 6;
|
|
24081
|
+
const off11 = (y1 * srcW + x1) * 6;
|
|
24082
|
+
const w00 = (1 - fx) * (1 - fy);
|
|
24083
|
+
const w10 = fx * (1 - fy);
|
|
24084
|
+
const w01 = (1 - fx) * fy;
|
|
24085
|
+
const w11 = fx * fy;
|
|
24086
|
+
const sr = source.readUInt16LE(off00) * w00 + source.readUInt16LE(off10) * w10 + source.readUInt16LE(off01) * w01 + source.readUInt16LE(off11) * w11;
|
|
24087
|
+
const sg = source.readUInt16LE(off00 + 2) * w00 + source.readUInt16LE(off10 + 2) * w10 + source.readUInt16LE(off01 + 2) * w01 + source.readUInt16LE(off11 + 2) * w11;
|
|
24088
|
+
const sb = source.readUInt16LE(off00 + 4) * w00 + source.readUInt16LE(off10 + 4) * w10 + source.readUInt16LE(off01 + 4) * w01 + source.readUInt16LE(off11 + 4) * w11;
|
|
24089
|
+
const dstOff = (dy * canvasW + dx) * 6;
|
|
24090
|
+
if (effectiveOp >= 0.999) {
|
|
24091
|
+
canvas.writeUInt16LE(Math.round(sr), dstOff);
|
|
24092
|
+
canvas.writeUInt16LE(Math.round(sg), dstOff + 2);
|
|
24093
|
+
canvas.writeUInt16LE(Math.round(sb), dstOff + 4);
|
|
24094
|
+
} else {
|
|
24095
|
+
const invEff = 1 - effectiveOp;
|
|
24096
|
+
const dr = canvas.readUInt16LE(dstOff);
|
|
24097
|
+
const dg = canvas.readUInt16LE(dstOff + 2);
|
|
24098
|
+
const db = canvas.readUInt16LE(dstOff + 4);
|
|
24099
|
+
canvas.writeUInt16LE(Math.round(sr * effectiveOp + dr * invEff), dstOff);
|
|
24100
|
+
canvas.writeUInt16LE(Math.round(sg * effectiveOp + dg * invEff), dstOff + 2);
|
|
24101
|
+
canvas.writeUInt16LE(Math.round(sb * effectiveOp + db * invEff), dstOff + 4);
|
|
24102
|
+
}
|
|
24103
|
+
}
|
|
24104
|
+
}
|
|
24105
|
+
}
|
|
24106
|
+
function parseTransformMatrix(css) {
|
|
24107
|
+
if (!css || css === "none") return null;
|
|
24108
|
+
const match = css.match(
|
|
24109
|
+
/^matrix\(\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^,)]+)\s*\)$/
|
|
24110
|
+
);
|
|
24111
|
+
if (!match) return null;
|
|
24112
|
+
const values = match.slice(1, 7).map(Number);
|
|
24113
|
+
if (!values.every(Number.isFinite)) return null;
|
|
24114
|
+
return values;
|
|
24115
|
+
}
|
|
23865
24116
|
var SRGB_TO_HLG, SRGB_TO_PQ;
|
|
23866
24117
|
var init_alphaBlit = __esm({
|
|
23867
24118
|
"../engine/src/utils/alphaBlit.ts"() {
|
|
@@ -23895,14 +24146,687 @@ var init_layerCompositor = __esm({
|
|
|
23895
24146
|
}
|
|
23896
24147
|
});
|
|
23897
24148
|
|
|
24149
|
+
// ../engine/src/utils/shaderTransitions.ts
|
|
24150
|
+
function pqEotf(signal) {
|
|
24151
|
+
const sp = Math.pow(Math.max(0, signal), 1 / PQ_M2);
|
|
24152
|
+
const num = Math.max(sp - PQ_C1, 0);
|
|
24153
|
+
const den = PQ_C2 - PQ_C3 * sp;
|
|
24154
|
+
return den > 0 ? Math.pow(num / den, 1 / PQ_M1) : 0;
|
|
24155
|
+
}
|
|
24156
|
+
function pqOetf(linear) {
|
|
24157
|
+
const lp = Math.pow(Math.max(0, linear), PQ_M1);
|
|
24158
|
+
return Math.pow((PQ_C1 + PQ_C2 * lp) / (1 + PQ_C3 * lp), PQ_M2);
|
|
24159
|
+
}
|
|
24160
|
+
function hlgEotf(signal) {
|
|
24161
|
+
const a = 0.17883277;
|
|
24162
|
+
const b = 1 - 4 * a;
|
|
24163
|
+
const c2 = 0.5 - a * Math.log(4 * a);
|
|
24164
|
+
if (signal <= 0.5) {
|
|
24165
|
+
return signal * signal / 3;
|
|
24166
|
+
}
|
|
24167
|
+
return (Math.exp((signal - c2) / a) + b) / 12;
|
|
24168
|
+
}
|
|
24169
|
+
function hlgOetf(linear) {
|
|
24170
|
+
const a = 0.17883277;
|
|
24171
|
+
const b = 1 - 4 * a;
|
|
24172
|
+
const c2 = 0.5 - a * Math.log(4 * a);
|
|
24173
|
+
if (linear <= 1 / 12) {
|
|
24174
|
+
return Math.sqrt(3 * linear);
|
|
24175
|
+
}
|
|
24176
|
+
return a * Math.log(12 * linear - b) + c2;
|
|
24177
|
+
}
|
|
24178
|
+
function buildLut(fn) {
|
|
24179
|
+
const lut = new Uint16Array(65536);
|
|
24180
|
+
for (let i2 = 0; i2 < 65536; i2++) {
|
|
24181
|
+
lut[i2] = Math.round(fn(i2 / 65535) * 65535);
|
|
24182
|
+
}
|
|
24183
|
+
return lut;
|
|
24184
|
+
}
|
|
24185
|
+
function getPqToLinearLut() {
|
|
24186
|
+
if (!pqToLinearLut) pqToLinearLut = buildLut(pqEotf);
|
|
24187
|
+
return pqToLinearLut;
|
|
24188
|
+
}
|
|
24189
|
+
function getLinearToPqLut() {
|
|
24190
|
+
if (!linearToPqLut) linearToPqLut = buildLut(pqOetf);
|
|
24191
|
+
return linearToPqLut;
|
|
24192
|
+
}
|
|
24193
|
+
function getHlgToLinearLut() {
|
|
24194
|
+
if (!hlgToLinearLut) hlgToLinearLut = buildLut(hlgEotf);
|
|
24195
|
+
return hlgToLinearLut;
|
|
24196
|
+
}
|
|
24197
|
+
function getLinearToHlgLut() {
|
|
24198
|
+
if (!linearToHlgLut) linearToHlgLut = buildLut(hlgOetf);
|
|
24199
|
+
return linearToHlgLut;
|
|
24200
|
+
}
|
|
24201
|
+
function hdrToLinear(buf, transfer) {
|
|
24202
|
+
const lut = transfer === "pq" ? getPqToLinearLut() : getHlgToLinearLut();
|
|
24203
|
+
const len = buf.length / 2;
|
|
24204
|
+
for (let i2 = 0; i2 < len; i2++) {
|
|
24205
|
+
const off = i2 * 2;
|
|
24206
|
+
buf.writeUInt16LE(lut[buf.readUInt16LE(off)] ?? 0, off);
|
|
24207
|
+
}
|
|
24208
|
+
}
|
|
24209
|
+
function linearToHdr(buf, transfer) {
|
|
24210
|
+
const lut = transfer === "pq" ? getLinearToPqLut() : getLinearToHlgLut();
|
|
24211
|
+
const len = buf.length / 2;
|
|
24212
|
+
for (let i2 = 0; i2 < len; i2++) {
|
|
24213
|
+
const off = i2 * 2;
|
|
24214
|
+
buf.writeUInt16LE(lut[buf.readUInt16LE(off)] ?? 0, off);
|
|
24215
|
+
}
|
|
24216
|
+
}
|
|
24217
|
+
function hlgSceneToPqDisplay(sceneLinear) {
|
|
24218
|
+
const displayNits = HLG_OOTF_LW * Math.pow(Math.max(0, sceneLinear), HLG_OOTF_GAMMA);
|
|
24219
|
+
return displayNits / 1e4;
|
|
24220
|
+
}
|
|
24221
|
+
function pqDisplayToHlgScene(displayNormalized) {
|
|
24222
|
+
const displayNits = displayNormalized * 1e4;
|
|
24223
|
+
return Math.pow(Math.max(0, displayNits / HLG_OOTF_LW), 1 / HLG_OOTF_GAMMA);
|
|
24224
|
+
}
|
|
24225
|
+
function getHlgToPqLut() {
|
|
24226
|
+
if (!hlgToPqLut) hlgToPqLut = buildLut((v) => pqOetf(hlgSceneToPqDisplay(hlgEotf(v))));
|
|
24227
|
+
return hlgToPqLut;
|
|
24228
|
+
}
|
|
24229
|
+
function getPqToHlgLut() {
|
|
24230
|
+
if (!pqToHlgLut) pqToHlgLut = buildLut((v) => hlgOetf(pqDisplayToHlgScene(pqEotf(v))));
|
|
24231
|
+
return pqToHlgLut;
|
|
24232
|
+
}
|
|
24233
|
+
function convertTransfer(buf, from, to) {
|
|
24234
|
+
if (from === to) return;
|
|
24235
|
+
const lut = from === "hlg" ? getHlgToPqLut() : getPqToHlgLut();
|
|
24236
|
+
const len = buf.length / 2;
|
|
24237
|
+
for (let i2 = 0; i2 < len; i2++) {
|
|
24238
|
+
const off = i2 * 2;
|
|
24239
|
+
buf.writeUInt16LE(lut[buf.readUInt16LE(off)] ?? 0, off);
|
|
24240
|
+
}
|
|
24241
|
+
}
|
|
24242
|
+
function sampleRgb48le(buf, u, v, w, h3) {
|
|
24243
|
+
const uc = Math.max(0, Math.min(1, u));
|
|
24244
|
+
const vc = Math.max(0, Math.min(1, v));
|
|
24245
|
+
const sx = uc * (w - 1);
|
|
24246
|
+
const sy = vc * (h3 - 1);
|
|
24247
|
+
const x0 = Math.floor(sx);
|
|
24248
|
+
const y0 = Math.floor(sy);
|
|
24249
|
+
const x1 = Math.min(x0 + 1, w - 1);
|
|
24250
|
+
const y1 = Math.min(y0 + 1, h3 - 1);
|
|
24251
|
+
const fx = sx - x0;
|
|
24252
|
+
const fy = sy - y0;
|
|
24253
|
+
const w00 = (1 - fx) * (1 - fy);
|
|
24254
|
+
const w10 = fx * (1 - fy);
|
|
24255
|
+
const w01 = (1 - fx) * fy;
|
|
24256
|
+
const w11 = fx * fy;
|
|
24257
|
+
const off00 = (y0 * w + x0) * 6;
|
|
24258
|
+
const off10 = (y0 * w + x1) * 6;
|
|
24259
|
+
const off01 = (y1 * w + x0) * 6;
|
|
24260
|
+
const off11 = (y1 * w + x1) * 6;
|
|
24261
|
+
const r2 = Math.round(
|
|
24262
|
+
buf.readUInt16LE(off00) * w00 + buf.readUInt16LE(off10) * w10 + buf.readUInt16LE(off01) * w01 + buf.readUInt16LE(off11) * w11
|
|
24263
|
+
);
|
|
24264
|
+
const g = Math.round(
|
|
24265
|
+
buf.readUInt16LE(off00 + 2) * w00 + buf.readUInt16LE(off10 + 2) * w10 + buf.readUInt16LE(off01 + 2) * w01 + buf.readUInt16LE(off11 + 2) * w11
|
|
24266
|
+
);
|
|
24267
|
+
const b = Math.round(
|
|
24268
|
+
buf.readUInt16LE(off00 + 4) * w00 + buf.readUInt16LE(off10 + 4) * w10 + buf.readUInt16LE(off01 + 4) * w01 + buf.readUInt16LE(off11 + 4) * w11
|
|
24269
|
+
);
|
|
24270
|
+
return [r2, g, b];
|
|
24271
|
+
}
|
|
24272
|
+
function mix16(a, b, t3) {
|
|
24273
|
+
return Math.round(a * (1 - t3) + b * t3);
|
|
24274
|
+
}
|
|
24275
|
+
function clamp16(v) {
|
|
24276
|
+
return Math.max(0, Math.min(65535, v));
|
|
24277
|
+
}
|
|
24278
|
+
function smoothstep(edge0, edge1, x4) {
|
|
24279
|
+
const t3 = Math.max(0, Math.min(1, (x4 - edge0) / (edge1 - edge0)));
|
|
24280
|
+
return t3 * t3 * (3 - 2 * t3);
|
|
24281
|
+
}
|
|
24282
|
+
function hash(x4, y2) {
|
|
24283
|
+
return (Math.sin(x4 * 127.1 + y2 * 311.7) * 43758.5453 % 1 + 1) % 1;
|
|
24284
|
+
}
|
|
24285
|
+
function vnoise(px, py) {
|
|
24286
|
+
const ix = Math.floor(px);
|
|
24287
|
+
const iy = Math.floor(py);
|
|
24288
|
+
let fx = px - ix;
|
|
24289
|
+
let fy = py - iy;
|
|
24290
|
+
fx = fx * fx * fx * (fx * (fx * 6 - 15) + 10);
|
|
24291
|
+
fy = fy * fy * fy * (fy * (fy * 6 - 15) + 10);
|
|
24292
|
+
const h00 = hash(ix, iy);
|
|
24293
|
+
const h10 = hash(ix + 1, iy);
|
|
24294
|
+
const h01 = hash(ix, iy + 1);
|
|
24295
|
+
const h11 = hash(ix + 1, iy + 1);
|
|
24296
|
+
return h00 * (1 - fx) * (1 - fy) + h10 * fx * (1 - fy) + h01 * (1 - fx) * fy + h11 * fx * fy;
|
|
24297
|
+
}
|
|
24298
|
+
function fbm(px, py) {
|
|
24299
|
+
let value = 0;
|
|
24300
|
+
let amplitude = 0.5;
|
|
24301
|
+
let x4 = px;
|
|
24302
|
+
let y2 = py;
|
|
24303
|
+
for (let i2 = 0; i2 < 5; i2++) {
|
|
24304
|
+
value += amplitude * vnoise(x4, y2);
|
|
24305
|
+
const nx = ROT_A * x4 - ROT_B * y2;
|
|
24306
|
+
const ny = ROT_B * x4 + ROT_A * y2;
|
|
24307
|
+
x4 = nx * 2.02;
|
|
24308
|
+
y2 = ny * 2.02;
|
|
24309
|
+
amplitude *= 0.5;
|
|
24310
|
+
}
|
|
24311
|
+
return value;
|
|
24312
|
+
}
|
|
24313
|
+
function glitchRand(x4, y2) {
|
|
24314
|
+
return (Math.sin(x4 * 12.9898 + y2 * 78.233) * 43758.5453 % 1 + 1) % 1;
|
|
24315
|
+
}
|
|
24316
|
+
function aces(x4) {
|
|
24317
|
+
return Math.max(0, Math.min(1, x4 * (2.51 * x4 + 0.03) / (x4 * (2.43 * x4 + 0.59) + 0.14)));
|
|
24318
|
+
}
|
|
24319
|
+
function ridged(px, py) {
|
|
24320
|
+
let value = 0;
|
|
24321
|
+
let amplitude = 0.5;
|
|
24322
|
+
let x4 = px;
|
|
24323
|
+
let y2 = py;
|
|
24324
|
+
for (let i2 = 0; i2 < 5; i2++) {
|
|
24325
|
+
value += amplitude * Math.abs(vnoise(x4, y2) * 2 - 1);
|
|
24326
|
+
const nx = ROT_A * x4 - ROT_B * y2;
|
|
24327
|
+
const ny = ROT_B * x4 + ROT_A * y2;
|
|
24328
|
+
x4 = nx * 2.02;
|
|
24329
|
+
y2 = ny * 2.02;
|
|
24330
|
+
amplitude *= 0.5;
|
|
24331
|
+
}
|
|
24332
|
+
return value;
|
|
24333
|
+
}
|
|
24334
|
+
var PQ_M1, PQ_M2, PQ_C1, PQ_C2, PQ_C3, pqToLinearLut, linearToPqLut, hlgToLinearLut, linearToHlgLut, HLG_OOTF_LW, HLG_OOTF_GAMMA, hlgToPqLut, pqToHlgLut, ROT_A, ROT_B, TRANSITIONS, crossfade, flashThroughWhite, chromaticSplit, sdfIris, glitch, lightLeak, crossWarpMorph, whipPan, cinematicZoom, gravitationalLens, rippleWaves, swirlVortex, thermalDistortion, domainWarp, ridgedBurn;
|
|
24335
|
+
var init_shaderTransitions = __esm({
|
|
24336
|
+
"../engine/src/utils/shaderTransitions.ts"() {
|
|
24337
|
+
"use strict";
|
|
24338
|
+
PQ_M1 = 0.1593017578125;
|
|
24339
|
+
PQ_M2 = 78.84375;
|
|
24340
|
+
PQ_C1 = 0.8359375;
|
|
24341
|
+
PQ_C2 = 18.8515625;
|
|
24342
|
+
PQ_C3 = 18.6875;
|
|
24343
|
+
pqToLinearLut = null;
|
|
24344
|
+
linearToPqLut = null;
|
|
24345
|
+
hlgToLinearLut = null;
|
|
24346
|
+
linearToHlgLut = null;
|
|
24347
|
+
HLG_OOTF_LW = 1e3;
|
|
24348
|
+
HLG_OOTF_GAMMA = 1.2 * Math.pow(1.111, Math.log2(HLG_OOTF_LW / 1e3));
|
|
24349
|
+
hlgToPqLut = null;
|
|
24350
|
+
pqToHlgLut = null;
|
|
24351
|
+
ROT_A = 0.8;
|
|
24352
|
+
ROT_B = 0.6;
|
|
24353
|
+
TRANSITIONS = {};
|
|
24354
|
+
crossfade = (from, to, out, w, h3, p) => {
|
|
24355
|
+
const inv = 1 - p;
|
|
24356
|
+
for (let i2 = 0; i2 < w * h3; i2++) {
|
|
24357
|
+
const o = i2 * 6;
|
|
24358
|
+
out.writeUInt16LE(Math.round(from.readUInt16LE(o) * inv + to.readUInt16LE(o) * p), o);
|
|
24359
|
+
out.writeUInt16LE(
|
|
24360
|
+
Math.round(from.readUInt16LE(o + 2) * inv + to.readUInt16LE(o + 2) * p),
|
|
24361
|
+
o + 2
|
|
24362
|
+
);
|
|
24363
|
+
out.writeUInt16LE(
|
|
24364
|
+
Math.round(from.readUInt16LE(o + 4) * inv + to.readUInt16LE(o + 4) * p),
|
|
24365
|
+
o + 4
|
|
24366
|
+
);
|
|
24367
|
+
}
|
|
24368
|
+
};
|
|
24369
|
+
TRANSITIONS["crossfade"] = crossfade;
|
|
24370
|
+
flashThroughWhite = (from, to, out, w, h3, p) => {
|
|
24371
|
+
const toWhite = smoothstep(0, 0.45, p);
|
|
24372
|
+
const fromWhite = 1 - smoothstep(0.5, 1, p);
|
|
24373
|
+
const blend = smoothstep(0.35, 0.65, p);
|
|
24374
|
+
for (let i2 = 0; i2 < w * h3; i2++) {
|
|
24375
|
+
const o = i2 * 6;
|
|
24376
|
+
const fromR = mix16(from.readUInt16LE(o), 65535, toWhite);
|
|
24377
|
+
const fromG = mix16(from.readUInt16LE(o + 2), 65535, toWhite);
|
|
24378
|
+
const fromB = mix16(from.readUInt16LE(o + 4), 65535, toWhite);
|
|
24379
|
+
const toR = mix16(to.readUInt16LE(o), 65535, fromWhite);
|
|
24380
|
+
const toG = mix16(to.readUInt16LE(o + 2), 65535, fromWhite);
|
|
24381
|
+
const toB = mix16(to.readUInt16LE(o + 4), 65535, fromWhite);
|
|
24382
|
+
out.writeUInt16LE(mix16(fromR, toR, blend), o);
|
|
24383
|
+
out.writeUInt16LE(mix16(fromG, toG, blend), o + 2);
|
|
24384
|
+
out.writeUInt16LE(mix16(fromB, toB, blend), o + 4);
|
|
24385
|
+
}
|
|
24386
|
+
};
|
|
24387
|
+
TRANSITIONS["flash-through-white"] = flashThroughWhite;
|
|
24388
|
+
chromaticSplit = (from, to, out, w, h3, p) => {
|
|
24389
|
+
for (let i2 = 0; i2 < w * h3; i2++) {
|
|
24390
|
+
const ux = i2 % w / w;
|
|
24391
|
+
const uy = Math.floor(i2 / w) / h3;
|
|
24392
|
+
const o = i2 * 6;
|
|
24393
|
+
const cx = ux - 0.5;
|
|
24394
|
+
const cy = uy - 0.5;
|
|
24395
|
+
const fromShift = p * 0.06;
|
|
24396
|
+
const fr = sampleRgb48le(from, ux + cx * fromShift, uy + cy * fromShift, w, h3)[0];
|
|
24397
|
+
const fg = sampleRgb48le(from, ux, uy, w, h3)[1];
|
|
24398
|
+
const fb = sampleRgb48le(from, ux - cx * fromShift, uy - cy * fromShift, w, h3)[2];
|
|
24399
|
+
const toShift = (1 - p) * 0.06;
|
|
24400
|
+
const tr = sampleRgb48le(to, ux - cx * toShift, uy - cy * toShift, w, h3)[0];
|
|
24401
|
+
const tg = sampleRgb48le(to, ux, uy, w, h3)[1];
|
|
24402
|
+
const tb = sampleRgb48le(to, ux + cx * toShift, uy + cy * toShift, w, h3)[2];
|
|
24403
|
+
out.writeUInt16LE(clamp16(mix16(fr, tr, p)), o);
|
|
24404
|
+
out.writeUInt16LE(clamp16(mix16(fg, tg, p)), o + 2);
|
|
24405
|
+
out.writeUInt16LE(clamp16(mix16(fb, tb, p)), o + 4);
|
|
24406
|
+
}
|
|
24407
|
+
};
|
|
24408
|
+
TRANSITIONS["chromatic-split"] = chromaticSplit;
|
|
24409
|
+
sdfIris = (from, to, out, w, h3, p) => {
|
|
24410
|
+
const accentBright = [65535, 55e3, 35e3];
|
|
24411
|
+
for (let i2 = 0; i2 < w * h3; i2++) {
|
|
24412
|
+
const ux = i2 % w / w;
|
|
24413
|
+
const uy = Math.floor(i2 / w) / h3;
|
|
24414
|
+
const o = i2 * 6;
|
|
24415
|
+
const ax = (ux - 0.5) * (w / h3);
|
|
24416
|
+
const ay = uy - 0.5;
|
|
24417
|
+
const d = Math.sqrt(ax * ax + ay * ay);
|
|
24418
|
+
const radius = p * 1.2;
|
|
24419
|
+
const fw = 3e-3;
|
|
24420
|
+
const edge = smoothstep(radius + fw, radius - fw, d);
|
|
24421
|
+
const ring1 = Math.exp(-Math.abs(d - radius) * 25);
|
|
24422
|
+
const ring2 = Math.exp(-Math.abs(d - radius + 0.04) * 20) * 0.5;
|
|
24423
|
+
const ring3 = Math.exp(-Math.abs(d - radius + 0.08) * 15) * 0.25;
|
|
24424
|
+
const glow = (ring1 + ring2 + ring3) * p * (1 - p) * 4;
|
|
24425
|
+
const [fromR, fromG, fromB] = sampleRgb48le(from, ux, uy, w, h3);
|
|
24426
|
+
const [toR, toG, toB] = sampleRgb48le(to, ux, uy, w, h3);
|
|
24427
|
+
out.writeUInt16LE(clamp16(mix16(fromR, toR, edge) + accentBright[0] * glow * 0.6), o);
|
|
24428
|
+
out.writeUInt16LE(clamp16(mix16(fromG, toG, edge) + accentBright[1] * glow * 0.6), o + 2);
|
|
24429
|
+
out.writeUInt16LE(clamp16(mix16(fromB, toB, edge) + accentBright[2] * glow * 0.6), o + 4);
|
|
24430
|
+
}
|
|
24431
|
+
};
|
|
24432
|
+
TRANSITIONS["sdf-iris"] = sdfIris;
|
|
24433
|
+
glitch = (from, to, out, w, h3, p) => {
|
|
24434
|
+
const intensity = p * (1 - p) * 4;
|
|
24435
|
+
for (let i2 = 0; i2 < w * h3; i2++) {
|
|
24436
|
+
const ux = i2 % w / w;
|
|
24437
|
+
const uy = Math.floor(i2 / w) / h3;
|
|
24438
|
+
const o = i2 * 6;
|
|
24439
|
+
const lineY = Math.floor(uy * 60) / 60;
|
|
24440
|
+
const lineDisp = (glitchRand(lineY, Math.floor(p * 17)) - 0.5) * 0.18 * intensity;
|
|
24441
|
+
const blockX = Math.floor(ux * 12);
|
|
24442
|
+
const blockY = Math.floor(uy * 8);
|
|
24443
|
+
const progressStep = Math.floor(p * 11);
|
|
24444
|
+
const br = glitchRand(blockX + progressStep, blockY + progressStep);
|
|
24445
|
+
const ba = (br >= 0.83 ? 1 : 0) * intensity;
|
|
24446
|
+
const bdx = (glitchRand(blockX * 2.1, blockY * 2.1) - 0.5) * 0.35 * ba;
|
|
24447
|
+
const bdy = (glitchRand(blockX * 3.7, blockY * 3.7) - 0.5) * 0.35 * ba;
|
|
24448
|
+
const uvx = Math.max(0, Math.min(1, ux + lineDisp + bdx));
|
|
24449
|
+
const uvy = Math.max(0, Math.min(1, uy + bdy));
|
|
24450
|
+
const shift = intensity * 0.035;
|
|
24451
|
+
const r2 = sampleRgb48le(from, uvx + shift, uvy, w, h3)[0];
|
|
24452
|
+
const g = sampleRgb48le(from, uvx, uvy, w, h3)[1];
|
|
24453
|
+
const b = sampleRgb48le(from, uvx - shift, uvy, w, h3)[2];
|
|
24454
|
+
let cr = r2 / 65535;
|
|
24455
|
+
let cg = g / 65535;
|
|
24456
|
+
let cb = b / 65535;
|
|
24457
|
+
const scanline = (uy * h3 * 0.5 % 1 + 1) % 1 >= 0.5 ? 0.05 * intensity : 0;
|
|
24458
|
+
cr -= scanline;
|
|
24459
|
+
cg -= scanline;
|
|
24460
|
+
cb -= scanline;
|
|
24461
|
+
const flicker = 1 + (glitchRand(Math.floor(p * 23), 0) - 0.5) * 0.3 * intensity;
|
|
24462
|
+
cr *= flicker;
|
|
24463
|
+
cg *= flicker;
|
|
24464
|
+
cb *= flicker;
|
|
24465
|
+
const levels = 256 - (256 - 8) * (intensity * 0.5);
|
|
24466
|
+
cr = Math.floor(cr * levels) / levels;
|
|
24467
|
+
cg = Math.floor(cg * levels) / levels;
|
|
24468
|
+
cb = Math.floor(cb * levels) / levels;
|
|
24469
|
+
const [toR, toG, toB] = sampleRgb48le(to, ux, uy, w, h3);
|
|
24470
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(cr * 65535), toR, p)), o);
|
|
24471
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(cg * 65535), toG, p)), o + 2);
|
|
24472
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(cb * 65535), toB, p)), o + 4);
|
|
24473
|
+
}
|
|
24474
|
+
};
|
|
24475
|
+
TRANSITIONS["glitch"] = glitch;
|
|
24476
|
+
lightLeak = (from, to, out, w, h3, p) => {
|
|
24477
|
+
const accent = [5e4 / 65535, 25e3 / 65535, 5e3 / 65535];
|
|
24478
|
+
const accentBright = [65535 / 65535, 55e3 / 65535, 35e3 / 65535];
|
|
24479
|
+
const lpx = 1.3;
|
|
24480
|
+
const lpy = -0.2;
|
|
24481
|
+
for (let i2 = 0; i2 < w * h3; i2++) {
|
|
24482
|
+
const ux = i2 % w / w;
|
|
24483
|
+
const uy = Math.floor(i2 / w) / h3;
|
|
24484
|
+
const o = i2 * 6;
|
|
24485
|
+
const dx = ux - lpx;
|
|
24486
|
+
const dy = uy - lpy;
|
|
24487
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
24488
|
+
const leak = Math.max(0, Math.min(1, Math.exp(-dist * 1.8) * p * 4));
|
|
24489
|
+
const warmR = accent[0] + (accentBright[0] - accent[0]) * dist * 0.7;
|
|
24490
|
+
const warmG = accent[1] + (accentBright[1] - accent[1]) * dist * 0.7;
|
|
24491
|
+
const warmB = accent[2] + (accentBright[2] - accent[2]) * dist * 0.7;
|
|
24492
|
+
const flare = Math.exp(-Math.abs(uy - (-0.2 + ux * 0.3)) * 15) * leak * 0.3;
|
|
24493
|
+
const [fr, fg, fb] = sampleRgb48le(from, ux, uy, w, h3);
|
|
24494
|
+
const fromR = fr / 65535;
|
|
24495
|
+
const fromG = fg / 65535;
|
|
24496
|
+
const fromB = fb / 65535;
|
|
24497
|
+
const overR = aces(fromR + warmR * leak * 3 + accentBright[0] * flare);
|
|
24498
|
+
const overG = aces(fromG + warmG * leak * 3 + accentBright[1] * flare);
|
|
24499
|
+
const overB = aces(fromB + warmB * leak * 3 + accentBright[2] * flare);
|
|
24500
|
+
const [toR, toG, toB] = sampleRgb48le(to, ux, uy, w, h3);
|
|
24501
|
+
const blend = smoothstep(0.15, 0.85, p);
|
|
24502
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(overR * 65535), toR, blend)), o);
|
|
24503
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(overG * 65535), toG, blend)), o + 2);
|
|
24504
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(overB * 65535), toB, blend)), o + 4);
|
|
24505
|
+
}
|
|
24506
|
+
};
|
|
24507
|
+
TRANSITIONS["light-leak"] = lightLeak;
|
|
24508
|
+
crossWarpMorph = (from, to, out, w, h3, p) => {
|
|
24509
|
+
for (let i2 = 0; i2 < w * h3; i2++) {
|
|
24510
|
+
const ux = i2 % w / w;
|
|
24511
|
+
const uy = Math.floor(i2 / w) / h3;
|
|
24512
|
+
const o = i2 * 6;
|
|
24513
|
+
const dispX = fbm(ux * 3, uy * 3) - 0.5;
|
|
24514
|
+
const dispY = fbm(ux * 3 + 7.3, uy * 3 + 3.7) - 0.5;
|
|
24515
|
+
const fromUx = Math.max(0, Math.min(1, ux + dispX * p * 0.5));
|
|
24516
|
+
const fromUy = Math.max(0, Math.min(1, uy + dispY * p * 0.5));
|
|
24517
|
+
const toUx = Math.max(0, Math.min(1, ux - dispX * (1 - p) * 0.5));
|
|
24518
|
+
const toUy = Math.max(0, Math.min(1, uy - dispY * (1 - p) * 0.5));
|
|
24519
|
+
const [fromR, fromG, fromB] = sampleRgb48le(from, fromUx, fromUy, w, h3);
|
|
24520
|
+
const [toR, toG, toB] = sampleRgb48le(to, toUx, toUy, w, h3);
|
|
24521
|
+
const n = fbm(ux * 4 + 3.1, uy * 4 + 1.7);
|
|
24522
|
+
const blend = smoothstep(0.4, 0.6, n + p * 1.2 - 0.6);
|
|
24523
|
+
out.writeUInt16LE(clamp16(mix16(fromR, toR, blend)), o);
|
|
24524
|
+
out.writeUInt16LE(clamp16(mix16(fromG, toG, blend)), o + 2);
|
|
24525
|
+
out.writeUInt16LE(clamp16(mix16(fromB, toB, blend)), o + 4);
|
|
24526
|
+
}
|
|
24527
|
+
};
|
|
24528
|
+
TRANSITIONS["cross-warp-morph"] = crossWarpMorph;
|
|
24529
|
+
whipPan = (from, to, out, w, h3, p) => {
|
|
24530
|
+
const fromOff = p * 1.5;
|
|
24531
|
+
const toOff = (1 - p) * 1.5;
|
|
24532
|
+
for (let i2 = 0; i2 < w * h3; i2++) {
|
|
24533
|
+
const ux = i2 % w / w;
|
|
24534
|
+
const uy = Math.floor(i2 / w) / h3;
|
|
24535
|
+
const o = i2 * 6;
|
|
24536
|
+
let fromR = 0, fromG = 0, fromB = 0;
|
|
24537
|
+
for (let s2 = 0; s2 < 10; s2++) {
|
|
24538
|
+
const f3 = s2 / 10;
|
|
24539
|
+
const fuv = Math.max(0, Math.min(1, ux + fromOff + p * 0.08 * f3));
|
|
24540
|
+
const [r2, g, b] = sampleRgb48le(from, fuv, uy, w, h3);
|
|
24541
|
+
fromR += r2;
|
|
24542
|
+
fromG += g;
|
|
24543
|
+
fromB += b;
|
|
24544
|
+
}
|
|
24545
|
+
fromR /= 10;
|
|
24546
|
+
fromG /= 10;
|
|
24547
|
+
fromB /= 10;
|
|
24548
|
+
let toR = 0, toG = 0, toB = 0;
|
|
24549
|
+
for (let s2 = 0; s2 < 10; s2++) {
|
|
24550
|
+
const f3 = s2 / 10;
|
|
24551
|
+
const tuv = Math.max(0, Math.min(1, ux - toOff - (1 - p) * 0.08 * f3));
|
|
24552
|
+
const [r2, g, b] = sampleRgb48le(to, tuv, uy, w, h3);
|
|
24553
|
+
toR += r2;
|
|
24554
|
+
toG += g;
|
|
24555
|
+
toB += b;
|
|
24556
|
+
}
|
|
24557
|
+
toR /= 10;
|
|
24558
|
+
toG /= 10;
|
|
24559
|
+
toB /= 10;
|
|
24560
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fromR), Math.round(toR), p)), o);
|
|
24561
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fromG), Math.round(toG), p)), o + 2);
|
|
24562
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fromB), Math.round(toB), p)), o + 4);
|
|
24563
|
+
}
|
|
24564
|
+
};
|
|
24565
|
+
TRANSITIONS["whip-pan"] = whipPan;
|
|
24566
|
+
cinematicZoom = (from, to, out, w, h3, p) => {
|
|
24567
|
+
const fromS = p * 0.08;
|
|
24568
|
+
const toS = (1 - p) * 0.06;
|
|
24569
|
+
for (let i2 = 0; i2 < w * h3; i2++) {
|
|
24570
|
+
const ux = i2 % w / w;
|
|
24571
|
+
const uy = Math.floor(i2 / w) / h3;
|
|
24572
|
+
const o = i2 * 6;
|
|
24573
|
+
const dx = ux - 0.5;
|
|
24574
|
+
const dy = uy - 0.5;
|
|
24575
|
+
let fr = 0, fg = 0, fb = 0;
|
|
24576
|
+
for (let s2 = 0; s2 < 12; s2++) {
|
|
24577
|
+
const f3 = s2 / 12;
|
|
24578
|
+
const rr = sampleRgb48le(
|
|
24579
|
+
from,
|
|
24580
|
+
ux - dx * fromS * 1.06 * f3,
|
|
24581
|
+
uy - dy * fromS * 1.06 * f3,
|
|
24582
|
+
w,
|
|
24583
|
+
h3
|
|
24584
|
+
)[0];
|
|
24585
|
+
const gg = sampleRgb48le(from, ux - dx * fromS * f3, uy - dy * fromS * f3, w, h3)[1];
|
|
24586
|
+
const bb = sampleRgb48le(
|
|
24587
|
+
from,
|
|
24588
|
+
ux - dx * fromS * 0.94 * f3,
|
|
24589
|
+
uy - dy * fromS * 0.94 * f3,
|
|
24590
|
+
w,
|
|
24591
|
+
h3
|
|
24592
|
+
)[2];
|
|
24593
|
+
fr += rr;
|
|
24594
|
+
fg += gg;
|
|
24595
|
+
fb += bb;
|
|
24596
|
+
}
|
|
24597
|
+
fr /= 12;
|
|
24598
|
+
fg /= 12;
|
|
24599
|
+
fb /= 12;
|
|
24600
|
+
let tr = 0, tg = 0, tb = 0;
|
|
24601
|
+
for (let s2 = 0; s2 < 12; s2++) {
|
|
24602
|
+
const f3 = s2 / 12;
|
|
24603
|
+
const rr = sampleRgb48le(to, ux + dx * toS * 1.06 * f3, uy + dy * toS * 1.06 * f3, w, h3)[0];
|
|
24604
|
+
const gg = sampleRgb48le(to, ux + dx * toS * f3, uy + dy * toS * f3, w, h3)[1];
|
|
24605
|
+
const bb = sampleRgb48le(to, ux + dx * toS * 0.94 * f3, uy + dy * toS * 0.94 * f3, w, h3)[2];
|
|
24606
|
+
tr += rr;
|
|
24607
|
+
tg += gg;
|
|
24608
|
+
tb += bb;
|
|
24609
|
+
}
|
|
24610
|
+
tr /= 12;
|
|
24611
|
+
tg /= 12;
|
|
24612
|
+
tb /= 12;
|
|
24613
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fr), Math.round(tr), p)), o);
|
|
24614
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fg), Math.round(tg), p)), o + 2);
|
|
24615
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fb), Math.round(tb), p)), o + 4);
|
|
24616
|
+
}
|
|
24617
|
+
};
|
|
24618
|
+
TRANSITIONS["cinematic-zoom"] = cinematicZoom;
|
|
24619
|
+
gravitationalLens = (from, to, out, w, h3, p) => {
|
|
24620
|
+
for (let i2 = 0; i2 < w * h3; i2++) {
|
|
24621
|
+
const ux = i2 % w / w;
|
|
24622
|
+
const uy = Math.floor(i2 / w) / h3;
|
|
24623
|
+
const o = i2 * 6;
|
|
24624
|
+
const uvx = ux - 0.5;
|
|
24625
|
+
const uvy = uy - 0.5;
|
|
24626
|
+
const dist = Math.sqrt(uvx * uvx + uvy * uvy);
|
|
24627
|
+
const pull = p * 2;
|
|
24628
|
+
const warpStr = pull * 0.3 / (dist + 0.1);
|
|
24629
|
+
const warpedX = Math.max(0, Math.min(1, ux - uvx * warpStr));
|
|
24630
|
+
const warpedY = Math.max(0, Math.min(1, uy - uvy * warpStr));
|
|
24631
|
+
const [, ag] = sampleRgb48le(from, warpedX, warpedY, w, h3);
|
|
24632
|
+
const horizon = smoothstep(0, 0.3, dist / (1 - p * 0.85 + 1e-3));
|
|
24633
|
+
const shift = pull * 0.02 / (dist + 0.2);
|
|
24634
|
+
const rSampX = Math.max(0, Math.min(1, ux - uvx * (warpStr + shift)));
|
|
24635
|
+
const rSampY = Math.max(0, Math.min(1, uy - uvy * (warpStr + shift)));
|
|
24636
|
+
const bSampX = Math.max(0, Math.min(1, ux - uvx * (warpStr - shift)));
|
|
24637
|
+
const bSampY = Math.max(0, Math.min(1, uy - uvy * (warpStr - shift)));
|
|
24638
|
+
const ar = sampleRgb48le(from, rSampX, rSampY, w, h3)[0];
|
|
24639
|
+
const ab = sampleRgb48le(from, bSampX, bSampY, w, h3)[2];
|
|
24640
|
+
const lensedR = Math.round(ar * horizon);
|
|
24641
|
+
const lensedG = Math.round(ag * horizon);
|
|
24642
|
+
const lensedB = Math.round(ab * horizon);
|
|
24643
|
+
const [toR, toG, toB] = sampleRgb48le(to, ux, uy, w, h3);
|
|
24644
|
+
const blend = smoothstep(0.3, 0.9, p);
|
|
24645
|
+
out.writeUInt16LE(clamp16(mix16(lensedR, toR, blend)), o);
|
|
24646
|
+
out.writeUInt16LE(clamp16(mix16(lensedG, toG, blend)), o + 2);
|
|
24647
|
+
out.writeUInt16LE(clamp16(mix16(lensedB, toB, blend)), o + 4);
|
|
24648
|
+
}
|
|
24649
|
+
};
|
|
24650
|
+
TRANSITIONS["gravitational-lens"] = gravitationalLens;
|
|
24651
|
+
rippleWaves = (from, to, out, w, h3, p) => {
|
|
24652
|
+
const accentBright = [65535, 55e3, 35e3];
|
|
24653
|
+
for (let i2 = 0; i2 < w * h3; i2++) {
|
|
24654
|
+
const ux = i2 % w / w;
|
|
24655
|
+
const uy = Math.floor(i2 / w) / h3;
|
|
24656
|
+
const o = i2 * 6;
|
|
24657
|
+
const uvx = ux - 0.5;
|
|
24658
|
+
const uvy = uy - 0.5;
|
|
24659
|
+
const dist = Math.sqrt(uvx * uvx + uvy * uvy);
|
|
24660
|
+
const nux = uvx + 1e-3;
|
|
24661
|
+
const nuy = uvy + 1e-3;
|
|
24662
|
+
const nlen = Math.sqrt(nux * nux + nuy * nuy);
|
|
24663
|
+
const dirx = nux / nlen;
|
|
24664
|
+
const diry = nuy / nlen;
|
|
24665
|
+
const fromAmp = p * 0.04;
|
|
24666
|
+
const fw1 = Math.exp(Math.sin(dist * 25 - p * 12) - 1);
|
|
24667
|
+
const fw2 = Math.exp(Math.sin(dist * 50 - p * 18) - 1) * 0.5;
|
|
24668
|
+
const fromUx = Math.max(0, Math.min(1, ux + dirx * (fw1 + fw2) * fromAmp));
|
|
24669
|
+
const fromUy = Math.max(0, Math.min(1, uy + diry * (fw1 + fw2) * fromAmp));
|
|
24670
|
+
const toAmp = (1 - p) * 0.04;
|
|
24671
|
+
const tw1 = Math.exp(Math.sin(dist * 25 + p * 12) - 1);
|
|
24672
|
+
const tw2 = Math.exp(Math.sin(dist * 50 + p * 18) - 1) * 0.5;
|
|
24673
|
+
const toUx = Math.max(0, Math.min(1, ux - dirx * (tw1 + tw2) * toAmp));
|
|
24674
|
+
const toUy = Math.max(0, Math.min(1, uy - diry * (tw1 + tw2) * toAmp));
|
|
24675
|
+
const [fromR, fromG, fromB] = sampleRgb48le(from, fromUx, fromUy, w, h3);
|
|
24676
|
+
const [toR, toG, toB] = sampleRgb48le(to, toUx, toUy, w, h3);
|
|
24677
|
+
const peak = fw1 * p;
|
|
24678
|
+
const tintR = accentBright[0] * peak * 0.1;
|
|
24679
|
+
const tintG = accentBright[1] * peak * 0.1;
|
|
24680
|
+
const tintB = accentBright[2] * peak * 0.1;
|
|
24681
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fromR + tintR), toR, p)), o);
|
|
24682
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fromG + tintG), toG, p)), o + 2);
|
|
24683
|
+
out.writeUInt16LE(clamp16(mix16(Math.round(fromB + tintB), toB, p)), o + 4);
|
|
24684
|
+
}
|
|
24685
|
+
};
|
|
24686
|
+
TRANSITIONS["ripple-waves"] = rippleWaves;
|
|
24687
|
+
swirlVortex = (from, to, out, w, h3, p) => {
|
|
24688
|
+
for (let i2 = 0; i2 < w * h3; i2++) {
|
|
24689
|
+
const ux = i2 % w / w;
|
|
24690
|
+
const uy = Math.floor(i2 / w) / h3;
|
|
24691
|
+
const o = i2 * 6;
|
|
24692
|
+
const uvx = ux - 0.5;
|
|
24693
|
+
const uvy = uy - 0.5;
|
|
24694
|
+
const dist = Math.sqrt(uvx * uvx + uvy * uvy);
|
|
24695
|
+
const warp = fbm(ux * 4, uy * 4) * 0.5;
|
|
24696
|
+
const fromAng = p * (1 - dist) * 10 + warp * p * 3;
|
|
24697
|
+
const fs4 = Math.sin(fromAng);
|
|
24698
|
+
const fc = Math.cos(fromAng);
|
|
24699
|
+
const fromUx = Math.max(0, Math.min(1, uvx * fc - uvy * fs4 + 0.5));
|
|
24700
|
+
const fromUy = Math.max(0, Math.min(1, uvx * fs4 + uvy * fc + 0.5));
|
|
24701
|
+
const toAng = -(1 - p) * (1 - dist) * 10 - warp * (1 - p) * 3;
|
|
24702
|
+
const ts = Math.sin(toAng);
|
|
24703
|
+
const tc = Math.cos(toAng);
|
|
24704
|
+
const toUx = Math.max(0, Math.min(1, uvx * tc - uvy * ts + 0.5));
|
|
24705
|
+
const toUy = Math.max(0, Math.min(1, uvx * ts + uvy * tc + 0.5));
|
|
24706
|
+
const [fromR, fromG, fromB] = sampleRgb48le(from, fromUx, fromUy, w, h3);
|
|
24707
|
+
const [toR, toG, toB] = sampleRgb48le(to, toUx, toUy, w, h3);
|
|
24708
|
+
out.writeUInt16LE(clamp16(mix16(fromR, toR, p)), o);
|
|
24709
|
+
out.writeUInt16LE(clamp16(mix16(fromG, toG, p)), o + 2);
|
|
24710
|
+
out.writeUInt16LE(clamp16(mix16(fromB, toB, p)), o + 4);
|
|
24711
|
+
}
|
|
24712
|
+
};
|
|
24713
|
+
TRANSITIONS["swirl-vortex"] = swirlVortex;
|
|
24714
|
+
thermalDistortion = (from, to, out, w, h3, p) => {
|
|
24715
|
+
const accentBright = [65535, 55e3, 35e3];
|
|
24716
|
+
for (let i2 = 0; i2 < w * h3; i2++) {
|
|
24717
|
+
const ux = i2 % w / w;
|
|
24718
|
+
const uy = Math.floor(i2 / w) / h3;
|
|
24719
|
+
const o = i2 * 6;
|
|
24720
|
+
const heat = p * 1.5;
|
|
24721
|
+
const yFade = smoothstep(1, 0, uy);
|
|
24722
|
+
const shimmer = Math.sin(uy * 40 + fbm(ux * 6, uy * 6) * 8) * fbm(ux * 3 + 0, uy * 3 + p * 2);
|
|
24723
|
+
const dispX = shimmer * heat * 0.03 * yFade;
|
|
24724
|
+
const fromUx = Math.max(0, Math.min(1, ux + dispX));
|
|
24725
|
+
const [fromR, fromG, fromB] = sampleRgb48le(from, fromUx, uy, w, h3);
|
|
24726
|
+
const invShimmer = Math.sin(uy * 40 + fbm(ux * 6 + 3, uy * 6 + 3) * 8) * fbm(ux * 3 + 3, uy * 3 + p * 2);
|
|
24727
|
+
const dispX2 = invShimmer * (1 - p) * 0.03 * yFade;
|
|
24728
|
+
const toUx = Math.max(0, Math.min(1, ux + dispX2));
|
|
24729
|
+
const [toR, toG, toB] = sampleRgb48le(to, toUx, uy, w, h3);
|
|
24730
|
+
const haze = heat * yFade * 0.15 * (1 - p);
|
|
24731
|
+
out.writeUInt16LE(clamp16(mix16(fromR, toR, p) + Math.round(accentBright[0] * haze)), o);
|
|
24732
|
+
out.writeUInt16LE(clamp16(mix16(fromG, toG, p) + Math.round(accentBright[1] * haze)), o + 2);
|
|
24733
|
+
out.writeUInt16LE(clamp16(mix16(fromB, toB, p) + Math.round(accentBright[2] * haze)), o + 4);
|
|
24734
|
+
}
|
|
24735
|
+
};
|
|
24736
|
+
TRANSITIONS["thermal-distortion"] = thermalDistortion;
|
|
24737
|
+
domainWarp = (from, to, out, w, h3, p) => {
|
|
24738
|
+
const accentDark = [25e3, 8e3, 2e3];
|
|
24739
|
+
const accentBright = [65535, 55e3, 35e3];
|
|
24740
|
+
for (let i2 = 0; i2 < w * h3; i2++) {
|
|
24741
|
+
const ux = i2 % w / w;
|
|
24742
|
+
const uy = Math.floor(i2 / w) / h3;
|
|
24743
|
+
const o = i2 * 6;
|
|
24744
|
+
const qx = fbm(ux * 3, uy * 3);
|
|
24745
|
+
const qy = fbm(ux * 3 + 5.2, uy * 3 + 1.3);
|
|
24746
|
+
const rx = fbm(ux * 3 + qx * 4 + 1.7, uy * 3 + qy * 4 + 9.2);
|
|
24747
|
+
const ry = fbm(ux * 3 + qx * 4 + 8.3, uy * 3 + qy * 4 + 2.8);
|
|
24748
|
+
const n = fbm(ux * 3 + rx * 2, uy * 3 + ry * 2);
|
|
24749
|
+
const warpDirX = (qx - 0.5) * 0.4;
|
|
24750
|
+
const warpDirY = (qy - 0.5) * 0.4;
|
|
24751
|
+
const aUx = Math.max(0, Math.min(1, ux + warpDirX * p));
|
|
24752
|
+
const aUy = Math.max(0, Math.min(1, uy + warpDirY * p));
|
|
24753
|
+
const bUx = Math.max(0, Math.min(1, ux - warpDirX * (1 - p)));
|
|
24754
|
+
const bUy = Math.max(0, Math.min(1, uy - warpDirY * (1 - p)));
|
|
24755
|
+
const [aR, aG, aB] = sampleRgb48le(from, aUx, aUy, w, h3);
|
|
24756
|
+
const [bR, bG, bB] = sampleRgb48le(to, bUx, bUy, w, h3);
|
|
24757
|
+
const e2 = smoothstep(p - 0.08, p + 0.08, n);
|
|
24758
|
+
const ed = Math.abs(n - p);
|
|
24759
|
+
const pStep = p >= 1 ? 1 : 0;
|
|
24760
|
+
const em = smoothstep(0.1, 0, ed) * (1 - pStep);
|
|
24761
|
+
const ecBlend = smoothstep(0, 0.1, ed);
|
|
24762
|
+
const ecR = accentDark[0] + (accentBright[0] - accentDark[0]) * (1 - ecBlend);
|
|
24763
|
+
const ecG = accentDark[1] + (accentBright[1] - accentDark[1]) * (1 - ecBlend);
|
|
24764
|
+
const ecB = accentDark[2] + (accentBright[2] - accentDark[2]) * (1 - ecBlend);
|
|
24765
|
+
out.writeUInt16LE(clamp16(mix16(bR, aR, e2) + Math.round(ecR * em * 2)), o);
|
|
24766
|
+
out.writeUInt16LE(clamp16(mix16(bG, aG, e2) + Math.round(ecG * em * 2)), o + 2);
|
|
24767
|
+
out.writeUInt16LE(clamp16(mix16(bB, aB, e2) + Math.round(ecB * em * 2)), o + 4);
|
|
24768
|
+
}
|
|
24769
|
+
};
|
|
24770
|
+
TRANSITIONS["domain-warp"] = domainWarp;
|
|
24771
|
+
ridgedBurn = (from, to, out, w, h3, p) => {
|
|
24772
|
+
const accent = [5e4, 25e3, 5e3];
|
|
24773
|
+
const accentDark = [25e3, 8e3, 2e3];
|
|
24774
|
+
const accentBright = [65535, 55e3, 35e3];
|
|
24775
|
+
for (let i2 = 0; i2 < w * h3; i2++) {
|
|
24776
|
+
const ux = i2 % w / w;
|
|
24777
|
+
const uy = Math.floor(i2 / w) / h3;
|
|
24778
|
+
const o = i2 * 6;
|
|
24779
|
+
const [aR, aG, aB] = sampleRgb48le(from, ux, uy, w, h3);
|
|
24780
|
+
const [bR, bG, bB] = sampleRgb48le(to, ux, uy, w, h3);
|
|
24781
|
+
const n = ridged(ux * 4, uy * 4);
|
|
24782
|
+
const e2 = smoothstep(p - 0.04, p + 0.04, n);
|
|
24783
|
+
const heat = smoothstep(0.12, 0, Math.abs(n - p));
|
|
24784
|
+
const pStep = p >= 1 ? 1 : 0;
|
|
24785
|
+
const heatMasked = heat * (1 - pStep);
|
|
24786
|
+
let burnR = accentDark[0] + (accent[0] - accentDark[0]) * smoothstep(0, 0.25, heatMasked);
|
|
24787
|
+
let burnG = accentDark[1] + (accent[1] - accentDark[1]) * smoothstep(0, 0.25, heatMasked);
|
|
24788
|
+
let burnB = accentDark[2] + (accent[2] - accentDark[2]) * smoothstep(0, 0.25, heatMasked);
|
|
24789
|
+
const blend2 = smoothstep(0.25, 0.5, heatMasked);
|
|
24790
|
+
burnR = burnR + (accentBright[0] - burnR) * blend2;
|
|
24791
|
+
burnG = burnG + (accentBright[1] - burnG) * blend2;
|
|
24792
|
+
burnB = burnB + (accentBright[2] - burnB) * blend2;
|
|
24793
|
+
const blend3 = smoothstep(0.5, 1, heatMasked);
|
|
24794
|
+
burnR = burnR + (65535 - burnR) * blend3;
|
|
24795
|
+
burnG = burnG + (65535 - burnG) * blend3;
|
|
24796
|
+
burnB = burnB + (65535 - burnB) * blend3;
|
|
24797
|
+
const sparks = (vnoise(ux * 80, uy * 80) >= 0.92 ? 1 : 0) * heatMasked * 3;
|
|
24798
|
+
out.writeUInt16LE(
|
|
24799
|
+
clamp16(
|
|
24800
|
+
mix16(bR, aR, e2) + Math.round(burnR * heatMasked * 3.5) + Math.round(accentBright[0] * sparks)
|
|
24801
|
+
),
|
|
24802
|
+
o
|
|
24803
|
+
);
|
|
24804
|
+
out.writeUInt16LE(
|
|
24805
|
+
clamp16(
|
|
24806
|
+
mix16(bG, aG, e2) + Math.round(burnG * heatMasked * 3.5) + Math.round(accentBright[1] * sparks)
|
|
24807
|
+
),
|
|
24808
|
+
o + 2
|
|
24809
|
+
);
|
|
24810
|
+
out.writeUInt16LE(
|
|
24811
|
+
clamp16(
|
|
24812
|
+
mix16(bB, aB, e2) + Math.round(burnB * heatMasked * 3.5) + Math.round(accentBright[2] * sparks)
|
|
24813
|
+
),
|
|
24814
|
+
o + 4
|
|
24815
|
+
);
|
|
24816
|
+
}
|
|
24817
|
+
};
|
|
24818
|
+
TRANSITIONS["ridged-burn"] = ridgedBurn;
|
|
24819
|
+
}
|
|
24820
|
+
});
|
|
24821
|
+
|
|
23898
24822
|
// ../engine/src/services/hdrCapture.ts
|
|
23899
24823
|
import { existsSync as existsSync22, readdirSync as readdirSync10 } from "fs";
|
|
23900
24824
|
import { join as join25 } from "path";
|
|
23901
24825
|
import { homedir as homedir6 } from "os";
|
|
23902
24826
|
function linearToPQ(L2) {
|
|
23903
24827
|
const Lp = Math.max(0, L2 * SDR_NITS / PQ_MAX_NITS);
|
|
23904
|
-
const Lm1 = Math.pow(Lp,
|
|
23905
|
-
return Math.pow((
|
|
24828
|
+
const Lm1 = Math.pow(Lp, PQ_M12);
|
|
24829
|
+
return Math.pow((PQ_C12 + PQ_C22 * Lm1) / (1 + PQ_C32 * Lm1), PQ_M22);
|
|
23906
24830
|
}
|
|
23907
24831
|
function float16Decode(h3) {
|
|
23908
24832
|
const sign = h3 >> 15 & 1;
|
|
@@ -24093,15 +25017,15 @@ function buildHdrChromeArgs(width, height) {
|
|
|
24093
25017
|
"--force-gpu-mem-available-mb=4096"
|
|
24094
25018
|
];
|
|
24095
25019
|
}
|
|
24096
|
-
var
|
|
25020
|
+
var PQ_M12, PQ_M22, PQ_C12, PQ_C22, PQ_C32, PQ_MAX_NITS, SDR_NITS;
|
|
24097
25021
|
var init_hdrCapture = __esm({
|
|
24098
25022
|
"../engine/src/services/hdrCapture.ts"() {
|
|
24099
25023
|
"use strict";
|
|
24100
|
-
|
|
24101
|
-
|
|
24102
|
-
|
|
24103
|
-
|
|
24104
|
-
|
|
25024
|
+
PQ_M12 = 0.1593017578125;
|
|
25025
|
+
PQ_M22 = 78.84375;
|
|
25026
|
+
PQ_C12 = 0.8359375;
|
|
25027
|
+
PQ_C22 = 18.8515625;
|
|
25028
|
+
PQ_C32 = 18.6875;
|
|
24105
25029
|
PQ_MAX_NITS = 1e4;
|
|
24106
25030
|
SDR_NITS = 203;
|
|
24107
25031
|
}
|
|
@@ -24111,15 +25035,19 @@ var init_hdrCapture = __esm({
|
|
|
24111
25035
|
var src_exports = {};
|
|
24112
25036
|
__export(src_exports, {
|
|
24113
25037
|
DEFAULT_CONFIG: () => DEFAULT_CONFIG2,
|
|
25038
|
+
DOM_LAYER_MASK_STYLE_ID: () => DOM_LAYER_MASK_STYLE_ID,
|
|
24114
25039
|
ENABLE_BROWSER_POOL: () => ENABLE_BROWSER_POOL,
|
|
24115
25040
|
ENCODER_PRESETS: () => ENCODER_PRESETS,
|
|
24116
25041
|
FrameLookupTable: () => FrameLookupTable,
|
|
24117
25042
|
MEDIA_VISUAL_STYLE_PROPERTIES: () => MEDIA_VISUAL_STYLE_PROPERTIES,
|
|
25043
|
+
TRANSITIONS: () => TRANSITIONS,
|
|
24118
25044
|
acquireBrowser: () => acquireBrowser,
|
|
24119
25045
|
analyzeCompositionHdr: () => analyzeCompositionHdr,
|
|
24120
25046
|
analyzeKeyframeIntervals: () => analyzeKeyframeIntervals,
|
|
25047
|
+
applyDomLayerMask: () => applyDomLayerMask,
|
|
24121
25048
|
applyFaststart: () => applyFaststart,
|
|
24122
25049
|
beginFrameCapture: () => beginFrameCapture,
|
|
25050
|
+
blitRgb48leAffine: () => blitRgb48leAffine,
|
|
24123
25051
|
blitRgb48leRegion: () => blitRgb48leRegion,
|
|
24124
25052
|
blitRgba8OverRgb48le: () => blitRgba8OverRgb48le,
|
|
24125
25053
|
buildChromeArgs: () => buildChromeArgs,
|
|
@@ -24131,11 +25059,13 @@ __export(src_exports, {
|
|
|
24131
25059
|
captureScreenshotWithAlpha: () => captureScreenshotWithAlpha,
|
|
24132
25060
|
cdpSessionCache: () => cdpSessionCache,
|
|
24133
25061
|
closeCaptureSession: () => closeCaptureSession,
|
|
25062
|
+
convertTransfer: () => convertTransfer,
|
|
24134
25063
|
createCaptureSession: () => createCaptureSession,
|
|
24135
25064
|
createFileServer: () => createFileServer,
|
|
24136
25065
|
createFrameLookupTable: () => createFrameLookupTable,
|
|
24137
25066
|
createFrameReorderBuffer: () => createFrameReorderBuffer,
|
|
24138
25067
|
createVideoFrameInjector: () => createVideoFrameInjector,
|
|
25068
|
+
crossfade: () => crossfade,
|
|
24139
25069
|
decodePng: () => decodePng,
|
|
24140
25070
|
decodePngToRgb48le: () => decodePngToRgb48le,
|
|
24141
25071
|
detectGpuEncoder: () => detectGpuEncoder,
|
|
@@ -24159,6 +25089,7 @@ __export(src_exports, {
|
|
|
24159
25089
|
getSrgbToHdrLut: () => getSrgbToHdrLut,
|
|
24160
25090
|
getSystemResources: () => getSystemResources,
|
|
24161
25091
|
groupIntoLayers: () => groupIntoLayers,
|
|
25092
|
+
hdrToLinear: () => hdrToLinear,
|
|
24162
25093
|
hideVideoElements: () => hideVideoElements,
|
|
24163
25094
|
initHdrReadback: () => initHdrReadback,
|
|
24164
25095
|
initTransparentBackground: () => initTransparentBackground,
|
|
@@ -24167,10 +25098,12 @@ __export(src_exports, {
|
|
|
24167
25098
|
isHdrColorSpace: () => isHdrColorSpace,
|
|
24168
25099
|
isHttpUrl: () => isHttpUrl,
|
|
24169
25100
|
launchHdrBrowser: () => launchHdrBrowser,
|
|
25101
|
+
linearToHdr: () => linearToHdr,
|
|
24170
25102
|
mergeWorkerFrames: () => mergeWorkerFrames,
|
|
24171
25103
|
muxVideoWithAudio: () => muxVideoWithAudio,
|
|
24172
25104
|
pageScreenshotCapture: () => pageScreenshotCapture,
|
|
24173
25105
|
parseAudioElements: () => parseAudioElements,
|
|
25106
|
+
parseTransformMatrix: () => parseTransformMatrix,
|
|
24174
25107
|
parseVideoElements: () => parseVideoElements,
|
|
24175
25108
|
prepareCaptureSessionForReuse: () => prepareCaptureSessionForReuse,
|
|
24176
25109
|
processCompositionAudio: () => processCompositionAudio,
|
|
@@ -24178,8 +25111,12 @@ __export(src_exports, {
|
|
|
24178
25111
|
queryElementStacking: () => queryElementStacking,
|
|
24179
25112
|
queryVideoElementBounds: () => queryVideoElementBounds,
|
|
24180
25113
|
releaseBrowser: () => releaseBrowser,
|
|
25114
|
+
removeDomLayerMask: () => removeDomLayerMask,
|
|
24181
25115
|
resolveConfig: () => resolveConfig,
|
|
24182
25116
|
resolveHeadlessShellPath: () => resolveHeadlessShellPath,
|
|
25117
|
+
roundedRectAlpha: () => roundedRectAlpha,
|
|
25118
|
+
runFfmpeg: () => runFfmpeg,
|
|
25119
|
+
sampleRgb48le: () => sampleRgb48le,
|
|
24183
25120
|
showVideoElements: () => showVideoElements,
|
|
24184
25121
|
spawnStreamingEncoder: () => spawnStreamingEncoder,
|
|
24185
25122
|
syncVideoFrameVisibility: () => syncVideoFrameVisibility,
|
|
@@ -24202,8 +25139,10 @@ var init_src2 = __esm({
|
|
|
24202
25139
|
init_src();
|
|
24203
25140
|
init_ffprobe();
|
|
24204
25141
|
init_urlDownloader();
|
|
25142
|
+
init_runFfmpeg();
|
|
24205
25143
|
init_alphaBlit();
|
|
24206
25144
|
init_layerCompositor();
|
|
25145
|
+
init_shaderTransitions();
|
|
24207
25146
|
init_hdrCapture();
|
|
24208
25147
|
init_screenshotService();
|
|
24209
25148
|
init_videoFrameInjector();
|
|
@@ -26746,6 +27685,63 @@ function applyRenderModeHints(cfg, compiled, log = defaultLogger) {
|
|
|
26746
27685
|
reasons: compiled.renderModeHints.reasons.map((reason) => reason.message)
|
|
26747
27686
|
});
|
|
26748
27687
|
}
|
|
27688
|
+
function blitHdrVideoLayer(canvas, el, time, fps, hdrFrameDirs, hdrStartTimes, width, height, log, sourceTransfer, targetTransfer) {
|
|
27689
|
+
const frameDir = hdrFrameDirs.get(el.id);
|
|
27690
|
+
const startTime = hdrStartTimes.get(el.id);
|
|
27691
|
+
if (!frameDir || startTime === void 0) {
|
|
27692
|
+
return;
|
|
27693
|
+
}
|
|
27694
|
+
const videoFrameIndex = Math.round((time - startTime) * fps) + 1;
|
|
27695
|
+
if (videoFrameIndex < 1) return;
|
|
27696
|
+
const maxIndex = getMaxFrameIndex(frameDir);
|
|
27697
|
+
const effectiveIndex = maxIndex > 0 ? Math.min(videoFrameIndex, maxIndex) : videoFrameIndex;
|
|
27698
|
+
const framePath = join31(frameDir, `frame_${String(effectiveIndex).padStart(4, "0")}.png`);
|
|
27699
|
+
if (!existsSync28(framePath)) {
|
|
27700
|
+
return;
|
|
27701
|
+
}
|
|
27702
|
+
try {
|
|
27703
|
+
const { data: hdrRgb, width: srcW, height: srcH } = decodePngToRgb48le(readFileSync20(framePath));
|
|
27704
|
+
if (sourceTransfer && targetTransfer && sourceTransfer !== targetTransfer) {
|
|
27705
|
+
convertTransfer(hdrRgb, sourceTransfer, targetTransfer);
|
|
27706
|
+
}
|
|
27707
|
+
const viewportMatrix = parseTransformMatrix(el.transform);
|
|
27708
|
+
const br = el.borderRadius;
|
|
27709
|
+
const hasBorderRadius = br[0] > 0 || br[1] > 0 || br[2] > 0 || br[3] > 0;
|
|
27710
|
+
const borderRadiusParam = hasBorderRadius ? br : void 0;
|
|
27711
|
+
if (viewportMatrix) {
|
|
27712
|
+
blitRgb48leAffine(
|
|
27713
|
+
canvas,
|
|
27714
|
+
hdrRgb,
|
|
27715
|
+
viewportMatrix,
|
|
27716
|
+
srcW,
|
|
27717
|
+
srcH,
|
|
27718
|
+
width,
|
|
27719
|
+
height,
|
|
27720
|
+
el.opacity < 0.999 ? el.opacity : void 0,
|
|
27721
|
+
borderRadiusParam
|
|
27722
|
+
);
|
|
27723
|
+
} else {
|
|
27724
|
+
blitRgb48leRegion(
|
|
27725
|
+
canvas,
|
|
27726
|
+
hdrRgb,
|
|
27727
|
+
el.x,
|
|
27728
|
+
el.y,
|
|
27729
|
+
srcW,
|
|
27730
|
+
srcH,
|
|
27731
|
+
width,
|
|
27732
|
+
height,
|
|
27733
|
+
el.opacity < 0.999 ? el.opacity : void 0,
|
|
27734
|
+
borderRadiusParam
|
|
27735
|
+
);
|
|
27736
|
+
}
|
|
27737
|
+
} catch (err) {
|
|
27738
|
+
if (log) {
|
|
27739
|
+
log.debug(`HDR blit failed for ${el.id}`, {
|
|
27740
|
+
error: err instanceof Error ? err.message : String(err)
|
|
27741
|
+
});
|
|
27742
|
+
}
|
|
27743
|
+
}
|
|
27744
|
+
}
|
|
26749
27745
|
function createRenderJob(config) {
|
|
26750
27746
|
return {
|
|
26751
27747
|
id: randomUUID2(),
|
|
@@ -27016,6 +28012,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
27016
28012
|
perfStages.browserProbeMs = Date.now() - probeStart;
|
|
27017
28013
|
job.duration = composition.duration;
|
|
27018
28014
|
job.totalFrames = Math.ceil(composition.duration * job.config.fps);
|
|
28015
|
+
const totalFrames = job.totalFrames;
|
|
27019
28016
|
if (job.duration <= 0) {
|
|
27020
28017
|
const diagnostics = [];
|
|
27021
28018
|
try {
|
|
@@ -27073,7 +28070,8 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
27073
28070
|
const compiledDir = join31(workDir, "compiled");
|
|
27074
28071
|
let extractionResult = null;
|
|
27075
28072
|
const nativeHdrVideoIds = /* @__PURE__ */ new Set();
|
|
27076
|
-
|
|
28073
|
+
const videoTransfers = /* @__PURE__ */ new Map();
|
|
28074
|
+
if (job.config.hdr && composition.videos.length > 0) {
|
|
27077
28075
|
await Promise.all(
|
|
27078
28076
|
composition.videos.map(async (v) => {
|
|
27079
28077
|
let videoPath = v.src;
|
|
@@ -27085,6 +28083,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
27085
28083
|
const meta = await extractVideoMetadata(videoPath);
|
|
27086
28084
|
if (isHdrColorSpace(meta.colorSpace)) {
|
|
27087
28085
|
nativeHdrVideoIds.add(v.id);
|
|
28086
|
+
videoTransfers.set(v.id, detectTransfer(meta.colorSpace));
|
|
27088
28087
|
}
|
|
27089
28088
|
})
|
|
27090
28089
|
);
|
|
@@ -27126,13 +28125,19 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
27126
28125
|
perfStages.videoExtractMs = Date.now() - stage2Start;
|
|
27127
28126
|
}
|
|
27128
28127
|
let effectiveHdr;
|
|
27129
|
-
if (frameLookup) {
|
|
28128
|
+
if (job.config.hdr && frameLookup) {
|
|
27130
28129
|
const colorSpaces = (extractionResult?.extracted ?? []).map((ext) => ext.metadata.colorSpace);
|
|
27131
28130
|
const info = analyzeCompositionHdr(colorSpaces);
|
|
27132
28131
|
if (info.hasHdr && info.dominantTransfer) {
|
|
27133
28132
|
effectiveHdr = { transfer: info.dominantTransfer };
|
|
27134
28133
|
}
|
|
27135
28134
|
}
|
|
28135
|
+
if (job.config.hdr && !effectiveHdr && nativeHdrVideoIds.size > 0) {
|
|
28136
|
+
const firstTransfer = videoTransfers.values().next().value;
|
|
28137
|
+
if (firstTransfer) {
|
|
28138
|
+
effectiveHdr = { transfer: firstTransfer };
|
|
28139
|
+
}
|
|
28140
|
+
}
|
|
27136
28141
|
if (effectiveHdr && outputFormat !== "mp4") {
|
|
27137
28142
|
log.info(`[Render] HDR source detected but format is ${outputFormat} \u2014 using SDR`);
|
|
27138
28143
|
effectiveHdr = void 0;
|
|
@@ -27183,15 +28188,15 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
27183
28188
|
format: needsAlpha ? "png" : "jpeg",
|
|
27184
28189
|
quality: needsAlpha ? void 0 : job.config.quality === "draft" ? 80 : 95
|
|
27185
28190
|
};
|
|
27186
|
-
const workerCount = calculateOptimalWorkers(
|
|
28191
|
+
const workerCount = calculateOptimalWorkers(totalFrames, job.config.workers, cfg);
|
|
27187
28192
|
const FORMAT_EXT2 = { mp4: ".mp4", webm: ".webm", mov: ".mov" };
|
|
27188
28193
|
const videoExt = FORMAT_EXT2[outputFormat] ?? ".mp4";
|
|
27189
28194
|
const videoOnlyPath = join31(workDir, `video-only${videoExt}`);
|
|
27190
|
-
const
|
|
27191
|
-
const encoderHdr =
|
|
28195
|
+
const hasHdrContent = effectiveHdr && nativeHdrVideoIds.size > 0;
|
|
28196
|
+
const encoderHdr = hasHdrContent ? effectiveHdr : void 0;
|
|
27192
28197
|
const preset = getEncoderPreset(job.config.quality, outputFormat, encoderHdr);
|
|
27193
28198
|
job.framesRendered = 0;
|
|
27194
|
-
if (
|
|
28199
|
+
if (hasHdrContent) {
|
|
27195
28200
|
log.info("[Render] HDR layered composite: z-ordered DOM + native HLG video layers");
|
|
27196
28201
|
const hdrVideoIds = composition.videos.filter((v) => nativeHdrVideoIds.has(v.id)).map((v) => v.id);
|
|
27197
28202
|
const hdrVideoSrcPaths = /* @__PURE__ */ new Map();
|
|
@@ -27204,6 +28209,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
27204
28209
|
}
|
|
27205
28210
|
hdrVideoSrcPaths.set(v.id, srcPath);
|
|
27206
28211
|
}
|
|
28212
|
+
if (!fileServer) throw new Error("fileServer must be initialized before HDR compositing");
|
|
27207
28213
|
const domSession = await createCaptureSession(
|
|
27208
28214
|
fileServer.url,
|
|
27209
28215
|
framesDir,
|
|
@@ -27215,6 +28221,34 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
27215
28221
|
assertNotAborted();
|
|
27216
28222
|
lastBrowserConsole = domSession.browserConsoleBuffer;
|
|
27217
28223
|
await initTransparentBackground(domSession.page);
|
|
28224
|
+
const transitionMeta = await domSession.page.evaluate(() => {
|
|
28225
|
+
return window.__hf?.transitions ?? [];
|
|
28226
|
+
});
|
|
28227
|
+
const sceneElements = await domSession.page.evaluate(() => {
|
|
28228
|
+
const scenes = document.querySelectorAll(".scene");
|
|
28229
|
+
const map = {};
|
|
28230
|
+
for (const scene of scenes) {
|
|
28231
|
+
const els = scene.querySelectorAll("[data-start]");
|
|
28232
|
+
map[scene.id] = Array.from(els).map((e2) => e2.id);
|
|
28233
|
+
}
|
|
28234
|
+
return map;
|
|
28235
|
+
});
|
|
28236
|
+
const transitionRanges = transitionMeta.map((t3) => ({
|
|
28237
|
+
...t3,
|
|
28238
|
+
startFrame: Math.floor(t3.time * job.config.fps),
|
|
28239
|
+
endFrame: Math.ceil((t3.time + t3.duration) * job.config.fps)
|
|
28240
|
+
}));
|
|
28241
|
+
if (transitionRanges.length > 0) {
|
|
28242
|
+
log.info("[Render] Detected shader transitions for HDR compositing", {
|
|
28243
|
+
count: transitionRanges.length,
|
|
28244
|
+
transitions: transitionRanges.map((t3) => ({
|
|
28245
|
+
shader: t3.shader,
|
|
28246
|
+
from: t3.fromScene,
|
|
28247
|
+
to: t3.toScene,
|
|
28248
|
+
frames: `${t3.startFrame}-${t3.endFrame}`
|
|
28249
|
+
}))
|
|
28250
|
+
});
|
|
28251
|
+
}
|
|
27218
28252
|
const hdrEncoder = await spawnStreamingEncoder(
|
|
27219
28253
|
videoOnlyPath,
|
|
27220
28254
|
{
|
|
@@ -27232,7 +28266,28 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
27232
28266
|
{ ffmpegStreamingTimeout: 36e5 }
|
|
27233
28267
|
);
|
|
27234
28268
|
assertNotAborted();
|
|
27235
|
-
const
|
|
28269
|
+
const hdrExtractionDims = /* @__PURE__ */ new Map();
|
|
28270
|
+
const hdrVideoStartTimes = /* @__PURE__ */ new Map();
|
|
28271
|
+
for (const v of composition.videos) {
|
|
28272
|
+
if (hdrVideoIds.includes(v.id)) {
|
|
28273
|
+
hdrVideoStartTimes.set(v.id, v.start);
|
|
28274
|
+
}
|
|
28275
|
+
}
|
|
28276
|
+
const uniqueStartTimes = [...new Set(hdrVideoStartTimes.values())].sort((a, b) => a - b);
|
|
28277
|
+
for (const seekTime of uniqueStartTimes) {
|
|
28278
|
+
await domSession.page.evaluate((t3) => {
|
|
28279
|
+
if (window.__hf && typeof window.__hf.seek === "function") window.__hf.seek(t3);
|
|
28280
|
+
}, seekTime);
|
|
28281
|
+
if (domSession.onBeforeCapture) {
|
|
28282
|
+
await domSession.onBeforeCapture(domSession.page, seekTime);
|
|
28283
|
+
}
|
|
28284
|
+
const stacking = await queryElementStacking(domSession.page, nativeHdrVideoIds);
|
|
28285
|
+
for (const el of stacking) {
|
|
28286
|
+
if (el.isHdr && el.layoutWidth > 0 && el.layoutHeight > 0 && !hdrExtractionDims.has(el.id)) {
|
|
28287
|
+
hdrExtractionDims.set(el.id, { width: el.layoutWidth, height: el.layoutHeight });
|
|
28288
|
+
}
|
|
28289
|
+
}
|
|
28290
|
+
}
|
|
27236
28291
|
const hdrFrameDirs = /* @__PURE__ */ new Map();
|
|
27237
28292
|
for (const [videoId, srcPath] of hdrVideoSrcPaths) {
|
|
27238
28293
|
const video = composition.videos.find((v) => v.id === videoId);
|
|
@@ -27240,24 +28295,190 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
27240
28295
|
const frameDir = join31(framesDir, `hdr_${videoId}`);
|
|
27241
28296
|
mkdirSync17(frameDir, { recursive: true });
|
|
27242
28297
|
const duration = video.end - video.start;
|
|
27243
|
-
|
|
27244
|
-
|
|
27245
|
-
|
|
27246
|
-
|
|
27247
|
-
|
|
27248
|
-
|
|
28298
|
+
const dims = hdrExtractionDims.get(videoId) ?? { width, height };
|
|
28299
|
+
const ffmpegArgs = [
|
|
28300
|
+
"-ss",
|
|
28301
|
+
String(video.mediaStart),
|
|
28302
|
+
"-i",
|
|
28303
|
+
srcPath,
|
|
28304
|
+
"-t",
|
|
28305
|
+
String(duration),
|
|
28306
|
+
"-r",
|
|
28307
|
+
String(job.config.fps),
|
|
28308
|
+
"-vf",
|
|
28309
|
+
`scale=${dims.width}:${dims.height}:force_original_aspect_ratio=increase,crop=${dims.width}:${dims.height}`,
|
|
28310
|
+
"-pix_fmt",
|
|
28311
|
+
"rgb48le",
|
|
28312
|
+
"-c:v",
|
|
28313
|
+
"png",
|
|
28314
|
+
"-y",
|
|
28315
|
+
join31(frameDir, "frame_%04d.png")
|
|
28316
|
+
];
|
|
28317
|
+
const result = await runFfmpeg(ffmpegArgs, { signal: abortSignal });
|
|
28318
|
+
if (!result.success) {
|
|
27249
28319
|
log.warn("HDR frame pre-extraction failed; loop will fill with black", {
|
|
27250
28320
|
videoId,
|
|
27251
28321
|
srcPath,
|
|
27252
|
-
|
|
28322
|
+
stderr: result.stderr.slice(-400)
|
|
27253
28323
|
});
|
|
27254
28324
|
}
|
|
27255
28325
|
hdrFrameDirs.set(videoId, frameDir);
|
|
27256
28326
|
}
|
|
27257
28327
|
assertNotAborted();
|
|
27258
28328
|
try {
|
|
28329
|
+
let countNonZeroAlpha2 = function(rgba) {
|
|
28330
|
+
let n = 0;
|
|
28331
|
+
for (let p = 3; p < rgba.length; p += 4) {
|
|
28332
|
+
if (rgba[p] !== 0) n++;
|
|
28333
|
+
}
|
|
28334
|
+
return n;
|
|
28335
|
+
}, countNonZeroRgb482 = function(buf) {
|
|
28336
|
+
let n = 0;
|
|
28337
|
+
for (let p = 0; p < buf.length; p += 6) {
|
|
28338
|
+
if (buf[p] !== 0 || buf[p + 1] !== 0 || buf[p + 2] !== 0) n++;
|
|
28339
|
+
}
|
|
28340
|
+
return n;
|
|
28341
|
+
};
|
|
28342
|
+
var countNonZeroAlpha = countNonZeroAlpha2, countNonZeroRgb48 = countNonZeroRgb482;
|
|
27259
28343
|
const beforeCaptureHook = domSession.onBeforeCapture;
|
|
27260
|
-
|
|
28344
|
+
const cleanedUpVideos = /* @__PURE__ */ new Set();
|
|
28345
|
+
const hdrVideoEndTimes = /* @__PURE__ */ new Map();
|
|
28346
|
+
for (const v of composition.videos) {
|
|
28347
|
+
if (hdrFrameDirs.has(v.id)) {
|
|
28348
|
+
hdrVideoEndTimes.set(v.id, v.end);
|
|
28349
|
+
}
|
|
28350
|
+
}
|
|
28351
|
+
const debugDumpEnabled = process.env.KEEP_TEMP === "1";
|
|
28352
|
+
const debugDumpDir = debugDumpEnabled ? join31(framesDir, "debug-composite") : null;
|
|
28353
|
+
if (debugDumpDir && !existsSync28(debugDumpDir)) {
|
|
28354
|
+
mkdirSync17(debugDumpDir, { recursive: true });
|
|
28355
|
+
}
|
|
28356
|
+
async function compositeToBuffer(canvas, time, fullStacking, elementFilter, debugFrameIndex = -1) {
|
|
28357
|
+
const filteredStacking = elementFilter ? fullStacking.filter((e2) => elementFilter.has(e2.id)) : fullStacking;
|
|
28358
|
+
const layers = groupIntoLayers(filteredStacking);
|
|
28359
|
+
const shouldLog = debugDumpEnabled && debugFrameIndex >= 0;
|
|
28360
|
+
if (shouldLog) {
|
|
28361
|
+
log.info("[diag] compositeToBuffer plan", {
|
|
28362
|
+
frame: debugFrameIndex,
|
|
28363
|
+
time: time.toFixed(3),
|
|
28364
|
+
filterSize: elementFilter?.size,
|
|
28365
|
+
fullStackingCount: fullStacking.length,
|
|
28366
|
+
filteredCount: filteredStacking.length,
|
|
28367
|
+
layerCount: layers.length,
|
|
28368
|
+
layers: layers.map(
|
|
28369
|
+
(l) => l.type === "hdr" ? {
|
|
28370
|
+
type: "hdr",
|
|
28371
|
+
id: l.element.id,
|
|
28372
|
+
z: l.element.zIndex,
|
|
28373
|
+
visible: l.element.visible,
|
|
28374
|
+
opacity: l.element.opacity,
|
|
28375
|
+
bounds: `${Math.round(l.element.x)},${Math.round(l.element.y)} ${Math.round(l.element.width)}x${Math.round(l.element.height)}`
|
|
28376
|
+
} : { type: "dom", ids: l.elementIds }
|
|
28377
|
+
)
|
|
28378
|
+
});
|
|
28379
|
+
}
|
|
28380
|
+
for (let layerIdx = 0; layerIdx < layers.length; layerIdx++) {
|
|
28381
|
+
const layer = layers[layerIdx];
|
|
28382
|
+
if (layer.type === "hdr") {
|
|
28383
|
+
const before2 = shouldLog ? countNonZeroRgb482(canvas) : 0;
|
|
28384
|
+
blitHdrVideoLayer(
|
|
28385
|
+
canvas,
|
|
28386
|
+
layer.element,
|
|
28387
|
+
time,
|
|
28388
|
+
job.config.fps,
|
|
28389
|
+
hdrFrameDirs,
|
|
28390
|
+
hdrVideoStartTimes,
|
|
28391
|
+
width,
|
|
28392
|
+
height,
|
|
28393
|
+
log,
|
|
28394
|
+
videoTransfers.get(layer.element.id),
|
|
28395
|
+
effectiveHdr?.transfer
|
|
28396
|
+
);
|
|
28397
|
+
if (shouldLog) {
|
|
28398
|
+
const after2 = countNonZeroRgb482(canvas);
|
|
28399
|
+
const frameDir = hdrFrameDirs.get(layer.element.id);
|
|
28400
|
+
const startTime = hdrVideoStartTimes.get(layer.element.id) ?? 0;
|
|
28401
|
+
const localTime = time - startTime;
|
|
28402
|
+
const frameNum = Math.floor(localTime * job.config.fps) + 1;
|
|
28403
|
+
const expectedFrame = frameDir ? join31(frameDir, `frame_${String(frameNum).padStart(4, "0")}.png`) : null;
|
|
28404
|
+
log.info("[diag] hdr layer blit", {
|
|
28405
|
+
frame: debugFrameIndex,
|
|
28406
|
+
layerIdx,
|
|
28407
|
+
id: layer.element.id,
|
|
28408
|
+
pixelsAdded: after2 - before2,
|
|
28409
|
+
totalNonZero: after2,
|
|
28410
|
+
startTime,
|
|
28411
|
+
localTime: localTime.toFixed(3),
|
|
28412
|
+
hdrFrameNum: frameNum,
|
|
28413
|
+
expectedFrame,
|
|
28414
|
+
expectedFrameExists: expectedFrame ? existsSync28(expectedFrame) : false
|
|
28415
|
+
});
|
|
28416
|
+
}
|
|
28417
|
+
} else {
|
|
28418
|
+
const allElementIds = fullStacking.map((e2) => e2.id);
|
|
28419
|
+
const layerIds = new Set(layer.elementIds);
|
|
28420
|
+
const hideIds = allElementIds.filter((id) => !layerIds.has(id));
|
|
28421
|
+
await domSession.page.evaluate((t3) => {
|
|
28422
|
+
if (window.__hf && typeof window.__hf.seek === "function") window.__hf.seek(t3);
|
|
28423
|
+
}, time);
|
|
28424
|
+
if (beforeCaptureHook) {
|
|
28425
|
+
await beforeCaptureHook(domSession.page, time);
|
|
28426
|
+
}
|
|
28427
|
+
await applyDomLayerMask(domSession.page, layer.elementIds, hideIds);
|
|
28428
|
+
const domPng = await captureAlphaPng(domSession.page, width, height);
|
|
28429
|
+
await removeDomLayerMask(domSession.page, hideIds);
|
|
28430
|
+
try {
|
|
28431
|
+
const { data: domRgba } = decodePng(domPng);
|
|
28432
|
+
if (!effectiveHdr) {
|
|
28433
|
+
throw new Error(
|
|
28434
|
+
"Invariant violation: effectiveHdr is undefined inside HDR layer branch"
|
|
28435
|
+
);
|
|
28436
|
+
}
|
|
28437
|
+
const before2 = shouldLog ? countNonZeroRgb482(canvas) : 0;
|
|
28438
|
+
const alphaPixels = shouldLog ? countNonZeroAlpha2(domRgba) : 0;
|
|
28439
|
+
blitRgba8OverRgb48le(domRgba, canvas, width, height, effectiveHdr.transfer);
|
|
28440
|
+
if (shouldLog && debugDumpDir) {
|
|
28441
|
+
const after2 = countNonZeroRgb482(canvas);
|
|
28442
|
+
const dumpName = `frame_${String(debugFrameIndex).padStart(4, "0")}_layer_${String(layerIdx).padStart(2, "0")}_dom.png`;
|
|
28443
|
+
const dumpPath = join31(debugDumpDir, dumpName);
|
|
28444
|
+
writeFileSync10(dumpPath, domPng);
|
|
28445
|
+
log.info("[diag] dom layer blit", {
|
|
28446
|
+
frame: debugFrameIndex,
|
|
28447
|
+
layerIdx,
|
|
28448
|
+
layerIds: layer.elementIds,
|
|
28449
|
+
hideCount: hideIds.length,
|
|
28450
|
+
pngBytes: domPng.length,
|
|
28451
|
+
alphaPixels,
|
|
28452
|
+
pixelsAdded: after2 - before2,
|
|
28453
|
+
totalNonZero: after2,
|
|
28454
|
+
dumpPath
|
|
28455
|
+
});
|
|
28456
|
+
}
|
|
28457
|
+
} catch (err) {
|
|
28458
|
+
log.warn("DOM layer decode/blit failed; skipping overlay", {
|
|
28459
|
+
layerIds: layer.elementIds,
|
|
28460
|
+
error: err instanceof Error ? err.message : String(err)
|
|
28461
|
+
});
|
|
28462
|
+
}
|
|
28463
|
+
}
|
|
28464
|
+
}
|
|
28465
|
+
if (shouldLog && debugDumpDir) {
|
|
28466
|
+
const finalNonZero = countNonZeroRgb482(canvas);
|
|
28467
|
+
log.info("[diag] compositeToBuffer end", {
|
|
28468
|
+
frame: debugFrameIndex,
|
|
28469
|
+
finalNonZeroPixels: finalNonZero,
|
|
28470
|
+
totalPixels: width * height,
|
|
28471
|
+
coverage: (finalNonZero / (width * height) * 100).toFixed(1) + "%"
|
|
28472
|
+
});
|
|
28473
|
+
}
|
|
28474
|
+
}
|
|
28475
|
+
const bufSize = width * height * 6;
|
|
28476
|
+
const hasTransitions = transitionRanges.length > 0;
|
|
28477
|
+
const transBufferA = hasTransitions ? Buffer.alloc(bufSize) : null;
|
|
28478
|
+
const transBufferB = hasTransitions ? Buffer.alloc(bufSize) : null;
|
|
28479
|
+
const transOutput = hasTransitions ? Buffer.alloc(bufSize) : null;
|
|
28480
|
+
const normalCanvas = Buffer.alloc(bufSize);
|
|
28481
|
+
for (let i2 = 0; i2 < totalFrames; i2++) {
|
|
27261
28482
|
assertNotAborted();
|
|
27262
28483
|
const time = i2 / job.config.fps;
|
|
27263
28484
|
await domSession.page.evaluate((t3) => {
|
|
@@ -27267,81 +28488,118 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
27267
28488
|
await beforeCaptureHook(domSession.page, time);
|
|
27268
28489
|
}
|
|
27269
28490
|
const stackingInfo = await queryElementStacking(domSession.page, nativeHdrVideoIds);
|
|
27270
|
-
const
|
|
28491
|
+
const activeTransition = transitionRanges.find(
|
|
28492
|
+
(t3) => i2 >= t3.startFrame && i2 <= t3.endFrame
|
|
28493
|
+
);
|
|
27271
28494
|
if (i2 % 30 === 0) {
|
|
27272
28495
|
const hdrEl = stackingInfo.find((e2) => e2.isHdr);
|
|
27273
|
-
const hdrInLayers = layers.some((l) => l.type === "hdr");
|
|
27274
28496
|
log.debug("[Render] HDR layer composite frame", {
|
|
27275
28497
|
frame: i2,
|
|
27276
28498
|
time: time.toFixed(2),
|
|
27277
28499
|
hdrElement: hdrEl ? { z: hdrEl.zIndex, visible: hdrEl.visible, width: hdrEl.width } : null,
|
|
27278
|
-
|
|
27279
|
-
|
|
28500
|
+
stackingCount: stackingInfo.length,
|
|
28501
|
+
activeTransition: activeTransition?.shader
|
|
27280
28502
|
});
|
|
27281
28503
|
}
|
|
27282
|
-
|
|
27283
|
-
|
|
27284
|
-
|
|
27285
|
-
|
|
27286
|
-
|
|
27287
|
-
|
|
27288
|
-
|
|
27289
|
-
|
|
27290
|
-
|
|
27291
|
-
|
|
27292
|
-
const framePath = inBounds ? join31(frameDir, `frame_${String(videoFrameIndex).padStart(4, "0")}.png`) : null;
|
|
27293
|
-
if (framePath !== null && existsSync28(framePath)) {
|
|
27294
|
-
try {
|
|
27295
|
-
const hdrRgb = decodePngToRgb48le(readFileSync20(framePath)).data;
|
|
27296
|
-
blitRgb48leRegion(
|
|
27297
|
-
canvas,
|
|
27298
|
-
hdrRgb,
|
|
27299
|
-
el.x,
|
|
27300
|
-
el.y,
|
|
27301
|
-
el.width,
|
|
27302
|
-
el.height,
|
|
27303
|
-
width,
|
|
27304
|
-
height,
|
|
27305
|
-
el.opacity < 0.999 ? el.opacity : void 0
|
|
27306
|
-
);
|
|
27307
|
-
} catch (err) {
|
|
27308
|
-
log.warn("HDR layer decode/blit failed; skipping layer for frame", {
|
|
27309
|
-
frameIndex: i2,
|
|
27310
|
-
videoId: el.id,
|
|
27311
|
-
framePath,
|
|
27312
|
-
error: err instanceof Error ? err.message : String(err)
|
|
27313
|
-
});
|
|
27314
|
-
}
|
|
27315
|
-
}
|
|
27316
|
-
} else {
|
|
27317
|
-
const allElementIds = stackingInfo.map((e2) => e2.id);
|
|
27318
|
-
const layerIds = new Set(layer.elementIds);
|
|
27319
|
-
const hideIds = allElementIds.filter(
|
|
27320
|
-
(id) => !layerIds.has(id) || nativeHdrVideoIds.has(id)
|
|
27321
|
-
);
|
|
27322
|
-
await hideVideoElements(domSession.page, hideIds);
|
|
27323
|
-
const domPng = await captureAlphaPng(domSession.page, width, height);
|
|
27324
|
-
await showVideoElements(domSession.page, hideIds);
|
|
28504
|
+
if (activeTransition && transBufferA && transBufferB && transOutput) {
|
|
28505
|
+
const progress = activeTransition.endFrame === activeTransition.startFrame ? 1 : (i2 - activeTransition.startFrame) / (activeTransition.endFrame - activeTransition.startFrame);
|
|
28506
|
+
const sceneAIds = new Set(sceneElements[activeTransition.fromScene] ?? []);
|
|
28507
|
+
const sceneBIds = new Set(sceneElements[activeTransition.toScene] ?? []);
|
|
28508
|
+
transBufferA.fill(0);
|
|
28509
|
+
transBufferB.fill(0);
|
|
28510
|
+
for (const [sceneBuf, sceneIds] of [
|
|
28511
|
+
[transBufferA, sceneAIds],
|
|
28512
|
+
[transBufferB, sceneBIds]
|
|
28513
|
+
]) {
|
|
27325
28514
|
await domSession.page.evaluate((t3) => {
|
|
27326
28515
|
if (window.__hf && typeof window.__hf.seek === "function") window.__hf.seek(t3);
|
|
27327
28516
|
}, time);
|
|
28517
|
+
if (beforeCaptureHook) {
|
|
28518
|
+
await beforeCaptureHook(domSession.page, time);
|
|
28519
|
+
}
|
|
28520
|
+
for (const el of stackingInfo) {
|
|
28521
|
+
if (!el.isHdr || !sceneIds.has(el.id)) continue;
|
|
28522
|
+
blitHdrVideoLayer(
|
|
28523
|
+
sceneBuf,
|
|
28524
|
+
el,
|
|
28525
|
+
time,
|
|
28526
|
+
job.config.fps,
|
|
28527
|
+
hdrFrameDirs,
|
|
28528
|
+
hdrVideoStartTimes,
|
|
28529
|
+
width,
|
|
28530
|
+
height,
|
|
28531
|
+
log,
|
|
28532
|
+
videoTransfers.get(el.id),
|
|
28533
|
+
effectiveHdr?.transfer
|
|
28534
|
+
);
|
|
28535
|
+
}
|
|
28536
|
+
const showIds = Array.from(sceneIds);
|
|
28537
|
+
const hideIds = stackingInfo.map((e2) => e2.id).filter((id) => !sceneIds.has(id) || nativeHdrVideoIds.has(id));
|
|
28538
|
+
await applyDomLayerMask(domSession.page, showIds, hideIds);
|
|
28539
|
+
const domPng = await captureAlphaPng(domSession.page, width, height);
|
|
28540
|
+
await removeDomLayerMask(domSession.page, hideIds);
|
|
27328
28541
|
try {
|
|
27329
28542
|
const { data: domRgba } = decodePng(domPng);
|
|
27330
|
-
|
|
27331
|
-
|
|
28543
|
+
if (!effectiveHdr) {
|
|
28544
|
+
throw new Error(
|
|
28545
|
+
"Invariant violation: effectiveHdr is undefined inside hasHdrVideo branch"
|
|
28546
|
+
);
|
|
28547
|
+
}
|
|
28548
|
+
blitRgba8OverRgb48le(
|
|
28549
|
+
domRgba,
|
|
28550
|
+
sceneBuf,
|
|
28551
|
+
width,
|
|
28552
|
+
height,
|
|
28553
|
+
effectiveHdr.transfer
|
|
28554
|
+
);
|
|
27332
28555
|
} catch (err) {
|
|
27333
|
-
log.warn("DOM layer decode/blit failed; skipping overlay for
|
|
28556
|
+
log.warn("DOM layer decode/blit failed; skipping overlay for transition scene", {
|
|
27334
28557
|
frameIndex: i2,
|
|
27335
|
-
|
|
28558
|
+
sceneIds: Array.from(sceneIds),
|
|
27336
28559
|
error: err instanceof Error ? err.message : String(err)
|
|
27337
28560
|
});
|
|
27338
28561
|
}
|
|
27339
28562
|
}
|
|
28563
|
+
const transitionFn = TRANSITIONS[activeTransition.shader] ?? crossfade;
|
|
28564
|
+
transitionFn(transBufferA, transBufferB, transOutput, width, height, progress);
|
|
28565
|
+
hdrEncoder.writeFrame(transOutput);
|
|
28566
|
+
} else {
|
|
28567
|
+
normalCanvas.fill(0);
|
|
28568
|
+
await compositeToBuffer(normalCanvas, time, stackingInfo, void 0, i2);
|
|
28569
|
+
if (debugDumpEnabled && debugDumpDir && i2 % 30 === 0) {
|
|
28570
|
+
const previewPath = join31(
|
|
28571
|
+
debugDumpDir,
|
|
28572
|
+
`frame_${String(i2).padStart(4, "0")}_final_rgb48le.bin`
|
|
28573
|
+
);
|
|
28574
|
+
writeFileSync10(previewPath, normalCanvas);
|
|
28575
|
+
}
|
|
28576
|
+
hdrEncoder.writeFrame(normalCanvas);
|
|
28577
|
+
}
|
|
28578
|
+
if (process.env.KEEP_TEMP !== "1") {
|
|
28579
|
+
for (const [videoId, endTime] of hdrVideoEndTimes) {
|
|
28580
|
+
if (time > endTime && !cleanedUpVideos.has(videoId)) {
|
|
28581
|
+
const stillNeeded = activeTransition && (sceneElements[activeTransition.fromScene]?.includes(videoId) || sceneElements[activeTransition.toScene]?.includes(videoId));
|
|
28582
|
+
if (!stillNeeded) {
|
|
28583
|
+
const frameDir = hdrFrameDirs.get(videoId);
|
|
28584
|
+
if (frameDir) {
|
|
28585
|
+
try {
|
|
28586
|
+
rmSync6(frameDir, { recursive: true, force: true });
|
|
28587
|
+
} catch (err) {
|
|
28588
|
+
log.warn("Failed to clean up HDR frame directory", {
|
|
28589
|
+
videoId,
|
|
28590
|
+
frameDir,
|
|
28591
|
+
error: err instanceof Error ? err.message : String(err)
|
|
28592
|
+
});
|
|
28593
|
+
}
|
|
28594
|
+
}
|
|
28595
|
+
cleanedUpVideos.add(videoId);
|
|
28596
|
+
}
|
|
28597
|
+
}
|
|
28598
|
+
}
|
|
27340
28599
|
}
|
|
27341
|
-
hdrEncoder.writeFrame(canvas);
|
|
27342
28600
|
job.framesRendered = i2 + 1;
|
|
27343
|
-
if ((i2 + 1) % 10 === 0 || i2 + 1 ===
|
|
27344
|
-
const frameProgress = (i2 + 1) /
|
|
28601
|
+
if ((i2 + 1) % 10 === 0 || i2 + 1 === totalFrames) {
|
|
28602
|
+
const frameProgress = (i2 + 1) / totalFrames;
|
|
27345
28603
|
updateJobStatus(
|
|
27346
28604
|
job,
|
|
27347
28605
|
"rendering",
|
|
@@ -27384,7 +28642,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
27384
28642
|
assertNotAborted();
|
|
27385
28643
|
}
|
|
27386
28644
|
if (enableStreamingEncode && streamingEncoder) {
|
|
27387
|
-
const reorderBuffer = createFrameReorderBuffer(0,
|
|
28645
|
+
const reorderBuffer = createFrameReorderBuffer(0, totalFrames);
|
|
27388
28646
|
const currentEncoder = streamingEncoder;
|
|
27389
28647
|
if (workerCount > 1) {
|
|
27390
28648
|
const tasks = distributeFrames(job.totalFrames, workerCount, workDir);
|
|
@@ -27441,7 +28699,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
27441
28699
|
}
|
|
27442
28700
|
assertNotAborted();
|
|
27443
28701
|
lastBrowserConsole = session.browserConsoleBuffer;
|
|
27444
|
-
for (let i2 = 0; i2 <
|
|
28702
|
+
for (let i2 = 0; i2 < totalFrames; i2++) {
|
|
27445
28703
|
assertNotAborted();
|
|
27446
28704
|
const time = i2 / job.config.fps;
|
|
27447
28705
|
const { buffer } = await captureFrameToBuffer(session, i2, time);
|
|
@@ -27449,7 +28707,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
27449
28707
|
currentEncoder.writeFrame(buffer);
|
|
27450
28708
|
reorderBuffer.advanceTo(i2 + 1);
|
|
27451
28709
|
job.framesRendered = i2 + 1;
|
|
27452
|
-
const frameProgress = (i2 + 1) /
|
|
28710
|
+
const frameProgress = (i2 + 1) / totalFrames;
|
|
27453
28711
|
const progress = 25 + frameProgress * 55;
|
|
27454
28712
|
updateJobStatus(
|
|
27455
28713
|
job,
|
|
@@ -27622,12 +28880,12 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
27622
28880
|
chunkedEncode: enableChunkedEncode,
|
|
27623
28881
|
chunkSizeFrames: enableChunkedEncode ? chunkedEncodeSize : null,
|
|
27624
28882
|
compositionDurationSeconds: composition.duration,
|
|
27625
|
-
totalFrames
|
|
28883
|
+
totalFrames,
|
|
27626
28884
|
resolution: { width, height },
|
|
27627
28885
|
videoCount: composition.videos.length,
|
|
27628
28886
|
audioCount: composition.audios.length,
|
|
27629
28887
|
stages: perfStages,
|
|
27630
|
-
captureAvgMs:
|
|
28888
|
+
captureAvgMs: totalFrames > 0 ? Math.round((perfStages.captureMs ?? 0) / totalFrames) : void 0
|
|
27631
28889
|
};
|
|
27632
28890
|
job.perfSummary = perfSummary;
|
|
27633
28891
|
if (job.config.debug) {
|
|
@@ -27645,6 +28903,8 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
27645
28903
|
const debugOutput = join31(workDir, `output${videoExt}`);
|
|
27646
28904
|
copyFileSync2(outputPath, debugOutput);
|
|
27647
28905
|
}
|
|
28906
|
+
} else if (process.env.KEEP_TEMP === "1") {
|
|
28907
|
+
log.info("KEEP_TEMP=1 \u2014 leaving workDir on disk for inspection", { workDir });
|
|
27648
28908
|
} else {
|
|
27649
28909
|
await safeCleanup(
|
|
27650
28910
|
"remove workDir",
|
|
@@ -30444,9 +31704,7 @@ async function renderDocker(projectDir, outputPath, options) {
|
|
|
30444
31704
|
"--workers",
|
|
30445
31705
|
String(options.workers),
|
|
30446
31706
|
...options.quiet ? ["--quiet"] : [],
|
|
30447
|
-
...options.gpu ? ["--gpu"] : []
|
|
30448
|
-
...options.crf != null ? ["--crf", String(options.crf)] : [],
|
|
30449
|
-
...options.videoBitrate ? ["--video-bitrate", options.videoBitrate] : []
|
|
31707
|
+
...options.gpu ? ["--gpu"] : []
|
|
30450
31708
|
];
|
|
30451
31709
|
if (!options.quiet) {
|
|
30452
31710
|
console.log(c.dim(" Running render in Docker container..."));
|
|
@@ -30491,8 +31749,7 @@ async function renderLocal(projectDir, outputPath, options) {
|
|
|
30491
31749
|
format: options.format,
|
|
30492
31750
|
workers: options.workers,
|
|
30493
31751
|
useGpu: options.gpu,
|
|
30494
|
-
|
|
30495
|
-
videoBitrate: options.videoBitrate
|
|
31752
|
+
hdr: options.hdr
|
|
30496
31753
|
});
|
|
30497
31754
|
const onProgress = options.quiet ? void 0 : (progressJob, message) => {
|
|
30498
31755
|
renderProgress(progressJob.progress, message);
|
|
@@ -30581,10 +31838,9 @@ var init_render2 = __esm({
|
|
|
30581
31838
|
["Render transparent overlay (ProRes)", "hyperframes render --format mov --output overlay.mov"],
|
|
30582
31839
|
["Render transparent WebM overlay", "hyperframes render --format webm --output overlay.webm"],
|
|
30583
31840
|
["High quality at 60fps", "hyperframes render --fps 60 --quality high --output hd.mp4"],
|
|
30584
|
-
["Custom CRF for maximum quality", "hyperframes render --crf 15 --output pristine.mp4"],
|
|
30585
|
-
["Target bitrate encoding", "hyperframes render --video-bitrate 10M --output hq.mp4"],
|
|
30586
31841
|
["Deterministic render via Docker", "hyperframes render --docker --output deterministic.mp4"],
|
|
30587
|
-
["Parallel rendering with 6 workers", "hyperframes render --workers 6 --output fast.mp4"]
|
|
31842
|
+
["Parallel rendering with 6 workers", "hyperframes render --workers 6 --output fast.mp4"],
|
|
31843
|
+
["HDR output (H.265 10-bit)", "hyperframes render --hdr --output hdr-output.mp4"]
|
|
30588
31844
|
];
|
|
30589
31845
|
VALID_FPS = /* @__PURE__ */ new Set([24, 30, 60]);
|
|
30590
31846
|
VALID_QUALITY = /* @__PURE__ */ new Set(["draft", "standard", "high"]);
|
|
@@ -30630,13 +31886,10 @@ var init_render2 = __esm({
|
|
|
30630
31886
|
description: "Use Docker for deterministic render",
|
|
30631
31887
|
default: false
|
|
30632
31888
|
},
|
|
30633
|
-
|
|
30634
|
-
type: "
|
|
30635
|
-
description: "
|
|
30636
|
-
|
|
30637
|
-
"video-bitrate": {
|
|
30638
|
-
type: "string",
|
|
30639
|
-
description: "Target video bitrate (e.g. '10M', '5000k'). Uses bitrate-based encoding instead of CRF. Cannot be used with --crf."
|
|
31889
|
+
hdr: {
|
|
31890
|
+
type: "boolean",
|
|
31891
|
+
description: "Enable HDR: probe sources for PQ/HLG, output H.265 10-bit BT.2020",
|
|
31892
|
+
default: false
|
|
30640
31893
|
},
|
|
30641
31894
|
gpu: { type: "boolean", description: "Use GPU encoding", default: false },
|
|
30642
31895
|
quiet: {
|
|
@@ -30679,34 +31932,6 @@ var init_render2 = __esm({
|
|
|
30679
31932
|
process.exit(1);
|
|
30680
31933
|
}
|
|
30681
31934
|
const format = formatRaw;
|
|
30682
|
-
let crf;
|
|
30683
|
-
let videoBitrate;
|
|
30684
|
-
if (args.crf != null && args["video-bitrate"] != null) {
|
|
30685
|
-
errorBox(
|
|
30686
|
-
"Conflicting options",
|
|
30687
|
-
"--crf and --video-bitrate cannot be used together. Choose one."
|
|
30688
|
-
);
|
|
30689
|
-
process.exit(1);
|
|
30690
|
-
}
|
|
30691
|
-
if (args.crf != null) {
|
|
30692
|
-
const parsed = parseInt(args.crf, 10);
|
|
30693
|
-
if (isNaN(parsed) || parsed < 0 || parsed > 51) {
|
|
30694
|
-
errorBox("Invalid CRF", `Got "${args.crf}". Must be a number between 0 and 51.`);
|
|
30695
|
-
process.exit(1);
|
|
30696
|
-
}
|
|
30697
|
-
crf = parsed;
|
|
30698
|
-
}
|
|
30699
|
-
if (args["video-bitrate"] != null) {
|
|
30700
|
-
const raw = args["video-bitrate"];
|
|
30701
|
-
if (!/^\d+(\.\d+)?[kKM]$/.test(raw)) {
|
|
30702
|
-
errorBox(
|
|
30703
|
-
"Invalid video bitrate",
|
|
30704
|
-
`Got "${raw}". Must be a number followed by k, K, or M (e.g. "10M", "5000k", "1.5M").`
|
|
30705
|
-
);
|
|
30706
|
-
process.exit(1);
|
|
30707
|
-
}
|
|
30708
|
-
videoBitrate = raw;
|
|
30709
|
-
}
|
|
30710
31935
|
let workers;
|
|
30711
31936
|
if (args.workers != null && args.workers !== "auto") {
|
|
30712
31937
|
const parsed = parseInt(args.workers, 10);
|
|
@@ -30746,8 +31971,7 @@ var init_render2 = __esm({
|
|
|
30746
31971
|
console.log(
|
|
30747
31972
|
c.accent("\u25C6") + " Rendering " + c.accent(project.name) + c.dim(" \u2192 " + outputPath)
|
|
30748
31973
|
);
|
|
30749
|
-
|
|
30750
|
-
console.log(c.dim(" " + fps + "fps \xB7 " + encodeLabel + " \xB7 " + workerLabel));
|
|
31974
|
+
console.log(c.dim(" " + fps + "fps \xB7 " + quality + " \xB7 " + workerLabel));
|
|
30751
31975
|
console.log("");
|
|
30752
31976
|
}
|
|
30753
31977
|
if (!useDocker) {
|
|
@@ -30817,9 +32041,8 @@ var init_render2 = __esm({
|
|
|
30817
32041
|
format,
|
|
30818
32042
|
workers: workerCount,
|
|
30819
32043
|
gpu: useGpu,
|
|
30820
|
-
|
|
30821
|
-
|
|
30822
|
-
videoBitrate
|
|
32044
|
+
hdr: args.hdr ?? false,
|
|
32045
|
+
quiet
|
|
30823
32046
|
});
|
|
30824
32047
|
} else {
|
|
30825
32048
|
await renderLocal(project.dir, outputPath, {
|
|
@@ -30828,10 +32051,9 @@ var init_render2 = __esm({
|
|
|
30828
32051
|
format,
|
|
30829
32052
|
workers: workerCount,
|
|
30830
32053
|
gpu: useGpu,
|
|
32054
|
+
hdr: args.hdr ?? false,
|
|
30831
32055
|
quiet,
|
|
30832
|
-
browserPath
|
|
30833
|
-
crf,
|
|
30834
|
-
videoBitrate
|
|
32056
|
+
browserPath
|
|
30835
32057
|
});
|
|
30836
32058
|
}
|
|
30837
32059
|
}
|
|
@@ -34125,9 +35347,9 @@ async function saveLottieAnimations(discoveredLotties, lottieDir) {
|
|
|
34125
35347
|
jsonData = animEntry.getData().toString("utf-8");
|
|
34126
35348
|
}
|
|
34127
35349
|
} catch {
|
|
34128
|
-
const
|
|
34129
|
-
if (savedHashes.has(
|
|
34130
|
-
savedHashes.add(
|
|
35350
|
+
const hash2 = buf.toString("base64").slice(0, 100);
|
|
35351
|
+
if (savedHashes.has(hash2)) continue;
|
|
35352
|
+
savedHashes.add(hash2);
|
|
34131
35353
|
writeFileSync18(join47(lottieDir, `animation-${savedCount}.lottie`), buf);
|
|
34132
35354
|
savedCount++;
|
|
34133
35355
|
continue;
|
|
@@ -34137,9 +35359,9 @@ async function saveLottieAnimations(discoveredLotties, lottieDir) {
|
|
|
34137
35359
|
}
|
|
34138
35360
|
}
|
|
34139
35361
|
if (jsonData) {
|
|
34140
|
-
const
|
|
34141
|
-
if (savedHashes.has(
|
|
34142
|
-
savedHashes.add(
|
|
35362
|
+
const hash2 = jsonData.slice(0, 200);
|
|
35363
|
+
if (savedHashes.has(hash2)) continue;
|
|
35364
|
+
savedHashes.add(hash2);
|
|
34143
35365
|
try {
|
|
34144
35366
|
const parsed = JSON.parse(jsonData);
|
|
34145
35367
|
if (!parsed.layers || !parsed.w) continue;
|
|
@@ -35368,12 +36590,12 @@ var require_common2 = __commonJS({
|
|
|
35368
36590
|
createDebug.skips = [];
|
|
35369
36591
|
createDebug.formatters = {};
|
|
35370
36592
|
function selectColor(namespace) {
|
|
35371
|
-
let
|
|
36593
|
+
let hash2 = 0;
|
|
35372
36594
|
for (let i2 = 0; i2 < namespace.length; i2++) {
|
|
35373
|
-
|
|
35374
|
-
|
|
36595
|
+
hash2 = (hash2 << 5) - hash2 + namespace.charCodeAt(i2);
|
|
36596
|
+
hash2 |= 0;
|
|
35375
36597
|
}
|
|
35376
|
-
return createDebug.colors[Math.abs(
|
|
36598
|
+
return createDebug.colors[Math.abs(hash2) % createDebug.colors.length];
|
|
35377
36599
|
}
|
|
35378
36600
|
createDebug.selectColor = selectColor;
|
|
35379
36601
|
function createDebug(namespace) {
|
|
@@ -42315,8 +43537,8 @@ var init_get_search = __esm({
|
|
|
42315
43537
|
return parsedURL.search;
|
|
42316
43538
|
}
|
|
42317
43539
|
const lastOffset = parsedURL.href.length - 1;
|
|
42318
|
-
const
|
|
42319
|
-
return parsedURL.href[lastOffset -
|
|
43540
|
+
const hash2 = parsedURL.hash || (parsedURL.href[lastOffset] === "#" ? "#" : "");
|
|
43541
|
+
return parsedURL.href[lastOffset - hash2.length] === "?" ? "?" : "";
|
|
42320
43542
|
};
|
|
42321
43543
|
}
|
|
42322
43544
|
});
|