-
Notifications
You must be signed in to change notification settings - Fork 19
/
ACES_InvOutputTransform_v1.2.nk
3974 lines (3974 loc) · 110 KB
/
ACES_InvOutputTransform_v1.2.nk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
set cut_paste_input [stack 0]
push $cut_paste_input
Group {
name ACES_InvOutputTransform_v1_2_
tile_color 0xa57aaaff
addUserKnob {20 ACES_OutputTransform_tab l "ACES OutputTransform"}
addUserKnob {41 gamut l "out gamut" T GamutToXYZ_lite.gamut}
addUserKnob {26 ""}
addUserKnob {35 presets t "display output presets." M {display/sRGB "knobs this \{lum \{0.02 4.8 48\} override_ssts_params 0 use_c9 1 display_pri 0 limiting_pri 0 eotf 0 stretch_black 0 d60_sim 0 force_d65_cat 0 dark_to_dim 1 legal_range 0 label \"sRGB\"\}" "display/sRGB D60 sim." "knobs this \{lum \{0.02 4.8 48\} override_ssts_params 0 use_c9 1 display_pri 0 limiting_pri 0 eotf 0 stretch_black 0 d60_sim 1 force_d65_cat 0 dark_to_dim 1 legal_range 0 label \"sRGB D60 sim.\"\}" display/Rec.709 "knobs this \{lum \{0.02 4.8 48\} override_ssts_params 0 use_c9 1 display_pri 0 limiting_pri 0 eotf 1 stretch_black 0 d60_sim 0 force_d65_cat 0 dark_to_dim 1 legal_range 0 label \"Rec.709\"\}" "display/Rec.709 D60 sim." "knobs this \{lum \{0.02 4.8 48\} override_ssts_params 0 use_c9 1 display_pri 0 limiting_pri 0 eotf 1 stretch_black 0 d60_sim 1 force_d65_cat 0 dark_to_dim 1 legal_range 0 label \"Rec.709 D60 sim.\"\}" display/Rec.2020 "knobs this \{lum \{0.02 4.8 48\} override_ssts_params 0 use_c9 1 display_pri 1 limiting_pri 1 eotf 1 stretch_black 0 d60_sim 0 force_d65_cat 0 dark_to_dim 1 legal_range 0 label \"Rec.2020\"\}" display/P3D60 "knobs this \{lum \{0.02 4.8 48\} override_ssts_params 0 use_c9 1 display_pri 4 limiting_pri 4 eotf 4 stretch_black 0 d60_sim 0 force_d65_cat 0 dark_to_dim 0 legal_range 0 label \"P3D60\"\}" display/P3D65 "knobs this \{lum \{0.02 4.8 48\} override_ssts_params 0 use_c9 1 display_pri 2 limiting_pri 2 eotf 4 stretch_black 0 d60_sim 0 force_d65_cat 0 dark_to_dim 0 legal_range 0 label \"P3D65\"\}" "display/P3D65 D60 sim." "knobs this \{lum \{0.02 4.8 48\} override_ssts_params 0 use_c9 1 display_pri 2 limiting_pri 2 eotf 4 stretch_black 0 d60_sim 1 force_d65_cat 0 dark_to_dim 0 legal_range 0 label \"P3D65 D60 sim.\"\}" display/P3DCI "knobs this \{lum \{0.02 4.8 48\} override_ssts_params 0 use_c9 1 display_pri 3 limiting_pri 3 eotf 4 stretch_black 0 d60_sim 0 force_d65_cat 0 dark_to_dim 0 legal_range 0 label \"P3DCI\"\}" "display/P3DCI D60 sim." "knobs this \{lum \{0.02 4.8 48\} override_ssts_params 0 use_c9 1 display_pri 3 limiting_pri 3 eotf 4 stretch_black 0 d60_sim 1 force_d65_cat 0 dark_to_dim 0 legal_range 0 label \"P3DCI D60 sim.\"\}" "display/P3DCI D65 sim." "knobs this \{lum \{0.02 4.8 48\} override_ssts_params 0 use_c9 1 display_pri 3 limiting_pri 3 eotf 4 stretch_black 0 d60_sim 0 force_d65_cat 1 dark_to_dim 0 legal_range 0 label \"P3DCI D65 sim.\"\}" display/DCDM "knobs this \{lum \{0.02 4.8 48\} override_ssts_params 0 use_c9 1 display_pri 7 limiting_pri 7 eotf 5 stretch_black 0 d60_sim 0 force_d65_cat 0 dark_to_dim 0 legal_range 0 label \"DCDM\"\}" "display/P3D65 ST2084 108nits 7.2nits" "knobs this \{lum \{0.0001 7.2 108\} override_ssts_params 0 use_c9 0 display_pri 2 limiting_pri 2 eotf 6 stretch_black 1 d60_sim 0 force_d65_cat 0 dark_to_dim 0 legal_range 0 label \"P3D65 ST2084 108nits 7.2nits\"\}" "display/P3D65 ST2084 1000nits 15nits" "knobs this \{lum \{0.0001 15 1000\} override_ssts_params 0 use_c9 0 display_pri 2 limiting_pri 2 eotf 6 stretch_black 1 d60_sim 0 force_d65_cat 0 dark_to_dim 0 legal_range 0 label \"P3D65 ST2084 1000nits 15nits\"\}" "display/P3D65 ST2084 2000nits 15nits" "knobs this \{lum \{0.0001 15 2000\} override_ssts_params 0 use_c9 0 display_pri 2 limiting_pri 2 eotf 6 stretch_black 1 d60_sim 0 force_d65_cat 0 dark_to_dim 0 legal_range 0 label \"P3D65 ST2084 2000nits 15nits\"\}" "display/P3D65 ST2084 2000nits 15nits" "knobs this \{lum \{0.0001 15 2000\} override_ssts_params 0 use_c9 0 display_pri 2 limiting_pri 2 eotf 6 stretch_black 1 d60_sim 0 force_d65_cat 0 dark_to_dim 0 legal_range 0 label \"P3D65 ST2084 2000nits 15nits\"\}" "display/P3D65 ST2084 4000nits 15nits" "knobs this \{lum \{0.0001 15 4000\} override_ssts_params 0 use_c9 0 display_pri 2 limiting_pri 2 eotf 6 stretch_black 1 d60_sim 0 force_d65_cat 0 dark_to_dim 0 legal_range 0 label \"P3D65 ST2084 4000nits 15nits\"\}" display/Rec2020_HLG_1000nits_15nits "knobs this \{lum \{0.0001 15 1000\} override_ssts_params 0 use_c9 0 display_pri 1 limiting_pri 1 eotf 7 stretch_black 1 d60_sim 0 force_d65_cat 0 dark_to_dim 0 legal_range 0 label \"Rec2020_HLG_1000nits_15nits\"\}" display/Rec2020_ST2084_1000nits_15nits "knobs this \{lum \{0.0001 15 1000\} override_ssts_params 0 use_c9 0 display_pri 1 limiting_pri 1 eotf 6 stretch_black 1 d60_sim 0 force_d65_cat 0 dark_to_dim 0 legal_range 0 label \"Rec2020_ST2084_1000nits_15nits\"\}" display/Rec2020_ST2084_2000nits_15nits "knobs this \{lum \{0.0001 15 2000\} override_ssts_params 0 use_c9 0 display_pri 1 limiting_pri 1 eotf 6 stretch_black 1 d60_sim 0 force_d65_cat 0 dark_to_dim 0 legal_range 0 label \"Rec2020_ST2084_2000nits_15nits\"\}" display/Rec2020_ST2084_4000nits_15nits "knobs this \{lum \{0.0001 15 4000\} override_ssts_params 0 use_c9 0 display_pri 1 limiting_pri 1 eotf 6 stretch_black 1 d60_sim 0 force_d65_cat 0 dark_to_dim 0 legal_range 0 label \"Rec2020_ST2084_4000nits_15nits\"\}" display/OCES "knobs this \{lum \{0.0001 4.8 10000\} override_ssts_params 0 use_c9 0 display_pri 6 limiting_pri 6 eotf 9 stretch_black 0 d60_sim 0 force_d65_cat 0 dark_to_dim 0 legal_range 0 label \"OCES\"\}" "" ""}}
addUserKnob {26 display_label l " " T "<b>Display Settings</b>"}
addUserKnob {78 lum l luminance t "SSTS Output Display Luminance:\nx = y_min / y = y_mid / z = y_max\n\nAccording to Zach Lewis's ACES_OT\nhttps://gist.github.com/zachlewis/786c0be941868644c993fde1c3515c2c\n\nStandard Cinema\n0.02 / 4.8 / 48\n" n 3}
lum {0.02 4.8 48}
addUserKnob {20 ssts_params_grp l "SSTS Parameters" n 1}
ssts_params_grp 0
addUserKnob {6 override_ssts_params l "override ssts params" t "Enable overrides of SSTS params.\n\nOtherwise the values will be calculated automatically by the algorithm." +STARTLINE}
addUserKnob {35 presets_ssts_param l presets t "If you want to override the default SSTS parameters and play around, here are some useful starting points." M {contrast/default "knobs this \{override_ssts_params 0 pctLow 0.35 pctHigh 0.89 slope \{0.38 1.501 0.01\} exposure 0.0 use_c9 0\}" "contrast/sdr (eye match)" "knobs this \{override_ssts_params 1 pctLow 0.35 pctHigh 0.99 slope \{0.38 1.501 0.1\} exposure 0.0 use_c9 0\}" contrast/high "knobs this \{override_ssts_params 1 pctLow 0.2 pctHigh 0.90 slope \{0.28 1.75 0.01\} exposure 0.0 use_c9 0\}" contrast/med "knobs this \{override_ssts_params 1 pctLow 0.40 pctHigh 0.96 slope \{0.38 1.3 0.01\} exposure 0.0 use_c9 0\}" contrast/med-low "knobs this \{override_ssts_params 1 pctLow 0.40 pctHigh 0.80 slope \{0.38 1.42 0.01\} exposure 0.0 use_c9 0\}" contrast/low "knobs this \{override_ssts_params 1 pctLow 0.40 pctHigh 0.80 slope \{0.38 1.2 0.01\} exposure 0.0 use_c9 0\}"}}
addUserKnob {7 exposure R -5 5}
addUserKnob {7 pctLow l knee}
pctLow 0.4
addUserKnob {7 pctHigh l shoulder}
pctHigh 0.8
addUserKnob {78 slope n 3}
slope {0.38 1.42 0.01}
addUserKnob {20 endGroup n -1}
addUserKnob {6 use_c9 l "use SegmentedSpline_c9" t "In ACES 1.1 the Output Transform was re-written for HDR tonescales. \n\nIn ACES 1.1, HDR transforms use the new SSTS (Single Stage Tone Scale), while SDR transforms continue to use the old SegmentedSpline_c5 -> OCES -> SegmentedSpline_c9 -> ODT transform.\n\nIf this is enabled, the SegmentedSpline_c9 transform is used to maintain compatibility with the ACES SDR output transforms and enable a 1:1 match with the AMPAS CTL.\n\nIf you are curious, turn use_c9 off and play around with the SSTS Parameters." +STARTLINE}
use_c9 true
addUserKnob {26 ""}
addUserKnob {4 display_pri l "display pri" t "Display encoding primaries." M {Rec709 Rec2020 P3D65 P3DCI P3D60 ACEScg ACES XYZ}}
addUserKnob {4 limiting_pri l "limiting pri" t "Limiting primaries for the output transform." -STARTLINE M {Rec709 Rec2020 P3D65 P3DCI P3D60 ACEScg ACES XYZ}}
addUserKnob {4 eotf l EOTF t "Electrical to Optical Transfer Function of the monitor." M {sRGB BT.1886 "Gamma 2.2" "Gamma 2.4" "Gamma 2.6" DCDM "ST-2084 (PQ)" HLG Linear OCES ""}}
eotf BT.1886
addUserKnob {6 stretch_black l "stretch black" t "For hdr outputs: stretch black luminance to a PQ code value of 0" +STARTLINE}
addUserKnob {6 d60_sim l "d60 sim" t "d60 whitepoint simulation." +STARTLINE}
addUserKnob {6 force_d65_cat l "force d60 to d65 cat" -STARTLINE}
addUserKnob {6 dark_to_dim l "dark to dim surround" t "Apply gamma adjustment to compensate for \"Dark to Dim\" surround. For SDR outputs only." +STARTLINE}
dark_to_dim true
addUserKnob {6 legal_range l "legal range" t "Output legal range." +STARTLINE}
}
BackdropNode {
inputs 0
name BackdropNode3
tile_color 0x3f3f3f01
label EOTFs
note_font_size 42
xpos 3359
ypos -1033
bdwidth 1203
bdheight 530
z_order -5
}
BackdropNode {
inputs 0
name BackdropNode4
tile_color 0x3f3f3f01
label "HDR EOTFs"
note_font_size 42
xpos 4605
ypos -1053
bdwidth 910
bdheight 617
z_order -5
}
BackdropNode {
inputs 0
name HLG_2_ST2084_1000nits_f3
tile_color 0x7f7f7f01
note_font_size 14
xpos 4975
ypos -941
bdwidth 467
bdheight 420
}
BackdropNode {
inputs 0
name Output_Legal_Range1
tile_color 0x232323ff
label "ACESlib.OutputTransforms.ctl : 216\n"
note_font_size 12
xpos 3361
ypos -1240
bdwidth 318
bdheight 176
}
Input {
inputs 0
name Input
xpos 3480
ypos -1570
}
AddChannels {
channels rgba
name AddChannels
xpos 3480
ypos -1498
}
Dot {
name Dot27
label " Display-Referred IN"
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3514
ypos -1326
}
set N6ece1600 [stack 0]
Dot {
name Dot28
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3294
ypos -1326
}
Dot {
name Dot29
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3294
ypos 1218
}
push $N6ece1600
Expression {
temp_name0 REFBLACK
temp_expr0 "64 / 1023"
temp_name1 REFWHITE
temp_expr1 "940 / 1023"
expr0 "r * ( REFWHITE - REFBLACK) + REFBLACK"
expr1 "g * ( REFWHITE - REFBLACK) + REFBLACK"
expr2 "b * ( REFWHITE - REFBLACK) + REFBLACK"
name fullRange_to_smpteRange_f3_1
label "ACESlib.OutputTransforms.ctl : 216"
xpos 3480
ypos -1168
disable {{!parent.legal_range}}
}
Dot {
name Dot30
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3514
ypos -990
}
set N9c583900 [stack 0]
push $N9c583900
Dot {
name Dot31
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3624
ypos -990
}
set N9c583200 [stack 0]
Dot {
name Dot32
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3734
ypos -990
}
set N9c582b00 [stack 0]
Dot {
name Dot33
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3844
ypos -990
}
set N9c582400 [stack 0]
Dot {
name Dot34
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3954
ypos -990
}
set N9c581d00 [stack 0]
Dot {
name Dot35
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 4064
ypos -990
}
set N9c581600 [stack 0]
Dot {
name Dot36
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 4174
ypos -990
}
set N9c580f00 [stack 0]
Dot {
name Dot40
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 4781
ypos -990
}
set N9c580800 [stack 0]
Dot {
name Dot47
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 5202
ypos -990
}
Expression {
temp_name0 e
temp_expr0 2.718281828
channel0 {rgba.red -rgba.green -rgba.blue none}
expr0 "r >= 0.0 && r <= 0.5 ? pow(r, 2)/3 : (pow(e, (r - c_c)/c_a)+c_b)/12"
expr1 "g >= 0.0 && g <= 0.5 ? pow(g, 2)/3 : (pow(e, (g - c_c)/c_a)+c_b)/12"
expr2 "b >= 0.0 && b <= 0.5 ? pow(b, 2)/3 : (pow(e, (b - c_c)/c_a)+c_b)/12"
expr3 1
name ST2084_2_HLG_1000nits_f3_2
label "ACESlib.Utilities_Color.ctl : 533\n// HLG EOTF (non-linear signal value to display linear)"
xpos 5168
ypos -910
addUserKnob {20 Constants_tab l Constants}
addUserKnob {7 c_a +DISABLED}
c_a 0.17883277
addUserKnob {7 c_b t 1.-4.*a +DISABLED}
c_b 0.28466892
addUserKnob {7 c_c t 0.5-a*log(4.*a) +DISABLED}
c_c 0.55991073
}
Expression {
temp_name0 Y_s
temp_expr0 "0.2627*r + 0.6780*g + 0.0593*b"
expr0 "c_alpha * pow( Y_s, c_gamma-1.) * r + c_beta"
expr1 "c_alpha * pow( Y_s, c_gamma-1.) * g + c_beta"
expr2 "c_alpha * pow( Y_s, c_gamma-1.) * b + c_beta"
name ST2084_2_HLG_1000nits_f3_1
label "ACESlib.Utilities_Color.ctl : 550\n// Scene-linear to display-linear"
xpos 5168
ypos -860
addUserKnob {20 Constants_tab l Constants}
addUserKnob {7 L_w +DISABLED}
L_w 1000
addUserKnob {7 L_b +DISABLED}
addUserKnob {7 c_alpha +DISABLED}
c_alpha {{L_w-L_b}}
addUserKnob {7 c_beta +DISABLED}
c_beta {{L_b}}
addUserKnob {7 c_gamma +DISABLED}
c_gamma 1.2
}
Expression {
temp_name0 Lm_r
temp_expr0 "pow((r / pq_C), pq_m1)"
temp_name1 Lm_g
temp_expr1 "pow((g / pq_C), pq_m1)"
temp_name2 Lm_b
temp_expr2 "pow((b / pq_C), pq_m1)"
expr0 "pow(( pq_c1 + pq_c2 * Lm_r ) / ( 1.0 + pq_c3 * Lm_r ), pq_m2)"
expr1 "pow(( pq_c1 + pq_c2 * Lm_g ) / ( 1.0 + pq_c3 * Lm_g ), pq_m2)"
expr2 "pow(( pq_c1 + pq_c2 * Lm_b ) / ( 1.0 + pq_c3 * Lm_b ), pq_m2)"
name Y_2_ST2084_1
label "ACESlib.OutputTransforms.ctl : 243 \nACESlib.Utilities_Color.ctl : 425"
xpos 5168
ypos -790
addUserKnob {20 SMPTE_ST2084-2014_Constants_tab l "Constants from SMPTE ST 2084-2014"}
addUserKnob {7 pq_m1 t " ( 2610.0 / 4096.0 ) / 4.0;" +DISABLED R 0 100}
pq_m1 0.1593017578
addUserKnob {7 pq_m2 t " ( 2523.0 / 4096.0 ) * 128.0;" +DISABLED R 0 100}
pq_m2 78.84375
addUserKnob {7 pq_c1 t " 3424.0 / 4096.0 or pq_c3 - pq_c2 + 1.0;" +DISABLED R 0 100}
pq_c1 0.8359375
addUserKnob {7 pq_c2 t " ( 2413.0 / 4096.0 ) * 32.0;" +DISABLED R 0 100}
pq_c2 18.8515625
addUserKnob {7 pq_c3 t " ( 2392.0 / 4096.0 ) * 32.0;" +DISABLED R 0 100}
pq_c3 18.6875
addUserKnob {7 pq_C +DISABLED R 0 100}
pq_C 10000
}
Expression {
temp_name0 Np_r
temp_expr0 "pow( r, 1.0 / pq_m2 )"
temp_name1 Np_g
temp_expr1 "pow( g, 1.0 / pq_m2 )"
temp_name2 Np_b
temp_expr2 "pow( b, 1.0 / pq_m2 )"
expr0 "r < 0 ? 0 : pow((Np_r - pq_c1) / ( pq_c2 - pq_c3 * Np_r ), 1.0/pq_m1) * pq_C"
expr1 "g < 0 ? 0 : pow((Np_g - pq_c1) / ( pq_c2 - pq_c3 * Np_g ), 1.0/pq_m1) * pq_C"
expr2 "b < 0 ? 0 : pow((Np_b - pq_c1) / ( pq_c2 - pq_c3 * Np_b ), 1.0/pq_m1) * pq_C"
name ST2084_2_Y_f3_2
label "ACESlib.Utilities_Color.ctl : 408\n// Converts from the non-linear perceptually quantized space to linear cd/m^2"
xpos 5168
ypos -740
addUserKnob {20 SMPTE_ST2084-2014_Constants_tab l "Constants from SMPTE ST 2084-2014"}
addUserKnob {7 pq_m1 t " ( 2610.0 / 4096.0 ) / 4.0;" +DISABLED R 0 100}
pq_m1 0.1593017578
addUserKnob {7 pq_m2 t " ( 2523.0 / 4096.0 ) * 128.0;" +DISABLED R 0 100}
pq_m2 78.84375
addUserKnob {7 pq_c1 t " 3424.0 / 4096.0 or pq_c3 - pq_c2 + 1.0;" +DISABLED R 0 100}
pq_c1 0.8359375
addUserKnob {7 pq_c2 t " ( 2413.0 / 4096.0 ) * 32.0;" +DISABLED R 0 100}
pq_c2 18.8515625
addUserKnob {7 pq_c3 t " ( 2392.0 / 4096.0 ) * 32.0;" +DISABLED R 0 100}
pq_c3 18.6875
addUserKnob {7 pq_C +DISABLED R 0 100}
pq_C 10000
}
Dot {
name Dot1
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 5202
ypos -678
}
set Nbc305d00 [stack 0]
Expression {
expr0 "(r - Ymin) / (Ymax - Ymin)"
expr1 "(g - Ymin) / (Ymax - Ymin)"
expr2 "(b - Ymin) / (Ymax - Ymin)"
expr3 1
name Y_2_linCV_f3_4
label "stretch_black = True"
xpos 5058
ypos -640
addUserKnob {20 Luminance}
addUserKnob {7 Ymin R 0.0001 0.02}
addUserKnob {7 Ymax R 48 10000}
Ymax {{parent.lum.2}}
}
push $Nbc305d00
Expression {
expr0 "(r - Ymin) / (Ymax - Ymin)"
expr1 "(g - Ymin) / (Ymax - Ymin)"
expr2 "(b - Ymin) / (Ymax - Ymin)"
expr3 1
name Y_2_linCV_f3_2
label "stretch_black = False"
xpos 5168
ypos -640
addUserKnob {20 Luminance}
addUserKnob {7 Ymin R 0.0001 0.02}
Ymin {{parent.lum.0}}
addUserKnob {7 Ymax R 48 10000}
Ymax {{parent.lum.2}}
}
Switch {
inputs 2
which {{parent.stretch_black}}
name StretchBlacks_Switch3
xpos 5168
ypos -562
}
push $N9c580800
Expression {
temp_name0 Np_r
temp_expr0 "pow( r, 1.0 / pq_m2 )"
temp_name1 Np_g
temp_expr1 "pow( g, 1.0 / pq_m2 )"
temp_name2 Np_b
temp_expr2 "pow( b, 1.0 / pq_m2 )"
expr0 "r < 0 ? 0 : pow((Np_r - pq_c1) / ( pq_c2 - pq_c3 * Np_r ), 1.0/pq_m1) * pq_C"
expr1 "g < 0 ? 0 : pow((Np_g - pq_c1) / ( pq_c2 - pq_c3 * Np_g ), 1.0/pq_m1) * pq_C"
expr2 "b < 0 ? 0 : pow((Np_b - pq_c1) / ( pq_c2 - pq_c3 * Np_b ), 1.0/pq_m1) * pq_C"
name ST2084_2_Y_f3_1
label "ACESlib.Utilities_Color.ctl : 408\n// Converts from the non-linear perceptually quantized space to linear cd/m^2"
xpos 4747
ypos -934
addUserKnob {20 SMPTE_ST2084-2014_Constants_tab l "Constants from SMPTE ST 2084-2014"}
addUserKnob {7 pq_m1 t " ( 2610.0 / 4096.0 ) / 4.0;" +DISABLED R 0 100}
pq_m1 0.1593017578
addUserKnob {7 pq_m2 t " ( 2523.0 / 4096.0 ) * 128.0;" +DISABLED R 0 100}
pq_m2 78.84375
addUserKnob {7 pq_c1 t " 3424.0 / 4096.0 or pq_c3 - pq_c2 + 1.0;" +DISABLED R 0 100}
pq_c1 0.8359375
addUserKnob {7 pq_c2 t " ( 2413.0 / 4096.0 ) * 32.0;" +DISABLED R 0 100}
pq_c2 18.8515625
addUserKnob {7 pq_c3 t " ( 2392.0 / 4096.0 ) * 32.0;" +DISABLED R 0 100}
pq_c3 18.6875
addUserKnob {7 pq_C +DISABLED R 0 100}
pq_C 10000
}
Dot {
name Dot46
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 4781
ypos -846
}
set N417b3900 [stack 0]
Expression {
expr0 "(r - Ymin) / (Ymax - Ymin)"
expr1 "(g - Ymin) / (Ymax - Ymin)"
expr2 "(b - Ymin) / (Ymax - Ymin)"
expr3 1
name Y_2_linCV_f3_5
label "stretch_black = True"
xpos 4637
ypos -808
addUserKnob {20 Luminance}
addUserKnob {7 Ymin R 0.0001 0.02}
addUserKnob {7 Ymax R 48 10000}
Ymax {{parent.lum.2}}
}
push $N417b3900
Expression {
expr0 "(r - Ymin) / (Ymax - Ymin)"
expr1 "(g - Ymin) / (Ymax - Ymin)"
expr2 "(b - Ymin) / (Ymax - Ymin)"
expr3 1
name Y_2_linCV_f3_1
label "stretch_black = False"
xpos 4747
ypos -808
addUserKnob {20 Luminance}
addUserKnob {7 Ymin R 0.0001 0.02}
Ymin {{parent.lum.0}}
addUserKnob {7 Ymax R 48 10000}
Ymax {{parent.lum.2}}
}
Switch {
inputs 2
which {{parent.stretch_black}}
name StretchBlacks_Switch1
xpos 4747
ypos -730
}
Dot {
name Dot48
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 4781
ypos -630
}
push $N9c580f00
Expression {
expr0 "(52.37/48.0) * pow( r, 2.6)"
expr1 "(52.37/48.0) * pow( g, 2.6)"
expr2 "(52.37/48.0) * pow( b, 2.6)"
expr3 1
name dcdm_decode1
xpos 4140
ypos -874
}
push $N9c581600
Expression {
expr0 pow(r,1/gamma)
expr1 pow(g,1/gamma)
expr2 pow(b,1/gamma)
name pow_f3_gamma_26_1
label "ACESlib.Utilities_Color.ctl : 260\n// Gamma 2.6"
xpos 4030
ypos -886
addUserKnob {20 Gamma_tab l Gamma}
addUserKnob {7 gamma R 0 4}
gamma 0.3846153846
}
push $N9c581d00
Expression {
expr0 pow(r,1/gamma)
expr1 pow(g,1/gamma)
expr2 pow(b,1/gamma)
name pow_f3_gamma_24_1
label "ACESlib.Utilities_Color.ctl : 260\n// Gamma 2.4"
xpos 3920
ypos -886
addUserKnob {20 Gamma_tab l Gamma}
addUserKnob {7 gamma R 0 4}
gamma 0.4166666667
}
push $N9c582400
Expression {
expr0 pow(r,1/gamma)
expr1 pow(g,1/gamma)
expr2 pow(b,1/gamma)
name pow_f3_gamma_22_1
label "ACESlib.Utilities_Color.ctl : 260\n// Gamma 2.2"
xpos 3810
ypos -886
addUserKnob {20 Gamma_tab l Gamma}
addUserKnob {7 gamma R 0 4}
gamma 0.4545454545
}
push $N9c582b00
Expression {
temp_name0 c_a
temp_expr0 "pow( pow( Lw, 1./gamma) - pow( Lb, 1./gamma), gamma)"
temp_name1 c_b
temp_expr1 "pow( Lb, 1./gamma) / ( pow( Lw, 1./gamma) - pow( Lb, 1./gamma))"
expr0 "c_a * pow( max( r + c_b, 0.), gamma)"
expr1 "c_a * pow( max( g + c_b, 0.), gamma)"
expr2 "c_a * pow( max( b + c_b, 0.), gamma)"
name bt1886_f_f3_1
label "ACESlib.Utilities_Color.ctl : 301\n// The reference EOTF specified in Rec. ITU-R BT.1886\n// L = a(max\[(V+b),0])^g"
xpos 3700
ypos -892
addUserKnob {20 Luminance}
addUserKnob {7 Lw R 48 10000}
Lw 1
addUserKnob {7 Lb R 0.0001 0.02}
addUserKnob {7 gamma R 1 4}
gamma 2.4
}
push $N9c583200
Expression {
temp_name0 fs
temp_expr0 "(( gamma - 1.0) / offs) * pow( offs * gamma / ( ( gamma - 1.0) * ( 1.0 + offs)), gamma)"
temp_name1 xb
temp_expr1 "offs / ( gamma - 1.0)"
expr0 "r >= xb ? pow( ( r + offs) / ( 1.0 + offs), gamma) : r * fs"
expr1 "g >= xb ? pow( ( g + offs) / ( 1.0 + offs), gamma) : g * fs"
expr2 "b >= xb ? pow( ( b + offs) / ( 1.0 + offs), gamma) : b * fs"
name moncurve_f_f3_1
label "ACESlib.Utilities_Color.ctl : 260\nmoncurve_f with gamma of 2.4 and offset of 0.055 matches the EOTF found in IEC 61966-2-1:1999 (sRGB)\n// Forward monitor curve"
xpos 3590
ypos -892
addUserKnob {20 Luminance}
addUserKnob {7 gamma R 0 4}
gamma 2.4
addUserKnob {7 offs}
offs 0.055
}
Switch {
inputs 9
which {{parent.eotf}}
name EOTF_Switch1
xpos 3480
ypos -562
}
Dot {
name Dot2
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3514
ypos -462
}
set N4177e400 [stack 0]
Dot {
name Dot51
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3844
ypos -462
}
Expression {
temp_name0 SCALE
temp_expr0 0.96
temp_name1 NEW_WHT
temp_expr1 0.918
expr0 "r / SCALE"
expr1 "g / SCALE"
expr2 "b / SCALE"
name Expression4
label "// Scale and clamp white to avoid casted highlights due to D60 simulation"
xpos 3810
ypos -376
}
Expression {
temp_name0 tr
temp_expr0 "( 2. * (c_c + r)) / ( -(sqrt( c_b * c_b - 4. * c_a * (c_c + r))) - c_b)"
temp_name1 tg
temp_expr1 "( 2. * (c_c + g)) / ( -(sqrt( c_b * c_b - 4. * c_a * (c_c + g))) - c_b)"
temp_name2 tb
temp_expr2 "( 2. * (c_c + b)) / ( -(sqrt( c_b * c_b - 4. * c_a * (c_c + b))) - c_b)"
expr0 "-r < c_y0 ? -c_x0 : -r > c_y1 ? r : -(( tr * ( c_x1 - c_x0)) + c_x0)"
expr1 "-g < c_y0 ? -c_x0 : -g > c_y1 ? g : -(( tg * ( c_x1 - c_x0)) + c_x0)"
expr2 "-b < c_y0 ? -c_x0 : -b > c_y1 ? b : -(( tb * ( c_x1 - c_x0)) + c_x0)"
name roll_white_rev_2
xpos 3810
ypos -322
addUserKnob {20 Params}
addUserKnob {7 new_wht}
new_wht 0.918
addUserKnob {7 c_width}
c_width 0.5
addUserKnob {7 c_x0 +DISABLED}
c_x0 -1
addUserKnob {7 c_x1 +DISABLED}
c_x1 {{"c_x0 + c_width"}}
addUserKnob {7 c_y0 +DISABLED}
c_y0 {{-new_wht}}
addUserKnob {7 c_y1 +DISABLED}
c_y1 {{c_x1}}
addUserKnob {7 c_m1 +DISABLED}
c_m1 {{"(c_x1 - c_x0)"}}
addUserKnob {7 c_a +DISABLED}
c_a {{"c_y0 - c_y1 + c_m1"}}
addUserKnob {7 c_b +DISABLED}
c_b {{"2 * (c_y1 - c_y0) - c_m1"}}
addUserKnob {7 c_c +DISABLED}
c_c {{c_y0}}
}
Dot {
name Dot52
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3844
ypos -246
}
push $N4177e400
Switch {
inputs 2
which {{"parent.display_pri == 3"}}
name switch_wp_is_dci_2
xpos 3480
ypos -250
}
Group {
name DISPLAY_PRI_to_XYZ
label "display encoding primaries to CIE XYZ"
xpos 3480
ypos -184
addUserKnob {20 XYZ_2_DISPLAY_PRI_tab l XYZ_2_DISPLAY_PRI}
addUserKnob {4 display_pri l "display pri" M {Rec709 Rec2020 P3D65 P3DCI P3D60 ACEScg ACES XYZ}}
display_pri {{parent.display_pri}}
}
Input {
inputs 0
name Input
xpos -40
ypos -298
}
Dot {
name Dot1
label " XYZ to display primaries"
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos -6
ypos -198
}
set N4174eb00 [stack 0]
push $N4174eb00
ColorMatrix {
matrix {
{1.049811006 0 -9.748453158e-05}
{-0.4959030151 1.373313069 0.09824004024}
{4.020908051e-08 0 0.9912520051}
}
invert true
name ColorMatrix3
label "XYZ to ACES"
xpos 730
ypos -136
}
push $N4174eb00
ColorMatrix {
matrix {
{1.641023397 -0.3248033226 -0.2364246994}
{-0.6636629701 1.615331769 0.01675636508}
{0.01172191743 -0.008284457959 0.9883947968}
}
invert true
name ColorMatrix21
label "XYZ to ACEScg"
xpos 620
ypos -136
}
push $N4174eb00
ColorMatrix {
matrix {
{2.402741432 -0.8974840641 -0.3880533576}
{-0.8325796723 1.769231915 0.02371272631}
{0.03882339597 -0.08249972761 1.036368608}
}
invert true
name ColorMatrix15
label "XYZ to P3D60"
xpos 510
ypos -136
}
push $N4174eb00
ColorMatrix {
matrix {
{2.725393534 -1.018002748 -0.4401631057}
{-0.795167923 1.689731717 0.02264718339}
{0.04124190658 -0.0876390487 1.100929499}
}
invert true
name ColorMatrix19
label "XYZ to P3DCI"
xpos 400
ypos -136
}
push $N4174eb00
ColorMatrix {
matrix {
{2.493496418 -0.9313833117 -0.4027107358}
{-0.8294888139 1.762663841 0.02362467349}
{0.03584583849 -0.07617240399 0.9568845034}
}
invert true
name ColorMatrix17
label "XYZ to P3D65"
xpos 290
ypos -136
}
push $N4174eb00
ColorMatrix {
matrix {
{1.71665132 -0.3556708097 -0.2533662617}
{-0.6666844487 1.616481304 0.01576855592}
{0.01763986237 -0.04277062416 0.9421030879}
}
invert true
name ColorMatrix12
label "XYZ to Rec2020"
xpos 180
ypos -136
}
push $N4174eb00
ColorMatrix {
matrix {
{3.240970135 -1.537383318 -0.4986107945}
{-0.9692437053 1.875967622 0.04155509174}
{0.0556300357 -0.2039768547 1.056971431}
}
invert true
name ColorMatrix2
label "XYZ to Rec709"
xpos 70
ypos -136
}
Switch {
inputs 8
which {{parent.display_pri}}
name limiting_primary_switch
xpos -40
ypos -34
}
Output {
name Output
xpos -40
ypos 86
}
end_group
Dot {
name Dot19
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3514
ypos -126
}
set N414ee400 [stack 0]
Dot {
name Dot9
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3624
ypos -126
}
set N414edd00 [stack 0]
ColorMatrix {
matrix {
{0.9872254133 -0.006114810705 0.01592640579}
{-0.007603884675 1.001874804 0.005322027951}
{0.003066040576 -0.005084238946 1.081519246}
}
invert true
name ColorMatrix2
label "CAT: Bradford\n D60 to D65"
xpos 3590
ypos -91
}
set N414ed600 [stack 0]
push $N414edd00
Dot {
name Dot10
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3734
ypos -126
}
push $N414ed600
Switch {
inputs 2
which {{parent.d60_sim}}
name d60_sim_switch
xpos 3590
ypos -10
}
push $N414ee400
Switch {
inputs 2
which {{"parent.display_pri < 3"}}
name switch_wp_is_d65_1
xpos 3480
ypos -10
}
Switch {
inputs 2
which {{parent.force_d65_cat}}
name switch_force_d65_cat
xpos 3480
ypos 41
}
Dot {
name Dot39
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3514
ypos 107
}
set N414c7200 [stack 0]
Colorspace {
colorspace_in CIE-XYZ
colorspace_out CIE-Yxy
name Colorspace2
label "\[value colorspace_in] -> \[value colorspace_out]"
xpos 3607
ypos 97
}
Clamp {
channels {rgba.red -rgba.green -rgba.blue none}
maximum_enable false
name ClampMin4
xpos 3607
ypos 154
}
Expression {
expr0 "pow(r, 1/DIM_SURROUND_GAMMA)"
expr1 g
expr2 b
channel3 none
name dim_to_dark
xpos 3607
ypos 180
addUserKnob {20 Params}
addUserKnob {7 DIM_SURROUND_GAMMA}
DIM_SURROUND_GAMMA 0.9811
}
Colorspace {
colorspace_in CIE-Yxy
colorspace_out CIE-XYZ
name Colorspace4
label "\[value colorspace_in] -> \[value colorspace_out]"
xpos 3607
ypos 217
}
push $N414c7200
Switch {
inputs 2
which {{"(parent.eotf <= 4) ? parent.dark_to_dim : 0"}}
name DimToDark_Switch1
label "enable if sdr\nand dark_to_dim enabled"
xpos 3480
ypos 211
}
ColorMatrix {
matrix {
{1.641023397 -0.3248033226 -0.2364246994}
{-0.6636629701 1.615331769 0.01675636508}
{0.01172191743 -0.008284457959 0.9883947968}
}
name ColorMatrix10
label "XYZ to ACEScg"
xpos 3480
ypos 333
}
Dot {
name Dot38
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3514
ypos 415
}
set N414a6400 [stack 0]
ColorMatrix {
matrix {
{{"(1.0 - sat) * rgb2Y.x + sat"} {"(1.0 - sat) * rgb2Y.y"} {"(1.0 - sat) * rgb2Y.z"}}
{{"(1.0 - sat) * rgb2Y.x"} {"(1.0 - sat) * rgb2Y.y + sat"} {"(1.0 - sat) * rgb2Y.z"}}
{{"(1.0 - sat) * rgb2Y.x"} {"(1.0 - sat) * rgb2Y.y"} {"(1.0 - sat) * rgb2Y.z + sat"}}
}
invert true
name ColorMatrix4
label "// Remove desaturation to compensate \nfor luminance difference"
xpos 3590
ypos 399
addUserKnob {20 params}
addUserKnob {13 rgb2Y}
rgb2Y {0.27222875 0.67408174 0.05368952}
addUserKnob {7 sat}
sat 0.93
}
push $N414a6400
Switch {
inputs 2
which {{"parent.eotf < 5 && display_pri < 2"}}
name Switch_eotf
xpos 3480
ypos 476
}
Dot {
name Dot17
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3514
ypos 570
}
set N414a4f00 [stack 0]
Dot {
name Dot49
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3624
ypos 570
}
set N414a4800 [stack 0]
Dot {
name Dot50
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3734
ypos 570
}
Expression {
temp_name0 SCALE
temp_expr0 0.96362
expr0 "r / SCALE"
expr1 "g / SCALE"
expr2 "b / SCALE"
name mult_f_f3_
label D65
xpos 3700
ypos 608
}
push $N414a4800
Switch {
inputs 2
which {{"parent.display_pri < 3"}}
name switch_wp_is_d65_
xpos 3590
ypos 638
}
Dot {
name Dot53
label " "
note_font "Helvetica Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos 3624
ypos 714
}
push $N414a4f00
Switch {
inputs 2
which {{parent.d60_sim}}
name d60_sim_switch2
xpos 3480
ypos 710
}
Dot {
name Dot44
label " "
note_font "Helvetica Bold"