WIP: integrate source CST primary pipeline and independent module disclosure; validation pending
这个提交包含在:
1 父节点
76537da0a6
当前提交
d2bf0696bd
19 个文件已更改
+7972
-79
没有与搜索条件相匹配的文件
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"repository": "https://dayu.media/git/dayu/dayu-cst.git",
|
||||
"commit": "973766b51dbcab3ab5092f1955d753575cd32d89",
|
||||
"files": [
|
||||
{
|
||||
"source": "tools/kernels/CSTKernel.ll",
|
||||
"destination": "tools/kernels/CSTKernel.ll",
|
||||
"sha256": "78c2414d1c086dc7eaa043308f0febd32691b1ad49629febdcc1138b232cefc8"
|
||||
},
|
||||
{
|
||||
"source": "tools/kernels/BasisKernel.ll",
|
||||
"destination": "tools/kernels/BasisKernel.ll",
|
||||
"sha256": "221ca94c52a997aa8cb2b2155bb8c7ad57bf0829b0241857664a75e78329a4b3"
|
||||
},
|
||||
{
|
||||
"source": "大鱼CST/Plugin/DayuShaderTypes.h",
|
||||
"destination": "大鱼调色/Plugin/DYCSTTypes.h",
|
||||
"sha256": "3372e3cd77248eeb374e54675d2902befceea8e00a2afc4f9543116ef3027696"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
# CST 色彩管理集成
|
||||
|
||||
本轮以 dayu-cst 的固定源码节点复用 CSTKernel / BasisKernel;原路径和摘要见 CSTIntegration.json,参考仓库保持只读。新处理顺序为输入转换 → 工作空间一级调色 → 输出转换 → 原有基础调整与风格链。曲线和色域独立选择,工作曲线由同一个参数供一级与输出使用,不通过跨实例通知同步。
|
||||
|
||||
沿用大鱼调色的宿主线性 RGB 边界:CST 前恢复编码值,三个阶段内部不使用 3D LUT、不裁切至 0–1;返回宿主线性后再进入原有显示域调色链。此版本的后续 HSL、曲线与风格 LUT 仍是既有显示域工具,不宣称全链路改造成场景线性调色。CST 源内核使用 half 输入,保留其原生精度边界。
|
||||
|
||||
新实例默认输入/输出 Gamma 2.4、Rec.709,工作 DaVinci Intermediate / DaVinci Wide Gamut;自动色调映射默认关闭。按实际素材选择相机曲线/色域。选择自动映射时复用参考代码的场景/显示映射标志。一级默认参数直接沿用 CST 源码。
|
||||
|
||||
一级调色、基础调整默认展开;其余折叠;所有模块眼睛开启。黑白模块增加混合(默认 0),保证眼睛开启不强制把初始画面变成黑白。折叠写入独立的 InspectorToken,仅保存界面状态,不修改任何调色参数、启用位或 LUT 路径。眼睛只修改启用位。
|
||||
|
||||
旧 InspectorToken schema 1 仍可读取:默认跳过新 CST,并保留旧版黑白强度。旧输入 LUT / 相机输入也维持原路径,直到用户明确编辑 CST 参数或选择“旧版输入 → 改用 CST”。新旧模型的前 944 字节 ABI 与所有旧参数 ID 保留。
|
||||
|
||||
Cube 导出改用生产渲染路径生成 33³ 色格,包含新的 CST 与一级参数;关闭不可写入 Cube 的空间细节工具和逐画面统计。用户 LUT 和宿主资料不进入仓库。
|
||||
|
||||
当前为实现检查点;原生回归、CST 数学对照、正式宿主验证和发行尚待完成。
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"archivesBase64": {
|
||||
"9000": "AAAAAAAAAb0qYnBsaXN0MDDUAQIDBAUGBwxYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05TS2V5ZWRBcmNoaXZlctIICQoLXERhdGFJc0xlZ2FjeV8QD0JsaW5kRGF0YU9iamVjdIACgAGjDQ4PVSRudWxsTxD+YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVtDdXN0b20gRGF0YYABowsMEVUkbnVsbNINDg8QVnNjaGVtYVYkY2xhc3MQAYAC0hITFBVaJGNsYXNzbmFtZVgkY2xhc3Nlc18QEERZSW5zcGVjdG9yVG9rZW6iFhdfEBBEWUluc3BlY3RvclRva2VuWE5TT2JqZWN0CBEaJCkyN0lMWFpeZGlwd3l7gIuUp6q9AAAAAAAAAQEAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAMYIAAgAEQAaACQAKQAyADcASQBOAFsAbQBvAHEAdQB7AXwAAAAAAAACAQAAAAAAAAAQAAAAAAAAAAAAAAAAAAABfQA=",
|
||||
"9000": "AAAAAAAAAisqYnBsaXN0MDDUAQIDBAUGBwxYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05TS2V5ZWRBcmNoaXZlctIICQoLXERhdGFJc0xlZ2FjeV8QD0JsaW5kRGF0YU9iamVjdIACgAGjDQ4PVSRudWxsTxEBa2JwbGlzdDAw1AECAwQFBgcKWCR2ZXJzaW9uWSRhcmNoaXZlclQkdG9wWCRvYmplY3RzEgABhqBfEA9OU0tleWVkQXJjaGl2ZXLRCAlbQ3VzdG9tIERhdGGAAaULDBMZH1UkbnVsbNMNDg8QERJVZm9sZHNWc2NoZW1hViRjbGFzc4ACEAKABNMUFQ8WFxhXTlMua2V5c1pOUy5vYmplY3RzoKCAA9IaGxwdWiRjbGFzc25hbWVYJGNsYXNzZXNcTlNEaWN0aW9uYXJ5ohweWE5TT2JqZWN00hobICFfEBBEWUluc3BlY3RvclRva2VuoiIeXxAQRFlJbnNwZWN0b3JUb2tlbgAIABEAGgAkACkAMgA3AEkATABYAFoAYABmAG0AcwB6AIEAgwCFAIcAjgCWAKEAogCjAKUAqgC1AL4AywDOANcA3ADvAPIAAAAAAAACAQAAAAAAAAAjAAAAAAAAAAAAAAAAAAABBQgACAARABoAJAApADIANwBJAE4AWwBtAG8AcQB1AHsB6gAAAAAAAAIBAAAAAAAAABAAAAAAAAAAAAAAAAAAAAHrAA==",
|
||||
"9001": "AAAAAAAAAe8qYnBsaXN0MDDUAQIDBAUGBwxYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05TS2V5ZWRBcmNoaXZlctIICQoLXERhdGFJc0xlZ2FjeV8QD0JsaW5kRGF0YU9iamVjdIACgAGjDQ4PVSRudWxsTxEBL2JwbGlzdDAw1AECAwQFBgcKWCR2ZXJzaW9uWSRhcmNoaXZlclQkdG9wWCRvYmplY3RzEgABhqBfEA9OU0tleWVkQXJjaGl2ZXLRCAlbQ3VzdG9tIERhdGGAAaULDBEXHVUkbnVsbNINDg8QVXBhdGhzViRjbGFzc4ACgATTEhMOFBUWV05TLmtleXNaTlMub2JqZWN0c6CggAPSGBkaG1okY2xhc3NuYW1lWCRjbGFzc2VzXE5TRGljdGlvbmFyeaIaHFhOU09iamVjdNIYGR4fXERZQXNzZXRTdGF0ZaIgHFxEWUFzc2V0U3RhdGUIERokKTI3SUxYWmBma3F4enyDi5aXmJqfqrPAw8zR3uEAAAAAAAABAQAAAAAAAAAhAAAAAAAAAAAAAAAAAAAA7ggACAARABoAJAApADIANwBJAE4AWwBtAG8AcQB1AHsBrgAAAAAAAAIBAAAAAAAAABAAAAAAAAAAAAAAAAAAAAGvAA=="
|
||||
},
|
||||
"parameters": [
|
||||
@@ -44,10 +44,827 @@
|
||||
"offset": 56,
|
||||
"pid": 2014,
|
||||
"step": 0.01,
|
||||
"title": "输入强度"
|
||||
"title": "旧版输入强度"
|
||||
},
|
||||
{
|
||||
"default": 0,
|
||||
"key": "cmConfigured",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 944,
|
||||
"pid": 2236,
|
||||
"step": 0.01,
|
||||
"title": "CST 配置版本"
|
||||
},
|
||||
{
|
||||
"cmTab": 0,
|
||||
"default": 1,
|
||||
"key": "cminputEnabled",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 964,
|
||||
"pid": 2241,
|
||||
"step": 0.01,
|
||||
"title": "输入转换启用"
|
||||
},
|
||||
{
|
||||
"cmTab": 0,
|
||||
"default": 1002,
|
||||
"key": "cminputTransfer",
|
||||
"kind": "popup",
|
||||
"max": 1003,
|
||||
"min": 0,
|
||||
"offset": 948,
|
||||
"options": [
|
||||
"KOLOR Default",
|
||||
"ACEScct",
|
||||
"Apple Log",
|
||||
"Apple Log 2",
|
||||
"ARRI LogC3",
|
||||
"ARRI LogC4",
|
||||
"Blackmagic Film Gen 5",
|
||||
"Canon C-Log",
|
||||
"Canon C-Log 2",
|
||||
"Canon C-Log 3",
|
||||
"DaVinci Intermediate",
|
||||
"DJI D-Log",
|
||||
"DJI D-Log 2",
|
||||
"DJI D-Log M",
|
||||
"Fujifilm F-Log",
|
||||
"Fujifilm F-Log2",
|
||||
"Fujifilm F-Log2 C",
|
||||
"GoPro GP-Log",
|
||||
"GoPro GP-Log2",
|
||||
"GoPro GP-Log2 (Official, 0 EV)",
|
||||
"Insta I-Log",
|
||||
"Leica L-Log",
|
||||
"Linear",
|
||||
"Nikon N-Log",
|
||||
"Panasonic V-Log",
|
||||
"Phantom Log 1",
|
||||
"Phantom Log 2",
|
||||
"REDLog3G10",
|
||||
"Samsung Log",
|
||||
"Sony S-Log2",
|
||||
"Sony S-Log3",
|
||||
"Gamma 2.2",
|
||||
"Gamma 2.4",
|
||||
"Gamma 2.6"
|
||||
],
|
||||
"pid": 2237,
|
||||
"step": 1,
|
||||
"title": "输入曲线",
|
||||
"values": [
|
||||
99,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
30,
|
||||
29,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27,
|
||||
28,
|
||||
1001,
|
||||
1002,
|
||||
1003
|
||||
]
|
||||
},
|
||||
{
|
||||
"cmTab": 0,
|
||||
"default": 22,
|
||||
"key": "cminputGamut",
|
||||
"kind": "popup",
|
||||
"max": 1003,
|
||||
"min": 0,
|
||||
"offset": 952,
|
||||
"options": [
|
||||
"KOLOR Default",
|
||||
"ACES AP0",
|
||||
"ACES AP1",
|
||||
"Apple Log 2",
|
||||
"ARRI WG3",
|
||||
"ARRI WG4",
|
||||
"Blackmagic Wide Gamut",
|
||||
"Canon Cinema Gamut",
|
||||
"DaVinci Wide Gamut",
|
||||
"DJI Action 5",
|
||||
"DJI Air 2S",
|
||||
"DJI D-Gamut",
|
||||
"DJI D-Gamut 2",
|
||||
"DJI Mavic2 Pro",
|
||||
"DJI Mavic 3 Pro",
|
||||
"DJI Mini 4 Pro",
|
||||
"DJI Mini 5 Pro",
|
||||
"DJI Pocket 3",
|
||||
"Fujifilm F-GamutC",
|
||||
"GoPro GP-Log",
|
||||
"P3-DCI",
|
||||
"P3 D65",
|
||||
"Panasonic V-Gamut",
|
||||
"Rec.709 / BT.709",
|
||||
"Rec.2020 / BT.2020",
|
||||
"RED Wide Gamut RGB",
|
||||
"Sony S-Gamut",
|
||||
"Sony S-Gamut3",
|
||||
"Sony S-Gamut3.Cine"
|
||||
],
|
||||
"pid": 2238,
|
||||
"step": 1,
|
||||
"title": "输入色域",
|
||||
"values": [
|
||||
99,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
16,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
28,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27
|
||||
]
|
||||
},
|
||||
{
|
||||
"cmTab": 0,
|
||||
"default": 10,
|
||||
"key": "cmworkingTransfer",
|
||||
"kind": "popup",
|
||||
"max": 1003,
|
||||
"min": 0,
|
||||
"offset": 956,
|
||||
"options": [
|
||||
"KOLOR Default",
|
||||
"ACEScct",
|
||||
"Apple Log",
|
||||
"Apple Log 2",
|
||||
"ARRI LogC3",
|
||||
"ARRI LogC4",
|
||||
"Blackmagic Film Gen 5",
|
||||
"Canon C-Log",
|
||||
"Canon C-Log 2",
|
||||
"Canon C-Log 3",
|
||||
"DaVinci Intermediate",
|
||||
"DJI D-Log",
|
||||
"DJI D-Log 2",
|
||||
"DJI D-Log M",
|
||||
"Fujifilm F-Log",
|
||||
"Fujifilm F-Log2",
|
||||
"Fujifilm F-Log2 C",
|
||||
"GoPro GP-Log",
|
||||
"GoPro GP-Log2",
|
||||
"GoPro GP-Log2 (Official, 0 EV)",
|
||||
"Insta I-Log",
|
||||
"Leica L-Log",
|
||||
"Linear",
|
||||
"Nikon N-Log",
|
||||
"Panasonic V-Log",
|
||||
"Phantom Log 1",
|
||||
"Phantom Log 2",
|
||||
"REDLog3G10",
|
||||
"Samsung Log",
|
||||
"Sony S-Log2",
|
||||
"Sony S-Log3",
|
||||
"Gamma 2.2",
|
||||
"Gamma 2.4",
|
||||
"Gamma 2.6"
|
||||
],
|
||||
"pid": 2239,
|
||||
"step": 1,
|
||||
"title": "工作曲线",
|
||||
"values": [
|
||||
99,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
30,
|
||||
29,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27,
|
||||
28,
|
||||
1001,
|
||||
1002,
|
||||
1003
|
||||
]
|
||||
},
|
||||
{
|
||||
"cmTab": 0,
|
||||
"default": 16,
|
||||
"key": "cmworkingGamut",
|
||||
"kind": "popup",
|
||||
"max": 1003,
|
||||
"min": 0,
|
||||
"offset": 960,
|
||||
"options": [
|
||||
"KOLOR Default",
|
||||
"ACES AP0",
|
||||
"ACES AP1",
|
||||
"Apple Log 2",
|
||||
"ARRI WG3",
|
||||
"ARRI WG4",
|
||||
"Blackmagic Wide Gamut",
|
||||
"Canon Cinema Gamut",
|
||||
"DaVinci Wide Gamut",
|
||||
"DJI Action 5",
|
||||
"DJI Air 2S",
|
||||
"DJI D-Gamut",
|
||||
"DJI D-Gamut 2",
|
||||
"DJI Mavic2 Pro",
|
||||
"DJI Mavic 3 Pro",
|
||||
"DJI Mini 4 Pro",
|
||||
"DJI Mini 5 Pro",
|
||||
"DJI Pocket 3",
|
||||
"Fujifilm F-GamutC",
|
||||
"GoPro GP-Log",
|
||||
"P3-DCI",
|
||||
"P3 D65",
|
||||
"Panasonic V-Gamut",
|
||||
"Rec.709 / BT.709",
|
||||
"Rec.2020 / BT.2020",
|
||||
"RED Wide Gamut RGB",
|
||||
"Sony S-Gamut",
|
||||
"Sony S-Gamut3",
|
||||
"Sony S-Gamut3.Cine"
|
||||
],
|
||||
"pid": 2240,
|
||||
"step": 1,
|
||||
"title": "工作色域",
|
||||
"values": [
|
||||
99,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
16,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
28,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27
|
||||
]
|
||||
},
|
||||
{
|
||||
"cmTab": 0,
|
||||
"default": 1,
|
||||
"key": "cmmix",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 1076,
|
||||
"pid": 2269,
|
||||
"step": 0.01,
|
||||
"title": "CST 混合"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 1,
|
||||
"key": "cmbasisEnabled",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 968,
|
||||
"pid": 2242,
|
||||
"step": 0.01,
|
||||
"title": "一级调色启用"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmexposure",
|
||||
"kind": "float",
|
||||
"max": 5,
|
||||
"min": -5,
|
||||
"offset": 988,
|
||||
"pid": 2247,
|
||||
"step": 0.01,
|
||||
"title": "一级曝光"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmbalanceAngle",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 992,
|
||||
"pid": 2248,
|
||||
"step": 0.01,
|
||||
"title": "色彩平衡方向"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmbalanceStrength",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 996,
|
||||
"pid": 2249,
|
||||
"step": 0.01,
|
||||
"title": "色彩平衡强度"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 1,
|
||||
"key": "cmsaturation",
|
||||
"kind": "float",
|
||||
"max": 2,
|
||||
"min": 0,
|
||||
"offset": 1000,
|
||||
"pid": 2250,
|
||||
"step": 0.01,
|
||||
"title": "一级饱和度"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmcontrast",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": -1,
|
||||
"offset": 1004,
|
||||
"pid": 2251,
|
||||
"step": 0.01,
|
||||
"title": "一级对比度"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmpivot",
|
||||
"kind": "float",
|
||||
"max": 3,
|
||||
"min": -3,
|
||||
"offset": 1008,
|
||||
"pid": 2252,
|
||||
"step": 0.01,
|
||||
"title": "对比度轴心"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmhiContrast",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": -1,
|
||||
"offset": 1012,
|
||||
"pid": 2253,
|
||||
"step": 0.01,
|
||||
"title": "高光对比度"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmhiPivot",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": -1,
|
||||
"offset": 1016,
|
||||
"pid": 2254,
|
||||
"step": 0.01,
|
||||
"title": "高光轴心"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmshadowContrast",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": -1,
|
||||
"offset": 1020,
|
||||
"pid": 2255,
|
||||
"step": 0.01,
|
||||
"title": "阴影对比度"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmshadowPivot",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": -1,
|
||||
"offset": 1024,
|
||||
"pid": 2256,
|
||||
"step": 0.01,
|
||||
"title": "阴影轴心"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 1,
|
||||
"key": "cmwhite",
|
||||
"kind": "float",
|
||||
"max": 1.5,
|
||||
"min": 0.5,
|
||||
"offset": 1028,
|
||||
"pid": 2257,
|
||||
"step": 0.01,
|
||||
"title": "白点"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0.5,
|
||||
"key": "cmshoulder",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 1032,
|
||||
"pid": 2258,
|
||||
"step": 0.01,
|
||||
"title": "肩部压缩"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmhighlights",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": -1,
|
||||
"offset": 1036,
|
||||
"pid": 2259,
|
||||
"step": 0.01,
|
||||
"title": "一级高光"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmmidtones",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": -1,
|
||||
"offset": 1040,
|
||||
"pid": 2260,
|
||||
"step": 0.01,
|
||||
"title": "一级中间调"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmshadows",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": -1,
|
||||
"offset": 1044,
|
||||
"pid": 2261,
|
||||
"step": 0.01,
|
||||
"title": "一级阴影"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmblack",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": -1,
|
||||
"offset": 1048,
|
||||
"pid": 2262,
|
||||
"step": 0.01,
|
||||
"title": "黑点"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0.5,
|
||||
"key": "cmtoe",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 1052,
|
||||
"pid": 2263,
|
||||
"step": 0.01,
|
||||
"title": "趾部压缩"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0.5,
|
||||
"key": "cmchromaMix",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 1056,
|
||||
"pid": 2264,
|
||||
"step": 0.01,
|
||||
"title": "色度混合"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmbypassExposure",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 1060,
|
||||
"pid": 2265,
|
||||
"step": 0.01,
|
||||
"title": "旁路一级曝光"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmbypassBalance",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 1064,
|
||||
"pid": 2266,
|
||||
"step": 0.01,
|
||||
"title": "旁路一级色彩"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmbypassContrast",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 1068,
|
||||
"pid": 2267,
|
||||
"step": 0.01,
|
||||
"title": "旁路一级对比"
|
||||
},
|
||||
{
|
||||
"cmTab": 1,
|
||||
"default": 0,
|
||||
"key": "cmbypassTone",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 1072,
|
||||
"pid": 2268,
|
||||
"step": 0.01,
|
||||
"title": "旁路一级影调"
|
||||
},
|
||||
{
|
||||
"cmTab": 2,
|
||||
"default": 1,
|
||||
"key": "cmoutputEnabled",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 972,
|
||||
"pid": 2243,
|
||||
"step": 0.01,
|
||||
"title": "输出转换启用"
|
||||
},
|
||||
{
|
||||
"cmTab": 2,
|
||||
"default": 1002,
|
||||
"key": "cmoutputTransfer",
|
||||
"kind": "popup",
|
||||
"max": 1003,
|
||||
"min": 0,
|
||||
"offset": 976,
|
||||
"options": [
|
||||
"KOLOR Default",
|
||||
"ACEScct",
|
||||
"Apple Log",
|
||||
"Apple Log 2",
|
||||
"ARRI LogC3",
|
||||
"ARRI LogC4",
|
||||
"Blackmagic Film Gen 5",
|
||||
"Canon C-Log",
|
||||
"Canon C-Log 2",
|
||||
"Canon C-Log 3",
|
||||
"DaVinci Intermediate",
|
||||
"DJI D-Log",
|
||||
"DJI D-Log 2",
|
||||
"DJI D-Log M",
|
||||
"Fujifilm F-Log",
|
||||
"Fujifilm F-Log2",
|
||||
"Fujifilm F-Log2 C",
|
||||
"GoPro GP-Log",
|
||||
"GoPro GP-Log2",
|
||||
"GoPro GP-Log2 (Official, 0 EV)",
|
||||
"Insta I-Log",
|
||||
"Leica L-Log",
|
||||
"Linear",
|
||||
"Nikon N-Log",
|
||||
"Panasonic V-Log",
|
||||
"Phantom Log 1",
|
||||
"Phantom Log 2",
|
||||
"REDLog3G10",
|
||||
"Samsung Log",
|
||||
"Sony S-Log2",
|
||||
"Sony S-Log3",
|
||||
"Gamma 2.2",
|
||||
"Gamma 2.4",
|
||||
"Gamma 2.6"
|
||||
],
|
||||
"pid": 2244,
|
||||
"step": 1,
|
||||
"title": "输出曲线",
|
||||
"values": [
|
||||
99,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
30,
|
||||
29,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27,
|
||||
28,
|
||||
1001,
|
||||
1002,
|
||||
1003
|
||||
]
|
||||
},
|
||||
{
|
||||
"cmTab": 2,
|
||||
"default": 22,
|
||||
"key": "cmoutputGamut",
|
||||
"kind": "popup",
|
||||
"max": 1003,
|
||||
"min": 0,
|
||||
"offset": 980,
|
||||
"options": [
|
||||
"KOLOR Default",
|
||||
"ACES AP0",
|
||||
"ACES AP1",
|
||||
"Apple Log 2",
|
||||
"ARRI WG3",
|
||||
"ARRI WG4",
|
||||
"Blackmagic Wide Gamut",
|
||||
"Canon Cinema Gamut",
|
||||
"DaVinci Wide Gamut",
|
||||
"DJI Action 5",
|
||||
"DJI Air 2S",
|
||||
"DJI D-Gamut",
|
||||
"DJI D-Gamut 2",
|
||||
"DJI Mavic2 Pro",
|
||||
"DJI Mavic 3 Pro",
|
||||
"DJI Mini 4 Pro",
|
||||
"DJI Mini 5 Pro",
|
||||
"DJI Pocket 3",
|
||||
"Fujifilm F-GamutC",
|
||||
"GoPro GP-Log",
|
||||
"P3-DCI",
|
||||
"P3 D65",
|
||||
"Panasonic V-Gamut",
|
||||
"Rec.709 / BT.709",
|
||||
"Rec.2020 / BT.2020",
|
||||
"RED Wide Gamut RGB",
|
||||
"Sony S-Gamut",
|
||||
"Sony S-Gamut3",
|
||||
"Sony S-Gamut3.Cine"
|
||||
],
|
||||
"pid": 2245,
|
||||
"step": 1,
|
||||
"title": "输出色域",
|
||||
"values": [
|
||||
99,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
16,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
28,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27
|
||||
]
|
||||
},
|
||||
{
|
||||
"cmTab": 2,
|
||||
"default": 0,
|
||||
"key": "cmtoneMapping",
|
||||
"kind": "popup",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 984,
|
||||
"options": [
|
||||
"关闭",
|
||||
"开启"
|
||||
],
|
||||
"pid": 2246,
|
||||
"step": 0.01,
|
||||
"title": "输出色调映射",
|
||||
"values": [
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"default": 1,
|
||||
"key": "inputEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -55,7 +872,7 @@
|
||||
"offset": 132,
|
||||
"pid": 2033,
|
||||
"step": 0.01,
|
||||
"title": "输入 / LUT"
|
||||
"title": "输入转换 / CST"
|
||||
},
|
||||
{
|
||||
"default": 0,
|
||||
@@ -413,7 +1230,7 @@
|
||||
"title": "肤色色相"
|
||||
},
|
||||
{
|
||||
"default": 0,
|
||||
"default": 1,
|
||||
"key": "skinEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -523,7 +1340,7 @@
|
||||
"title": "风格 5 强度"
|
||||
},
|
||||
{
|
||||
"default": 0,
|
||||
"default": 1,
|
||||
"key": "lookEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -1106,7 +1923,7 @@
|
||||
"title": "蓝 扩展点4 X"
|
||||
},
|
||||
{
|
||||
"default": 0,
|
||||
"default": 1,
|
||||
"key": "curveEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -1491,7 +2308,7 @@
|
||||
"title": "显示自定义色选区"
|
||||
},
|
||||
{
|
||||
"default": 0,
|
||||
"default": 1,
|
||||
"key": "hslEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -1656,7 +2473,7 @@
|
||||
"title": "平衡"
|
||||
},
|
||||
{
|
||||
"default": 0,
|
||||
"default": 1,
|
||||
"key": "gradingEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -1733,7 +2550,7 @@
|
||||
"title": "蓝原色 饱和度"
|
||||
},
|
||||
{
|
||||
"default": 0,
|
||||
"default": 1,
|
||||
"key": "primariesEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -1964,7 +2781,7 @@
|
||||
"title": "蓝 输出白"
|
||||
},
|
||||
{
|
||||
"default": 0,
|
||||
"default": 1,
|
||||
"key": "levelsEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -2064,6 +2881,17 @@
|
||||
},
|
||||
{
|
||||
"default": 0,
|
||||
"key": "blackWhiteMix",
|
||||
"kind": "float",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"offset": 1080,
|
||||
"pid": 2270,
|
||||
"step": 0.01,
|
||||
"title": "黑白混合"
|
||||
},
|
||||
{
|
||||
"default": 1,
|
||||
"key": "blackwhiteEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -2184,7 +3012,7 @@
|
||||
"title": "高光 黄 ↔ 蓝"
|
||||
},
|
||||
{
|
||||
"default": 0,
|
||||
"default": 1,
|
||||
"key": "balanceEnabled",
|
||||
"kind": "bool",
|
||||
"max": 1,
|
||||
@@ -2197,8 +3025,8 @@
|
||||
],
|
||||
"sourceSHA256": {
|
||||
"template/tools/dump_model.mm": "2ef22e010e0cae15b73107d39fb2c125f6049b1e5405e88078f936cf29e79350",
|
||||
"大鱼调色/Plugin/DYModel.h": "66507eb37e0c0e3426a10ab45f7388fd53fcba570a715a6574396056731d5129",
|
||||
"大鱼调色/Plugin/DYModel.mm": "cf46784f302014d7c025249c5ebbd02505a5e70739ec3ffc0d269890601bb5c5",
|
||||
"大鱼调色/Plugin/DYUniforms.h": "06db5ec83703aa320c9569a7de08617a2fdbc535ac29f438558959d485aa2138"
|
||||
"大鱼调色/Plugin/DYModel.h": "2a1b3064d2c1179347412ad44981aad384165c2238aac06d936a496976d52e63",
|
||||
"大鱼调色/Plugin/DYModel.mm": "da9edad3d5681c27db1f2700d7946b965e4ba06ae9297d7c98116361c1c57e10",
|
||||
"大鱼调色/Plugin/DYUniforms.h": "536a2eed28dd4acf1d77959a1667a7d3c0da3433a510c57aa25de67c0a9be927"
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"passed": true,
|
||||
"sha256": "ebf8b7aa7a6781b9ce611375a838d89997656b0fc01077b2a7e5b1b2a2c373e1",
|
||||
"sha256": "b2c3c6d9037d14e10eefadfcec9ed9c96100b0be668f0f4077ed3e31fc4dd4d4",
|
||||
"version": "5.13",
|
||||
"displayversion": "5.6.7",
|
||||
"filterCount": 1,
|
||||
"nativeFloatParameters": 196,
|
||||
"nativeFloatParameters": 231,
|
||||
"customParameters": 2,
|
||||
"publications": [
|
||||
{
|
||||
|
||||
+48
-13
@@ -293,8 +293,8 @@
|
||||
<baseFlags>8589934608</baseFlags>
|
||||
<parameter name="大鱼调色" id="9000" flags="12884901888">
|
||||
<numberOfKeypoints>0</numberOfKeypoints>
|
||||
<defaultVal>*********PoeMb-gOLBoA11I*E61-*I4-klM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh660Ec9L2FVR437QolZNq3XSJwE1o7gOKtYF43oMIxWOaJXR6*0U*4X1EsDJGFiRKlgHl1yMb-gOLBoA11I*E61-*I4-kdM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh260Jh1RLBoPqoUF43oMM*-ckgA2JIYPbJgPB6B1UwEJbBXO4JhMJMYMqlVQrAE*M*0oV6H3-JO74BgMLBnPa3hNJUYMqlVQrBZQpwE22FNGKtnQ4JXR4xmJ4xfNKuW3VRT2--2KIZiQr-ZMrFjQZFjOqJiK2tHHq7eNKBo0-2O70YmBoZAK3dSN4ZkRrZvU6iIduex*********E2*********4********************AM6**U*2E*O*0E*8E*m*1Q*GE-C*3g*PE-j*52*RE-v*Lk********0*E*********E*******************-TE*</defaultVal>
|
||||
<dataValue>*********PoeMb-gOLBoA11I*E61-*I4-klM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh660Ec9L2FVR437QolZNq3XSJwE1o7gOKtYF43oMIxWOaJXR6*0U*4X1EsDJGFiRKlgHl1yMb-gOLBoA11I*E61-*I4-kdM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh260Jh1RLBoPqoUF43oMM*-ckgA2JIYPbJgPB6B1UwEJbBXO4JhMJMYMqlVQrAE*M*0oV6H3-JO74BgMLBnPa3hNJUYMqlVQrBZQpwE22FNGKtnQ4JXR4xmJ4xfNKuW3VRT2--2KIZiQr-ZMrFjQZFjOqJiK2tHHq7eNKBo0-2O70YmBoZAK3dSN4ZkRrZvU6iIduex*********E2*********4********************AM6**U*2E*O*0E*8E*m*1Q*GE-C*3g*PE-j*52*RE-v*Lk********0*E*********E*******************-TE*</dataValue>
|
||||
<defaultVal>*********WgeMb-gOLBoA11I*E61-*I4-klM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh660Ec9L2FVR437QolZNq3XSJwE1o7gOKtYF43oMIxWOaJXR6*0U*4X1EsDJGFiRKlgHl2-Oq7kP4ZnR1*kp*20*kE3-UQ8K0FqNL7nOKxiKGFVQaBcOLNZQZEYR4xkK0FjMadZMrFn2U*-Ve-T2*xCIohZSKJYEL7XO4ZqNL9F0*ZPErJnR4xh62FVR44**OI91-AN5pIYPbJgPBAB1UwE2F7JNaxgN5BKQqBcNKpVJWFXP43nQs*02*8*-BAI3EwK3lVLHZAiOqJtQpdCImtjMadZMrFnc80**x6O4lkRKWFXP43nQqtVPKJM74BgMLBnNLBQHZB2OKBoOKxiML7tcVkSK2tHHq7eNKBooVcP603T2--2KIZiQr-ZMrFjQZFjOqJicW6SLl*EF3Z7PbBkNKBoPr7IPqhZPU*6*-2*4U*Y*0Y*AU*r*2Y*H*-M*3c*M*-a*4o*Qk-u*62*Uk03*6Q*XU0K*82*cU0X*8I*eU0p*9s*mk1C*BQ*r*1j*D6********0*E*********X*******************--EU*0**F*-c*7**d*16*Bk-7*2s*Kk-h*4w*QE-p*5g-uU********6-*********-********************5f**</defaultVal>
|
||||
<dataValue>*********WgeMb-gOLBoA11I*E61-*I4-klM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh660Ec9L2FVR437QolZNq3XSJwE1o7gOKtYF43oMIxWOaJXR6*0U*4X1EsDJGFiRKlgHl2-Oq7kP4ZnR1*kp*20*kE3-UQ8K0FqNL7nOKxiKGFVQaBcOLNZQZEYR4xkK0FjMadZMrFn2U*-Ve-T2*xCIohZSKJYEL7XO4ZqNL9F0*ZPErJnR4xh62FVR44**OI91-AN5pIYPbJgPBAB1UwE2F7JNaxgN5BKQqBcNKpVJWFXP43nQs*02*8*-BAI3EwK3lVLHZAiOqJtQpdCImtjMadZMrFnc80**x6O4lkRKWFXP43nQqtVPKJM74BgMLBnNLBQHZB2OKBoOKxiML7tcVkSK2tHHq7eNKBooVcP603T2--2KIZiQr-ZMrFjQZFjOqJicW6SLl*EF3Z7PbBkNKBoPr7IPqhZPU*6*-2*4U*Y*0Y*AU*r*2Y*H*-M*3c*M*-a*4o*Qk-u*62*Uk03*6Q*XU0K*82*cU0X*8I*eU0p*9s*mk1C*BQ*r*1j*D6********0*E*********X*******************--EU*0**F*-c*7**d*16*Bk-7*2s*Kk-h*4w*QE-p*5g-uU********6-*********-********************5f**</dataValue>
|
||||
</parameter>
|
||||
<parameter name="LUT 文件" id="9001" flags="12889161776">
|
||||
<numberOfKeypoints>0</numberOfKeypoints>
|
||||
@@ -302,8 +302,42 @@
|
||||
<dataValue>*********SweMb-gOLBoA11I*E61-*I4-klM75NZQbBdPqtN743mMqVdRaJmJ0FoPr-M74xWOaJXR5AG**44c3wE1otHGqJtNKF-QaBcOLNZQh660Ec9L2FVR437QolZNq3XSJwE1o7gOKtYF43oMIxWOaJXR6*0U*4X1EsDJGFiRKlgHl2-9q7kP4ZnR1*kp*20*kE3-UQ8K0FqNL7nOKxiKGFVQaBcOLNZQZEYR4xkK0FjMadZMrFn2U*-Ve-T2*xCIohZSKJYEL7XO4ZqNL9F0*ZPErJnR4xh62FVR44**OI91-2L5JIYPbJgPB6B1UwEJL-VR4VnJWFXP43nQs*0U*HH2VAC3-IKJotH9ahZSLBOHZAiPq7eNKBoQu0UU*DG4-YO4pcYMqlVQrBiMKpZK0FXP43nQqJnL2tHF4ZXR4ZjPa3mSO6O53VCIoxWOaJXRB6M4FsTL2FNELBnNLFHR43oNO6U53l2KI3nQqJoIrFVR4I62FcY8H6rGIlMKa-aOr3sSbm1WtOLa7eTefD*kwnFri2********-*E*********V********************vUU*0**F*-c*7**d*16*Bk-7*2s*Kk-h*4w*QE-p*5g-fU********6-*********-********************4j**</dataValue>
|
||||
</parameter>
|
||||
<parameter name="相机输入" id="2013" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="输入强度" id="2014" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="输入 / LUT" id="2033" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="旧版输入强度" id="2014" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="CST 配置版本" id="2236" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="输入转换启用" id="2241" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="输入曲线" id="2237" flags="12889161760" default="1002" value="1002" />
|
||||
<parameter name="输入色域" id="2238" flags="12889161760" default="22" value="22" />
|
||||
<parameter name="工作曲线" id="2239" flags="12889161760" default="10" value="10" />
|
||||
<parameter name="工作色域" id="2240" flags="12889161760" default="16" value="16" />
|
||||
<parameter name="CST 混合" id="2269" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="一级调色启用" id="2242" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="一级曝光" id="2247" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="色彩平衡方向" id="2248" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="色彩平衡强度" id="2249" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="一级饱和度" id="2250" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="一级对比度" id="2251" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="对比度轴心" id="2252" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="高光对比度" id="2253" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="高光轴心" id="2254" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="阴影对比度" id="2255" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="阴影轴心" id="2256" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="白点" id="2257" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="肩部压缩" id="2258" flags="12889161760" default="0.5" value="0.5" />
|
||||
<parameter name="一级高光" id="2259" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="一级中间调" id="2260" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="一级阴影" id="2261" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="黑点" id="2262" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="趾部压缩" id="2263" flags="12889161760" default="0.5" value="0.5" />
|
||||
<parameter name="色度混合" id="2264" flags="12889161760" default="0.5" value="0.5" />
|
||||
<parameter name="旁路一级曝光" id="2265" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="旁路一级色彩" id="2266" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="旁路一级对比" id="2267" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="旁路一级影调" id="2268" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="输出转换启用" id="2243" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="输出曲线" id="2244" flags="12889161760" default="1002" value="1002" />
|
||||
<parameter name="输出色域" id="2245" flags="12889161760" default="22" value="22" />
|
||||
<parameter name="输出色调映射" id="2246" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="输入转换 / CST" id="2033" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="曝光" id="2000" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="曝光 启用" id="2020" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="对比度" id="2001" flags="12889161760" default="0" value="0" />
|
||||
@@ -335,7 +369,7 @@
|
||||
<parameter name="白平衡与颜色" id="2035" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="保护程度" id="2117" flags="12889161760" default="60" value="60" />
|
||||
<parameter name="肤色色相" id="2118" flags="12889161760" default="28" value="28" />
|
||||
<parameter name="肤色保护" id="2116" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="肤色保护" id="2116" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="风格 1 强度" id="2015" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="风格 2 启用" id="2040" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="风格 2 强度" id="2016" flags="12889161760" default="1" value="1" />
|
||||
@@ -345,7 +379,7 @@
|
||||
<parameter name="风格 4 强度" id="2018" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="风格 5 启用" id="2043" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="风格 5 强度" id="2019" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="风格 LUT" id="2036" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="风格 LUT" id="2036" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="主曲线 阴影" id="2046" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="主曲线 暗部" id="2047" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="主曲线 亮部" id="2048" flags="12889161760" default="0" value="0" />
|
||||
@@ -398,7 +432,7 @@
|
||||
<parameter name="蓝 扩展点3 X" id="2234" flags="12889161760" default="-1" value="-1" />
|
||||
<parameter name="蓝 扩展点4 偏移" id="2231" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="蓝 扩展点4 X" id="2235" flags="12889161760" default="-1" value="-1" />
|
||||
<parameter name="曲线" id="2044" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="曲线" id="2044" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="红 色相" id="2068" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="橙 色相" id="2069" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="黄 色相" id="2070" flags="12889161760" default="0" value="0" />
|
||||
@@ -433,7 +467,7 @@
|
||||
<parameter name="自定义 明亮度" id="2098" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="自定义 明亮度范围" id="2142" flags="12889161760" default="40" value="40" />
|
||||
<parameter name="显示自定义色选区" id="2144" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="HSL 混色" id="2045" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="HSL 混色" id="2045" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="阴影 色相" id="2106" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="阴影 饱和度" id="2107" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="阴影 明亮度" id="2113" flags="12889161760" default="0" value="0" />
|
||||
@@ -448,14 +482,14 @@
|
||||
<parameter name="全局 明亮度" id="2150" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="混合" id="2101" flags="12889161760" default="50" value="50" />
|
||||
<parameter name="平衡" id="2102" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="颜色分级" id="2100" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="颜色分级" id="2100" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="红原色 色相" id="2121" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="红原色 饱和度" id="2122" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="绿原色 色相" id="2123" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="绿原色 饱和度" id="2124" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="蓝原色 色相" id="2125" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="蓝原色 饱和度" id="2126" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="三原色" id="2120" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="三原色" id="2120" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="RGB 输入黑" id="2156" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="RGB 伽马" id="2160" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="RGB 输入白" id="2164" flags="12889161760" default="255" value="255" />
|
||||
@@ -476,7 +510,7 @@
|
||||
<parameter name="蓝 输入白" id="2167" flags="12889161760" default="255" value="255" />
|
||||
<parameter name="蓝 输出黑" id="2171" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="蓝 输出白" id="2175" flags="12889161760" default="255" value="255" />
|
||||
<parameter name="色阶" id="2152" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="色阶" id="2152" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="黑白 红" id="2180" flags="12889161760" default="40" value="40" />
|
||||
<parameter name="黑白 黄" id="2181" flags="12889161760" default="60" value="60" />
|
||||
<parameter name="黑白 绿" id="2182" flags="12889161760" default="40" value="40" />
|
||||
@@ -485,7 +519,8 @@
|
||||
<parameter name="黑白 洋红" id="2185" flags="12889161760" default="80" value="80" />
|
||||
<parameter name="着色色相" id="2186" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="着色饱和度" id="2187" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="黑白混色" id="2176" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="黑白混合" id="2270" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="黑白混色" id="2176" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="保持明度" id="2189" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="阴影 青 ↔ 红" id="2192" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="阴影 洋红 ↔ 绿" id="2193" flags="12889161760" default="0" value="0" />
|
||||
@@ -496,7 +531,7 @@
|
||||
<parameter name="高光 青 ↔ 红" id="2200" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="高光 洋红 ↔ 绿" id="2201" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="高光 黄 ↔ 蓝" id="2202" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="色彩平衡" id="2188" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="色彩平衡" id="2188" flags="12889161760" default="1" value="1" />
|
||||
<parameter name="混合" id="10001" flags="12884901888" default="1" value="1" />
|
||||
<parameter name="翻转" id="10002" flags="12889161760" default="0" value="0" />
|
||||
<parameter name="输入点" id="10003" flags="12889161760" default="1" value="1" />
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ def main():
|
||||
work.mkdir(parents=True, exist_ok=True)
|
||||
args.output.parent.mkdir(parents=True, exist_ok=True)
|
||||
objects = []
|
||||
for name in ('DYGradeKernel', 'DYStatisticsKernel', 'DYLUTExportKernel'):
|
||||
for name in ('DYGradeKernel', 'DYStatisticsKernel', 'DYLUTExportKernel', 'CSTKernel', 'BasisKernel'):
|
||||
target = work / (name + '.air')
|
||||
subprocess.run(['xcrun', 'metal-opt', str(root / 'tools/kernels' / (name + '.ll')),
|
||||
'-o', str(target)], check=True)
|
||||
|
||||
文件差异过大,未显示。
加载差异
文件差异过大,未显示。
加载差异
@@ -0,0 +1,29 @@
|
||||
#ifndef DAYU_SHADER_TYPES_H
|
||||
#define DAYU_SHADER_TYPES_H
|
||||
#include <simd/simd.h>
|
||||
typedef struct CSTParams { int inputGamut, inputTransfer, outputGamut, outputTransfer, toneMapping; } CSTParams;
|
||||
typedef struct BasisParams {
|
||||
int colorspace;
|
||||
float exposure, balanceTarget, balanceStrength, contrast, pivot, highlights, midtones, shadows;
|
||||
float trimLow, trimHigh, trimToeStrength, trimShoulderStrength, shadowContrast, shadowPivot, hiContrast, hiPivot, chromaMix;
|
||||
unsigned char bypassBalance, bypassTone, bypassExposure, bypassContrast;
|
||||
float saturation;
|
||||
} BasisParams;
|
||||
typedef struct DayuRenderParams {
|
||||
CSTParams input;
|
||||
CSTParams output;
|
||||
BasisParams basis;
|
||||
int stages;
|
||||
int sourceLinear;
|
||||
int destinationLinear;
|
||||
int reserved;
|
||||
// Additional curve-only adapters for working encodings absent from original BASIS.
|
||||
CSTParams basisInput;
|
||||
CSTParams basisOutput;
|
||||
} DayuRenderParams;
|
||||
#ifndef __METAL_VERSION__
|
||||
_Static_assert(sizeof(CSTParams)==20, "CST target layout");
|
||||
_Static_assert(sizeof(BasisParams)==80, "BASIS target layout");
|
||||
_Static_assert(sizeof(DayuRenderParams)==176, "Integrated layout; legacy prefix remains 136 bytes");
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,63 @@
|
||||
// Raw, animatable CST controls. The first 944 bytes of DYUniforms stay unchanged.
|
||||
#pragma once
|
||||
#include "DYCSTTypes.h"
|
||||
typedef struct DYCMSettings {
|
||||
float configured;
|
||||
float inputTransfer;
|
||||
float inputGamut;
|
||||
float workingTransfer;
|
||||
float workingGamut;
|
||||
float inputEnabled;
|
||||
float basisEnabled;
|
||||
float outputEnabled;
|
||||
float outputTransfer;
|
||||
float outputGamut;
|
||||
float toneMapping;
|
||||
float exposure;
|
||||
float balanceAngle;
|
||||
float balanceStrength;
|
||||
float saturation;
|
||||
float contrast;
|
||||
float pivot;
|
||||
float hiContrast;
|
||||
float hiPivot;
|
||||
float shadowContrast;
|
||||
float shadowPivot;
|
||||
float white;
|
||||
float shoulder;
|
||||
float highlights;
|
||||
float midtones;
|
||||
float shadows;
|
||||
float black;
|
||||
float toe;
|
||||
float chromaMix;
|
||||
float bypassExposure;
|
||||
float bypassBalance;
|
||||
float bypassContrast;
|
||||
float bypassTone;
|
||||
float mix;
|
||||
float blackWhiteMix;
|
||||
} DYCMSettings;
|
||||
#ifndef __METAL_VERSION__
|
||||
#include <math.h>
|
||||
static inline int DYBasisMode(int c) {
|
||||
if(c==99)return 0;if(c>=1&&c<=11)return c;
|
||||
switch(c){case 14:return 12;case 15:return 13;case 16:return 14;case 19:return 15;case 20:return 16;case 21:return 17;case 22:return 18;case 25:return 19;case 27:return 20;case 28:return 21;default:return -1;}
|
||||
}
|
||||
static inline DayuRenderParams DYCMRender(DYCMSettings s) {
|
||||
DayuRenderParams p={0};
|
||||
p.input=(CSTParams){(int)lroundf(s.inputGamut),(int)lroundf(s.inputTransfer),(int)lroundf(s.workingGamut),(int)lroundf(s.workingTransfer),0};
|
||||
p.output=(CSTParams){p.input.outputGamut,p.input.outputTransfer,(int)lroundf(s.outputGamut),(int)lroundf(s.outputTransfer),(int)lroundf(s.toneMapping)};
|
||||
p.stages=(s.inputEnabled>.5?1:0)|(s.basisEnabled>.5?2:0)|(s.outputEnabled>.5?4:0);
|
||||
if(s.toneMapping>.5){p.input.toneMapping=(p.input.inputTransfer>1000?2:0)+(p.input.outputTransfer>1000?1:0);p.output.toneMapping=(p.output.inputTransfer>1000?2:0)+(p.output.outputTransfer>1000?1:0);}
|
||||
int mode=DYBasisMode(p.input.outputTransfer);p.basis.colorspace=mode<0?10:mode;
|
||||
if(mode<0){p.reserved|=8;p.basisInput=(CSTParams){p.input.outputGamut,p.input.outputTransfer,p.input.outputGamut,10,0};p.basisOutput=(CSTParams){p.input.outputGamut,10,p.input.outputGamut,p.input.outputTransfer,0};}
|
||||
BasisParams *b=&p.basis;
|
||||
b->exposure=exp2f(s.exposure);b->balanceTarget=s.balanceAngle;b->balanceStrength=s.balanceStrength*s.balanceStrength*4;
|
||||
b->contrast=exp2f(s.contrast);b->pivot=exp2f(s.pivot);b->highlights=s.highlights;b->midtones=s.midtones*.3330000042915344f;b->shadows=s.shadows*1.5f;
|
||||
b->trimLow=1.0+(double)s.black*-.5;b->trimHigh=s.white;b->trimToeStrength=1+15*s.toe;b->trimShoulderStrength=1+7*s.shoulder;
|
||||
b->shadowContrast=(double)s.shadowContrast*-1.3;b->shadowPivot=exp2f(.20000000298023224f*s.shadowPivot);b->hiContrast=s.hiContrast*2;b->hiPivot=exp2f(-.20000000298023224f*s.hiPivot);b->chromaMix=s.chromaMix;
|
||||
b->bypassExposure=s.bypassExposure>.5;b->bypassBalance=s.bypassBalance>.5;b->bypassContrast=s.bypassContrast>.5;b->bypassTone=s.bypassTone>.5;b->saturation=s.saturation;
|
||||
return p;
|
||||
}
|
||||
#endif
|
||||
+28
-1
@@ -38,12 +38,17 @@ fragment half4 dyFragment(DYRaster in [[stage_in]],
|
||||
texture3d<float> colorGrading [[texture(9)]],
|
||||
constant DYUniforms& uniforms [[buffer(0)]],
|
||||
constant float& sceneLevel [[buffer(1)]],
|
||||
constant DYRenderOptions& options [[buffer(2)]]) {
|
||||
constant DYRenderOptions& options [[buffer(2)]],
|
||||
constant DYUniforms& colorUniforms [[buffer(3)]]) {
|
||||
constexpr sampler sampleFilter(coord::normalized, address::clamp_to_edge, filter::linear);
|
||||
half4 sample = source.sample(sampleFilter, in.uv);
|
||||
if (!(sample.a > half(0.0))) return half4(0.0h);
|
||||
half4 result = dy_grade(sample, in.uv, source, preLUT, look1, look2, look3,
|
||||
look4, look5, hslMixer, whiteBalance, colorGrading, uniforms, sceneLevel);
|
||||
if(options.blackWhiteMix>0.0f && options.blackWhiteMix<1.0f) {
|
||||
half4 color=dy_grade(sample,in.uv,source,preLUT,look1,look2,look3,look4,look5,hslMixer,whiteBalance,colorGrading,colorUniforms,sceneLevel);
|
||||
result.rgb=mix(color.rgb,result.rgb,half(options.blackWhiteMix));
|
||||
}
|
||||
result.a = sample.a;
|
||||
if (options.outputPremultiplied) result.rgb *= result.a;
|
||||
return result;
|
||||
@@ -110,3 +115,25 @@ kernel void dyInputAnalysis(texture2d<half> source [[texture(0)]],
|
||||
encoded=round(clamp(encoded,0.0f,1.0f)*255.0f)/255.0f;
|
||||
outRGBA[pixel.y*320+pixel.x]=float4(encoded,float(sample.a));
|
||||
}
|
||||
|
||||
// CST/BASIS arithmetic is reused verbatim from the versioned dayu-cst source.
|
||||
float4 cst_air(half4 sample, constant CSTParams& params);
|
||||
float4 basis_air(half4 sample, constant BasisParams& params);
|
||||
inline float3 dyEncode(float3 linear) {
|
||||
return select(1.055f*pow(max(linear,float3(0)),float3(1.0f/2.4f))-.055f,linear*12.92f,linear<=.0031308f);
|
||||
}
|
||||
inline float3 dyDecode(float3 encoded) {
|
||||
return select(pow(max((encoded+.055f)/1.055f,float3(0)),float3(2.4f)),encoded/12.92f,encoded<=.04045f);
|
||||
}
|
||||
kernel void dyColorManagement(texture2d<float,access::read> source [[texture(0)]],
|
||||
texture2d<half,access::write> destination [[texture(1)]],
|
||||
constant DayuRenderParams& p [[buffer(0)]],constant float& amount [[buffer(1)]],uint2 pos [[thread_position_in_grid]]) {
|
||||
if(pos.x>=source.get_width()||pos.y>=source.get_height())return;
|
||||
float4 sample=source.read(pos);if(!(sample.a>0)){destination.write(half4(0),pos);return;}
|
||||
float4 raw=float4(dyEncode(sample.rgb),sample.a),c=raw;
|
||||
if(p.stages&1)c=cst_air(half4(c),p.input);
|
||||
if(p.stages&2){if(p.reserved&8)c=cst_air(half4(c),p.basisInput);c=basis_air(half4(c),p.basis);if(p.reserved&8)c=cst_air(half4(c),p.basisOutput);}
|
||||
if(p.stages&4)c=cst_air(half4(c),p.output);
|
||||
c.rgb=mix(raw.rgb,c.rgb,amount);
|
||||
destination.write(half4(half3(dyDecode(c.rgb)),half(sample.a)),pos);
|
||||
}
|
||||
+40
-22
@@ -167,11 +167,12 @@ static NSArray *DYPresentationSections(void) {
|
||||
NSMutableDictionary *bySection=[NSMutableDictionary dictionary],*byKey=[NSMutableDictionary dictionary];
|
||||
for(NSDictionary *s in DYSections())bySection[s[@"key"]]=s;
|
||||
for(NSDictionary *d in DYDescriptors())byKey[d[@"key"]]=d;
|
||||
NSMutableDictionary *input=[[bySection[@"input"] mutableCopy]autorelease];input[@"rows"]=@[byKey[@"preLUTStrength"]];
|
||||
NSMutableDictionary *input=[[bySection[@"input"] mutableCopy]autorelease];
|
||||
NSMutableDictionary *base=[[bySection[@"base"] mutableCopy]autorelease];NSMutableArray *rows=[NSMutableArray array];
|
||||
for(NSString *key in @[@"temperature",@"tint",@"exposure",@"contrast",@"highlights",@"shadows",@"whites",@"blacks",@"texture",@"clarity",@"dehaze",@"vibrance",@"saturation",@"skinEnabled",@"copyAutoGrade"]){NSDictionary*d=byKey[key];if(d)[rows addObject:d];}
|
||||
base[@"rows"]=rows;base[@"extraEnabled"]=bySection[@"color"][@"enabled"];
|
||||
return @[input,base,bySection[@"skin"],bySection[@"look"],bySection[@"hsl"],bySection[@"curve"],bySection[@"grading"],bySection[@"primaries"],bySection[@"levels"],bySection[@"blackwhite"],bySection[@"balance"]];
|
||||
base[@"title"]=@"基础调整";
|
||||
return @[input,bySection[@"primary"],bySection[@"output"],base,bySection[@"skin"],bySection[@"look"],bySection[@"hsl"],bySection[@"curve"],bySection[@"grading"],bySection[@"primaries"],bySection[@"levels"],bySection[@"blackwhite"],bySection[@"balance"]];
|
||||
}
|
||||
|
||||
|
||||
@@ -495,7 +496,7 @@ static NSImage *DYWheelImage(void) {
|
||||
[header setButtonType:NSButtonTypePushOnPushOff];
|
||||
header.bordered=NO; header.alignment=NSTextAlignmentLeft; header.font=[NSFont boldSystemFontOfSize:12];
|
||||
header.contentTintColor=DYInk(); header.target=self; header.action=@selector(toggleSection:); header.tag=index;
|
||||
header.doubleClickAction=@selector(resetSection:); header.toolTip=@"展开启用,折叠停用;双击还原本组";
|
||||
header.doubleClickAction=@selector(resetSection:); header.toolTip=@"展开或折叠界面;双击还原本组";
|
||||
[card addSubview:header];
|
||||
NSButton *enabled=DYButton(@"",self,@selector(groupEnabled:));enabled.bordered=NO;[enabled setButtonType:NSButtonTypePushOnPushOff];enabled.image=[NSImage imageWithSystemSymbolName:@"eye" accessibilityDescription:@"启用本组"];
|
||||
enabled.tag=index; enabled.contentTintColor=DYAccent(); enabled.toolTip=@"启用或旁路本组";
|
||||
@@ -507,8 +508,8 @@ static NSImage *DYWheelImage(void) {
|
||||
[card addSubview:reset];
|
||||
NSMutableArray *body=[NSMutableArray array];
|
||||
NSString *key=section[@"key"]?:@"";
|
||||
if([key localizedCaseInsensitiveContainsString:@"input"]) {
|
||||
[body addObject:[self assetRowForKey:@"input" title:@"输入色彩" inCard:card]];
|
||||
if([key isEqual:@"input"]) {
|
||||
NSButton *migrate=DYButton(@"旧版输入 → 改用 CST",self,@selector(useCST:));migrate.identifier=@"legacyInput";migrate.toolTip=@"保留旧工程输入效果;点击后改用上方 CST 设置,可撤销";[card addSubview:migrate];[body addObject:migrate];
|
||||
}
|
||||
if([key localizedCaseInsensitiveContainsString:@"look"]) {
|
||||
for(NSInteger i=0;i<5;i++) {
|
||||
@@ -552,7 +553,7 @@ static NSImage *DYWheelImage(void) {
|
||||
NSButton *eye=DYButton(@"",self,@selector(itemEnabled:));eye.bordered=NO;[eye setButtonType:NSButtonTypePushOnPushOff];eye.image=[NSImage imageWithSystemSymbolName:@"eye" accessibilityDescription:@"启用"];eye.tag=[pid integerValue];eye.contentTintColor=DYAccent();eye.accessibilityLabel=[d[@"title"] stringByAppendingString:@"启用"];eye.toolTip=@"启用或旁路此项";[row addSubview:eye];record[@"itemEnabled"]=eye;
|
||||
}
|
||||
NSString *kind=d[@"kind"]?:@"float";
|
||||
if([kind isEqualToString:@"bool"]) {
|
||||
if([kind isEqualToString:@"bool"]||[d[@"key"]hasPrefix:@"cmbypass"]) {
|
||||
NSButton *toggle=[NSButton checkboxWithTitle:@"" target:self action:@selector(scalarChanged:)];
|
||||
toggle.tag=[pid integerValue]; toggle.contentTintColor=DYAccent(); toggle.accessibilityLabel=d[@"title"];
|
||||
[row addSubview:toggle]; record[@"toggle"]=toggle;
|
||||
@@ -589,7 +590,7 @@ static NSImage *DYWheelImage(void) {
|
||||
}
|
||||
for(NSView *row in body)if(![ordered containsObject:row])row.hidden=YES;body=ordered;
|
||||
}
|
||||
NSMutableDictionary *record=[NSMutableDictionary dictionaryWithDictionary:@{@"section":section,@"view":card,@"header":header,@"enabled":enabled,@"reset":reset,@"body":body,@"collapsed":@(![section[@"defaultEnabled"]boolValue])}];
|
||||
NSMutableDictionary *record=[NSMutableDictionary dictionaryWithDictionary:@{@"section":section,@"view":card,@"header":header,@"enabled":enabled,@"reset":reset,@"body":body,@"collapsed":@(![@[@"primary",@"base"]containsObject:key])}];
|
||||
if([key isEqual:@"look"]){NSButton *add=DYButton(@"+",self,@selector(addLook:));add.bordered=NO;add.font=[NSFont boldSystemFontOfSize:20];add.accessibilityLabel=@"添加风格 LUT";[card addSubview:add];record[@"add"]=add;}
|
||||
[_cards addObject:record];
|
||||
index++;
|
||||
@@ -611,6 +612,7 @@ static NSImage *DYWheelImage(void) {
|
||||
}
|
||||
- (BOOL)showRow:(NSView *)row section:(NSString *)section {
|
||||
NSString *key=row.identifier?:@"";NSInteger tab=[_tabs[section]integerValue];
|
||||
if([key isEqual:@"legacyInput"])return [_tabs[@"legacyInput"]boolValue];
|
||||
if([section isEqual:@"curve"] && ![key isEqual:@"curveGraph"])return NO;
|
||||
if([section isEqual:@"hsl"]) {
|
||||
int axis=0,color=0;if(sscanf(key.UTF8String,"hsl%d_%d",&axis,&color)==2)return color==tab;
|
||||
@@ -689,7 +691,7 @@ static NSImage *DYWheelImage(void) {
|
||||
if(d[@"enabled"]) {double enabled=1;[get getFloatValue:&enabled fromParameter:[d[@"enabled"] unsignedIntValue] atTime:t];[r[@"itemEnabled"] setState:enabled>=.5?NSControlStateValueOn:NSControlStateValueOff];[r[@"itemEnabled"] setImage:[NSImage imageWithSystemSymbolName:enabled>=.5?@"eye":@"eye.slash" accessibilityDescription:enabled>=.5?@"启用":@"旁路"]];for(NSString *control in @[@"slider",@"field",@"popup"]) [r[control] setAlphaValue:enabled>=.5?1:.45];}
|
||||
[r[@"slider"] setDoubleValue:v]; [r[@"field"] setStringValue:DYNumber(v,d)];
|
||||
[r[@"toggle"] setState:v>=.5?NSControlStateValueOn:NSControlStateValueOff];
|
||||
NSPopUpButton *popup=r[@"popup"]; if(popup.numberOfItems>0) [popup selectItemAtIndex:MAX(0,MIN((NSInteger)llround(v),popup.numberOfItems-1))];
|
||||
NSPopUpButton *popup=r[@"popup"]; if(popup.numberOfItems>0){NSArray *values=d[@"values"];NSInteger index=values?[values indexOfObject:@((int)llround(v))]:(NSInteger)llround(v);[popup selectItemAtIndex:index==NSNotFound?0:MAX(0,MIN(index,popup.numberOfItems-1))];}
|
||||
}
|
||||
for(id graphic in _graphics)[graphic setValues:graphicValues];
|
||||
for(NSMutableDictionary *c in _cards) {
|
||||
@@ -698,19 +700,21 @@ static NSImage *DYWheelImage(void) {
|
||||
NSNumber *extra=c[@"section"][@"extraEnabled"];double extraValue=0;
|
||||
if(extra)[get getFloatValue:&extraValue fromParameter:extra.unsignedIntValue atTime:t];
|
||||
BOOL enabled=v>=.5||extraValue>=.5;
|
||||
BOOL collapsed=!enabled;groupingChanged|=collapsed!=[c[@"collapsed"]boolValue];c[@"collapsed"]=@(collapsed);
|
||||
[c[@"header"]setState:enabled?NSControlStateValueOn:NSControlStateValueOff];
|
||||
[c[@"header"]setToolTip:enabled?@"折叠并停用本组,保留参数值;双击还原本组":@"展开并启用本组,恢复之前的参数值;双击还原本组"];
|
||||
[c[@"header"]setAccessibilityHelp:[c[@"header"]toolTip]];
|
||||
[c[@"header"]setNeedsDisplay:YES];
|
||||
[c[@"enabled"] setState:enabled?NSControlStateValueOn:NSControlStateValueOff];
|
||||
[c[@"enabled"]setImage:[NSImage imageWithSystemSymbolName:enabled?@"eye":@"eye.slash" accessibilityDescription:enabled?@"折叠并停用本组":@"展开并启用本组"]];
|
||||
[c[@"enabled"]setToolTip:enabled?@"折叠并停用本组,保留参数值":@"展开并启用本组,恢复之前的参数值"];
|
||||
[c[@"enabled"]setAccessibilityHelp:[c[@"enabled"]toolTip]];
|
||||
// Visibility and rendering share the host's section enable value.
|
||||
for(NSView *row in c[@"body"])row.alphaValue=1;
|
||||
DYInspectorToken *token=nil;[get getCustomParameterValue:&token fromParameter:DYInspectorParameterID atTime:t];
|
||||
NSNumber *saved=[token isKindOfClass:DYInspectorToken.class]?token.folds[c[@"section"][@"key"]]:nil;
|
||||
BOOL collapsed=saved?saved.boolValue:[c[@"collapsed"]boolValue];groupingChanged|=collapsed!=[c[@"collapsed"]boolValue];c[@"collapsed"]=@(collapsed);
|
||||
[c[@"header"]setState:collapsed?NSControlStateValueOff:NSControlStateValueOn];
|
||||
[c[@"header"]setToolTip:collapsed?@"展开界面,不改变启用状态;双击还原本组":@"折叠界面,保持当前效果;双击还原本组"];
|
||||
[c[@"header"]setAccessibilityHelp:[c[@"header"]toolTip]];[c[@"header"]setNeedsDisplay:YES];
|
||||
[c[@"enabled"]setState:enabled?NSControlStateValueOn:NSControlStateValueOff];
|
||||
[c[@"enabled"]setImage:[NSImage imageWithSystemSymbolName:enabled?@"eye":@"eye.slash" accessibilityDescription:enabled?@"停用本组":@"启用本组"]];
|
||||
[c[@"enabled"]setToolTip:enabled?@"停用本组,保留参数和展开状态":@"启用本组,保留展开状态"];[c[@"enabled"]setAccessibilityHelp:[c[@"enabled"]toolTip]];
|
||||
for(NSView *row in c[@"body"])row.alphaValue=enabled?1:.45;
|
||||
}
|
||||
DYAssetState *assets=DYReadAssets(_manager,t);
|
||||
double profile=0,configured=0;[get getFloatValue:&profile fromParameter:2013 atTime:t];[get getFloatValue:&configured fromParameter:2236 atTime:t];
|
||||
DYInspectorToken *oldToken=nil;[get getCustomParameterValue:&oldToken fromParameter:DYInspectorParameterID atTime:t];
|
||||
_tabs[@"legacyInput"]=@(configured<.5&&(profile>.5||[assets.paths[@"input"]length]||oldToken.schema<2));
|
||||
for(NSString *key in _assetButtons) {
|
||||
NSString *path=assets.paths[key]; NSButton *button=_assetButtons[key][@"choose"];
|
||||
NSString *name=path.length?path.lastPathComponent.stringByDeletingPathExtension:@"无";
|
||||
@@ -731,7 +735,7 @@ static NSImage *DYWheelImage(void) {
|
||||
if(_refreshing)return;
|
||||
NSNumber *pid=@(sender.tag); NSDictionary *r=_controls[pid],*d=r[@"descriptor"]; if(!d)return;
|
||||
double v;
|
||||
if([sender isKindOfClass:[NSPopUpButton class]])v=[(NSPopUpButton *)sender indexOfSelectedItem];
|
||||
if([sender isKindOfClass:[NSPopUpButton class]]){NSInteger i=[(NSPopUpButton *)sender indexOfSelectedItem];v=d[@"values"]?[d[@"values"][i]doubleValue]:i;}
|
||||
else if([sender isKindOfClass:[NSButton class]])v=[(NSButton *)sender state]==NSControlStateValueOn?1:0;
|
||||
else {
|
||||
if([sender isKindOfClass:[NSTextField class]]) {
|
||||
@@ -745,7 +749,7 @@ static NSImage *DYWheelImage(void) {
|
||||
v=fmax([d[@"min"] doubleValue],fmin([d[@"max"] doubleValue],v));
|
||||
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
|
||||
[action startAction:self];
|
||||
@try { id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)]; [set setFloatValue:v toParameter:pid.unsignedIntValue atTime:action.currentTime]; }
|
||||
@try { id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)]; [set setFloatValue:v toParameter:pid.unsignedIntValue atTime:action.currentTime];if([d[@"key"]hasPrefix:@"cm"])[set setFloatValue:1 toParameter:2236 atTime:action.currentTime]; }
|
||||
@finally { [action endAction:self]; }
|
||||
[self postChanged];
|
||||
}
|
||||
@@ -792,7 +796,19 @@ static NSImage *DYWheelImage(void) {
|
||||
- (void)groupEnabled:(NSButton *)sender { [self setSectionEnabled:sender.state==NSControlStateValueOn atIndex:sender.tag]; }
|
||||
- (void)toggleSection:(NSButton *)sender {
|
||||
if(sender.tag<0||sender.tag>=_cards.count)return;
|
||||
[self setSectionEnabled:[_cards[sender.tag][@"collapsed"]boolValue] atIndex:sender.tag];
|
||||
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;[action startAction:self];
|
||||
@try {
|
||||
id<FxParameterRetrievalAPI_v6> get=[_manager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];
|
||||
DYInspectorToken *old=nil;[get getCustomParameterValue:&old fromParameter:DYInspectorParameterID atTime:action.currentTime];DYInspectorToken *token=[old isKindOfClass:DYInspectorToken.class]?[[old copy]autorelease]:[[[DYInspectorToken alloc]init]autorelease];
|
||||
NSMutableDictionary *folds=[[token.folds mutableCopy]autorelease];
|
||||
for(NSDictionary *card in _cards)folds[card[@"section"][@"key"]]=card[@"collapsed"];
|
||||
NSString *key=_cards[sender.tag][@"section"][@"key"];folds[key]=@(![_cards[sender.tag][@"collapsed"]boolValue]);token.folds=folds;
|
||||
[set setCustomParameterValue:token toParameter:DYInspectorParameterID atTime:action.currentTime];
|
||||
}@finally{[action endAction:self];}[self postChanged];
|
||||
}
|
||||
- (void)useCST:(id)sender {
|
||||
id<FxCustomParameterActionAPI_v4> a=[self actionAPI];if(!a)return;[a startAction:self];
|
||||
@try{id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];[set setFloatValue:1 toParameter:2236 atTime:a.currentTime];} @finally{[a endAction:self];}[self postChanged];
|
||||
}
|
||||
- (void)resetSection:(NSButton *)sender {
|
||||
[self cancelAssetLoads];
|
||||
@@ -827,6 +843,8 @@ static NSImage *DYWheelImage(void) {
|
||||
CMTime t=action.currentTime;id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];
|
||||
for(NSDictionary *d in DYDescriptors())[set setFloatValue:[d[@"default"] doubleValue] toParameter:[d[@"pid"] unsignedIntValue] atTime:t];
|
||||
DYAssetState *assets=[[[DYAssetState alloc] init] autorelease];assets.paths=@{};DYWriteAssets(_manager,assets,t);
|
||||
[set setCustomParameterValue:[[[DYInspectorToken alloc]init]autorelease] toParameter:DYInspectorParameterID atTime:t];
|
||||
for(NSMutableDictionary *card in _cards)card[@"collapsed"]=@(![@[@"primary",@"base"]containsObject:card[@"section"][@"key"]]);
|
||||
} @finally {[action endAction:self];}
|
||||
[self postChanged];
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ FOUNDATION_EXPORT void DYReadUniforms(id<PROAPIAccessing> manager,CMTime time,DY
|
||||
@property(copy) NSDictionary *paths;
|
||||
@end
|
||||
@interface DYInspectorToken : NSObject<NSSecureCoding,NSCopying,FxCustomParameterInterpolation_v2>
|
||||
@property(copy) NSDictionary *folds;
|
||||
@property NSInteger schema;
|
||||
@end
|
||||
FOUNDATION_EXPORT DYAssetState *DYReadAssets(id<PROAPIAccessing> manager,CMTime time);
|
||||
FOUNDATION_EXPORT BOOL DYWriteAssets(id<PROAPIAccessing> manager,DYAssetState *assets,CMTime time);
|
||||
+114
-10
@@ -7,16 +7,116 @@ static NSDictionary *row(NSString*k,NSString*t,NSUInteger o,double lo,double hi,
|
||||
NSMutableDictionary*r=[@{@"key":k,@"title":t,@"pid":@(PID(o)),@"offset":@(o),@"min":@(lo),@"max":@(hi),@"default":@(d),@"step":@(hi-lo>10?1:.01),@"kind":kind?:@"float"}mutableCopy];
|
||||
[descriptors addObject:r];return [r autorelease];
|
||||
}
|
||||
static void section(NSString*k,NSString*t,NSUInteger offset,NSArray*rows,double def=0){
|
||||
static void section(NSString*k,NSString*t,NSUInteger offset,NSArray*rows,double def=1){
|
||||
NSDictionary*e=row([k stringByAppendingString:@"Enabled"],t,offset,0,1,def,@"bool");
|
||||
[sections addObject:@{@"key":k,@"title":t,@"enabled":e[@"pid"],@"defaultEnabled":@(def),@"rows":rows}];
|
||||
}
|
||||
static NSDictionary *scalar(NSString*k,NSString*t,NSUInteger o,double lo=-100,double hi=100,double def=0){return row(k,t,o,lo,hi,def,@"float");}
|
||||
NSArray<NSDictionary *> *DYCMSceneSpaces(void) { return @[
|
||||
@{ @"id":@99, @"name":@"KOLOR Default" },
|
||||
@{ @"id":@1, @"name":@"ACEScct" },
|
||||
@{ @"id":@2, @"name":@"Apple Log" },
|
||||
@{ @"id":@3, @"name":@"Apple Log 2" },
|
||||
@{ @"id":@4, @"name":@"ARRI LogC3" },
|
||||
@{ @"id":@5, @"name":@"ARRI LogC4" },
|
||||
@{ @"id":@6, @"name":@"Blackmagic Film Gen 5" },
|
||||
@{ @"id":@7, @"name":@"Canon C-Log" },
|
||||
@{ @"id":@8, @"name":@"Canon C-Log 2" },
|
||||
@{ @"id":@9, @"name":@"Canon C-Log 3" },
|
||||
@{ @"id":@10, @"name":@"DaVinci Intermediate" },
|
||||
@{ @"id":@11, @"name":@"DJI D-Log" },
|
||||
@{ @"id":@12, @"name":@"DJI D-Log 2" },
|
||||
@{ @"id":@13, @"name":@"DJI D-Log M" },
|
||||
@{ @"id":@14, @"name":@"Fujifilm F-Log" },
|
||||
@{ @"id":@15, @"name":@"Fujifilm F-Log2" },
|
||||
@{ @"id":@16, @"name":@"Fujifilm F-Log2 C" },
|
||||
@{ @"id":@17, @"name":@"GoPro GP-Log" },
|
||||
@{ @"id":@18, @"name":@"GoPro GP-Log2" },
|
||||
@{ @"id":@30, @"name":@"GoPro GP-Log2 (Official, 0 EV)" },
|
||||
@{ @"id":@29, @"name":@"Insta I-Log" },
|
||||
@{ @"id":@19, @"name":@"Leica L-Log" },
|
||||
@{ @"id":@20, @"name":@"Linear" },
|
||||
@{ @"id":@21, @"name":@"Nikon N-Log" },
|
||||
@{ @"id":@22, @"name":@"Panasonic V-Log" },
|
||||
@{ @"id":@23, @"name":@"Phantom Log 1" },
|
||||
@{ @"id":@24, @"name":@"Phantom Log 2" },
|
||||
@{ @"id":@25, @"name":@"REDLog3G10" },
|
||||
@{ @"id":@26, @"name":@"Samsung Log" },
|
||||
@{ @"id":@27, @"name":@"Sony S-Log2" },
|
||||
@{ @"id":@28, @"name":@"Sony S-Log3" }
|
||||
]; }
|
||||
NSArray<NSDictionary *> *DYCMDisplaySpaces(void) { return @[
|
||||
@{ @"id":@1001, @"name":@"Gamma 2.2" },
|
||||
@{ @"id":@1002, @"name":@"Gamma 2.4" },
|
||||
@{ @"id":@1003, @"name":@"Gamma 2.6" }
|
||||
]; }
|
||||
NSArray<NSDictionary *> *DYCMGamuts(void) { return @[
|
||||
@{ @"id":@99, @"name":@"KOLOR Default" },
|
||||
@{ @"id":@1, @"name":@"ACES AP0" },
|
||||
@{ @"id":@2, @"name":@"ACES AP1" },
|
||||
@{ @"id":@3, @"name":@"Apple Log 2" },
|
||||
@{ @"id":@4, @"name":@"ARRI WG3" },
|
||||
@{ @"id":@5, @"name":@"ARRI WG4" },
|
||||
@{ @"id":@6, @"name":@"Blackmagic Wide Gamut" },
|
||||
@{ @"id":@7, @"name":@"Canon Cinema Gamut" },
|
||||
@{ @"id":@16, @"name":@"DaVinci Wide Gamut" },
|
||||
@{ @"id":@8, @"name":@"DJI Action 5" },
|
||||
@{ @"id":@9, @"name":@"DJI Air 2S" },
|
||||
@{ @"id":@10, @"name":@"DJI D-Gamut" },
|
||||
@{ @"id":@28, @"name":@"DJI D-Gamut 2" },
|
||||
@{ @"id":@11, @"name":@"DJI Mavic2 Pro" },
|
||||
@{ @"id":@12, @"name":@"DJI Mavic 3 Pro" },
|
||||
@{ @"id":@13, @"name":@"DJI Mini 4 Pro" },
|
||||
@{ @"id":@14, @"name":@"DJI Mini 5 Pro" },
|
||||
@{ @"id":@15, @"name":@"DJI Pocket 3" },
|
||||
@{ @"id":@17, @"name":@"Fujifilm F-GamutC" },
|
||||
@{ @"id":@18, @"name":@"GoPro GP-Log" },
|
||||
@{ @"id":@19, @"name":@"P3-DCI" },
|
||||
@{ @"id":@20, @"name":@"P3 D65" },
|
||||
@{ @"id":@21, @"name":@"Panasonic V-Gamut" },
|
||||
@{ @"id":@22, @"name":@"Rec.709 / BT.709" },
|
||||
@{ @"id":@23, @"name":@"Rec.2020 / BT.2020" },
|
||||
@{ @"id":@24, @"name":@"RED Wide Gamut RGB" },
|
||||
@{ @"id":@25, @"name":@"Sony S-Gamut" },
|
||||
@{ @"id":@26, @"name":@"Sony S-Gamut3" },
|
||||
@{ @"id":@27, @"name":@"Sony S-Gamut3.Cine" }
|
||||
]; }
|
||||
|
||||
static NSDictionary *cmRow(NSString*k,NSString*t,NSUInteger o,double lo,double hi,double def,int tab,NSArray *choices=nil){
|
||||
NSMutableDictionary *d=[[row(k,t,offsetof(DYUniforms,cm)+o,lo,hi,def,choices?@"popup":@"float")mutableCopy]autorelease];d[@"cmTab"]=@(tab);
|
||||
if(choices){d[@"options"]=[choices valueForKey:@"name"];d[@"values"]=[choices valueForKey:@"id"];}
|
||||
[descriptors replaceObjectAtIndex:descriptors.count-1 withObject:d];return d;
|
||||
}
|
||||
static void initialize(){static dispatch_once_t once;dispatch_once(&once,^{
|
||||
sections=[[NSMutableArray alloc]init];descriptors=[[NSMutableArray alloc]init];
|
||||
NSMutableDictionary*profile=[[scalar(@"inputProfile",@"相机输入",52,0,17)mutableCopy]autorelease];profile[@"kind"]=@"popup";profile[@"options"]=@[@"无",@"Apple Log",@"ARRI LogC3",@"ARRI LogC4",@"Blackmagic Film Gen5",@"Canon C-Log",@"Canon C-Log2",@"Canon C-Log3",@"DJI D-Log",@"DJI D-Log M",@"Fujifilm F-Log",@"Fujifilm F-Log2",@"Nikon N-Log",@"Panasonic V-Log",@"RED Log3G10",@"Sony S-Log2",@"Sony S-Log3",@"Sony HLG"];
|
||||
[descriptors replaceObjectAtIndex:0 withObject:profile];
|
||||
section(@"input",@"输入 / LUT",132,@[profile,scalar(@"preLUTStrength",@"输入强度",56,0,1,1)]);
|
||||
// Legacy IDs remain registered for existing FCP documents and presets.
|
||||
scalar(@"preLUTStrength",@"旧版输入强度",56,0,1,1);
|
||||
row(@"cmConfigured",@"CST 配置版本",offsetof(DYUniforms,cm)+offsetof(DYCMSettings,configured),0,1,0,@"bool");
|
||||
NSArray *transfers=[DYCMSceneSpaces() arrayByAddingObjectsFromArray:DYCMDisplaySpaces()];
|
||||
NSMutableArray *cm=[NSMutableArray array];
|
||||
#define CM(f,t,lo,hi,def,tab) [cm addObject:cmRow(@"cm" #f,t,offsetof(DYCMSettings,f),lo,hi,def,tab)]
|
||||
#define CH(f,t,def,tab,list) [cm addObject:cmRow(@"cm" #f,t,offsetof(DYCMSettings,f),0,1003,def,tab,list)]
|
||||
CM(inputEnabled,@"输入转换启用",0,1,1,0);
|
||||
CH(inputTransfer,@"输入曲线",1002,0,transfers);CH(inputGamut,@"输入色域",22,0,DYCMGamuts());
|
||||
CH(workingTransfer,@"工作曲线",10,0,transfers);CH(workingGamut,@"工作色域",16,0,DYCMGamuts());
|
||||
CM(mix,@"CST 混合",0,1,1,0);
|
||||
CM(basisEnabled,@"一级调色启用",0,1,1,1);
|
||||
CM(exposure,@"一级曝光",-5,5,0,1);CM(balanceAngle,@"色彩平衡方向",0,1,0,1);CM(balanceStrength,@"色彩平衡强度",0,1,0,1);CM(saturation,@"一级饱和度",0,2,1,1);
|
||||
CM(contrast,@"一级对比度",-1,1,0,1);CM(pivot,@"对比度轴心",-3,3,0,1);CM(hiContrast,@"高光对比度",-1,1,0,1);CM(hiPivot,@"高光轴心",-1,1,0,1);CM(shadowContrast,@"阴影对比度",-1,1,0,1);CM(shadowPivot,@"阴影轴心",-1,1,0,1);
|
||||
CM(white,@"白点",.5,1.5,1,1);CM(shoulder,@"肩部压缩",0,1,.5,1);CM(highlights,@"一级高光",-1,1,0,1);CM(midtones,@"一级中间调",-1,1,0,1);CM(shadows,@"一级阴影",-1,1,0,1);CM(black,@"黑点",-1,1,0,1);CM(toe,@"趾部压缩",0,1,.5,1);CM(chromaMix,@"色度混合",0,1,.5,1);
|
||||
CM(bypassExposure,@"旁路一级曝光",0,1,0,1);CM(bypassBalance,@"旁路一级色彩",0,1,0,1);CM(bypassContrast,@"旁路一级对比",0,1,0,1);CM(bypassTone,@"旁路一级影调",0,1,0,1);
|
||||
CM(outputEnabled,@"输出转换启用",0,1,1,2);CH(outputTransfer,@"输出曲线",1002,2,transfers);CH(outputGamut,@"输出色域",22,2,DYCMGamuts());
|
||||
[cm addObject:cmRow(@"cmtoneMapping",@"输出色调映射",offsetof(DYCMSettings,toneMapping),0,1,0,2,@[@{@"id":@0,@"name":@"关闭"},@{@"id":@1,@"name":@"开启"}])];
|
||||
#undef CM
|
||||
#undef CH
|
||||
NSMutableArray *input=[NSMutableArray array],*primary=[NSMutableArray array],*output=[NSMutableArray array];
|
||||
for(NSDictionary *d in cm){NSString *key=d[@"key"];if([@[@"cminputEnabled",@"cmbasisEnabled",@"cmoutputEnabled"]containsObject:key])continue;[([d[@"cmTab"]intValue]==0?input:[d[@"cmTab"]intValue]==1?primary:output) addObject:d];}
|
||||
section(@"input",@"输入转换 / CST",132,input);
|
||||
// Enable descriptors already exist; do not register the same offset twice.
|
||||
[sections addObject:@{@"key":@"primary",@"title":@"一级调色",@"enabled":@(PID(offsetof(DYUniforms,cm)+offsetof(DYCMSettings,basisEnabled))),@"defaultEnabled":@1,@"rows":primary}];
|
||||
[sections addObject:@{@"key":@"output",@"title":@"输出转换 / CST",@"enabled":@(PID(offsetof(DYUniforms,cm)+offsetof(DYCMSettings,outputEnabled))),@"defaultEnabled":@1,@"rows":output}];
|
||||
NSMutableArray*base=[NSMutableArray array];
|
||||
NSArray*names=@[@"曝光",@"对比度",@"高光",@"阴影",@"白色色阶",@"黑色色阶",@"色温",@"色调",@"饱和度",@"鲜艳度",@"纹理",@"清晰度",@"去朦胧"];
|
||||
NSArray*keys=@[@"exposure",@"contrast",@"highlights",@"shadows",@"whites",@"blacks",@"temperature",@"tint",@"saturation",@"vibrance",@"texture",@"clarity",@"dehaze"];
|
||||
@@ -28,7 +128,7 @@ static void initialize(){static dispatch_once_t once;dispatch_once(&once,^{
|
||||
NSDictionary*copyAuto=@{@"key":@"copyAutoGrade",@"title":@"复制时自动调色",@"pid":@8800,@"offset":@(-1),@"min":@0,@"max":@1,@"default":@0,@"step":@1,@"kind":@"bool",@"notAnimatable":@YES};[descriptors addObject:copyAuto];
|
||||
section(@"base",@"基础调色",136,[[[base subarrayWithRange:NSMakeRange(0,6)]arrayByAddingObjectsFromArray:[base subarrayWithRange:NSMakeRange(10,3)]]arrayByAddingObject:copyAuto],1);
|
||||
section(@"color",@"白平衡与颜色",140,@[base[6],base[7],base[9],base[8]],1);
|
||||
section(@"skin",@"肤色保护",464,@[scalar(@"skinStrength",@"保护程度",468,0,100,60),scalar(@"skinHue",@"肤色色相",472,0,60,28)],0);
|
||||
section(@"skin",@"肤色保护",464,@[scalar(@"skinStrength",@"保护程度",468,0,100,60),scalar(@"skinHue",@"肤色色相",472,0,60,28)],1);
|
||||
NSMutableArray*look=[NSMutableArray arrayWithObject:scalar(@"postLUTStrength",@"风格 1 强度",60,0,1,1)];
|
||||
for(int i=0;i<4;i++){[look addObject:row([NSString stringWithFormat:@"look%dEnabled",i+2],[NSString stringWithFormat:@"风格 %d 启用",i+2],160+i*4,0,1,1,@"bool")];[look addObject:scalar([NSString stringWithFormat:@"look%dStrength",i+2],[NSString stringWithFormat:@"风格 %d 强度",i+2],64+i*4,0,1,1)];}
|
||||
section(@"look",@"风格 LUT",144,look);
|
||||
@@ -49,12 +149,14 @@ static void initialize(){static dispatch_once_t once;dispatch_once(&once,^{
|
||||
[grade addObject:scalar(@"gradingBlending",@"混合",404,0,100,50)];[grade addObject:scalar(@"gradingBalance",@"平衡",408)];section(@"grading",@"颜色分级",400,grade);
|
||||
NSMutableArray*prim=[NSMutableArray array];for(int c=0;c<3;c++)for(int a=0;a<2;a++)[prim addObject:scalar([NSString stringWithFormat:@"primary%d_%d",c,a],[NSString stringWithFormat:@"%@原色 %@",@[@"红",@"绿",@"蓝"][c],a?@"饱和度":@"色相"],484+c*8+a*4)];section(@"primaries",@"三原色",480,prim);
|
||||
NSMutableArray*levels=[NSMutableArray array];for(int c=0;c<4;c++)for(int a=0;a<5;a++)[levels addObject:scalar([NSString stringWithFormat:@"level%d_%d",c,a],[NSString stringWithFormat:@"%@ %@",@[@"RGB",@"红",@"绿",@"蓝"][c],@[@"输入黑",@"伽马",@"输入白",@"输出黑",@"输出白"][a]],624+a*16+c*4,a==1?.1:0,a==1?10:255,a==1?1:(a==2||a==4)?255:0)];section(@"levels",@"色阶",608,levels);
|
||||
NSMutableArray*bw=[NSMutableArray array];for(int c=0;c<6;c++)[bw addObject:scalar([NSString stringWithFormat:@"bw%d",c],[NSString stringWithFormat:@"黑白 %@",@[@"红",@"黄",@"绿",@"青",@"蓝",@"洋红"][c]],c<4?720+c*4:736+(c-4)*4,0,200,((double[]){40,60,40,60,20,80})[c])];[bw addObject:scalar(@"bwHue",@"着色色相",744,0,360)];[bw addObject:scalar(@"bwSat",@"着色饱和度",748,0,100)];section(@"blackwhite",@"黑白混色",704,bw,0);
|
||||
NSMutableArray*bw=[NSMutableArray array];for(int c=0;c<6;c++)[bw addObject:scalar([NSString stringWithFormat:@"bw%d",c],[NSString stringWithFormat:@"黑白 %@",@[@"红",@"黄",@"绿",@"青",@"蓝",@"洋红"][c]],c<4?720+c*4:736+(c-4)*4,0,200,((double[]){40,60,40,60,20,80})[c])];[bw addObject:scalar(@"bwHue",@"着色色相",744,0,360)];[bw addObject:scalar(@"bwSat",@"着色饱和度",748,0,100)];[bw insertObject:scalar(@"blackWhiteMix",@"黑白混合",offsetof(DYUniforms,cm)+offsetof(DYCMSettings,blackWhiteMix),0,1,0) atIndex:0];section(@"blackwhite",@"黑白混色",704,bw,1);
|
||||
NSMutableArray*balance=[NSMutableArray arrayWithObject:row(@"preserveLuma",@"保持明度",756,0,1,1,@"bool")];for(int c=0;c<3;c++)for(int a=0;a<3;a++)[balance addObject:scalar([NSString stringWithFormat:@"balance%d_%d",c,a],[NSString stringWithFormat:@"%@ %@",@[@"阴影",@"中间调",@"高光"][c],@[@"青 ↔ 红",@"洋红 ↔ 绿",@"黄 ↔ 蓝"][a]],768+c*16+a*4)];section(@"balance",@"色彩平衡",752,balance);
|
||||
});}
|
||||
NSArray<NSDictionary*> *DYSections(void){initialize();return sections;} NSArray<NSDictionary*> *DYDescriptors(void){initialize();return descriptors;}
|
||||
void DYDefaultUniforms(DYUniforms*u){memset(u,0,sizeof(*u));for(NSDictionary*r in DYDescriptors())if([r[@"offset"]integerValue]>=0)*(float*)((uint8_t*)u+[r[@"offset"]unsignedIntegerValue])=[r[@"default"]floatValue];u->primariesM0=(DYFloat3){1,0,0};u->primariesM1=(DYFloat3){0,1,0};u->primariesM2=(DYFloat3){0,0,1};}
|
||||
void DYReadUniforms(id<PROAPIAccessing>m,CMTime t,DYUniforms*u){DYDefaultUniforms(u);id<FxParameterRetrievalAPI_v6>g=[m apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];for(NSDictionary*r in DYDescriptors()){if([r[@"offset"]integerValue]<0)continue;double v=[r[@"default"]doubleValue];if([g getFloatValue:&v fromParameter:[r[@"pid"]unsignedIntValue] atTime:t]&&std::isfinite(v))*(float*)((uint8_t*)u+[r[@"offset"]unsignedIntegerValue])=fmin([r[@"max"]doubleValue],fmax([r[@"min"]doubleValue],v));}}
|
||||
void DYReadUniforms(id<PROAPIAccessing>m,CMTime t,DYUniforms*u){DYDefaultUniforms(u);id<FxParameterRetrievalAPI_v6>g=[m apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];for(NSDictionary*r in DYDescriptors()){if([r[@"offset"]integerValue]<0)continue;double v=[r[@"default"]doubleValue];if([g getFloatValue:&v fromParameter:[r[@"pid"]unsignedIntValue] atTime:t]&&std::isfinite(v))*(float*)((uint8_t*)u+[r[@"offset"]unsignedIntegerValue])=fmin([r[@"max"]doubleValue],fmax([r[@"min"]doubleValue],v));}NSObject<NSSecureCoding,NSCopying> *token=nil;[g getCustomParameterValue:&token fromParameter:DYInspectorParameterID atTime:t];
|
||||
if([token isKindOfClass:DYInspectorToken.class]&&[(DYInspectorToken*)token schema]<2){if(u->cm.configured<.5)u->cm.configured=-1;u->cm.blackWhiteMix=1;}
|
||||
}
|
||||
BOOL DYCreateParameters(id<PROAPIAccessing>m,NSError**error){id<FxParameterCreationAPI_v5>a=[m apiForProtocol:@protocol(FxParameterCreationAPI_v5)];BOOL ok=a!=nil;
|
||||
ok=[a addCustomParameterWithName:@"大鱼调色" parameterID:DYInspectorParameterID defaultValue:[[[DYInspectorToken alloc]init]autorelease] parameterFlags:kFxParameterFlag_CUSTOM_UI|kFxParameterFlag_USE_FULL_VIEW_WIDTH|kFxParameterFlag_DONT_DISPLAY_IN_DASHBOARD|kFxParameterFlag_NOT_ANIMATABLE]&&ok;
|
||||
for(NSDictionary*r in DYDescriptors())ok=[a addFloatSliderWithName:r[@"title"] parameterID:[r[@"pid"]unsignedIntValue] defaultValue:[r[@"default"]doubleValue] parameterMin:[r[@"min"]doubleValue] parameterMax:[r[@"max"]doubleValue] sliderMin:[r[@"min"]doubleValue] sliderMax:[r[@"max"]doubleValue] delta:[r[@"step"]doubleValue] parameterFlags:kFxParameterFlag_HIDDEN|([r[@"notAnimatable"]boolValue]?kFxParameterFlag_NOT_ANIMATABLE:0)]&&ok;
|
||||
@@ -73,12 +175,14 @@ BOOL DYCreateParameters(id<PROAPIAccessing>m,NSError**error){id<FxParameterCreat
|
||||
@end
|
||||
@implementation DYInspectorToken
|
||||
+ (BOOL)supportsSecureCoding{return YES;}
|
||||
- (void)encodeWithCoder:(NSCoder*)c{[c encodeInt:1 forKey:@"schema"];}
|
||||
- (instancetype)initWithCoder:(NSCoder*)c{return [self init];}
|
||||
- (id)copyWithZone:(NSZone*)z{return [[[self class]allocWithZone:z]init];}
|
||||
- (instancetype)init{if((self=[super init])){_folds=[@{} copy];_schema=2;}return self;}
|
||||
- (void)dealloc{[_folds release];[super dealloc];}
|
||||
- (void)encodeWithCoder:(NSCoder*)c{[c encodeInteger:_schema forKey:@"schema"];[c encodeObject:_folds forKey:@"folds"];}
|
||||
- (instancetype)initWithCoder:(NSCoder*)c{if((self=[self init])){NSDictionary *v=[c decodeObjectOfClasses:[NSSet setWithObjects:NSDictionary.class,NSString.class,NSNumber.class,nil] forKey:@"folds"];if(v)self.folds=v;_schema=[c decodeIntegerForKey:@"schema"];}return self;}
|
||||
- (id)copyWithZone:(NSZone*)z{DYInspectorToken *v=[[[self class]allocWithZone:z]init];v.folds=_folds;v.schema=_schema;return v;}
|
||||
- (id)interpolateBetween:(id)r withWeight:(float)w{return [[self copy]autorelease];}
|
||||
- (BOOL)isEqual:(id)o{return [o isKindOfClass:self.class];}
|
||||
- (NSUInteger)hash{return 1;}
|
||||
- (BOOL)isEqual:(id)o{return [o isKindOfClass:self.class]&&_schema==[o schema]&&[_folds isEqual:[o folds]];}
|
||||
- (NSUInteger)hash{return _folds.hash;}
|
||||
@end
|
||||
DYAssetState*DYReadAssets(id<PROAPIAccessing>m,CMTime t){DYAssetState*v=nil;id<FxParameterRetrievalAPI_v6>g=[m apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)];[g getCustomParameterValue:&v fromParameter:DYAssetsParameterID atTime:t];return [v isKindOfClass:DYAssetState.class]?v:[[[DYAssetState alloc]init]autorelease];}
|
||||
BOOL DYWriteAssets(id<PROAPIAccessing>m,DYAssetState*v,CMTime t){id<FxParameterSettingAPI_v6>s=[m apiForProtocol:@protocol(FxParameterSettingAPI_v6)];return [s setCustomParameterValue:v toParameter:DYAssetsParameterID atTime:t];}
|
||||
+2
-2
@@ -12,9 +12,9 @@
|
||||
- (void)dealloc{[NSNotificationCenter.defaultCenter removeObserver:self];[_renderer release];[super dealloc];}
|
||||
- (BOOL)properties:(NSDictionary**)p error:(NSError**)e{*p=@{kFxPropertyKey_MayRemapTime:@NO,kFxPropertyKey_PixelTransformSupport:@(kFxPixelTransform_ScaleTranslate),kFxPropertyKey_VariesWhenParamsAreStatic:@NO,kFxPropertyKey_DesiredProcessingColorInfo:@(kFxImageColorInfo_RGB_LINEAR),kFxPropertyKey_NeedsFullBuffer:@YES};return YES;}
|
||||
- (BOOL)addParametersWithError:(NSError**)e{return DYCreateParameters(_apiManager,e);}
|
||||
- (NSSet<Class>*)classesForCustomParameterID:(UInt32)pid{return pid==DYAssetsParameterID?[NSSet setWithObjects:DYAssetState.class,NSDictionary.class,NSString.class,nil]:[NSSet setWithObject:DYInspectorToken.class];}
|
||||
- (NSSet<Class>*)classesForCustomParameterID:(UInt32)pid{return pid==DYAssetsParameterID?[NSSet setWithObjects:DYAssetState.class,NSDictionary.class,NSString.class,nil]:[NSSet setWithObjects:DYInspectorToken.class,NSDictionary.class,NSString.class,NSNumber.class,nil];}
|
||||
- (NSView*)createViewForParameterID:(UInt32)pid{return pid==DYInspectorParameterID?[[DYInspector alloc]initWithAPIManager:_apiManager renderer:_renderer]:[[NSView alloc]initWithFrame:NSZeroRect];}
|
||||
- (BOOL)parameterChanged:(UInt32)pid atTime:(CMTime)t error:(NSError**)e{if(pid==2013||pid==2014||pid==DYAssetsParameterID)[_renderer invalidatePreview];dispatch_async(dispatch_get_main_queue(),^{[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:self.apiManager];});return YES;}
|
||||
- (BOOL)parameterChanged:(UInt32)pid atTime:(CMTime)t error:(NSError**)e{if(pid==2013||pid==2014||(pid>=2236&&pid<2400)||pid==DYAssetsParameterID)[_renderer invalidatePreview];dispatch_async(dispatch_get_main_queue(),^{[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:self.apiManager];});return YES;}
|
||||
- (BOOL)pluginState:(NSData**)state atTime:(CMTime)t quality:(FxQuality)q error:(NSError**)e{
|
||||
DYUniforms u;DYReadUniforms(_apiManager,t,&u);DYAssetState*a=DYReadAssets(_apiManager,t);double copyAuto=0;[[_apiManager apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)]getFloatValue:©Auto fromParameter:8800 atTime:t];NSDictionary*s=@{@"schema":@1,@"copyAuto":@(copyAuto>.5),@"uniforms":[NSData dataWithBytes:&u length:sizeof(u)],@"paths":a.paths?:@{}};*state=[NSPropertyListSerialization dataWithPropertyList:s format:NSPropertyListBinaryFormat_v1_0 options:0 error:e];return *state!=nil;
|
||||
}
|
||||
|
||||
+40
-8
@@ -8,6 +8,20 @@
|
||||
static BOOL fail(NSError**e,NSString*m){if(e)*e=[NSError errorWithDomain:@"com.dayu.color" code:1 userInfo:@{NSLocalizedDescriptionKey:m?:@"Metal 调色失败"}];return NO;}
|
||||
static NSArray *inputFiles(){return @[@"",@"apple_log_to_rec709",@"arri_logc3_to_rec709",@"arri_logc4_to_rec709",@"blackmagic_film_gen5_to_rec709",@"canon_clog_bt709_to_rec709",@"canon_clog2_cinema_gamut_to_rec709",@"canon_clog3_cinema_gamut_to_rec709",@"dji_dlog_to_rec709",@"dji_dlog_m_to_rec709",@"fujifilm_flog_to_rec709",@"fujifilm_flog2_to_rec709",@"nikon_nlog_to_rec709",@"panasonic_vlog_vgamut_to_rec709",@"red_log3g10_rwg_to_rec709",@"sony_slog2_sgamut_to_rec709",@"sony_slog3_sgamut3cine_to_rec709",@"sony_hlg_bt2020_to_rec709"];}
|
||||
static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){MTLTextureDescriptor*t=[MTLTextureDescriptor new];t.textureType=MTLTextureType3D;t.pixelFormat=MTLPixelFormatRGBA32Float;t.width=n;t.height=n;t.depth=n;t.storageMode=MTLStorageModeShared;t.usage=MTLTextureUsageShaderRead;id<MTLTexture>x=[d newTextureWithDescriptor:t];[t release];if(x)[x replaceRegion:MTLRegionMake3D(0,0,0,n,n,n) mipmapLevel:0 slice:0 withBytes:values bytesPerRow:n*16 bytesPerImage:n*n*16];return [x autorelease];}
|
||||
// A synthetic texture lattice uses exactly the production render path for Cube export.
|
||||
@interface DYExportTile : FxImageTile { id<MTLTexture> _tex; uint64_t _registry; }
|
||||
- (instancetype)initWithTexture:(id<MTLTexture>)texture registry:(uint64_t)registry;
|
||||
@end
|
||||
@implementation DYExportTile
|
||||
- (instancetype)initWithTexture:(id<MTLTexture>)texture registry:(uint64_t)registry{if((self=[super init])){_tex=[texture retain];_registry=registry;}return self;}
|
||||
- (void)dealloc{[_tex release];[super dealloc];}
|
||||
- (id<MTLTexture>)metalTextureForDevice:(id<MTLDevice>)d{return d.registryID==_registry?_tex:nil;}
|
||||
- (FxRect)tilePixelBounds{return (FxRect){0,0,(SInt32)_tex.width,(SInt32)_tex.height};}
|
||||
- (FxRect)imagePixelBounds{return self.tilePixelBounds;}
|
||||
- (uint64_t)deviceRegistryID{return _registry;}
|
||||
- (FxImageOrigin)imageOrigin{return kFxImageOrigin_TOP_LEFT;}
|
||||
@end
|
||||
static BOOL managed(DYUniforms u,NSDictionary *paths){return u.cm.configured>=0&&(u.cm.configured>.5||(![paths[@"input"]length]&&u.inputProfile<.5));}
|
||||
@interface DYRenderer(){
|
||||
NSMutableDictionary *_devices,*_luts,*_preparedLUTs;
|
||||
NSSet *_activeLUTPaths;
|
||||
@@ -16,6 +30,7 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
|
||||
NSObject *_previewLock;
|
||||
NSData *_preview,*_lookLUTPreview;
|
||||
CFTimeInterval _lastPreview;
|
||||
BOOL _exporting;
|
||||
}
|
||||
@end
|
||||
@implementation DYRenderer
|
||||
@@ -52,7 +67,7 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
|
||||
NSURL*url=[[NSBundle bundleForClass:self.class]URLForResource:@"default" withExtension:@"metallib"];
|
||||
id<MTLLibrary>lib=[d newLibraryWithURL:url error:err];if(!lib){[d release];return nil;}
|
||||
id<MTLCommandQueue>q=[d newCommandQueue];entry=[NSMutableDictionary dictionaryWithDictionary:@{@"device":d,@"library":lib,@"queue":q,@"pipelines":[NSMutableDictionary dictionary]}];
|
||||
for(NSString*fn in @[@"dyUnpremultiply",@"dyWhitesSceneStatistics",@"dyLUTExportKernel",@"dyInputAnalysis"]){id<MTLFunction>f=[lib newFunctionWithName:fn];if(!f){fail(err,[fn stringByAppendingString:@" 缺失"]);[lib release];[q release];[d release];return nil;}id<MTLComputePipelineState>p=[d newComputePipelineStateWithFunction:f error:err];[f release];if(!p){[lib release];[q release];[d release];return nil;}entry[fn]=p;[p release];}
|
||||
for(NSString*fn in @[@"dyUnpremultiply",@"dyWhitesSceneStatistics",@"dyLUTExportKernel",@"dyInputAnalysis",@"dyColorManagement"]){id<MTLFunction>f=[lib newFunctionWithName:fn];if(!f){fail(err,[fn stringByAppendingString:@" 缺失"]);[lib release];[q release];[d release];return nil;}id<MTLComputePipelineState>p=[d newComputePipelineStateWithFunction:f error:err];[f release];if(!p){[lib release];[q release];[d release];return nil;}entry[fn]=p;[p release];}
|
||||
float identity[32];for(int z=0;z<2;z++)for(int y=0;y<2;y++)for(int x=0;x<2;x++){int i=((z*2+y)*2+x)*4;identity[i]=x;identity[i+1]=y;identity[i+2]=z;identity[i+3]=1;}id<MTLTexture>neutral=texture3D(d,identity,2);if(!neutral){fail(err,@"无法分配中性 LUT");return nil;}entry[@"identity"]=neutral;
|
||||
// Preparing before the first frame may use registry 0. Reuse those pipelines
|
||||
// when the host subsequently supplies that device's actual registry ID.
|
||||
@@ -67,9 +82,9 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
|
||||
return [self textureForTable:table entry:e error:err];
|
||||
}
|
||||
- (NSArray*)textures:(NSDictionary*)paths uniforms:(DYUniforms*)u entry:(NSDictionary*)e error:(NSError**)err{
|
||||
// Normalize only this render copy. Folded groups retain their host parameters
|
||||
// Normalize only this render copy. Disabled groups retain their host parameters
|
||||
// and paths, while inactive LUTs neither load files nor affect any layer.
|
||||
BOOL inputEnabled=u->inputSectionEnabled>.5;
|
||||
BOOL inputEnabled=u->inputSectionEnabled>.5&&!managed(*u,paths);
|
||||
NSString*input=inputEnabled?paths[@"input"]:nil;int profile=inputEnabled?(int)roundf(u->inputProfile):0;
|
||||
if(!inputEnabled){u->inputProfile=0;u->preLUTStrength=0;}
|
||||
if(!input.length&&profile>0&&profile<(int)inputFiles().count)input=[[NSBundle bundleForClass:self.class]pathForResource:inputFiles()[profile] ofType:@"dylut" inDirectory:@"InputLUTs"];
|
||||
@@ -84,19 +99,26 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
|
||||
- (BOOL)renderSource:(FxImageTile*)src destination:(FxImageTile*)dst uniforms:(DYUniforms)u paths:(NSDictionary*)paths error:(NSError**)err{@synchronized(self){@autoreleasepool{
|
||||
[_activeLUTPaths release];_activeLUTPaths=[[NSSet alloc]initWithArray:paths.allValues?:@[]];
|
||||
NSMutableDictionary*e=[self device:dst.deviceRegistryID error:err];if(!e)return NO;id<MTLDevice>d=e[@"device"];id<MTLTexture>input=[src metalTextureForDevice:d],output=[dst metalTextureForDevice:d];if(!input||!output)return fail(err,@"宿主图像纹理不可用");
|
||||
BOOL useCM=managed(u,paths);float bwMix=fmaxf(0,fminf(1,u.cm.blackWhiteMix));if(bwMix<=0)u.blackWhiteSectionEnabled=0;
|
||||
NSArray*ts=[self textures:paths uniforms:&u entry:e error:err];if(!ts)return NO;
|
||||
NSMutableDictionary*ps=e[@"pipelines"];NSNumber*format=@(output.pixelFormat);id<MTLRenderPipelineState>pipeline=ps[format];if(!pipeline){MTLRenderPipelineDescriptor*p=[MTLRenderPipelineDescriptor new];p.vertexFunction=[e[@"library"]newFunctionWithName:@"dyVertex"];p.fragmentFunction=[e[@"library"]newFunctionWithName:@"dyFragment"];p.colorAttachments[0].pixelFormat=output.pixelFormat;pipeline=[d newRenderPipelineStateWithDescriptor:p error:err];[p.vertexFunction release];[p.fragmentFunction release];[p release];if(!pipeline)return NO;ps[format]=pipeline;[pipeline release];}
|
||||
MTLTextureDescriptor*td=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA16Float width:input.width height:input.height mipmapped:NO];td.storageMode=MTLStorageModePrivate;td.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite;id<MTLTexture>straight=[d newTextureWithDescriptor:td];if(!straight)return fail(err,@"无法分配调色缓冲区");
|
||||
id<MTLCommandBuffer>cb=[e[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyUnpremultiply"]];[ce setTexture:input atIndex:0];[ce setTexture:straight atIndex:1];[ce dispatchThreads:MTLSizeMake(input.width,input.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];
|
||||
if(useCM&&u.cm.mix>0){
|
||||
DayuRenderParams cm=DYCMRender(u.cm);cm.stages=(cm.stages&~1)|(u.inputSectionEnabled>.5?1:0);
|
||||
if(cm.stages){id<MTLTexture>converted=[d newTextureWithDescriptor:td];if(!converted){[straight release];return fail(err,@"无法分配 CST 缓冲区");}
|
||||
ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyColorManagement"]];[ce setTexture:straight atIndex:0];[ce setTexture:converted atIndex:1];[ce setBytes:&cm length:sizeof(cm) atIndex:0];[ce setBytes:&u.cm.mix length:4 atIndex:1];[ce dispatchThreads:MTLSizeMake(input.width,input.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];[straight release];straight=converted;
|
||||
}
|
||||
}
|
||||
float level=.5;id<MTLBuffer>scene=[d newBufferWithBytes:&level length:4 options:MTLResourceStorageModeShared];
|
||||
if(u.whites>0&&u.whitesEnabled>.5&&u.baseSectionEnabled>.5){ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyWhitesSceneStatistics"]];[ce setTexture:straight atIndex:0];[ce setTexture:ts[7] atIndex:1];[ce setBytes:&u length:sizeof(u) atIndex:0];[ce setBuffer:scene offset:0 atIndex:1];[ce dispatchThreadgroups:MTLSizeMake(1,1,1) threadsPerThreadgroup:MTLSizeMake(256,1,1)];[ce endEncoding];}
|
||||
BOOL preview=NO;@synchronized(_previewLock){preview=CACurrentMediaTime()-_lastPreview>.5;}id<MTLBuffer>pb=nil;if(preview){pb=[d newBufferWithLength:320*180*16 options:MTLResourceStorageModeShared];ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyInputAnalysis"]];[ce setTexture:straight atIndex:0];[ce setTexture:ts[0] atIndex:1];float inputStrength=u.inputSectionEnabled>.5?u.preLUTStrength:0;[ce setBytes:&inputStrength length:4 atIndex:1];[ce setBuffer:pb offset:0 atIndex:0];[ce dispatchThreads:MTLSizeMake(320,180,1) threadsPerThreadgroup:MTLSizeMake(8,8,1)];[ce endEncoding];}
|
||||
if(!_exporting&&u.whites>0&&u.whitesEnabled>.5&&u.baseSectionEnabled>.5){ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyWhitesSceneStatistics"]];[ce setTexture:straight atIndex:0];[ce setTexture:ts[7] atIndex:1];[ce setBytes:&u length:sizeof(u) atIndex:0];[ce setBuffer:scene offset:0 atIndex:1];[ce dispatchThreadgroups:MTLSizeMake(1,1,1) threadsPerThreadgroup:MTLSizeMake(256,1,1)];[ce endEncoding];}
|
||||
BOOL preview=NO;@synchronized(_previewLock){preview=!_exporting&&CACurrentMediaTime()-_lastPreview>.5;}id<MTLBuffer>pb=nil;if(preview){pb=[d newBufferWithLength:320*180*16 options:MTLResourceStorageModeShared];ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyInputAnalysis"]];[ce setTexture:straight atIndex:0];[ce setTexture:ts[0] atIndex:1];float inputStrength=u.inputSectionEnabled>.5?u.preLUTStrength:0;[ce setBytes:&inputStrength length:4 atIndex:1];[ce setBuffer:pb offset:0 atIndex:0];[ce dispatchThreads:MTLSizeMake(320,180,1) threadsPerThreadgroup:MTLSizeMake(8,8,1)];[ce endEncoding];}
|
||||
MTLRenderPassDescriptor*rp=[MTLRenderPassDescriptor renderPassDescriptor];rp.colorAttachments[0].texture=output;rp.colorAttachments[0].loadAction=MTLLoadActionDontCare;rp.colorAttachments[0].storeAction=MTLStoreActionStore;id<MTLRenderCommandEncoder>re=[cb renderCommandEncoderWithDescriptor:rp];[re setRenderPipelineState:pipeline];
|
||||
float w=output.width,h=output.height;FxRect s=src.tilePixelBounds,t=dst.tilePixelBounds;float sw=s.right-s.left,sh=s.top-s.bottom;float l=(t.left-s.left)/sw,r=(t.right-s.left)/sw,top=(s.top-t.top)/sh,bottom=(s.top-t.bottom)/sh;
|
||||
if(src.imageOrigin==kFxImageOrigin_BOTTOM_LEFT){top=1-top;bottom=1-bottom;}
|
||||
DYVertex2D vs[]={{{w/2,-h/2},{r,bottom}},{{-w/2,-h/2},{l,bottom}},{{w/2,h/2},{r,top}},{{-w/2,h/2},{l,top}}};
|
||||
if(dst.imageOrigin==kFxImageOrigin_BOTTOM_LEFT)for(int i=0;i<4;i++)vs[i].position.y=-vs[i].position.y;
|
||||
vector_uint2 vp={(unsigned)output.width,(unsigned)output.height};[re setVertexBytes:vs length:sizeof(vs) atIndex:0];[re setVertexBytes:&vp length:sizeof(vp) atIndex:1];[re setViewport:(MTLViewport){0,0,w,h,0,1}];[re setFragmentTexture:straight atIndex:0];for(NSUInteger i=0;i<ts.count;i++)[re setFragmentTexture:ts[i] atIndex:i+1];[re setFragmentBytes:&u length:sizeof(u) atIndex:0];[re setFragmentBuffer:scene offset:0 atIndex:1];DYRenderOptions options={1,0,0,0};[re setFragmentBytes:&options length:sizeof(options) atIndex:2];[re drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];[re endEncoding];[cb commit];[cb waitUntilCompleted];BOOL ok=cb.status==MTLCommandBufferStatusCompleted;
|
||||
vector_uint2 vp={(unsigned)output.width,(unsigned)output.height};[re setVertexBytes:vs length:sizeof(vs) atIndex:0];[re setVertexBytes:&vp length:sizeof(vp) atIndex:1];[re setViewport:(MTLViewport){0,0,w,h,0,1}];[re setFragmentTexture:straight atIndex:0];for(NSUInteger i=0;i<ts.count;i++)[re setFragmentTexture:ts[i] atIndex:i+1];[re setFragmentBytes:&u length:sizeof(u) atIndex:0];[re setFragmentBuffer:scene offset:0 atIndex:1];DYRenderOptions options={1,bwMix,0,0};[re setFragmentBytes:&options length:sizeof(options) atIndex:2];DYUniforms color=u;color.blackWhiteSectionEnabled=0;[re setFragmentBytes:&color length:sizeof(color) atIndex:3];[re drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];[re endEncoding];[cb commit];[cb waitUntilCompleted];BOOL ok=cb.status==MTLCommandBufferStatusCompleted;
|
||||
if(ok&&pb){@synchronized(_previewLock){
|
||||
[_preview release];_preview=[[NSData alloc]initWithBytes:pb.contents length:320*180*16];
|
||||
// The analysis kernel reads physical texture rows. Its result remains intact
|
||||
@@ -112,7 +134,17 @@ static id<MTLTexture> texture3D(id<MTLDevice>d,const float*values,NSUInteger n){
|
||||
if(!ok)fail(err,cb.error.localizedDescription);[pb release];[straight release];[scene release];return ok;
|
||||
}}}
|
||||
- (BOOL)exportLUT:(NSURL*)url uniforms:(DYUniforms)u paths:(NSDictionary*)paths error:(NSError**)err{@synchronized(self){
|
||||
NSMutableDictionary*e=[self device:0 error:err];if(!e)return NO;NSArray*ts=[self textures:paths uniforms:&u entry:e error:err];if(!ts)return NO;id<MTLDevice>d=e[@"device"];uint32_t n=33;NSUInteger count=n*n*n;id<MTLBuffer>out=[d newBufferWithLength:count*3*4 options:MTLResourceStorageModeShared];if(!out)return fail(err,@"无法分配 LUT 输出");id<MTLCommandBuffer>cb=[e[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:e[@"dyLUTExportKernel"]];for(NSUInteger i=0;i<ts.count;i++)[ce setTexture:ts[i] atIndex:i];[ce setBytes:&u length:sizeof(u) atIndex:0];[ce setBuffer:out offset:0 atIndex:1];[ce setBytes:&n length:4 atIndex:2];[ce dispatchThreads:MTLSizeMake(count,1,1) threadsPerThreadgroup:MTLSizeMake(64,1,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];if(cb.status!=MTLCommandBufferStatusCompleted){[out release];return fail(err,cb.error.localizedDescription);}
|
||||
NSMutableString*s=[NSMutableString stringWithString:@"TITLE \"大鱼调色\"\n# 仅包含逐像素颜色;纹理、清晰度和画面分析不写入 LUT。\nLUT_3D_SIZE 33\nDOMAIN_MIN 0 0 0\nDOMAIN_MAX 1 1 1\n"];float*v=(float*)out.contents;for(NSUInteger i=0;i<count;i++){if(!std::isfinite(v[i*3])||!std::isfinite(v[i*3+1])||!std::isfinite(v[i*3+2])){[out release];return fail(err,@"LUT GPU 输出含无效值");}[s appendFormat:@"%.8f %.8f %.8f\n",v[i*3],v[i*3+1],v[i*3+2]];}[out release];return [s writeToURL:url atomically:YES encoding:NSUTF8StringEncoding error:err];
|
||||
NSMutableDictionary *e=[self device:0 error:err];if(!e)return NO;id<MTLDevice>d=e[@"device"];const NSUInteger n=33,count=n*n*n,width=n*n,height=n;
|
||||
MTLTextureDescriptor *desc=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA16Float width:width height:height mipmapped:NO];desc.storageMode=MTLStorageModeShared;desc.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite|MTLTextureUsageRenderTarget;
|
||||
id<MTLTexture>input=[d newTextureWithDescriptor:desc],output=[d newTextureWithDescriptor:desc];if(!input||!output){[input release];[output release];return fail(err,@"无法分配 LUT 色格");}
|
||||
std::vector<__fp16>values(count*4);for(NSUInteger i=0;i<count;i++){float v[3]={(float)(i%n)/(n-1),(float)((i/n)%n)/(n-1),(float)(i/(n*n))/(n-1)};for(int c=0;c<3;c++)values[i*4+c]=v[c]<=.04045f?v[c]/12.92f:powf((v[c]+.055f)/1.055f,2.4f);values[i*4+3]=1;}
|
||||
[input replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:values.data() bytesPerRow:width*8];
|
||||
DYExportTile *source=[[[DYExportTile alloc]initWithTexture:input registry:d.registryID]autorelease],*dest=[[[DYExportTile alloc]initWithTexture:output registry:d.registryID]autorelease];
|
||||
u.textureEnabled=0;u.clarityEnabled=0;u.dehazeEnabled=0;BOOL ok=NO;_exporting=YES;
|
||||
@try{ok=[self renderSource:source destination:dest uniforms:u paths:paths error:err];}@finally{_exporting=NO;}
|
||||
if(ok)[output getBytes:values.data() bytesPerRow:width*8 fromRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0];[input release];[output release];if(!ok)return NO;
|
||||
NSMutableString *text=[NSMutableString stringWithString:@"TITLE \"大鱼调色\"\n# 包含 CST 与逐像素颜色;不包含纹理、清晰度和逐画面分析。\nLUT_3D_SIZE 33\nDOMAIN_MIN 0 0 0\nDOMAIN_MAX 1 1 1\n"];
|
||||
for(NSUInteger i=0;i<count;i++){float rgb[3];for(int c=0;c<3;c++){float v=values[i*4+c];rgb[c]=v<=.0031308f?v*12.92f:1.055f*powf(v,1/2.4f)-.055f;if(!std::isfinite(rgb[c]))return fail(err,@"LUT 输出含无效值");}[text appendFormat:@"%.8f %.8f %.8f\n",rgb[0],rgb[1],rgb[2]];}
|
||||
return [text writeToURL:url atomically:YES encoding:NSUTF8StringEncoding error:err];
|
||||
}}
|
||||
@end
|
||||
+6
-2
@@ -16,6 +16,8 @@ typedef vector_float4 DYFloat4;
|
||||
typedef uint32_t DYUInt;
|
||||
#endif
|
||||
|
||||
#include "DYColorManagement.h"
|
||||
|
||||
typedef struct DYUniforms {
|
||||
float exposure; // offset 0
|
||||
float contrast; // offset 4
|
||||
@@ -119,12 +121,14 @@ typedef struct DYUniforms {
|
||||
DYFloat4 greenCurveExtraX; // offset 896
|
||||
DYFloat4 blueCurveExtra; // offset 912
|
||||
DYFloat4 blueCurveExtraX; // offset 928
|
||||
DYCMSettings cm; // appended; recovered color arithmetic reads only the stable prefix
|
||||
} DYUniforms;
|
||||
|
||||
typedef struct DYVertex2D { DYFloat2 position; DYFloat2 textureCoordinate; } DYVertex2D;
|
||||
typedef struct DYRenderOptions {
|
||||
DYUInt outputPremultiplied;
|
||||
DYUInt reserved[3];
|
||||
float blackWhiteMix;
|
||||
DYUInt reserved[2];
|
||||
} DYRenderOptions;
|
||||
|
||||
#ifndef __METAL_VERSION__
|
||||
@@ -133,7 +137,7 @@ typedef struct DYRenderOptions {
|
||||
#else
|
||||
#define DY_ABI_ASSERT _Static_assert
|
||||
#endif
|
||||
DY_ABI_ASSERT(sizeof(DYUniforms) == 944, "DYUniforms must match recovered GPU ABI");
|
||||
DY_ABI_ASSERT(offsetof(DYUniforms, cm) == 944, "DYUniforms must match recovered GPU ABI");
|
||||
DY_ABI_ASSERT(offsetof(DYUniforms, exposure) == 0, "exposure offset");
|
||||
DY_ABI_ASSERT(offsetof(DYUniforms, contrast) == 4, "contrast offset");
|
||||
DY_ABI_ASSERT(offsetof(DYUniforms, highlights) == 8, "highlights offset");
|
||||
|
||||
+2
-2
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.1.5</string>
|
||||
<string>1.2.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>16</string>
|
||||
<string>17</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string></string>
|
||||
<key>PlugInKit</key>
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.1.5</string>
|
||||
<string>1.2.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>16</string>
|
||||
<string>17</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
在新工单中引用
屏蔽一个用户