比较提交

..
共修改 39 个文件,包含 4381 行新增和 70 行删除

没有与搜索条件相匹配的文件

+16
查看文件
@@ -0,0 +1,16 @@
大鱼调色 1.8.1(57)公测
修正 1.8.0 固定 ACEScct 接管一级 CST 的设计,恢复输入、工作曲线/色域与输出设置。主输出移至所有一级层及印片之后;新增一级层继承工作空间,默认关闭额外映射。局部 CST、线性混合、负值和超白保留经过回归;线性工作曲线增加明确的 DI 适配。
在参数顶部明确选择“一级 CST · 延后输出(推荐)”启用。模板与注册缺省、已保存的 nil/v2 状态保持原流程,避免 FCP 把新缺省应用到旧实例。65³ Cube 按一级声明的输入、输出编码导出,所选 Gamma/Log 不再统一写成 sRGB。
旧工具仍作为输出后的 SDR 修饰;Log/线性码值输出不运行活跃的 SDR 修饰。上游 FCP 已还原或裁切的数据不能由插件恢复,请核对相机 LUT 与颜色符合。受控 Log 码值载体不等于所有相机文件的上游路由认证。
581 项原生检查通过,包括独立曝光/高光参考、负值/超白、局部 CST、线性混合、印片域和 Cube 输出曲线。
正式签名、公证、宿主验收与包校验以 verification/Delivery.json、HostPrimaryCST1.8.1.json、Package.json 和 Release.json 为准。安装包已通过20项展开验包;本轮未重新执行系统安装脚本,APP已在正式位置独立安装和宿主验收。
安装包:大鱼调色-1.8.1.pkg
字节数:42999475
SHA-256:f94aa3a21ffbe52bc68b482289b71112d9895161e18f983af918d11547d254cd
实际编译源码:059245858035e74f78bd669ef25913408d07d235
+19 -4
查看文件
@@ -1,11 +1,26 @@
# 大鱼调色
原生 FxPlug 4 调色器,当前正式安装的公测版本 **1.8.0(55)**。唯一安装位置为 `/Library/Plug-Ins/FxPlug/大鱼调色.app`;Final Cut Pro 中从“效果 → 大鱼调色”添加。
原生 FxPlug 4 调色器,当前公测版本 **1.8.1(57)**。唯一安装位置为 `/Library/Plug-Ins/FxPlug/大鱼调色.app`;Final Cut Pro 中从“效果 → 大鱼调色”添加。
2026-11-03完成BASIS、Colour Space Transform和Color Finale的只读色彩管理调查,含原版GPU曝光/映射及当前一级颜色内核的有限检查。宿主边界、重复映射、工具工作域和旧工程迁移的改进方案见[研究报告与实施方案](research/cms-audit-20261103/report.md)。1.8.0(55)已按方案接入新版 CMS,530 项正式原生检查与 FCP 12.4 切换、错误恢复、保存重开及实际导出通过。详见 [宿主验收](verification/HostColorManagement1.8.0.json)。
1.8.1 修正 1.8.0 固定 ACEScct 接管并隐藏一级 CST 的设计问题,恢复原有输入、工作曲线/色域与输出选择,并将主输出放到一级层和印片之后。在参数顶部明确选择“一级 CST · 延后输出(推荐)”启用修正流程。模板与插件注册缺省保持原有流程,保护已有未声明 CMS 的工程。1.8.0 ACES 流程作为兼容方式保留,不自动修改已保存画面。
[1.8.1 安装包 Release](https://dayu.media/git/dayu/dayu-color/releases/tag/v1.8.1-cst-correction-20261104);[修正约定与验证边界](research/cms-correction-20261104/design.md)。1.8.0 的研究来源与历史实施见[只读调查](research/cms-audit-20261103/report.md)。
## 1.8.0 色彩管理
## 1.8.1 一级 CST · 延后输出
推荐方式的实际顺序:**声明的素材编码 → 一级输入 CST(不做显示映射)→ 所选工作域一级调色 → 独立一级层 → 印片 → 一级输出 CST/可选映射 → SDR 修饰 → 宿主显示**。主输入不先套 Rec.709 显示还原,工作空间由原一级的工作曲线与工作色域决定,可使用 DWG/DaVinci Intermediate、ACEScct/AP1 或其他已列出的独立组合。
新增独立一级默认继承主工作空间,输入/输出相同且映射关闭。切换主工作空间时跟随更新;手动修改某段曲线/色域后,该段保留独立选择。每层明确设置的 CST 实际执行,完成后按声明的输出空间返回主工作域。混合、蒙版在 AP1 线性中进行。主一级眼睛旁路整个主 CST 模块;其他工具保持既有宿主直通行为。
印片只在自身所需的 ACEScct/AP1 域处理,随后返回所选工作空间。主输出始终在这些步骤之后。其余旧工具仍是输出后的 SDR 修饰;Log/线性码值输出会拒绝活跃的 SDR 修饰。此修正没有把所有旧工具改写为场景域/HDR 算法。
新流程的 CST/BASIS 入口、出口和图像传输为 float32,原算术与旧入口保留;线性工作曲线明确经过 DI 适配。纯 Log/线性直通不产生重复编码量化。新流程 Cube 为 65³,输入、输出均依启用的一级 CST 阶段声明,保留所选输出 Gamma/Log 编码;宿主显示另按实际目标配置解释。
手动 CST 接收 FCP 已交给插件的像素,沿用明确的码值载体。使用相机 Log 时须核对上游相机 LUT、颜色符合和任何其它还原;本插件不能恢复上游已经压缩或裁切的信息。受控宿主样本使用带 sRGB 标签的 16-bit PNG Log 码值载体,不代表验证所有相机文件的上游路由。
完整预设仍为 v7,新增独立 CMS 状态 v3;旧 nil/v2 状态按原流程渲染,不静默升级。 581 项正式原生检查、FCP12.4 两代预设逐字节保存重开、独立层跟随与撤销重做、65³ Cube、100帧 ProRes 和 XML 回读通过,见[宿主验收](verification/HostPrimaryCST1.8.1.json)。
## 1.8.0 兼容色彩管理
在调色参数顶部选择管理方式;色彩管理独立于可删除的调色模块。旧工程与 v1–v6 预设缺省仍走原有渲染,不自动改变原画面。新增一级层默认关闭额外色调映射,旧层明确保存的开关保留。
@@ -15,7 +30,7 @@
引擎固定 OpenColorIO 2.5.2 / ACES 1.3 studio-config v2.2.0,源码、依赖源包、摘要与许可证保存在 ColorManagement/,不依赖兄弟 APP 的安装。宿主颜色配置用实际 CGColorSpace 描述及指纹分别缓存;只有已知 RGB Linear / Rec.709 或 Rec.2020 才允许缺失配置的回退。
新版处理顺序固定:所有一级层 → 所有印片(ACEScct)→ 一次输出变换 → SDR 修饰工具 → 实际宿主目标。一级混合、蒙版及印片强度在 AP1 线性域混合。核心图像传输、OCIO 与配置转换采用 float32;沿用的 BASIS 入口及活跃旧工具仍有 half 精度。SDR 修饰域明确为 Rec.709 线性/sRGB,物理色域转换后接入;新版减色用有界效果差量延伸保留超范围残差,旧版限幅保持。
1.8.0 兼容方式的处理顺序固定:所有一级层 → 所有印片(ACEScct)→ 一次输出变换 → SDR 修饰工具 → 实际宿主目标。一级混合、蒙版及印片强度在 AP1 线性域混合。核心图像传输、OCIO 与配置转换采用 float32;沿用的 BASIS 入口及活跃旧工具仍有 half 精度。SDR 修饰域明确为 Rec.709 线性/sRGB,物理色域转换后接入;新版减色用有界效果差量延伸保留超范围残差,旧版限幅保持。
PQ/HLG 输出或跟随 Rec.2020 宿主暂只接受一级与印片;存在活跃 SDR 修饰时返回明确错误,不静默进入有界 LUT。此版本没有把全部旧工具改写成场景/HDR 算法。
+18
查看文件
@@ -1,3 +1,17 @@
# 1.8.1(57)CST 修正交付
实际编译源码:`059245858035e74f78bd669ef25913408d07d235`。仓库:`https://dayu.media/git/dayu/dayu-color.git`;版本标签为 `v1.8.1-cst-correction-20261104`。标签包含最终 `verification/Package.json`;Release 发布记录在完成上传/下载校验后提交到后续 main。标签快照中的旧 `Release.json` 属于上一版历史,不能当作本版的安装包记录;本版以版本页面及后续 main 的发布校验为准。
正式位置 `/Library/Plug-Ins/FxPlug/大鱼调色.app`,Bundle ID `com.dayu.color`。启用修正流程需在顶部选择“一级 CST · 延后输出(推荐)”;旧 nil/v2 工程与模板缺省保留。候选56自动模板切换在实际宿主验收中发现会影响旧 nil 工程,已回滚,未发布安装包。
581 项正式原生检查、FCP12.4 两代预设逐字节保存重开、输入/工作/输出及独立层跟随/撤销重做、65³ Cube、100帧 ProRes 与两个项目的 XML1.12 回读通过。独立远程克隆重建源码版本并通过581项检查;8个依赖源包按锁定摘要验证,复用已验证的静态依赖缓存,不宣称全部依赖冷构建。
恢复源码与构建步骤沿用下文;需要恢复本版时检出上述编译提交或最终版本标签。重新验证证书、FxPlug SDK和 Xcode,正式交付仍需 Release 签名、公证、票据、唯一位置安装和宿主验收。受控 Log 载体可用正式服务的 `--self-test` 生成的 `primary-host-chart.json`,再运行 `tools/create_primary_host_fixture.py --diagnostic <路径>` 重建,不需要用户媒体或预设。
详细范围:[数值验证](verification/PrimaryCSTNumerical1.8.1.json)、[宿主验收](verification/HostPrimaryCST1.8.1.json)、[恢复构建](verification/PrimaryCSTRecovery1.8.1.json)。Git 保存不包含签名私钥;服务端备份仍遵循仓库指南,不假定已有异地备份。
---
# 大鱼调色恢复说明
## 当前1.8.0(55):版本化 ACES 色彩管理
@@ -12,6 +26,10 @@
包 `../发行包/大鱼调色-1.8.0.pkg`,42851034 字节,SHA-256 `fd59203d387122e768090a97851daf3bd7c07193a8073b9497a10c05d5fd6c42`。签名、票据、Gatekeeper 和 20 项展开验包通过。本轮仅生成并验包,未再次运行 PKG 安装脚本;正式 APP 已有独立安装和宿主验证。源码、版本标签和 Release 的恢复证明另见 `CMSRecovery1.8.0.json`。本任务不改网站文章或自动更新后端。
正式 [1.8.0 Release](https://dayu.media/git/dayu/dayu-color/releases/tag/v1.8.0-cms-20261103),Release381 / 附件25,保留公测标记。发行标签完整 SHA `a5a2bddeb361aac66899c5939671122075a6cffa`;草稿浏览器下载和发布后的完整下载均验证 42851034 字节、SHA-256 `fd59203d387122e768090a97851daf3bd7c07193a8073b9497a10c05d5fd6c42`。发布后的 `Release.json` 与恢复报告保存在 main 的后续核验提交;发行标签内 `Package.json` 为本版已验包记录。
远端标签独立恢复440个文件,full/strict fsck、八个依赖源包摘要、程序源码与编译节点一致、新检出的 Release 构建及530项无界面集成检查通过。依赖静态库缓存经过内容校验复用,未声称重新冷编译整套依赖。恢复 APP 未以 GUI 或宿主运行。恢复 clone、构建 APP/独立服务、提交 ZIP、旧 APP 备份及浏览器下载副本已核验清理;仅保留正式安装、当前发行包和私人验收资料。签名、票据与正式 PluginKit 唯一路径再次核验通过。
## 历史1.7.4(52):删除模块和图层
远程`https://dayu.media/git/dayu/dayu-color.git`,main;实际编译源码`06a00371dfba6d9857dc75f48121232fb0ea01b8`。通过`git switch --detach 06a00371dfba6d9857dc75f48121232fb0ea01b8`恢复,Xcode27.1 / FxPlugSDK4.3.5;无LFS或子模块。新机器签名证书、私钥、公证凭据仍需独立恢复。构建与交付使用`tools/deliver.py`,436项正式安装版原生检查通过。模块删除实现、真实宿主边界见`research/ToolDeletion1.7.4.md`、`verification/HostToolDeletion1.7.4.json`。
@@ -0,0 +1,25 @@
# 1.8.1:恢复一级 CST,延后主输出
基线:aa9a8d24f298a3bd9a52bf6c7078a0a9a93a78cc;正式 1.8.0(55)。用户指出新版固定 ACEScct 隐藏并覆盖原有一级 CST,要求修正。
增加独立版本化的“一级 CST · 延后输出”方式。输入、工作曲线/色域、输出、映射来自原一级参数,不再由全局 ACES 状态覆盖。旧 nil/v2 状态的渲染保持,以免已保存工程变色。
主链:宿主线性像素的既有显式码值载体 → 主输入 CST(仅曲线/色域,无显示映射)→ 用户选定的工作域一级调色 → 独立一级层 → 印片(正确往返 ACEScct/AP1)→ 主输出 CST/可选映射 → SDR 修饰 → 实际宿主配置。主输出不在输入或额外一级层前执行。
独立一级层默认继承主工作曲线/色域,输入/输出相同,映射关闭。其明确设置的输入/工作/输出 CST 均执行;处理后按声明的输出域返回主工作域。混合与蒙版在 AP1 线性中执行。额外映射只在用户明确开启时执行,主输出则在这些层和印片之后执行。
未开启输出或选择 Log/线性数据输出时,保留声明的码值并经显式载体交回宿主;有界 SDR 修饰不在这种数据输出上偷偷运行。显示输出以声明的曲线/色域解释,并转换到实际宿主空间。
原算术 AIR 保留原入口;仅在新流程提供 float32 输入/输出入口,消除原 half 边界的重复量化,内部曲线、矩阵和调色算术沿用原图。需对原入口、OCIO 与生产入口分别回归。
边界:FxPlug 收到的是上游 FCP 像素,手动模式不能绕开或恢复上游已经进行的相机 LUT、颜色符合或裁切。界面明确说明。其他旧工具继续作为输出后的 SDR 修饰,不声称全部已成为场景域/HDR 算法。旧工程不自动升级;通过明确选择启用新版。
验收:恢复输入/工作/输出选择;Sony Log→DWG/DI 与 ACEScct 工作;高光先降曝光后映射的独立参考;新层中性;局部 CST、蒙版与混合;印片域往返;显示/码值输出及错误路径;旧 v1/v2 回归;正式路径 FCP 保存重开、实际导出;签名、公证、PKG/Release 与远程恢复。
独立层输入/工作/输出默认随主工作空间更新;手动修改其中一段的曲线或色域后,该段停止跟随,另外两段继续更新。`primaryFollow` 仅是作者状态,实际渲染仍使用可见的明确参数,绝不在渲染阶段偷偷覆盖。主一级眼睛停用时旁路其完整 CST 模块,其余工具沿用原有宿主直通流程。
“线性”工作曲线采用明确的线性↔DI适配器进入已验证的 BASIS 模式,避免原内核编号对应错误。Log/线性纯直通不引入无意义的编码往返。Cube 使用声明的输入与输出码值;显示预览另按实际宿主颜色配置处理。
受控宿主样本是带 sRGB 标签的 16-bit PNG Log 码值载体,用于核对本插件链路,不代表验证任意相机文件的上游 FCP 路由。
候选 56 的真实 FCP 验收证明:即使 `defaultVal` 与注册缺省保持 nil,修改模板 `dataValue` 仍会影响旧 nil 实例。已回滚该自动启用方案;57 保留模板原 nil 值,由用户明确选择 v3,旧 nil/v2 不自动迁移。候选 56 未制作发行包或 Release,旧版先行恢复。
@@ -0,0 +1,104 @@
{
"saturation": 6,
"y": [
0.5,
0.5,
0.5,
0.5,
0.5,
0.5866025686264038,
0.6732050776481628,
0.7598076462745667,
0.8464101552963257,
0.9330127239227295,
0.5866025686264038,
0.6732050776481628,
0.7598076462745667,
0.8464101552963257,
0.9330127239227295,
0.5,
0.4999999701976776,
0.4999999701976776,
0.4999999701976776,
0.4999999701976776,
0.4133974611759186,
0.32679492235183716,
0.24019235372543335,
0.15358981490135193,
0.06698727607727051,
0.41339749097824097,
0.32679495215415955,
0.24019242823123932,
0.1535899043083191,
0.06698739528656006,
0.5
],
"hues": 6,
"x": [
0.6000000238418579,
0.699999988079071,
0.800000011920929,
0.8999999761581421,
1,
0.550000011920929,
0.6000000238418579,
0.6499999761581421,
0.699999988079071,
0.75,
0.44999998807907104,
0.3999999761581421,
0.34999996423721313,
0.29999998211860657,
0.2499999701976776,
0.4000000059604645,
0.30000001192092896,
0.19999998807907104,
0.09999999403953552,
0,
0.45000001788139343,
0.4000000059604645,
0.3500000238418579,
0.30000004172325134,
0.2500000596046448,
0.550000011920929,
0.6000000834465027,
0.6500000953674316,
0.7000001668930054,
0.7500001788139343,
0.5
],
"pins": [
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
1
],
"linked": true
}
+4 -4
查看文件
@@ -3634,17 +3634,17 @@
],
"sourceSHA256": {
"template/tools/dump_model.mm": "04e04446aa351d774913bc25b06512fefe7969bdf4c6e471a91f1e9d6c4fc3b5",
"大鱼调色/Plugin/DYCSTTypes.h": "3372e3cd77248eeb374e54675d2902befceea8e00a2afc4f9543116ef3027696",
"大鱼调色/Plugin/DYCSTTypes.h": "ed5ba7e7ae35d1bba10e80a81184fa26b1f7eb582e47b2e45c3edd294889c76a",
"大鱼调色/Plugin/DYColorManagement.h": "b0a4cd1b8c45dbce90a7b4f30f72ebf95ecd382895e74e3bfeda0f7cdb185157",
"大鱼调色/Plugin/DYFilmMath.h": "945b7036c6aa6d27941a3bf96c4d70dec65a14b1747fba618e650738fa7108f0",
"大鱼调色/Plugin/DYFilmTypes.h": "c35a43b5b93988e8517e5db8f281da0dfd1e02f5b0e7bfb62e7345cec444a36d",
"大鱼调色/Plugin/DYManagedColor.h": "616c7919bf0889f767ebb68d4b37b775183451b213b8d2d979eeb293be69010c",
"大鱼调色/Plugin/DYManagedColor.mm": "8c9276003ea75c21c8e631122fe9a910bac26b12db69c76e626ec2100a6cbfd1",
"大鱼调色/Plugin/DYManagedColor.h": "d5901d6ac11d93f3f4438dd8d48bb3a123d06d9b79ed39e8dca38db4261bc87a",
"大鱼调色/Plugin/DYManagedColor.mm": "d9d2688f26a51d1131ee63b415e0c09989616312d31eb3b636fd299f475ece08",
"大鱼调色/Plugin/DYModel.h": "a28652bd53aa9e1d085af1108c344b5d673c5e1b3731531e1bb2982efeb8708c",
"大鱼调色/Plugin/DYModel.mm": "29fea6064d3131119933401f554cc04e48cadf07d0c62f25b8d66795201396f8",
"大鱼调色/Plugin/DYSpiderState.h": "0c80747e41e8fc97762e301b011bd08c18865a825eaafde086ed79ace37b22f9",
"大鱼调色/Plugin/DYToolState.h": "0a83109d2c02626d6b9e7340b74be6e6a74f366f31f9d7622b4a88000d5ad7b9",
"大鱼调色/Plugin/DYToolState.mm": "3be23fd6e50f1137a2d5f2c087fd5724d0c41ca0aabb8e3b43dbb0ed7ec6b578",
"大鱼调色/Plugin/DYToolState.mm": "be984c73f5c4e563e3ac8de2b911e33071773f3d823b6b2d631444d3aa2baea2",
"大鱼调色/Plugin/DYUniforms.h": "207d36b5b53ab084fa8eb3813ccbbeb5193178e3468a37e9dc692ab196ffbb6a",
"大鱼调色/Plugin/MaskCore/DYMask.h": "5b9aa44390d4a1fca1baf5e34cb9eefc8483c939a65cc2a0412b7b41fc85bc16",
"大鱼调色/Plugin/MaskCore/DYMaskOperator.h": "43fa701ad574f38ce0ab4f4d3900bb034edaaa1adc09821d2f4443ee2b687ba2",
+5
查看文件
@@ -4,6 +4,7 @@ from pathlib import Path
import argparse
import subprocess
from build_masked_kernel import masked_kernel
from float_air_boundary import float_boundary
def main():
@@ -23,6 +24,10 @@ def main():
generated = work / 'DYGradeMasked.ll'
generated.write_text(masked_kernel(source.read_text()))
source = generated
if name in ('CSTKernel', 'BasisKernel'):
generated = work / (name + 'Float.ll')
generated.write_text(float_boundary(source.read_text(), name))
source = generated
subprocess.run(['xcrun', 'metal-opt', str(source),
'-o', str(target)], check=True)
objects.append(str(target))
+4
查看文件
@@ -130,6 +130,10 @@ def verify(data,model):
assert params["10005"].get("value")=="1" and params["10005"].get("flags")=="8589934592" and f.get("pluginVersion")=="0"
for row in model['parameters']:
p=params[str(row['pid'])];assert float(p.get('default'))==float(row.get('hostDefault',row['default'])) and float(p.get('value'))==float(row['default'])
# FCP also applies a changed dataValue to existing nil-state instances.
# Keep both carriers at the original registered value; V3 is explicit opt-in.
for pid in ['9000','9001','9002']:
assert params[pid].findtext('defaultVal')==params[pid].findtext('dataValue')==custom_archive(model['archivesBase64'][pid])[0]
assert all(not v in data for v in (b'CameraRawTables',b'1.png',b'relativeURL'))
assert len(root.findall('.//behavior'))==0 and len(root.findall('.//keypoint'))==0
assert scene.find('.//scenenode[@name="效果源"]/parameter[@id="2"]/parameter[@id="321"]').get('value')=='3'
+59
查看文件
@@ -0,0 +1,59 @@
#!/usr/bin/env python3
"""Build a controlled Log-code carrier fixture; never edit an FCP library.
The 16-bit PNG explicitly carries sRGB metadata so RGB_LINEAR host pixels can be
unwrapped with the plugin's existing carrier. It is not raw-camera verification.
"""
import argparse, base64, json, plistlib, struct, uuid, zlib
from pathlib import Path
import xml.etree.ElementTree as E
root = Path(__file__).resolve().parent.parent
p = argparse.ArgumentParser(description=__doc__)
p.add_argument('--diagnostic', type=Path, required=True)
args = p.parse_args()
fixture = json.loads(args.diagnostic.read_text())
qa = Path.home() / 'Library/Caches/CodexBuilds/com.dayu.color/fcp-qa'
qa.mkdir(parents=True, exist_ok=True)
width, height = 1920, 1080
def chunk(name, data):
return struct.pack('>I', len(data)) + name + data + struct.pack('>I', zlib.crc32(name + data) & 0xffffffff)
row = bytearray(b'\0')
for x in range(width):
code = fixture['patches'][x * 8 // width]['code']
row += struct.pack('>HHH', *(round(max(0, min(1, v)) * 65535) for v in code))
chart = qa / 'primary-slog3-code-carrier.png'
chart.write_bytes(b'\x89PNG\r\n\x1a\n'
+ chunk(b'IHDR', struct.pack('>IIBBBBB', width, height, 16, 2, 0, 0, 0))
+ chunk(b'sRGB', b'\0') + chunk(b'gAMA', struct.pack('>I', 45455))
+ chunk(b'IDAT', zlib.compress(bytes(row) * height)) + chunk(b'IEND', b''))
model = json.loads((root / 'template/sources/RegisteredParameters.json').read_text())
values = {r['key']: r['default'] for r in model['parameters']}
values.update(cmConfigured=1, cmexposure=-4, skinEnabled=0)
spider = json.loads((root / 'research/cms-correction-20261104/neutral-spider.json').read_text())
preset = dict(format='com.dayu.color.preset', version=7,
colorManagement=dict(version=3, mode=4, engine='Dayu-CST-f32', config='primary-parameters-v1'),
values=values, paths={}, spider=spider,
tools=base64.b64encode(plistlib.dumps(dict(schema=2, layers=[], baseMasks={}), fmt=plistlib.FMT_BINARY)).decode())
(qa / 'primary-host-minus4.json').write_text(json.dumps(preset, ensure_ascii=False, indent=2) + '\n')
xml = E.Element('fcpxml', version='1.12')
r = E.SubElement(xml, 'resources')
E.SubElement(r, 'format', id='f1', width=str(width), height=str(height), frameDuration='1/25s', colorSpace='1-1-1 (Rec. 709)')
E.SubElement(r, 'format', id='f2', width=str(width), height=str(height), name='FFVideoFormatRateUndefined')
a = E.SubElement(r, 'asset', id='a1', name='SLog3 控制码值', start='0s', duration='0s', format='f2', hasVideo='1', videoSources='1')
E.SubElement(a, 'media-rep', kind='original-media', src=chart.as_uri())
template = Path.home() / 'Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef'
E.SubElement(r, 'effect', id='fx', name='大鱼调色', uid='~/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef', src=template.as_uri())
event = E.SubElement(E.SubElement(xml, 'library'), 'event', name='大鱼调色_1.8.1_CST修正验收', uid=str(uuid.uuid4()).upper())
for title in ['1.8.1_Log高光恢复', '1.8.1_工作空间与独立层']:
project = E.SubElement(event, 'project', name=title, uid=str(uuid.uuid4()).upper())
sequence = E.SubElement(project, 'sequence', format='f1', duration='4s', tcStart='0s', tcFormat='NDF', audioLayout='stereo', audioRate='48k')
clip = E.SubElement(E.SubElement(sequence, 'spine'), 'video', ref='a1', name=title, offset='0s', start='0s', duration='4s')
E.SubElement(clip, 'filter-video', ref='fx', name='大鱼调色', enabled='1')
E.indent(xml)
output = qa / '大鱼调色_1.8.1_CST修正验收.fcpxml'
output.write_text('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE fcpxml>\n' + E.tostring(xml, encoding='unicode') + '\n')
(qa / 'primary-host-reference.json').write_text(json.dumps(fixture, ensure_ascii=False, indent=2) + '\n')
print(output)
+32
查看文件
@@ -0,0 +1,32 @@
"""Add float boundary entry points; preserve all original AIR and arithmetic.
The recovered arithmetic already calculates in float. Only its sample entry and
return were half. The new CST pipeline must not quantize every domain crossing.
Legacy entry points remain byte-for-byte in the module and keep their behavior.
"""
import re
def float_boundary(source, kind):
name, size, first, rgb, tag = {
'CSTKernel': ('cst', '9CSTParams', (7, 8), 2040, 6),
'BasisKernel': ('basis', '11BasisParams', (8, 9), 247, 8),
}[kind]
old = f'_Z{len(name)+4}{name}_airDv4_DhRU11MTLconstantK{size}'
new_name = name + '_float_air'
new = f'_Z{len(new_name)}{new_name}Dv4_fRU11MTLconstantK{size}'
match = re.search(r'define <4 x float> @' + re.escape(old) + r'\(.*?\n}', source, re.S)
assert match, 'Versioned AIR entry changed; review the boundary adapter'
function = match.group().replace(old, new, 1).replace('<4 x half> noundef %sample', '<4 x float> noundef %sample', 1)
entry = (f' %v{first[0]} = shufflevector <4 x half> %sample, <4 x half> poison, <3 x i32> <i32 0, i32 1, i32 2>\n'
f' %v{first[1]} = tail call fast <3 x float> @air.convert.f.v3f32.f.v3f16(<3 x half> %v{first[0]}) #{tag}')
assert function.count(entry) == 1
function = function.replace(entry, f' %v{first[1]} = shufflevector <4 x float> %sample, <4 x float> poison, <3 x i32> <i32 0, i32 1, i32 2>')
exit = (f' %v{rgb+1} = tail call fast <3 x half> @air.convert.f.v3f16.f.v3f32(<3 x float> %v{rgb}) #{tag}\n'
f' %v{rgb+2} = shufflevector <3 x half> %v{rgb+1}, <3 x half> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 undef>\n'
f' %v{rgb+3} = shufflevector <4 x half> %v{rgb+2}, <4 x half> %sample, <4 x i32> <i32 0, i32 1, i32 2, i32 7>\n'
f' %v{rgb+4} = tail call fast <4 x float> @air.convert.f.v4f32.f.v4f16(<4 x half> %v{rgb+3}) #{tag}\n'
f' ret <4 x float> %v{rgb+4}')
assert function.count(exit) == 1
function = function.replace(exit, f' %dayuRGB = shufflevector <3 x float> %v{rgb}, <3 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 undef>\n %dayuRGBA = shufflevector <4 x float> %dayuRGB, <4 x float> %sample, <4 x i32> <i32 0, i32 1, i32 2, i32 7>\n ret <4 x float> %dayuRGBA')
return source[:match.end()] + '\n\n; Dayu float boundary, arithmetic unchanged.\n' + function + source[match.end():]
+18
查看文件
@@ -0,0 +1,18 @@
{
"status": "host-default-compatibility-failed",
"path": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"bundleID": "com.dayu.color",
"version": "1.8.1",
"build": "56",
"team": "B3W25FX5H5",
"notaryID": "9f54c118-8827-494e-9736-84b8f39d7a06",
"notaryStatus": "Accepted",
"gatekeeper": "/Library/Plug-Ins/FxPlug/大鱼调色.app: accepted\nsource=Notarized Developer ID",
"sourceCommit": "072bf881b97930325108cc6126d9d26997ca8425",
"templatePath": "/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef",
"templateSHA256": "f9b3e2f009cfd4bc3a92d8af21b15f0e0e8715c3b3756b14750013bee2d4abfb",
"shaderSHA256": "38395fc34a3e3f222c34abc7b643df820f6a3c1a12eac52f2f9a6beaa0a7da76",
"previousInstallBackup": "/Library/Plug-Ins/FxPlug/.dayu-color-previous-ba2204ac9c814f378eaa57d3bb327276.app",
"reason": "Changing template dataValue to v3 also changed an existing nil-state FCP project; automatic template opt-in withdrawn.",
"hostObservation": "Existing 大鱼调色_1.8_旧版兼容 displayed 一级 CST · 延后输出 before any author edit."
}
文件差异过大,未显示。 加载差异
+6 -1
查看文件
@@ -12,5 +12,10 @@
}
],
"formalInstall": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"scope": "Only generated backups created by this CMS task; source, media, historical installers and other apps retained"
"scope": "Only generated backups created by this CMS task; source, media, historical installers and other apps retained",
"browserDownloadRemoved": "/Volumes/备份/大鱼调色-1.8.0.pkg",
"recoveryCloneAndBuildCopiesRemoved": true,
"formalPluginRegistry": "com.dayu.color.XPC(1.1)\t636387FF-19DA-454E-ABFD-33256B8F3BCE\t2026-11-03 05:20:18 +0000\t/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit\n (1 plug-in)",
"remainingGeneratedAPPs": [],
"remainingTaskBackups": []
}
+27
查看文件
@@ -0,0 +1,27 @@
{
"passResult": true,
"remote": "https://dayu.media/git/dayu/dayu-color.git",
"tag": "v1.8.0-cms-20261103",
"commit": "a5a2bddeb361aac66899c5939671122075a6cffa",
"compiledSource": "11a88518280f0665f3cd0f388d1d66e5446ece14",
"trackedFiles": 440,
"gitFsck": "full/strict passed",
"dependencySourceArchives": [
"OpenColorIO-2.5.2.tar.gz",
"expat-2.7.2.tar.gz",
"yaml-cpp-0.8.0.tar.gz",
"Imath-3.2.1.tar.gz",
"pystring-1.1.4.tar.gz",
"minizip-ng-4.0.10.tar.gz",
"zlib-1.3.1.tar.gz",
"sse2neon-227cc413fb2d50b2a10073087be96b59d5364aea.tar.gz"
],
"programSourcesMatchCompiledCommit": true,
"restoredBuildVersion": "1.8.0",
"restoredBuild": "55",
"nativeChecks": 530,
"execution": "headless integration tests only; generated APP never launched as a GUI or loaded in FCP",
"buildLog": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/cms-recovery-build.log",
"runtimeCache": "Pinned static library cache reused after content checks; all dependency source archives independently present and verified",
"cleanup": "Only this recovery clone and generated APP/loose service; formal installation and QA projects retained"
}
+11
查看文件
@@ -0,0 +1,11 @@
{
"status": "draft-download-required",
"releaseID": 381,
"releaseURL": "https://dayu.media/git/dayu/dayu-color/releases/tag/v1.8.0-cms-20261103",
"tag": "v1.8.0-cms-20261103",
"commit": "a5a2bddeb361aac66899c5939671122075a6cffa",
"assetID": 25,
"downloadURL": "https://dayu.media/git/dayu/dayu-color/releases/download/v1.8.0-cms-20261103/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.8.0.pkg",
"bytes": 42851034,
"sha256": "fd59203d387122e768090a97851daf3bd7c07193a8073b9497a10c05d5fd6c42"
}
+6 -6
查看文件
@@ -2,15 +2,15 @@
"status": "verified",
"path": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"bundleID": "com.dayu.color",
"version": "1.8.0",
"build": "55",
"version": "1.8.1",
"build": "57",
"team": "B3W25FX5H5",
"notaryID": "ab2b40ea-886f-49fa-8735-aa392e65f036",
"notaryID": "cdc68483-c0ef-4b1e-a3a3-8a3eb621afdd",
"notaryStatus": "Accepted",
"gatekeeper": "/Library/Plug-Ins/FxPlug/大鱼调色.app: accepted\nsource=Notarized Developer ID",
"sourceCommit": "11a88518280f0665f3cd0f388d1d66e5446ece14",
"sourceCommit": "059245858035e74f78bd669ef25913408d07d235",
"templatePath": "/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef",
"templateSHA256": "3f4f642146ae60710b865bd131c0d0be458e6430de54b50bd49dc9637643c891",
"shaderSHA256": "52a9630ed3f887a0b5f3678da4330254891b15e88f637204473796736a8b7be1",
"hostVerification": "verification/HostColorManagement1.8.0.json"
"shaderSHA256": "38395fc34a3e3f222c34abc7b643df820f6a3c1a12eac52f2f9a6beaa0a7da76",
"hostVerification": "verification/HostPrimaryCST1.8.1.json"
}
+90
查看文件
@@ -0,0 +1,90 @@
{
"passResult": true,
"date": "2026-11-04",
"version": "1.8.1",
"build": "57",
"host": "Final Cut Pro 12.4",
"formalPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"compiledSource": "059245858035e74f78bd669ef25913408d07d235",
"nativeChecks": 581,
"hostChecks": [
"Existing nil-state project remained 原有流程 after upgrade (candidate56 automatic template seed was rejected and rolled back)",
"Old mode3 LUT/ACES project retained original LUT, exposure and exact preset bytes",
"Explicit V3 opt-in via full preset; input/work/output selectors visible and effective",
"Root exposure -4 and neutral extra layer exposure0 with mapping off",
"New primary inherits DWG/DI input/work/output",
"Root working-curve change updates all inherited domains; one timeline undo and redo restore all related fields",
"Cold reopen preserves V3 state, primaryFollow metadata and all preset bytes",
"Real 65cube export completed with declared primary input/output metadata",
"1080p25 ProRes422 export: all100 frames decoded",
"Two-project FCPXML1.12 import/export without warning; compared fields match"
],
"preset": {
"before": {
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/primary-host-before57.json",
"bytes": 9048,
"sha256": "72b88dde2c30d0ed391184f666dbbceef1ad14e76749fee4aadcec98a6ad9e8b"
},
"after": {
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/primary-host-after57.json",
"bytes": 9048,
"sha256": "72b88dde2c30d0ed391184f666dbbceef1ad14e76749fee4aadcec98a6ad9e8b"
},
"byteIdentical": true
},
"legacyV2Preset": {
"before": {
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/cms-lut-recovered-before.json",
"bytes": 9003,
"sha256": "9a0eac72e3c41b26c1553c0a47b3d67acc85e1f63fd2ec4f1c0591805b77a214"
},
"after": {
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/primary-v2-preserved57.json",
"bytes": 9003,
"sha256": "9a0eac72e3c41b26c1553c0a47b3d67acc85e1f63fd2ec4f1c0591805b77a214"
},
"byteIdentical": true
},
"cube": {
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/primary-host-export57.cube",
"bytes": 9063074,
"sha256": "c3da6ef3bb8ce2118e94ea51b29e7a3e87a228f967f6128ede1ab3e55dd8a939",
"side": 65,
"rows": 274625,
"finite": true,
"input": "Sony SLog3/S-Gamut3.Cine",
"output": "Gamma2.4/Rec709 declared code values"
},
"render": {
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa/primary-host-render57.mov",
"bytes": 3833304,
"sha256": "a6afd62ffd44852175e3db3d33c4203e8520c1413c4bed7ce1920e3fda0f1f28",
"codec": "ProRes422",
"width": 1920,
"height": 1080,
"fps": "25/1",
"framesDecoded": 100,
"duration": "4s",
"colorTags": "bt709"
},
"FCPXML": {
"version": "1.12",
"projects": 2,
"DTD": true,
"comparison": {
"expected_projects": 2,
"actual_projects": 2,
"status": "compared_fields_match",
"differences": [],
"scope": "project format/timecode, story timing/identity, static transforms (1e-4 absolute tolerance), title/caption text+role, linear time-map samples, effect references, opaque payload hashes, audio component/volume attributes",
"not_covered": "rendered picture/sound, plugin parameter semantics, smooth interpolation, all crop/keyframe/metadata attributes, media/resources not reachable directly inside projects"
}
},
"limitations": [
"Controlled 16bit sRGB-tagged Log-code PNG, not generic camera/raw routing certification",
"PNG fixture clips code values above1; high64scene reference remains a float32 numerical test",
"Host export decoded and structurally verified; monitor/display colorimetry not certified",
"Old tools remain post-output SDR finishing; no claim of complete HDR tool conversion",
"PKG installation scripts not rerun; APP installed separately and verified in formal path"
]
}
+265 -5
查看文件
@@ -1,6 +1,6 @@
{
"bundlePath": "/Library/Plug-Ins/FxPlug/大鱼调色.app/Contents/PlugIns/大鱼调色 XPC Service.pluginkit",
"checks": 530,
"checks": 581,
"gpu": "Apple M4",
"limitations": [
"Finite states and a 64x48 frame; live FCP discovery, inspector interaction, timeline persistence and real host export require separate acceptance.",
@@ -12,7 +12,7 @@
"error": "未提供错误信息",
"name": "runtime-directory",
"pass": true,
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/FBA3B728-B160-450E-9D50-3F2DCA624ECA"
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/E8696C43-54FE-43B0-AC84-69FCD0178A98"
},
{
"descriptors": 278,
@@ -890,7 +890,7 @@
"error": "未提供错误信息",
"name": "renderer-export-33cube",
"pass": true,
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/FBA3B728-B160-450E-9D50-3F2DCA624ECA/diagnostic-export.cube"
"path": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/E8696C43-54FE-43B0-AC84-69FCD0178A98/diagnostic-export.cube"
},
{
"bytes": 1186074,
@@ -910,7 +910,7 @@
},
{
"heartbeats": 0,
"maximumGapMS": 77.1040416584583,
"maximumGapMS": 83.03549999254756,
"name": "external-activation-main-loop-responsive",
"pass": true
},
@@ -2806,8 +2806,268 @@
{
"name": "cms-preview-still-available",
"pass": true
},
{
"name": "primary-v3-independent-state-valid",
"pass": true
},
{
"name": "primary-v3-rejects-conflicting-global-input",
"pass": true
},
{
"name": "primary-v3-secure-state-roundtrip",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-main-input-grade-output-render",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-DWG-intermediate-without-display-output",
"pass": true
},
{
"changedComponents": 2816,
"maxAbsoluteError": 0.00048828125,
"name": "primary-input-goes-directly-to-DWG-DI-not-709",
"nonfiniteComponents": 0,
"nonzeroComponents": 12288,
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-ACEScct-without-display-output",
"pass": true
},
{
"changedComponents": 4276,
"maxAbsoluteError": 0.00048828125,
"name": "primary-ACEScct-is-selectable-not-forced",
"nonfiniteComponents": 0,
"nonzeroComponents": 12288,
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-input-selection-ARRI",
"pass": true
},
{
"name": "primary-input-selection-is-effective",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-four-inherited-neutral-layers",
"pass": true
},
{
"name": "primary-new-layer-inherits-workspace-no-remap",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-four-stop-root-before-output",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-four-stop-extra-before-output",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "primary-independent-grade-before-main-output",
"nonfiniteComponents": 0,
"nonzeroComponents": 12288,
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-independent-OCIO-reduced-scene-input",
"pass": true
},
{
"independentReference": 0.424072265625,
"maxDifference": 0.00048828125,
"name": "primary-highlights-recovered-before-mapping-reference",
"pass": true,
"scene64afterMinus4": 0.424072265625
},
{
"error": "未提供错误信息",
"name": "primary-local-DI-contrast",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-local-ACES-contrast",
"pass": true
},
{
"name": "primary-local-working-selection-is-effective",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-local-input-CST-selection",
"pass": true
},
{
"name": "primary-local-input-CST-is-not-overridden",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-zero-mask",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-zero-grade-mix",
"pass": true
},
{
"name": "primary-zero-mask-and-mix-retain-CST-boundaries",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-linear-light-half-mix",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-linear-light-mix-reference",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "primary-mix-in-linear-AP1",
"nonfiniteComponents": 0,
"nonzeroComponents": 12288,
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-print-DWG-before-output",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-print-ACES-before-output",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "primary-print-domain-adapts-to-selected-working-space",
"nonfiniteComponents": 0,
"nonzeroComponents": 12288,
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-declared-Log-output",
"pass": true
},
{
"name": "primary-declared-output-controls-restored",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-no-output-tone-map",
"pass": true
},
{
"name": "primary-tone-mapping-switch-restored",
"pass": true
},
{
"name": "primary-Log-data-output-rejects-SDR-finishing",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-main-eye-keeps-other-tools",
"pass": true
},
{
"error": "",
"name": "primary-eye-unmanaged-reference",
"pass": true
},
{
"name": "primary-main-eye-bypasses-whole-CST-retains-tools",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-negative-superwhite-hidden-RGB",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "primary-float-domain-identity-retains-extended-values",
"nonfiniteComponents": 0,
"nonzeroComponents": 11520,
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-linear-exposure-extended-values",
"pass": true
},
{
"grey": 0.3599466383457184,
"name": "primary-one-stop-exposure-is-linear-light-with-negative-values",
"negative": -0.05998092517256737,
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-data-output-ignores-disabled-SDR-and-LUT-controls",
"pass": true
},
{
"name": "primary-inspector-no-v2-selector-override",
"pass": true
},
{
"name": "primary-inspector-add-layer-inherits-workspace",
"pass": true
},
{
"name": "primary-workspace-change-updates-inherited-domains",
"pass": true
},
{
"name": "primary-manual-local-space-retains-choice-and-follows-boundaries",
"pass": true
},
{
"name": "primary-complete-preset-stores-v3-state",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-v3-Cube65-declared-encoding",
"pass": true
},
{
"Gamma22": 0.7297400236129761,
"Gamma26": 0.7659831047058105,
"name": "primary-Cube-restores-output-gamma-selection",
"pass": true
}
],
"runtimePath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/FBA3B728-B160-450E-9D50-3F2DCA624ECA",
"runtimePath": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/verification-runtime/E8696C43-54FE-43B0-AC84-69FCD0178A98",
"scope": "Native model and renderer integration with real Metal/IOSurface textures and fake FxPlug host selectors; no GUI or live host document."
}
+15 -15
查看文件
@@ -1,7 +1,7 @@
{
"package": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.8.0.pkg",
"sha256": "fd59203d387122e768090a97851daf3bd7c07193a8073b9497a10c05d5fd6c42",
"bytes": 42851034,
"package": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.8.1.pkg",
"sha256": "f94aa3a21ffbe52bc68b482289b71112d9895161e18f983af918d11547d254cd",
"bytes": 42999475,
"testUnsigned": false,
"installationExecuted": false,
"checks": [
@@ -31,27 +31,27 @@
"source": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"payload": "Library/Plug-Ins/FxPlug/大鱼调色.app",
"bundleID": "com.dayu.color",
"version": "1.8.0",
"build": "55"
"version": "1.8.1",
"build": "57"
},
{
"source": "/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/pkg-inputs/大鱼调色",
"payload": "Library/Application Support/PKGForge/Payload/com.dayu.color.installer.746989a4-8119-4b88-af02-e861254bd9d2/EF8CD85E-8B1E-47BF-8034-51E5439EF770/大鱼调色"
"payload": "Library/Application Support/PKGForge/Payload/com.dayu.color.installer.9130cef7-f8cf-4179-ba41-ec0bbaf9147f/AA2FAE46-CB99-479D-B1AB-D2102658694A/大鱼调色"
}
],
"signature": "Package \"大鱼调色-1.8.0.pkg\":\n Status: signed by a developer certificate issued by Apple for distribution\n Notarization: trusted by the Apple notary service\n Signed with a trusted timestamp on: 2026-11-03 05:16:45 +0000\n Certificate Chain:\n 1. Developer ID Installer: zhong luo (B3W25FX5H5)\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n C0 19 01 3C 67 88 8F 34 65 56 C5 91 3C E5 B6 12 4C 5D A6 DA F9 D8 \n DA 00 37 52 DF F0 F3 E6 00 B4\n ------------------------------------------------------------------------\n 2. Developer ID Certification Authority\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n 7A FC 9D 01 A6 2F 03 A2 DE 96 37 93 6D 4A FE 68 09 0D 2D E1 8D 03 \n F2 9C 88 CF B0 B1 BA 63 58 7F\n ------------------------------------------------------------------------\n 3. Apple Root CA\n Expires: 2035-02-09 21:40:36 +0000\n SHA256 Fingerprint:\n B0 B1 73 0E CB C7 FF 45 05 14 2C 49 F1 29 5E 6E DA 6B CA ED 7E 2C \n 68 C5 BE 91 B5 A1 10 01 F0 24",
"gatekeeper": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.8.0.pkg: accepted\nsource=Notarized Developer ID",
"signature": "Package \"大鱼调色-1.8.1.pkg\":\n Status: signed by a developer certificate issued by Apple for distribution\n Notarization: trusted by the Apple notary service\n Signed with a trusted timestamp on: 2026-11-04 00:20:55 +0000\n Certificate Chain:\n 1. Developer ID Installer: zhong luo (B3W25FX5H5)\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n C0 19 01 3C 67 88 8F 34 65 56 C5 91 3C E5 B6 12 4C 5D A6 DA F9 D8 \n DA 00 37 52 DF F0 F3 E6 00 B4\n ------------------------------------------------------------------------\n 2. Developer ID Certification Authority\n Expires: 2027-02-01 22:12:15 +0000\n SHA256 Fingerprint:\n 7A FC 9D 01 A6 2F 03 A2 DE 96 37 93 6D 4A FE 68 09 0D 2D E1 8D 03 \n F2 9C 88 CF B0 B1 BA 63 58 7F\n ------------------------------------------------------------------------\n 3. Apple Root CA\n Expires: 2035-02-09 21:40:36 +0000\n SHA256 Fingerprint:\n B0 B1 73 0E CB C7 FF 45 05 14 2C 49 F1 29 5E 6E DA 6B CA ED 7E 2C \n 68 C5 BE 91 B5 A1 10 01 F0 24",
"gatekeeper": "/Volumes/备份/大鱼调色/发行包/大鱼调色-1.8.1.pkg: accepted\nsource=Notarized Developer ID",
"pass": true,
"scope": "Expanded package structural and payload verification only; no installer scripts executed and no host quit or registration performed.",
"notarization": {
"name": "大鱼调色-1.8.0.pkg",
"message": "Successfully received submission info",
"id": "2d32b77f-b825-4119-afcf-372588ad03c1",
"status": "Accepted",
"createdDate": "2026-11-03T05:16:46.953Z"
"createdDate": "2026-11-04T00:20:57.041Z",
"id": "f525871a-56a0-4b05-8726-d2f116db4594",
"name": "大鱼调色-1.8.1.pkg",
"status": "Accepted"
},
"appCompiledSource": "11a88518280f0665f3cd0f388d1d66e5446ece14",
"appBuild": "55",
"appCompiledSource": "059245858035e74f78bd669ef25913408d07d235",
"appBuild": "57",
"packageBuilderRemote": "https://dayu.media/git/dayu/pkg-forge.git",
"packageBuilderCommit": "eb53707c0e67d8ddeab8c1270bb079f1050cfafe",
"templateSHA256": {
@@ -59,6 +59,6 @@
"large.png": "ab12611e8801cff86332ccc505a4cffa0c1120541c2efb9bb9908be2c9fe631a",
"small.png": "41fec3138aee904fc39d6982e6fde809243ffec55298dbfe966f4f48d89caf8a"
},
"installedAppHostAcceptance": "verification/HostColorManagement1.8.0.json",
"installedAppHostAcceptance": "verification/HostPrimaryCST1.8.1.json",
"installScope": "本轮仅生成并验包,未再次执行系统安装;正式 APP 已有独立宿主验收。"
}
+11
查看文件
@@ -0,0 +1,11 @@
{
"version": "1.8.1",
"build": "57",
"removed": [
"/Library/Plug-Ins/FxPlug/.dayu-color-candidate56-retained.app",
"/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/restore-build-1.8.1/Build/Products/Release/大鱼调色.app",
"/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/restore-build-1.8.1/Build/Products/Release/大鱼调色 XPC Service.pluginkit"
],
"formalPath": "/Library/Plug-Ins/FxPlug/大鱼调色.app",
"scope": "Current task generated candidates and restore products; user source, media, packages and prior releases retained"
}
+323
查看文件
@@ -0,0 +1,323 @@
{
"date": "2026-11-04",
"version": "1.8.1",
"build": "57",
"scope": "Installed Release headless integration; live FCP acceptance recorded separately",
"passResult": true,
"totalChecks": 581,
"previousChecks": 530,
"newChecks": 51,
"results": [
{
"name": "primary-balance-wheel-restored-and-palette-loaded",
"pass": true
},
{
"error": "",
"name": "primary-master-active-render",
"pass": true
},
{
"error": "",
"name": "primary-master-inactive-render",
"pass": true
},
{
"name": "primary-master-controls-complete-cst-pipeline",
"pass": true
},
{
"error": "",
"name": "primary-mask-full-reference",
"pass": true
},
{
"error": "",
"name": "primary-mask-bypass-reference",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-cst-mask-render",
"pass": true
},
{
"name": "primary-mask-blends-cst-only-in-selected-region",
"pass": true
},
{
"name": "primary-v3-independent-state-valid",
"pass": true
},
{
"name": "primary-v3-rejects-conflicting-global-input",
"pass": true
},
{
"name": "primary-v3-secure-state-roundtrip",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-main-input-grade-output-render",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-DWG-intermediate-without-display-output",
"pass": true
},
{
"changedComponents": 2816,
"maxAbsoluteError": 0.00048828125,
"name": "primary-input-goes-directly-to-DWG-DI-not-709",
"nonfiniteComponents": 0,
"nonzeroComponents": 12288,
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-ACEScct-without-display-output",
"pass": true
},
{
"changedComponents": 4276,
"maxAbsoluteError": 0.00048828125,
"name": "primary-ACEScct-is-selectable-not-forced",
"nonfiniteComponents": 0,
"nonzeroComponents": 12288,
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-input-selection-ARRI",
"pass": true
},
{
"name": "primary-input-selection-is-effective",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-four-inherited-neutral-layers",
"pass": true
},
{
"name": "primary-new-layer-inherits-workspace-no-remap",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-four-stop-root-before-output",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-four-stop-extra-before-output",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "primary-independent-grade-before-main-output",
"nonfiniteComponents": 0,
"nonzeroComponents": 12288,
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-independent-OCIO-reduced-scene-input",
"pass": true
},
{
"independentReference": 0.424072265625,
"maxDifference": 0.00048828125,
"name": "primary-highlights-recovered-before-mapping-reference",
"pass": true,
"scene64afterMinus4": 0.424072265625
},
{
"error": "未提供错误信息",
"name": "primary-local-DI-contrast",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-local-ACES-contrast",
"pass": true
},
{
"name": "primary-local-working-selection-is-effective",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-local-input-CST-selection",
"pass": true
},
{
"name": "primary-local-input-CST-is-not-overridden",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-zero-mask",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-zero-grade-mix",
"pass": true
},
{
"name": "primary-zero-mask-and-mix-retain-CST-boundaries",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-linear-light-half-mix",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-linear-light-mix-reference",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "primary-mix-in-linear-AP1",
"nonfiniteComponents": 0,
"nonzeroComponents": 12288,
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-print-DWG-before-output",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-print-ACES-before-output",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "primary-print-domain-adapts-to-selected-working-space",
"nonfiniteComponents": 0,
"nonzeroComponents": 12288,
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-declared-Log-output",
"pass": true
},
{
"name": "primary-declared-output-controls-restored",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-no-output-tone-map",
"pass": true
},
{
"name": "primary-tone-mapping-switch-restored",
"pass": true
},
{
"name": "primary-Log-data-output-rejects-SDR-finishing",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-main-eye-keeps-other-tools",
"pass": true
},
{
"error": "",
"name": "primary-eye-unmanaged-reference",
"pass": true
},
{
"name": "primary-main-eye-bypasses-whole-CST-retains-tools",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-negative-superwhite-hidden-RGB",
"pass": true
},
{
"changedComponents": 0,
"maxAbsoluteError": 0,
"name": "primary-float-domain-identity-retains-extended-values",
"nonfiniteComponents": 0,
"nonzeroComponents": 11520,
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-linear-exposure-extended-values",
"pass": true
},
{
"grey": 0.3599466383457184,
"name": "primary-one-stop-exposure-is-linear-light-with-negative-values",
"negative": -0.05998092517256737,
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-data-output-ignores-disabled-SDR-and-LUT-controls",
"pass": true
},
{
"name": "primary-inspector-no-v2-selector-override",
"pass": true
},
{
"name": "primary-inspector-add-layer-inherits-workspace",
"pass": true
},
{
"name": "primary-workspace-change-updates-inherited-domains",
"pass": true
},
{
"name": "primary-manual-local-space-retains-choice-and-follows-boundaries",
"pass": true
},
{
"name": "primary-complete-preset-stores-v3-state",
"pass": true
},
{
"error": "未提供错误信息",
"name": "primary-v3-Cube65-declared-encoding",
"pass": true
},
{
"Gamma22": 0.7297400236129761,
"Gamma26": 0.7659831047058105,
"name": "primary-Cube-restores-output-gamma-selection",
"pass": true
}
],
"sourceSHA256": {
"tools/float_air_boundary.py": "6775344aa79d4fe2d8c3b322f1276b4592904afa5cc50a62defb6211a7836833",
"tools/build_kernels.py": "006711689251a4bc49f88ec4685d3baac55c2e56f033f384994a571515622e51",
"大鱼调色/Plugin/DYPrimaryRender.inc.h": "adcac0ca85dcfba614060bc87549814507671b5688b3980ec416a9afdffcbfb3",
"大鱼调色/Plugin/DYPrimaryKernels.inc.h": "e96c027ffec5a0a454771c93032c8fbed83bf11ca2951b97e0a9b6ee81b93b61",
"大鱼调色/Plugin/DYPrimaryDiagnostics.inc.h": "54a83300ed0fbc5588cdd5531271eacff7fca66bf7087336304bac16136e0f5f",
"大鱼调色/Plugin/DYManagedColor.mm": "d9d2688f26a51d1131ee63b415e0c09989616312d31eb3b636fd299f475ece08",
"大鱼调色/Plugin/DYRenderer.mm": "9b081acb6cd6e048cee4fe9bbfe4d72ae472ca6e3e2e4afff79f371a1755fad7"
},
"limitations": [
"Controlled code-carrier vectors, not a raw-camera source API certification",
"Old bounded tools remain post-output SDR finishing",
"Live FCP and unique formal install verified separately"
]
}
+54
查看文件
@@ -0,0 +1,54 @@
{
"passResult": true,
"sourceCommit": "059245858035e74f78bd669ef25913408d07d235",
"trackedFiles": 453,
"gitFsck": true,
"independentClone": true,
"freshReleaseBuild": true,
"headlessChecks": 581,
"headlessPassed": true,
"archives": [
{
"archive": "OpenColorIO-2.5.2.tar.gz",
"sha256": "722601e01b78b7a12da4829cb450674935f404b0e508f3f20046fa77570e3272",
"bytes": 14182890
},
{
"archive": "expat-2.7.2.tar.gz",
"sha256": "d09e2dd23398805cec1bac2860304714c96dc2fde629a7a1a77d0880ab7cd242",
"bytes": 8439887
},
{
"archive": "yaml-cpp-0.8.0.tar.gz",
"sha256": "fbe74bbdcee21d656715688706da3c8becfd946d92cd44705cc6098bb23b3a16",
"bytes": 1017151
},
{
"archive": "Imath-3.2.1.tar.gz",
"sha256": "b2c8a44c3e4695b74e9644c76f5f5480767355c6f98cde58ba0e82b4ad8c63ce",
"bytes": 689041
},
{
"archive": "pystring-1.1.4.tar.gz",
"sha256": "49da0fe2a049340d3c45cce530df63a2278af936003642330287b68cefd788fb",
"bytes": 19184
},
{
"archive": "minizip-ng-4.0.10.tar.gz",
"sha256": "c362e35ee973fa7be58cc5e38a4a6c23cc8f7e652555daf4f115a9eb2d3a6be7",
"bytes": 773269
},
{
"archive": "zlib-1.3.1.tar.gz",
"sha256": "17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c",
"bytes": 1572744
},
{
"archive": "sse2neon-227cc413fb2d50b2a10073087be96b59d5364aea.tar.gz",
"sha256": "3427a495743bb6fd1b5f9f806b80f57d67b1ac7ccf39a5f44aedd487fd7e6da1",
"bytes": 136342
}
],
"scope": "Application source rebuilt from independent remote clone; verified static dependency cache reused, not a completely cold dependency build",
"cleanupPending": true
}
+19 -11
查看文件
@@ -3,17 +3,25 @@
"repository": "dayu/dayu-color",
"repositoryID": 52,
"private": false,
"tag": "v1.7.4-tool-deletion-20261103",
"releaseCommit": "468d530bf002a34e407bd5e182cb6b90d6df1eb4",
"releaseID": 380,
"releaseURL": "https://dayu.media/git/dayu/dayu-color/releases/tag/v1.7.4-tool-deletion-20261103",
"tag": "v1.8.0-cms-20261103",
"releaseCommit": "a5a2bddeb361aac66899c5939671122075a6cffa",
"releaseID": 381,
"releaseURL": "https://dayu.media/git/dayu/dayu-color/releases/tag/v1.8.0-cms-20261103",
"prerelease": true,
"assetID": 24,
"assetName": "大鱼调色-1.7.4.pkg",
"downloadURL": "https://dayu.media/git/dayu/dayu-color/releases/download/v1.7.4-tool-deletion-20261103/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.7.4.pkg",
"bytes": 40918925,
"sha256": "bab2cb14229de151f73782e4a9bd54ca34ef47b9dd15ef3590dd1cd95d04fce5",
"assetID": 25,
"assetName": "大鱼调色-1.8.0.pkg",
"downloadURL": "https://dayu.media/git/dayu/dayu-color/releases/download/v1.8.0-cms-20261103/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.8.0.pkg",
"bytes": 42851034,
"sha256": "fd59203d387122e768090a97851daf3bd7c07193a8073b9497a10c05d5fd6c42",
"existingAssetReused": true,
"verification": "Authenticated full download SHA-256 and byte count, then beta release/asset read-back; original prerelease metadata preserved.",
"credentialSource": "macOS Keychain: dayu-git-api"
"verification": "Full draft download checked before publication; published attachment downloaded and checked again; release, tag and asset read-back verified.",
"credentialSource": "macOS Keychain: dayu-git-api",
"draftBrowserDownload": {
"path": "/Volumes/备份/大鱼调色-1.8.0.pkg",
"sha256": "fd59203d387122e768090a97851daf3bd7c07193a8073b9497a10c05d5fd6c42",
"bytes": 42851034,
"sourceURL": "https://dayu.media/git/dayu/dayu-color/releases/download/v1.8.0-cms-20261103/%E5%A4%A7%E9%B1%BC%E8%B0%83%E8%89%B2-1.8.0.pkg",
"observedBrowserURL": "https://dayu.media/git/attachments/52c92564-4662-4157-b22b-d9020b3fd4dd",
"cleanup": "Verified temporary browser download removed; final distribution package retained"
}
}
+2
查看文件
@@ -21,6 +21,8 @@ typedef struct DayuRenderParams {
CSTParams basisInput;
CSTParams basisOutput;
} DayuRenderParams;
// New pipeline only; the original parameter and uniform layouts stay fixed.
typedef struct DYCSTMixParams { CSTParams toLinear, fromLinear; float amount; } DYCSTMixParams;
#ifndef __METAL_VERSION__
_Static_assert(sizeof(CSTParams)==20, "CST target layout");
_Static_assert(sizeof(BasisParams)==80, "BASIS target layout");
+1
查看文件
@@ -500,6 +500,7 @@ extern "C" int DYRunDiagnostics(void) { @autoreleasepool {
#include "DYToolPenDiagnostics.inc.h"
#include "DYMaskPanelDiagnostics.inc.h"
#include "DYManagedDiagnostics.inc.h"
#include "DYPrimaryDiagnostics.inc.h"
[gpu release];
} @catch(NSException *exception) {
run.record(@"diagnostic-exception",false,@{@"exception":exception.name?:@"unknown",@"message":exception.reason?:@"unknown"});
+1
查看文件
@@ -326,3 +326,4 @@ fragment half4 dyToolCopyFragment(DYRaster in [[stage_in]],texture2d<half> sourc
#include "DYFilmKernels.inc.h"
#include "DYManagedKernels.inc.h"
#include "DYPrimaryKernels.inc.h"
+6 -5
查看文件
@@ -691,7 +691,7 @@ static NSImage *DYWheelImage(void) {
if([row.identifier isEqual:@"toolMasks"])return [(DYToolMaskPanel*)row contentHeight]>0;
NSString *key=row.identifier?:@"";NSInteger tab=[_tabs[section]integerValue];
if(!_embedded&&[section isEqual:@"base"]&&[key isEqual:@"skinEnabled"])for(NSDictionary *card in _cards)if([card[@"section"][@"key"]isEqual:@"skin"])return ![card[@"removed"]boolValue];
if([key isEqual:@"legacyInput"])return ![_tabs[@"managedColor"]boolValue]&&[_tabs[@"legacyInput"]boolValue];
if([key isEqual:@"legacyInput"])return ![_tabs[@"primaryCMS"]boolValue]&&![_tabs[@"managedColor"]boolValue]&&[_tabs[@"legacyInput"]boolValue];
if([section isEqual:@"primary"]&&[_tabs[@"managedColor"]boolValue]){if([@[@"heading:input",@"heading:output"]containsObject:key])return NO;if([key isEqual:@"cmmix"])return YES;for(NSDictionary*d in DYDescriptors())if([d[@"key"]isEqual:key]&&d[@"cmTab"]&&[d[@"cmTab"]integerValue]!=1)return NO;}
if([section isEqual:@"curve"] && ![key isEqual:@"curveGraph"])return NO;
if([section isEqual:@"hsl"]) {
@@ -810,8 +810,8 @@ static NSImage *DYWheelImage(void) {
[(DYMaskCountBadge*)card[@"maskBadge"]setCount:count];NSString *hint=count?[NSString stringWithFormat:@"已有 %lu 个蒙版;点击添加独立蒙版",(unsigned long)count]:@"添加本工具的独立蒙版";
[card[@"maskButton"]setToolTip:hint];[card[@"maskButton"]setAccessibilityHelp:hint];
}
DYAssetState *assets=DYReadAssets(_manager,t);_tabs[@"managedColor"]=@((_embedded?DYReadAssets([(DYToolManager*)_manager host],t).colorManagement:assets.colorManagement).count>0);[_managedPanel refreshWithState:assets.colorManagement context:[_renderer colorContext]];[_managedPanel setInputLUTPath:assets.paths[@"input"]];for(NSDictionary *r in _controls.allValues)if([r[@"descriptor"][@"key"]isEqual:@"cmmix"])[r[@"label"]setStringValue:[_tabs[@"managedColor"]boolValue]?@"调色混合":@"CST 混合"];
if([_tabs[@"managedColor"]boolValue])for(NSDictionary *c in _cards)if([c[@"section"][@"key"]isEqual:@"primary"]){[c[@"enabled"]setToolTip:@"启停此层一级调色;全局色彩管理保持当前方式"];[c[@"enabled"]setAccessibilityHelp:[c[@"enabled"]toolTip]];}
DYAssetState *assets=DYReadAssets(_manager,t);NSDictionary *cms=_embedded?DYReadAssets([(DYToolManager*)_manager host],t).colorManagement:assets.colorManagement;_tabs[@"managedColor"]=@(cms.count>0&&!DYPrimaryColorState(cms));_tabs[@"primaryCMS"]=@(DYPrimaryColorState(cms));[_managedPanel refreshWithState:assets.colorManagement context:[_renderer colorContext]];[_managedPanel setInputLUTPath:assets.paths[@"input"]];for(NSDictionary *r in _controls.allValues)if([r[@"descriptor"][@"key"]isEqual:@"cmmix"])[r[@"label"]setStringValue:([_tabs[@"managedColor"]boolValue]||[_tabs[@"primaryCMS"]boolValue])?@"调色混合":@"CST 混合"];
for(NSDictionary *c in _cards)if([c[@"section"][@"key"]isEqual:@"primary"]){[c[@"enabled"]setToolTip:[_tabs[@"managedColor"]boolValue]?@"启停此层一级调色;全局色彩管理保持当前方式":@"启停此层输入、一级调色与输出转换"];[c[@"enabled"]setAccessibilityHelp:[c[@"enabled"]toolTip]];}
[_spiderPanel setMesh:assets.spiderMesh linked:assets.spiderLinked];
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];
@@ -857,7 +857,7 @@ static NSImage *DYWheelImage(void) {
if([d[@"key"]hasPrefix:@"cm"]){[set setFloatValue:1 toParameter:2236 atTime:action.currentTime];[self clearPrimaryBypasses:set time:action.currentTime];}
else if(old.schema<2){double cfg=0;[get getFloatValue:&cfg fromParameter:2236 atTime:action.currentTime];if(cfg<.5)[set setFloatValue:-1 toParameter:2236 atTime:action.currentTime];}
if(old.schema<2){DYInspectorToken *token=[[old copy]autorelease];token.schema=2;[set setCustomParameterValue:token toParameter:DYInspectorParameterID atTime:action.currentTime];}
} }
}DYPrimaryControlChanged(_manager,action.currentTime,d[@"key"]); }
@finally { [action endAction:self]; }
[self postChanged];
}
@@ -865,7 +865,7 @@ static NSImage *DYWheelImage(void) {
NSDictionary *r=_controls[@(sender.tag)],*d=r[@"descriptor"];if(!d)return;
id<FxCustomParameterActionAPI_v4> action=[self actionAPI];if(!action)return;
[action startAction:self];
@try {id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];[set setFloatValue:[d[@"default"] doubleValue] toParameter:(UInt32)sender.tag atTime:action.currentTime];if([d[@"key"]hasPrefix:@"cm"]){[set setFloatValue:1 toParameter:2236 atTime:action.currentTime];[self clearPrimaryBypasses:set time:action.currentTime];}}
@try {id<FxParameterSettingAPI_v6> set=[_manager apiForProtocol:@protocol(FxParameterSettingAPI_v6)];[set setFloatValue:[d[@"default"] doubleValue] toParameter:(UInt32)sender.tag atTime:action.currentTime];if([d[@"key"]hasPrefix:@"cm"]){[set setFloatValue:1 toParameter:2236 atTime:action.currentTime];[self clearPrimaryBypasses:set time:action.currentTime];}DYPrimaryControlChanged(_manager,action.currentTime,d[@"key"]);}
@finally {[action endAction:self];}
[self postChanged];
}
@@ -948,6 +948,7 @@ static NSImage *DYWheelImage(void) {
NSNumber *extra=section[@"extraEnabled"];if(extra)[set setFloatValue:defaultEnabled toParameter:extra.unsignedIntValue atTime:t];
NSString *key=section[@"key"]?:@"";
if([key isEqual:@"primary"]){for(NSDictionary *d in DYDescriptors())if([d[@"key"]hasPrefix:@"cm"])[set setFloatValue:[d[@"default"]doubleValue] toParameter:[d[@"pid"]unsignedIntValue] atTime:t];[set setFloatValue:1 toParameter:2236 atTime:t];for(NSNumber *linked in section[@"enableParameters"])[set setFloatValue:1 toParameter:linked.unsignedIntValue atTime:t];[set setFloatValue:0 toParameter:2013 atTime:t];DYAssetState *state=[[DYReadAssets(_manager,t)copy]autorelease];NSMutableDictionary *paths=[[state.paths mutableCopy]autorelease];[paths removeObjectForKey:@"input"];state.paths=paths;DYWriteAssets(_manager,state,t);}
if([key isEqual:@"primary"])DYPrimaryControlChanged(_manager,t,@"cmworkingTransfer");
if([key isEqual:@"spider"]){DYAssetState *state=[[DYReadAssets(_manager,t)copy]autorelease];auto m=DYSpiderMesh(state.spiderMesh);m=dy::neutralMesh(m.hues,m.rings+1);state.spiderMesh=[NSData dataWithBytes:&m length:sizeof(m)];DYWriteAssets(_manager,state,t);}
if([key localizedCaseInsensitiveContainsString:@"input"]||[key localizedCaseInsensitiveContainsString:@"look"]) {
DYAssetState *assets=[[DYReadAssets(_manager,t) copy] autorelease];
+5
查看文件
@@ -3,7 +3,12 @@
#import <FxPlug/FxPlugSDK.h>
// Separate authoring state; absent state always selects the unchanged v1 renderer.
FOUNDATION_EXPORT NSDictionary *DYManagedColorDefaults(void);
FOUNDATION_EXPORT NSDictionary *DYPrimaryColorDefaults(void);
FOUNDATION_EXPORT BOOL DYPrimaryColorState(NSDictionary *state);
FOUNDATION_EXPORT void DYSeedPrimaryWorkingSpace(NSMutableDictionary *node,float transfer,float gamut);
FOUNDATION_EXPORT BOOL DYManagedColorValid(id state,NSError **error);
FOUNDATION_EXPORT void DYFollowPrimaryWorkingSpace(NSMutableDictionary *document,float transfer,float gamut);
FOUNDATION_EXPORT void DYPrimaryControlChanged(id<PROAPIAccessing> manager,CMTime time,NSString *key);
FOUNDATION_EXPORT NSArray<NSDictionary*> *DYManagedInputSpaces(void);
FOUNDATION_EXPORT NSArray<NSDictionary*> *DYManagedOutputSpaces(void);
FOUNDATION_EXPORT NSDictionary *DYHostColorContext(FxImageTile *source,FxImageTile *destination,NSInteger primaries);
+14
查看文件
@@ -1,11 +1,25 @@
#import "DYManagedColor.h"
#import "DYToolState.h"
#include "../../ColorManagement/Core/DYColorManagement.hpp"
#include <CommonCrypto/CommonDigest.h>
#include <cmath>
NSDictionary *DYManagedColorDefaults(void){return @{@"version":@2,@"mode":@1,@"input":@109,@"output":@1,@"gamutCompression":@YES,@"engine":@"OpenColorIO-2.5.2",@"config":@"studio-config-v2.2.0_aces-v1.3_ocio-v2.4"};}
NSDictionary *DYPrimaryColorDefaults(void){return @{@"version":@3,@"mode":@4,@"engine":@"Dayu-CST-f32",@"config":@"primary-parameters-v1"};}
BOOL DYPrimaryColorState(NSDictionary *s){return [s isKindOfClass:NSDictionary.class]&&[s[@"version"]isEqual:@3]&&[s[@"mode"]isEqual:@4];}
void DYSeedPrimaryWorkingSpace(NSMutableDictionary *node,float transfer,float gamut){
if(![node[@"type"]isEqual:@"primary"])return;NSMutableDictionary*v=node[@"values"];NSUInteger follow=[node[@"primaryFollow"]unsignedIntegerValue],bit=1;
for(NSString *part in @[@"input",@"working",@"output"]){NSString*t=[NSString stringWithFormat:@"cm%@Transfer",part],*g=[NSString stringWithFormat:@"cm%@Gamut",part];if(!v[t]&&!v[g])follow|=bit;if(!v[t])v[t]=@(transfer);if(!v[g])v[g]=@(gamut);bit<<=1;}node[@"primaryFollow"]=@(follow);
}
void DYFollowPrimaryWorkingSpace(NSMutableDictionary *doc,float transfer,float gamut){for(NSMutableDictionary*node in doc[@"layers"]){NSUInteger follow=[node[@"primaryFollow"]unsignedIntegerValue],bit=1;if(![node[@"type"]isEqual:@"primary"])continue;for(NSString*part in @[@"input",@"working",@"output"]){if(follow&bit){node[@"values"][[NSString stringWithFormat:@"cm%@Transfer",part]]=@(transfer);node[@"values"][[NSString stringWithFormat:@"cm%@Gamut",part]]=@(gamut);}bit<<=1;}}}
void DYPrimaryControlChanged(id<PROAPIAccessing> manager,CMTime time,NSString *key){
if([manager isKindOfClass:DYToolManager.class]||![@[@"cmworkingTransfer",@"cmworkingGamut"]containsObject:key]||!DYPrimaryColorState(DYReadAssets(manager,time).colorManagement))return;
DYUniforms u;DYReadUniforms(manager,time,&u);NSMutableDictionary*doc=DYMutablePlist(DYReadTools(manager,time).document);DYFollowPrimaryWorkingSpace(doc,u.cm.workingTransfer,u.cm.workingGamut);DYWriteTools(manager,doc,time);
}
NSArray<NSDictionary*> *DYManagedInputSpaces(void){NSMutableArray *a=[NSMutableArray array];for(const auto&s:dycm::spaces())[a addObject:@{@"id":@(unsigned(s.id)),@"name":@(s.label)}];return a;}
NSArray<NSDictionary*> *DYManagedOutputSpaces(void){NSMutableArray *a=[NSMutableArray array];for(const auto&s:dycm::outputs())[a addObject:@{@"id":@(unsigned(s.id)),@"name":@(s.label)}];return a;}
BOOL DYManagedColorValid(id state,NSError **error){
if(DYPrimaryColorState(state)){BOOL valid=[state isEqual:DYPrimaryColorDefaults()];if(!valid&&error)*error=[NSError errorWithDomain:@"com.dayu.color.cms" code:1 userInfo:@{NSLocalizedDescriptionKey:@"一级 CST 设置版本不匹配。"}];return valid;}
BOOL valid=[state isKindOfClass:NSDictionary.class]&&[state count]==7&&[state[@"version"]isEqual:@2]&&[state[@"engine"]isEqual:@"OpenColorIO-2.5.2"]&&[state[@"config"]isEqual:@"studio-config-v2.2.0_aces-v1.3_ocio-v2.4"];
for(NSString *key in @[@"mode",@"input",@"output",@"gamutCompression"]){id v=[state isKindOfClass:NSDictionary.class]?state[key]:nil;double n=[v isKindOfClass:NSNumber.class]?[v doubleValue]:NAN;valid&=std::isfinite(n)&&n==floor(n);}
if(valid){valid=[@[@1,@2,@3]containsObject:state[@"mode"]]&&[@[@0,@1]containsObject:state[@"gamutCompression"]];BOOL input=NO,output=NO;for(NSDictionary *s in DYManagedInputSpaces())input|=[s[@"id"]isEqual:state[@"input"]];for(NSDictionary *s in DYManagedOutputSpaces())output|=[s[@"id"]isEqual:state[@"output"]];valid&=input&&output;}
+11 -10
查看文件
@@ -3,6 +3,7 @@
#import "DYModel.h"
#import "DYRenderer.h"
#import "DYTheme.h"
#import "DYToolState.h"
@protocol DYManagedAssetTarget <NSObject>
- (NSProgress*)setAssetPath:(NSString*)path forKey:(NSString*)key completion:(void(^)(NSError*))completion;
@end
@@ -12,11 +13,11 @@
NSDictionary *_state;NSString *_inputLUTPath;NSUInteger _selectionGeneration;BOOL _refreshing;
}
- (BOOL)isFlipped{return YES;}
- (CGFloat)contentHeight{NSInteger m=[_state[@"mode"]integerValue];return m==0?112:m==1?190:302;}
- (CGFloat)contentHeight{NSInteger m=[_state[@"mode"]integerValue];return m==0?112:(m==1||m==4)?204:302;}
static NSTextField *cmsLabel(NSString*s){NSTextField*l=[NSTextField wrappingLabelWithString:s];l.font=[NSFont systemFontOfSize:11];l.textColor=DYThemeColor(@"text");return l;}
- (instancetype)initWithManager:(id<PROAPIAccessing>)m renderer:(DYRenderer*)r assetTarget:(id)target {
if((self=[super initWithFrame:NSZeroRect])){_manager=m;_renderer=[r retain];_assetTarget=target;self.identifier=@"managedColor";
_mode=[[NSPopUpButton alloc]initWithFrame:NSZeroRect];[_mode addItemsWithTitles:@[@"色彩管理 · 旧版兼容",@"色彩管理 · 跟随 FCP",@"相机编码 → ACES",@"输入 LUT → ACES"]];_mode.target=self;_mode.action=@selector(modeChanged:);_mode.accessibilityLabel=@"色彩管理方式";
_mode=[[NSPopUpButton alloc]initWithFrame:NSZeroRect];[_mode addItemsWithTitles:@[@"一级 CST · 原有流程",@"1.8 兼容 · 跟随 FCP",@"1.8 兼容 · 相机 → ACES",@"1.8 兼容 · LUT → ACES",@"一级 CST · 延后输出(推荐)"]];_mode.target=self;_mode.action=@selector(modeChanged:);_mode.accessibilityLabel=@"色彩管理方式";
_inputLabel=[cmsLabel(@"输入空间")retain];_outputLabel=[cmsLabel(@"输出目标")retain];
_input=[[NSPopUpButton alloc]initWithFrame:NSZeroRect];for(NSDictionary*s in DYManagedInputSpaces()){[_input addItemWithTitle:s[@"name"]];_input.lastItem.representedObject=s[@"id"];} _input.target=self;_input.action=@selector(settingsChanged:);_input.accessibilityLabel=@"新版输入空间";
_output=[[NSPopUpButton alloc]initWithFrame:NSZeroRect];for(NSDictionary*s in DYManagedOutputSpaces()){[_output addItemWithTitle:s[@"name"]];_output.lastItem.representedObject=s[@"id"];} _output.target=self;_output.action=@selector(settingsChanged:);_output.accessibilityLabel=@"新版输出目标";
@@ -27,25 +28,25 @@ static NSTextField *cmsLabel(NSString*s){NSTextField*l=[NSTextField wrappingLabe
}return self;
}
- (void)dealloc{[_renderer release];[_state release];[_inputLUTPath release];for(id v in @[_mode,_input,_output,_gamut,_lut,_inputLabel,_outputLabel,_help,_context])[v release];[super dealloc];}
- (void)layout{[super layout];CGFloat w=self.bounds.size.width;_mode.frame=NSMakeRect(0,3,w,26);_inputLabel.frame=NSMakeRect(2,36,70,22);_input.frame=NSMakeRect(72,32,w-72,26);_outputLabel.frame=NSMakeRect(2,67,70,22);_output.frame=NSMakeRect(72,63,w-72,26);_gamut.frame=NSMakeRect(0,94,w,22);_lut.frame=NSMakeRect(0,120,w,25);_help.frame=NSMakeRect(2,152,w-4,96);_context.frame=NSMakeRect(2,252,w-4,47);if([_state[@"mode"]integerValue]<2){_help.frame=NSMakeRect(2,36,w-4,90);_context.frame=NSMakeRect(2,132,w-4,54);}}
- (void)layout{[super layout];CGFloat w=self.bounds.size.width;_mode.frame=NSMakeRect(0,3,w,26);_inputLabel.frame=NSMakeRect(2,36,70,22);_input.frame=NSMakeRect(72,32,w-72,26);_outputLabel.frame=NSMakeRect(2,67,70,22);_output.frame=NSMakeRect(72,63,w-72,26);_gamut.frame=NSMakeRect(0,94,w,22);_lut.frame=NSMakeRect(0,120,w,25);_help.frame=NSMakeRect(2,152,w-4,96);_context.frame=NSMakeRect(2,252,w-4,47);if([_state[@"mode"]integerValue]<2||DYPrimaryColorState(_state)){_help.frame=NSMakeRect(2,36,w-4,104);_context.frame=NSMakeRect(2,144,w-4,54);}}
- (void)refreshWithState:(NSDictionary*)s context:(NSDictionary*)context {
_refreshing=YES;NSDictionary *saved=[s copy];[_state release];_state=saved;NSInteger mode=s.count?[s[@"mode"]integerValue]:0;[_mode selectItemAtIndex:mode];
NSDictionary *values=s.count?s:DYManagedColorDefaults();for(NSMenuItem*i in _input.itemArray)if([i.representedObject isEqual:values[@"input"]])[_input selectItem:i];for(NSMenuItem*i in _output.itemArray)if([i.representedObject isEqual:values[@"output"]])[_output selectItem:i];
_input.hidden=_inputLabel.hidden=_output.hidden=_outputLabel.hidden=_gamut.hidden=mode<2;_context.hidden=mode==0;_input.enabled=mode==2||mode==3;_output.enabled=mode==2||mode==3;_gamut.enabled=mode==2||mode==3;_gamut.state=[values[@"gamutCompression"]boolValue];_lut.hidden=mode!=3;_inputLabel.stringValue=mode==3?@"LUT 输出":@"输入空间";_outputLabel.stringValue=mode==1?@"跟随宿主":@"输出目标";
_help.stringValue=mode==0?@"保留当前工程的原有颜色。选择新版后,一级层在 ACEScct 中调色,印片位于输出之前;可撤销或切回兼容方式。":mode==1?@"按宿主实际空间处理,不重复还原或映射。顺序:一级层 → 印片 → SDR 修饰。Rec.2020 宿主暂限一级与印片。":mode==2?@"按所选相机编码解释兼容码值。请确认上游未还原、未自动符合;选择准确输入与输出目标。PQ/HLG 仅支持一级与印片,其他工具用于 SDR。":@"使用输入 LUT,并按“LUT 输出”解释其结果;再进入 ACEScct 和所选输出变换。";
_context.stringValue=context.count?[NSString stringWithFormat:@"%@ → ACEScct → %@",context[@"source"]?:@"未知",context[@"destination"]?:@"未知"]:@"宿主颜色信息将在渲染后显示。";_refreshing=NO;[self setNeedsLayout:YES];
NSDictionary *values=s.count&&!DYPrimaryColorState(s)?s:DYManagedColorDefaults();for(NSMenuItem*i in _input.itemArray)if([i.representedObject isEqual:values[@"input"]])[_input selectItem:i];for(NSMenuItem*i in _output.itemArray)if([i.representedObject isEqual:values[@"output"]])[_output selectItem:i];
_input.hidden=_inputLabel.hidden=_output.hidden=_outputLabel.hidden=_gamut.hidden=mode<2||mode==4;_context.hidden=mode==0;_input.enabled=mode==2||mode==3;_output.enabled=mode==2||mode==3;_gamut.enabled=mode==2||mode==3;_gamut.state=[values[@"gamutCompression"]boolValue];_lut.hidden=mode!=3;_inputLabel.stringValue=mode==3?@"LUT 输出":@"输入空间";_outputLabel.stringValue=mode==1?@"跟随宿主":@"输出目标";
_help.stringValue=mode==4?@"输入、工作空间及输出均使用下面的一级 CST 设置。一级与印片完成后才执行主输出;其余工具为输出后的 SDR 修饰。请核对上游相机 LUT 与颜色符合,插件无法恢复上游已裁切的信息。":mode==0?@"保留原有处理顺序。选择“延后输出”后,使用一级 CST 的输入和工作空间,在一级与印片之后执行主输出。":mode==1?@"保留 1.8.0 的固定 ACEScct 流程,一级 CST 转换由全局管理接管。宿主已还原的画面无法重新获得原始 Log 信息。":mode==2?@"按所选相机编码解释兼容码值。请确认上游未还原、未自动符合;选择准确输入与输出目标。PQ/HLG 仅支持一级与印片,其他工具用于 SDR。":@"使用输入 LUT,并按“LUT 输出”解释其结果;再进入 ACEScct 和所选输出变换。";
_context.stringValue=mode==4?@"素材编码 → 一级输入 CST → 所选工作域调色与印片 → 一级输出 CST → 宿主":context.count?[NSString stringWithFormat:@"%@ → ACEScct → %@",context[@"source"]?:@"未知",context[@"destination"]?:@"未知"]:@"宿主颜色信息将在渲染后显示。";_refreshing=NO;[self setNeedsLayout:YES];
}
- (void)setInputLUTPath:(NSString*)path{NSString *saved=[path copy];[_inputLUTPath release];_inputLUTPath=saved;_lut.title=path.length?path.lastPathComponent:@"选择输入 LUT…";_lut.toolTip=path.length?path:@"选择 LUT,并准确指定其输出编码";_lut.accessibilityLabel=path.length?[@"输入 LUT:" stringByAppendingString:path.lastPathComponent]:@"选择输入 LUT";}
- (void)refreshContext{[self refreshWithState:_state context:[_renderer colorContext]];}
- (void)writeState:(NSDictionary*)state {
if(state&&!DYManagedColorValid(state,nil))return;id<FxCustomParameterActionAPI_v4>a=[_manager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(!a)return;[a startAction:self];@try{id<FxUndoAPI>undo=[_manager apiForProtocol:@protocol(FxUndoAPI)];[undo startUndoGroup:@"更改色彩管理方式"];DYAssetState*assets=[[DYReadAssets(_manager,a.currentTime)copy]autorelease];assets.colorManagement=state;DYWriteAssets(_manager,assets,a.currentTime);[undo endUndoGroup];}@finally{[a endAction:self];}[_renderer invalidatePreview];[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:_manager];
if(state&&!DYManagedColorValid(state,nil))return;id<FxCustomParameterActionAPI_v4>a=[_manager apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(!a)return;[a startAction:self];@try{id<FxUndoAPI>undo=[_manager apiForProtocol:@protocol(FxUndoAPI)];[undo startUndoGroup:@"更改色彩管理方式"];DYAssetState*assets=[[DYReadAssets(_manager,a.currentTime)copy]autorelease];assets.colorManagement=state;DYWriteAssets(_manager,assets,a.currentTime);if(DYPrimaryColorState(state)&&!DYPrimaryColorState(_state)){DYUniforms u;DYReadUniforms(_manager,a.currentTime,&u);NSMutableDictionary*doc=DYMutablePlist(DYReadTools(_manager,a.currentTime).document);for(NSMutableDictionary*node in doc[@"layers"])DYSeedPrimaryWorkingSpace(node,u.cm.workingTransfer,u.cm.workingGamut);DYFollowPrimaryWorkingSpace(doc,u.cm.workingTransfer,u.cm.workingGamut);DYWriteTools(_manager,doc,a.currentTime);}[undo endUndoGroup];}@finally{[a endAction:self];}[_renderer invalidatePreview];[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:_manager];
}
- (void)modeChanged:(id)sender {if(_refreshing)return;NSInteger mode=_mode.indexOfSelectedItem;_selectionGeneration++;if(mode==3&&(!_inputLUTPath.length||![NSFileManager.defaultManager fileExistsAtPath:_inputLUTPath])){[self refreshWithState:_state context:[_renderer colorContext]];[self selectInputLUTAndEnable:YES];return;}if(!mode){[self writeState:nil];return;}NSMutableDictionary *s=[[_state?:DYManagedColorDefaults() mutableCopy]autorelease];s[@"mode"]=@(mode);[self writeState:s];}
- (void)modeChanged:(id)sender {if(_refreshing)return;NSInteger mode=_mode.indexOfSelectedItem;_selectionGeneration++;if(mode==3&&(!_inputLUTPath.length||![NSFileManager.defaultManager fileExistsAtPath:_inputLUTPath])){[self refreshWithState:_state context:[_renderer colorContext]];[self selectInputLUTAndEnable:YES];return;}if(!mode){[self writeState:nil];return;}if(mode==4){[self writeState:DYPrimaryColorDefaults()];return;}NSMutableDictionary *s=[[(_state&&!DYPrimaryColorState(_state)?_state:DYManagedColorDefaults())mutableCopy]autorelease];s[@"mode"]=@(mode);[self writeState:s];}
- (void)settingsChanged:(id)sender {if(_refreshing||!_state)return;NSMutableDictionary*s=[[_state mutableCopy]autorelease];s[@"input"]=_input.selectedItem.representedObject;s[@"output"]=_output.selectedItem.representedObject;s[@"gamutCompression"]=@(_gamut.state==NSControlStateValueOn);[self writeState:s];}
- (void)selectInputLUTAndEnable:(BOOL)enable {
NSUInteger generation=_selectionGeneration;NSOpenPanel *panel=[NSOpenPanel openPanel];panel.allowedFileTypes=@[@"cube"];panel.allowsMultipleSelection=NO;panel.canChooseDirectories=NO;panel.message=@"选择输入 LUT,再指定 LUT 的输出编码";
if([panel runModal]!=NSModalResponseOK||!self.window)return;
[(id<DYManagedAssetTarget>)_assetTarget setAssetPath:panel.URL.path forKey:@"input" completion:^(NSError *error){if(error||!enable||!self.window||generation!=_selectionGeneration)return;NSMutableDictionary *s=[[(_state?:DYManagedColorDefaults())mutableCopy]autorelease];s[@"mode"]=@3;[self writeState:s];}];
[(id<DYManagedAssetTarget>)_assetTarget setAssetPath:panel.URL.path forKey:@"input" completion:^(NSError *error){if(error||!enable||!self.window||generation!=_selectionGeneration)return;NSMutableDictionary *s=[[(_state&&!DYPrimaryColorState(_state)?_state:DYManagedColorDefaults())mutableCopy]autorelease];s[@"mode"]=@3;[self writeState:s];}];
}
- (void)chooseLUT:(id)sender {[self selectInputLUTAndEnable:NO];}
@end
@@ -29,6 +29,7 @@
NSDictionary*context=DYHostColorContext(src,dst,primaries);@synchronized(_previewLock){[_colorContext release];_colorContext=[context copy];}
if(!state.count)return [self renderSource:src destination:dst uniforms:u paths:paths spider:spider tools:tools error:error];
if(!DYManagedColorValid(state,error))return NO;if(!tools)tools=@{@"schema":@2,@"layers":@[],@"baseMasks":@{}};if(!DYValidToolDocument(tools))return fail(error,@"调色层或蒙版数据无效。");
if(DYPrimaryColorState(state))return [self renderPrimarySource:src destination:dst uniforms:u paths:paths spider:spider tools:tools hostPrimaries:primaries error:error];
NSMutableDictionary*entry=[self device:dst.deviceRegistryID error:error];if(!entry)return NO;id<MTLDevice>d=entry[@"device"];id<MTLTexture>source=[src metalTextureForDevice:d];if(!source)return fail(error,@"色彩管理输入纹理不可用。");
uint64_t pixels=uint64_t(source.width)*source.height;if(!pixels||pixels>64ull*1024*1024||pixels*16*8>MAX(768ull*1024*1024,MIN(2ull*1024*1024*1024,d.recommendedMaxWorkingSetSize/2)))return fail(error,@"当前画面超过色彩管理内存预算。");
CGColorSpaceRef srcSpace=DYManagedTileSpace(src,primaries),dstSpace=DYManagedTileSpace(dst,primaries),aces=CGColorSpaceCreateWithName(kCGColorSpaceACESCGLinear),linear709=CGColorSpaceCreateWithName(kCGColorSpaceExtendedLinearSRGB);
@@ -0,0 +1,50 @@
// Regression for the user's failure case: scene grading precedes the main ODT.
{
DYRenderer *primaryRenderer=[[[DYRenderer alloc]init]autorelease];NSDictionary *v3=DYPrimaryColorDefaults();DYToolDocument *empty=[[[DYToolDocument alloc]init]autorelease];
run.need(@"primary-v3-independent-state-valid",DYManagedColorValid(v3,nil)&&DYPrimaryColorState(v3));NSMutableDictionary *bad=DYMutablePlist(v3);bad[@"input"]=@109;run.record(@"primary-v3-rejects-conflicting-global-input",!DYManagedColorValid(bad,nil));
DYAssetState *saved=[[[DYAssetState alloc]init]autorelease];saved.colorManagement=v3;NSData *encoded=[NSKeyedArchiver archivedDataWithRootObject:saved requiringSecureCoding:YES error:&error];DYAssetState *decoded=[NSKeyedUnarchiver unarchivedObjectOfClass:DYAssetState.class fromData:encoded error:&error];run.record(@"primary-v3-secure-state-roundtrip",[saved isEqual:decoded]);
DYUniforms u=defaults;u.skinProtection.x=0;u.cm.configured=1;u.cm.inputTransfer=28;u.cm.inputGamut=27;u.cm.workingTransfer=10;u.cm.workingGamut=16;u.cm.outputTransfer=1002;u.cm.outputGamut=22;u.cm.toneMapping=1;
auto decodeCarrier=[](float x){return x<=.04045f?x/12.92f:powf((x+.055f)/1.055f,2.4f);};auto encodeCarrier=[](float x){return x<=.0031308f?12.92f*x:1.055f*powf(x,1/2.4f)-.055f;};
std::vector<DYCompositeRGBA>scene(width*height);float levels[]={.002f,.018f,.18f,1,4,16,32,64};for(size_t i=0;i<scene.size();i++){float v=levels[i%8],alpha=i%5?.5f:1;scene[i]={v*alpha,v*(i%3?.9f:1)*alpha,v*(i%3?.6f:1)*alpha,alpha};}
auto sceneInput=[&](std::vector<DYCompositeRGBA> pixels){dycm::Transform::convert(dycm::Space::ACEScg,dycm::Space::SonySLog3Cine).apply(pixels,dycm::Alpha::Premultiplied);Pixels out(pixels.size()*4);for(size_t i=0;i<pixels.size();i++){float a=pixels[i].a;out[i*4]=decodeCarrier(pixels[i].r/a)*a;out[i*4+1]=decodeCarrier(pixels[i].g/a)*a;out[i*4+2]=decodeCarrier(pixels[i].b/a)*a;out[i*4+3]=a;}return out;};
Pixels logInput=sceneInput(scene);auto upload=[&](const Pixels&p){[[source metalTextureForDevice:gpu]replaceRegion:MTLRegionMake2D(0,0,width,height) mipmapLevel:0 withBytes:p.data() bytesPerRow:width*8];};upload(logInput);
auto renderPrimary=[&](DYUniforms values,NSDictionary *doc,NSString *name){NSError *e=nil;BOOL ok=[primaryRenderer renderSource:source destination:destination uniforms:values paths:@{} spider:nil tools:doc colorManagement:v3 hostPrimaries:kFxColorPrimaries_Rec709 error:&e];run.need(name,ok,@{@"error":reason(e)});return read(destination,gpu);};
auto inputReference=[&](dycm::Space target){std::vector<DYCompositeRGBA>r(scene.size());for(size_t i=0;i<r.size();i++){float a=logInput[i*4+3];r[i]={encodeCarrier((float)logInput[i*4]/a)*a,encodeCarrier((float)logInput[i*4+1]/a)*a,encodeCarrier((float)logInput[i*4+2]/a)*a,a};}dycm::Transform::convert(dycm::Space::SonySLog3Cine,target).apply(r,dycm::Alpha::Premultiplied);return r;};
auto carrierReference=[&](const std::vector<DYCompositeRGBA>&r){Pixels p(r.size()*4);for(size_t i=0;i<r.size();i++){float a=r[i].a;p[i*4]=decodeCarrier(r[i].r/a)*a;p[i*4+1]=decodeCarrier(r[i].g/a)*a;p[i*4+2]=decodeCarrier(r[i].b/a)*a;p[i*4+3]=a;}return p;};
Pixels baseline=renderPrimary(u,empty.document,@"primary-main-input-grade-output-render");
// No main output: independently compare the working code values against OCIO.
DYUniforms data=u;data.cm.outputEnabled=0;data.cm.toneMapping=0;Pixels intermediate=renderPrimary(data,empty.document,@"primary-DWG-intermediate-without-display-output");Difference di=difference(intermediate,carrierReference(inputReference(dycm::Space::DaVinciIntermediate)));run.record(@"primary-input-goes-directly-to-DWG-DI-not-709",di.maximum<.003&&di.nonfinite==0,measure(di));
data.cm.workingTransfer=1;data.cm.workingGamut=2;Pixels cct=renderPrimary(data,empty.document,@"primary-ACEScct-without-display-output");Difference aces=difference(cct,carrierReference(inputReference(dycm::Space::ACEScct)));run.record(@"primary-ACEScct-is-selectable-not-forced",aces.maximum<.003&&aces.nonfinite==0,measure(aces));
DYUniforms changed=u;changed.cm.inputTransfer=4;changed.cm.inputGamut=4;Pixels arri=renderPrimary(changed,empty.document,@"primary-input-selection-ARRI");run.record(@"primary-input-selection-is-effective",difference(baseline,arri).maximum>.05);
// Neutral additional layers are exact bypasses, with no second display map.
NSMutableDictionary *doc=DYMutablePlist(empty.document);for(int i=0;i<4;i++)DYSeedPrimaryWorkingSpace((id)DYInsertTool(doc,@"primary",@"base:primary"),10,16);Pixels neutral=renderPrimary(u,doc,@"primary-four-inherited-neutral-layers");run.record(@"primary-new-layer-inherits-workspace-no-remap",difference(baseline,neutral).maximum==0);
// Move the entire exposure correction into an independent layer. The result
// must be the same as correcting the root before its one final display map.
NSMutableDictionary *one=DYMutablePlist(empty.document),*node=(id)DYInsertTool(one,@"primary",@"base:primary");DYSeedPrimaryWorkingSpace(node,10,16);node[@"values"][@"cmexposure"]=@(-4);DYUniforms reduced=u;reduced.cm.exposure=-4;Pixels beforeOutput=renderPrimary(reduced,empty.document,@"primary-four-stop-root-before-output"),extra=renderPrimary(u,one,@"primary-four-stop-extra-before-output");Difference order=difference(beforeOutput,extra);run.record(@"primary-independent-grade-before-main-output",order.maximum<.002&&order.nonfinite==0,measure(order));
auto reducedScene=scene;for(auto &p:reducedScene){p.r/=16;p.g/=16;p.b/=16;}Pixels reducedInput=sceneInput(reducedScene);upload(reducedInput);Pixels knownReduced=renderPrimary(u,empty.document,@"primary-independent-OCIO-reduced-scene-input");Difference high=difference(beforeOutput,knownReduced);run.record(@"primary-highlights-recovered-before-mapping-reference",high.maximum<.008&&high.nonfinite==0,@{@"maxDifference":@(high.maximum),@"scene64afterMinus4":@((float)beforeOutput[7*4]),@"independentReference":@((float)knownReduced[7*4])});upload(logInput);
NSMutableArray *patches=[NSMutableArray array];for(int k=0;k<8;k++){size_t i=k*5;float a=logInput[i*4+3];[patches addObject:@{@"index":@(i),@"code":@[@(encodeCarrier((float)logInput[i*4]/a)),@(encodeCarrier((float)logInput[i*4+1]/a)),@(encodeCarrier((float)logInput[i*4+2]/a))],@"expectedMinus4Linear709":@[@((float)beforeOutput[i*4]/a),@((float)beforeOutput[i*4+1]/a),@((float)beforeOutput[i*4+2]/a)]}];}NSData *fixture=[NSJSONSerialization dataWithJSONObject:@{@"patches":patches,@"input":@"Sony S-Log3 / S-Gamut3.Cine code carrier",@"exposure":@(-4)} options:NSJSONWritingPrettyPrinted error:nil];[fixture writeToFile:[runtime stringByAppendingPathComponent:@"primary-host-chart.json"] atomically:YES];
// Local working curves are read from the node, including BASIS adapters.
node[@"values"][@"cmexposure"]=@0;node[@"values"][@"cmcontrast"]=@.3;Pixels localDI=renderPrimary(u,one,@"primary-local-DI-contrast");node[@"values"][@"cmworkingTransfer"]=@1;node[@"values"][@"cmworkingGamut"]=@2;Pixels localACES=renderPrimary(u,one,@"primary-local-ACES-contrast");run.record(@"primary-local-working-selection-is-effective",difference(localDI,localACES).maximum>.001);
node[@"values"][@"cminputTransfer"]=@1;node[@"values"][@"cminputGamut"]=@2;Pixels reinterpret=renderPrimary(u,one,@"primary-local-input-CST-selection");run.record(@"primary-local-input-CST-is-not-overridden",difference(reinterpret,localACES).maximum>.01);
// Zero masks and zero mix bypass grade while retaining global input/output.
NSMutableDictionary *mask=DYMutablePlist(DYNewMask(DYMaskRectangle)),*masked=DYMutablePlist(empty.document);DYMaskParameters mp=DYMaskAtTime(mask,kCMTimeZero);mp.strength=0;mask[@"parameters"]=[NSData dataWithBytes:&mp length:sizeof(mp)];masked[@"baseMasks"][@"primary"]=@[mask];Pixels zero=renderPrimary(reduced,masked,@"primary-zero-mask");reduced.cm.mix=0;Pixels zeroMix=renderPrimary(reduced,empty.document,@"primary-zero-grade-mix");run.record(@"primary-zero-mask-and-mix-retain-CST-boundaries",difference(zero,baseline).maximum==0&&difference(zeroMix,baseline).maximum==0);
// A half-strength one-stop grade is 1.5x light, before mapping.
DYUniforms half=u;half.cm.exposure=1;half.cm.mix=.5;Pixels halfFrame=renderPrimary(half,empty.document,@"primary-linear-light-half-mix");half.cm.exposure=log2f(1.5f);half.cm.mix=1;Pixels halfReference=renderPrimary(half,empty.document,@"primary-linear-light-mix-reference");run.record(@"primary-mix-in-linear-AP1",difference(halfFrame,halfReference).maximum<.003,measure(difference(halfFrame,halfReference)));
// Print looks cross into their real ACEScct domain, then return to the chosen
// working space. Neutral grade must not make the choice alter the print.
DYUniforms print=u;print.filmPrint.x=1;print.filmPrint.y=.6;Pixels printDI=renderPrimary(print,empty.document,@"primary-print-DWG-before-output");print.cm.workingTransfer=1;print.cm.workingGamut=2;Pixels printACES=renderPrimary(print,empty.document,@"primary-print-ACES-before-output");Difference printDelta=difference(printDI,printACES);run.record(@"primary-print-domain-adapts-to-selected-working-space",printDelta.maximum<.005&&difference(printDI,baseline).different>20,measure(printDelta));
// The output controls change data output, and the optional display map is last.
DYUniforms logOut=u;logOut.cm.outputTransfer=10;logOut.cm.outputGamut=16;logOut.cm.toneMapping=0;Pixels selectedOutput=renderPrimary(logOut,empty.document,@"primary-declared-Log-output");run.record(@"primary-declared-output-controls-restored",difference(intermediate,selectedOutput).maximum==0&&difference(selectedOutput,baseline).maximum>.05);
DYUniforms unmapped=u;unmapped.cm.toneMapping=0;Pixels noMap=renderPrimary(unmapped,empty.document,@"primary-no-output-tone-map");run.record(@"primary-tone-mapping-switch-restored",difference(noMap,baseline).maximum>.05);
DYUniforms invalid=data;invalid.hslHueA.x=20;NSError *e=nil;BOOL bounded=[primaryRenderer renderSource:source destination:destination uniforms:invalid paths:@{} spider:nil tools:empty.document colorManagement:v3 hostPrimaries:kFxColorPrimaries_Rec709 error:&e];run.record(@"primary-Log-data-output-rejects-SDR-finishing",!bounded&&e.localizedDescription.length>0);
DYUniforms bypass=u;bypass.primarySectionEnabled=0;bypass.hslHueA.x=20;Pixels bypassFrame=renderPrimary(bypass,empty.document,@"primary-main-eye-keeps-other-tools");Pixels oldBypass=render(run,primaryRenderer,source,destination,gpu,bypass,@{},@"primary-eye-unmanaged-reference");run.record(@"primary-main-eye-bypasses-whole-CST-retains-tools",difference(bypassFrame,oldBypass).maximum==0);
// Float domain crossings retain negative values, overrange and hidden RGB.
DYUniforms linear=u;linear.cm.inputTransfer=linear.cm.workingTransfer=linear.cm.outputTransfer=20;linear.cm.inputGamut=linear.cm.workingGamut=linear.cm.outputGamut=2;linear.cm.toneMapping=0;Pixels extended(width*height*4);for(size_t i=0;i<width*height;i++){float a=i%4?.25f:0;extended[i*4]=a?decodeCarrier(-.03f)*a:.07f;extended[i*4+1]=a?decodeCarrier(.18f)*a:-.02f;extended[i*4+2]=a?decodeCarrier(4.f)*a:.5f;extended[i*4+3]=a;}upload(extended);Pixels exact=renderPrimary(linear,empty.document,@"primary-negative-superwhite-hidden-RGB");run.record(@"primary-float-domain-identity-retains-extended-values",difference(extended,exact).maximum<.002&&difference(extended,exact).nonfinite==0,measure(difference(extended,exact)));linear.cm.exposure=1;Pixels doubled=renderPrimary(linear,empty.document,@"primary-linear-exposure-extended-values");BOOL photometric=YES;for(size_t i=1;i<width*height;i++)if(extended[i*4+3]>0){float a=extended[i*4+3];photometric&=fabs(encodeCarrier((float)doubled[i*4+1]/a)-.36f)<.002&&fabs(encodeCarrier((float)doubled[i*4]/a)+.06f)<.002;}run.record(@"primary-one-stop-exposure-is-linear-light-with-negative-values",photometric,@{@"negative":@(encodeCarrier((float)doubled[4]/.25f)),@"grey":@(encodeCarrier((float)doubled[5]/.25f))});upload(logInput);
DYUniforms idle=logOut;idle.texture=25;idle.textureEnabled=0;idle.postLUTStrength=0;idle.extraPostLUTStrengths[0]=.8;idle.extraLookSectionEnableds[0]=0;e=nil;BOOL idleOK=[primaryRenderer renderSource:source destination:destination uniforms:idle paths:@{@"look0":@"/nonexistent/disabled.cube",@"look1":@"/nonexistent/disabled2.cube"} spider:nil tools:empty.document colorManagement:v3 hostPrimaries:kFxColorPrimaries_Rec709 error:&e];run.record(@"primary-data-output-ignores-disabled-SDR-and-LUT-controls",idleOK&&difference(read(destination,gpu),selectedOutput).maximum==0,@{@"error":reason(e)});
// Actual inspector must expose all three sets of selectors in V3.
DYDiagnosticManager *host=[[[DYDiagnosticManager alloc]init]autorelease];DYCreateParameters(host,nil);DYAssetState *assets=[[[DYAssetState alloc]init]autorelease];assets.colorManagement=v3;DYWriteAssets(host,assets,kCMTimeZero);DYInspector *view=[[[DYInspector alloc]initWithAPIManager:host renderer:primaryRenderer]autorelease];[view refresh];[view setFrame:NSMakeRect(0,0,400,780)];[view layoutSubtreeIfNeeded];NSDictionary *tabs=[view valueForKey:@"tabs"];run.record(@"primary-inspector-no-v2-selector-override",![tabs[@"managedColor"]boolValue]&&[tabs[@"primaryCMS"]boolValue]);NSMenuItem *add=[[[NSMenuItem alloc]init]autorelease];add.representedObject=@"primary";[view addModule:add];NSDictionary *added=[DYReadTools(host,kCMTimeZero).document[@"layers"]lastObject];run.record(@"primary-inspector-add-layer-inherits-workspace",[added[@"values"][@"cminputTransfer"]isEqual:@10]&&[added[@"values"][@"cmoutputGamut"]isEqual:@16]&&[added[@"values"][@"cmtoneMapping"]isEqual:@0]);NSMutableDictionary *followed=DYMutablePlist(DYReadTools(host,kCMTimeZero).document);DYFollowPrimaryWorkingSpace(followed,1,2);NSDictionary *following=[followed[@"layers"]lastObject];run.record(@"primary-workspace-change-updates-inherited-domains",[following[@"values"][@"cminputTransfer"]isEqual:@1]&&[following[@"values"][@"cmworkingGamut"]isEqual:@2]&&[following[@"values"][@"cmoutputTransfer"]isEqual:@1]);DYWriteTools(host,followed,kCMTimeZero);DYToolManager *local=[[[DYToolManager alloc]initWithHost:host node:following]autorelease];UInt32 workingID=0;for(NSDictionary*d in DYDescriptors())if([d[@"key"]isEqual:@"cmworkingTransfer"])workingID=[d[@"pid"]unsignedIntValue];id<FxCustomParameterActionAPI_v4>action=[local apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];[action startAction:nil];[(id<FxParameterSettingAPI_v6>)local setFloatValue:10 toParameter:workingID atTime:kCMTimeZero];[action endAction:nil];followed=DYMutablePlist(DYReadTools(host,kCMTimeZero).document);DYFollowPrimaryWorkingSpace(followed,4,4);following=[followed[@"layers"]lastObject];run.record(@"primary-manual-local-space-retains-choice-and-follows-boundaries",[following[@"values"][@"cmworkingTransfer"]isEqual:@10]&&[following[@"values"][@"cminputTransfer"]isEqual:@4]&&[following[@"values"][@"cmoutputGamut"]isEqual:@4]&&[following[@"primaryFollow"]isEqual:@5]);NSDictionary *preset=[view presetSnapshot];run.record(@"primary-complete-preset-stores-v3-state",[preset[@"colorManagement"]isEqual:v3]&&[preset[@"version"]isEqual:@7]);
NSURL *cube=[NSURL fileURLWithPath:[runtime stringByAppendingPathComponent:@"primary-v3.cube"]];e=nil;BOOL exported=[primaryRenderer exportLUT:cube uniforms:logOut paths:@{} spider:nil tools:empty.document colorManagement:v3 error:&e];std::vector<float>table;NSUInteger side=0;BOOL parsed=exported&&DYLUTReadCube(cube.path,table,side,&e);run.record(@"primary-v3-Cube65-declared-encoding",parsed&&side==65&&[[NSString stringWithContentsOfURL:cube encoding:NSUTF8StringEncoding error:nil]containsString:@"V3 input"],@{@"error":reason(e)});
// Cube output follows the selected encoding, independent of the monitor.
linear.cm.exposure=0;linear.cm.outputGamut=22;float gammaValues[2]={};BOOL gammaExports=YES;int gammaIDs[]={1001,1003};for(int j=0;j<2;j++){linear.cm.outputTransfer=gammaIDs[j];NSURL *target=[NSURL fileURLWithPath:[runtime stringByAppendingPathComponent:[NSString stringWithFormat:@"primary-gamma-%d.cube",gammaIDs[j]]]];e=nil;BOOL ok=[primaryRenderer exportLUT:target uniforms:linear paths:@{} spider:nil tools:empty.document colorManagement:v3 error:&e];std::vector<float>values;NSUInteger n=0;ok=ok&&DYLUTReadCube(target.path,values,n,&e)&&n==65;gammaExports&=ok;if(ok)gammaValues[j]=values[((32*n+32)*n+32)*4];}run.record(@"primary-Cube-restores-output-gamma-selection",gammaExports&&fabs(gammaValues[0]-powf(.5f,1/2.2f))<.001&&fabs(gammaValues[1]-powf(.5f,1/2.6f))<.001,@{@"Gamma22":@(gammaValues[0]),@"Gamma26":@(gammaValues[1])});
upload(input);
}
@@ -0,0 +1,18 @@
// V3 uses the user's declared working encoding, never a hardcoded display space.
float4 cst_float_air(float4 sample, constant CSTParams& params);
float4 basis_float_air(float4 sample, constant BasisParams& params);
constant CSTParams dyPrimaryAP1To709={2,20,22,20,0};
kernel void dyPrimaryCST(texture2d<float,access::read> a [[texture(0)]],texture2d<float,access::write> b [[texture(1)]],constant CSTParams& p [[buffer(0)]],uint2 xy [[thread_position_in_grid]]){
if(any(xy>=uint2(b.get_width(),b.get_height())))return;float4 c=a.read(xy);if(c.a>0)c.rgb=cst_float_air(float4(c.rgb/c.a,1),p).rgb*c.a;b.write(c,xy);
}
kernel void dyPrimaryGrade(texture2d<float,access::read> a [[texture(0)]],texture2d<float,access::write> b [[texture(1)]],constant DayuRenderParams& p [[buffer(0)]],constant CSTParams& back [[buffer(1)]],uint2 xy [[thread_position_in_grid]]){
if(any(xy>=uint2(b.get_width(),b.get_height())))return;float4 c=a.read(xy);if(c.a>0){float4 v=float4(c.rgb/c.a,1);if(p.stages&1)v=cst_float_air(v,p.input);if(p.stages&2){if(p.reserved&8)v=cst_float_air(v,p.basisInput);v=basis_float_air(v,p.basis);if(p.reserved&8)v=cst_float_air(v,p.basisOutput);}if(p.stages&4)v=cst_float_air(v,p.output);if(back.inputTransfer!=back.outputTransfer||back.inputGamut!=back.outputGamut||back.toneMapping)v=cst_float_air(v,back);c.rgb=v.rgb*c.a;}b.write(c,xy);
}
kernel void dyPrimaryBlend(texture2d<float,access::read> before [[texture(0)]],texture2d<float,access::read> after [[texture(1)]],texture2d<float,access::write> output [[texture(2)]],device const DYToolMaskEntry* masks [[buffer(0)]],constant DYToolMaskHeader& h [[buffer(1)]],constant DYCSTMixParams& p [[buffer(2)]],uint2 xy [[thread_position_in_grid]]){
if(any(xy>=uint2(output.get_width(),output.get_height())))return;float4 a=before.read(xy),b=after.read(xy);if(!(a.a>0)||!(b.a>0)){output.write(a,xy);return;}float3 ac=cst_float_air(float4(a.rgb/a.a,1),p.toLinear).rgb,bc=cst_float_air(float4(b.rgb/b.a,1),p.toLinear).rgb;
float2 uv=(float2(xy)+.5f)/float2(output.get_width(),output.get_height());float w=p.amount;if(h.count)w*=dyToolCoverage(uv,dyToolEncode(cst_float_air(float4(ac,1),dyPrimaryAP1To709).rgb),masks,h,h.section);
if(w<=0){output.write(a,xy);return;}if(w>=1){output.write(b,xy);return;}output.write(float4(cst_float_air(float4(mix(ac,bc,w),1),p.fromLinear).rgb*a.a,a.a),xy);
}
kernel void dyPrimaryCodeOutput(texture2d<float,access::read> a [[texture(0)]],texture2d<float,access::write> b [[texture(1)]],uint2 xy [[thread_position_in_grid]]){
if(any(xy>=uint2(b.get_width(),b.get_height())))return;float4 c=a.read(xy);if(c.a>0)c.rgb=dyDecode(c.rgb/c.a)*c.a;b.write(c,xy);
}
+41
查看文件
@@ -0,0 +1,41 @@
// Opt-in V3. The root primary owns input/working/output; V1/V2 stay frozen.
- (BOOL)renderPrimarySource:(FxImageTile*)src destination:(FxImageTile*)dst uniforms:(DYUniforms)u paths:(NSDictionary*)paths spider:(NSData*)spider tools:(NSDictionary*)tools hostPrimaries:(NSInteger)primaries error:(NSError**)error {
// The main eye bypasses the whole primary/CST module. Other tools retain
// their established unmanaged host workflow rather than inheriting a Log tag.
if(u.primarySectionEnabled<.5||DYBaseToolRemoved(tools,@"primary"))return [self renderSource:src destination:dst uniforms:u paths:paths spider:spider tools:tools error:error];
NSMutableDictionary*entry=[self device:dst.deviceRegistryID error:error];if(!entry)return NO;id<MTLDevice>d=entry[@"device"];id<MTLTexture>source=[src metalTextureForDevice:d];if(!source)return fail(error,@"一级 CST 输入纹理不可用。");
uint64_t pixels=uint64_t(source.width)*source.height;if(!pixels||pixels>64ull*1024*1024||pixels*16*8>MAX(768ull*1024*1024,MIN(2ull*1024*1024*1024,d.recommendedMaxWorkingSetSize/2)))return fail(error,@"当前画面超过一级 CST 内存预算。");
DYApplyRemovedBaseTools(&u,tools);BOOL root=u.primarySectionEnabled>.5;BOOL transparent=identityCM(u)&&!DYFilmPrintActive(u);int wt=lroundf(u.cm.workingTransfer),wg=lroundf(u.cm.workingGamut);
NSMutableArray*pool=[NSMutableArray array];NSMutableSet*pinned=[NSMutableSet set];id<MTLTexture>current=nil;
auto next=[&]()->id<MTLTexture>{for(id<MTLTexture>t in pool)if(t!=current&&![pinned containsObject:t])return t;MTLTextureDescriptor*td=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA32Float width:source.width height:source.height mipmapped:NO];td.storageMode=MTLStorageModePrivate;td.usage=MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite|MTLTextureUsageRenderTarget;id<MTLTexture>t=[d newTextureWithDescriptor:td];if(t){[pool addObject:t];[t release];}return t;};
auto dispatch=[&](NSString*name,const void*params,NSUInteger length,const void*extra=nullptr,NSUInteger extraLength=0){id<MTLTexture>out=next();if(!out)return fail(error,@"无法分配一级 CST 缓冲区。");BOOL ok=[self managedDispatch:name textures:@[current,out] data:params length:length extra:extra extraLength:extraLength entry:entry error:error];if(ok)current=out;return ok;};
auto transform=[&](CSTParams p){if(p.inputTransfer==p.outputTransfer&&p.inputGamut==p.outputGamut&&!p.toneMapping)return YES;return dispatch(@"dyPrimaryCST",&p,sizeof(p));};
auto tile=[&](id<MTLTexture>t){DYExportTile*v=[[[DYExportTile alloc]initWithTexture:t registry:d.registryID]autorelease];[v setBounds:src.tilePixelBounds origin:src.imageOrigin];[v setPixelAspect:src.pixelAspect];return v;};
auto blend=[&](id<MTLTexture>before,NSArray*masks,float amount,NSString*type){if(!masks.count&&amount>=1)return YES;id<MTLTexture>out=next();if(!out)return fail(error,@"无法分配一级混合缓冲区。");DYToolMaskHeader h{};id<MTLBuffer>mb=[self maskBuffer:@{type:masks?:@[]} tile:src device:d header:&h];h.section=(int)[DYToolTypes()indexOfObject:type];DYCSTMixParams p={{wg,wt,2,20,0},{2,20,wg,wt,0},amount};id<MTLComputePipelineState>pipeline=[self managedKernel:@"dyPrimaryBlend" entry:entry error:error];if(!pipeline||!mb)return NO;id<MTLCommandBuffer>cb=[entry[@"queue"]commandBuffer];id<MTLComputeCommandEncoder>ce=[cb computeCommandEncoder];[ce setComputePipelineState:pipeline];[ce setTexture:before atIndex:0];[ce setTexture:current atIndex:1];[ce setTexture:out atIndex:2];[ce setBuffer:mb offset:0 atIndex:0];[ce setBytes:&h length:sizeof(h) atIndex:1];[ce setBytes:&p length:sizeof(p) atIndex:2];[ce dispatchThreads:MTLSizeMake(source.width,source.height,1) threadsPerThreadgroup:MTLSizeMake(16,16,1)];[ce endEncoding];[cb commit];[cb waitUntilCompleted];if(cb.status!=MTLCommandBufferStatusCompleted)return fail(error,cb.error.localizedDescription);current=out;return YES;};
auto grade=[&](DYUniforms values,NSArray*masks,BOOL local){if(values.primarySectionEnabled<.5||values.cm.mix<=0)return YES;DYUniforms neutral=values;neutral.inputSectionEnabled=neutral.cm.outputEnabled=0;BOOL gradeNeutral=identityCM(neutral);if(!local&&gradeNeutral)return YES;if(local&&identityCM(values))return YES;
DayuRenderParams p=DYCMRender(values.cm);p.input.toneMapping=0;if((int)lroundf(values.cm.workingTransfer)==20){p.reserved|=8;p.basis.colorspace=10;p.basisInput={(int)lroundf(values.cm.workingGamut),20,(int)lroundf(values.cm.workingGamut),10,0};p.basisOutput={(int)lroundf(values.cm.workingGamut),10,(int)lroundf(values.cm.workingGamut),20,0};}CSTParams back={wg,wt,wg,wt,0};
if(local){p.stages=(values.inputSectionEnabled>.5?1:0)|(gradeNeutral?0:2)|(values.cm.outputEnabled>.5?4:0);back={values.cm.outputEnabled>.5?(int)lroundf(values.cm.outputGamut):(int)lroundf(values.cm.workingGamut),values.cm.outputEnabled>.5?(int)lroundf(values.cm.outputTransfer):(int)lroundf(values.cm.workingTransfer),wg,wt,0};}
else{p.stages=2;}
id<MTLTexture>before=current;[pinned addObject:before];BOOL ok=dispatch(@"dyPrimaryGrade",&p,sizeof(p),&back,sizeof(back));if(ok)ok=blend(before,masks,values.cm.mix,@"primary");[pinned removeObject:before];return ok;
};
auto print=[&](DYUniforms values,NSArray*masks){if(!DYFilmPrintActive(values))return YES;NSArray*names=@[@"",@"kodak_2383",@"kodak_2393",@"kodak_2302_bw",@"fuji_3510",@"fuji_3513",@"fuji_3519",@"fuji_3521",@"agfa_cp30"];NSString*path=[[NSBundle bundleForClass:self.class]pathForResource:names[(int)values.filmPrint.x] ofType:@"dylut" inDirectory:@"PrintLooks"];id<MTLTexture>cube=path?[self lut:path entry:entry error:error]:nil;if(!cube)return fail(error,@"印片资源不可用。");id<MTLTexture>before=current;[pinned addObject:before];BOOL ok=transform({wg,wt,2,1,0});float amount=values.filmPrint.y*values.film.mix;if(ok){id<MTLTexture>out=next();ok=out&&[self managedDispatch:@"dyManagedPrint" textures:@[current,cube,out] data:&amount length:4 extra:nullptr extraLength:0 entry:entry error:error];if(ok)current=out;}if(ok)ok=transform({2,1,wg,wt,0});if(ok)ok=blend(before,masks,1,@"film");[pinned removeObject:before];return ok;};
// Recover only the pre-existing explicit code-value carrier. No display
// transform or host-profile-to-709 conversion precedes the declared input.
current=source;id<MTLTexture>carrier=next();uint32_t noLUT=0;if(!carrier||![self managedDispatch:@"dyManagedCarrier" textures:@[current,carrier,entry[@"identity"]] data:&noLUT length:4 extra:nullptr extraLength:0 entry:entry error:error])return NO;current=carrier;
if(root&&u.inputSectionEnabled>.5&&!transform({(int)lroundf(u.cm.inputGamut),(int)lroundf(u.cm.inputTransfer),wg,wt,0}))return NO;
if(!grade(u,tools[@"baseMasks"][@"primary"],NO))return NO;
NSMutableDictionary*finishing=DYMutablePlist(tools);NSMutableSet*scene=[NSMutableSet set];for(NSString*ID in DYToolDisplayOrder(tools)){NSDictionary*node=DYToolWithID(tools,ID);if([node[@"type"]isEqual:@"primary"]){transparent&=identityCM(DYToolUniforms(node));if(!grade(DYToolUniforms(node),node[@"masks"],YES))return NO;[scene addObject:ID];}}
if(!print(u,tools[@"baseMasks"][@"film"]))return NO;for(NSString*ID in DYToolDisplayOrder(tools)){NSDictionary*node=DYToolWithID(tools,ID);if([node[@"type"]isEqual:@"film"]){transparent&=!DYFilmPrintActive(DYToolUniforms(node));if(!print(DYToolUniforms(node),node[@"masks"]))return NO;}}
for(NSString*ID in scene)DYRemoveTool(finishing,ID);for(NSMutableDictionary*node in finishing[@"layers"])if([node[@"type"]isEqual:@"film"])node[@"values"][@"filmPrintLook"]=@0;
BOOL outputEnabled=root&&u.cm.outputEnabled>.5;int ot=outputEnabled?lroundf(u.cm.outputTransfer):wt,og=outputEnabled?lroundf(u.cm.outputGamut):wg;
// Only this stage owns the main display rendering / tone mapping.
if(outputEnabled&&!transform(DYCMRender(u.cm).output))return NO;
u.primarySectionEnabled=0;u.cm.configured=-1;u.inputProfile=u.preLUTStrength=0;u.filmPrint.x=0;NSDictionary*finishPaths=DYVisibleBaseToolPaths(paths,finishing);NSArray*activeFinish=DYPrimaryActiveFinishing(u,finishPaths,spider,finishing);
BOOL display=outputEnabled&&ot>=1001&&ot<=1003;
if(!display&&activeFinish.count)return fail(error,@"当前是 Log/线性码值输出。SDR 修饰工具需要显示输出,请选择 Gamma 输出,或关闭这些工具并保存完整预设。");
if(!display&&transparent&&!activeFinish.count){current=source;[self managedPreview:current origin:src.imageOrigin entry:entry];}else if(display&&_exporting&&!activeFinish.count){if(!dispatch(@"dyPrimaryCodeOutput",nullptr,0))return NO;}else if(display){if(!transform({og,ot,22,20,0}))return NO;[self managedPreview:current origin:src.imageOrigin entry:entry];
if(activeFinish.count){id<MTLTexture>out=next();if(!out)return fail(error,@"无法分配 SDR 修饰缓冲区。");_managedFinishing=YES;BOOL ok=NO;@try{ok=[self renderSource:tile(current) destination:tile(out) uniforms:u paths:finishPaths spider:spider tools:finishing error:error];}@finally{_managedFinishing=NO;}if(!ok)return NO;current=out;}
if(_exporting){if(!transform({22,20,og,ot,0})||!dispatch(@"dyPrimaryCodeOutput",nullptr,0))return NO;}else{CGColorSpaceRef from=CGColorSpaceCreateWithName(kCGColorSpaceExtendedLinearSRGB),to=DYManagedTileSpace(dst,primaries);DYColorProfile*p=to?[[[DYColorProfile alloc]initWithSource:from target:to error:error]autorelease]:nil;CGColorSpaceRelease(from);if(to)CGColorSpaceRelease(to);if(!p)return fail(error,@"宿主未提供明确的目标颜色空间。");id<MTLTexture>out=next();if(!out||![self managedProfile:p input:current output:out entry:entry error:error])return NO;current=out;}
}else{if(!dispatch(@"dyPrimaryCodeOutput",nullptr,0))return NO;[self managedPreview:current origin:src.imageOrigin entry:entry];}
_managedFinishing=YES;@try{return [self copyTile:tile(current) to:dst entry:entry error:error];}@finally{_managedFinishing=NO;}
}
+18 -1
查看文件
@@ -83,6 +83,22 @@ static NSArray *DYManagedActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
}
for(NSDictionary *node in tools[@"layers"])if(!DYToolIsNeutral(node))[active addObject:node[@"type"]];return active;
}
// V3 eligibility is based on active math, not differences in disabled switches.
// Keep the historical V2 predicate/render behavior unchanged.
static NSArray *DYPrimaryActiveFinishing(DYUniforms u,NSDictionary *paths,NSData *spider,NSDictionary *tools){
auto normalize=[](DYUniforms v){
float *values=&v.exposure,*flags=&v.exposureEnabled;
for(int i=0;i<13;i++){BOOL group=i>=6&&i<=9?v.colorSectionEnabled>.5:v.baseSectionEnabled>.5;if(!group||flags[i]<.5)values[i]=0;flags[i]=1;}
for(NSDictionary *section in DYSections())for(NSDictionary *row in section[@"rows"])if(row[@"enabled"]){
for(NSDictionary *flag in DYDescriptors())if([flag[@"pid"]isEqual:row[@"enabled"]]&&[flag[@"offset"]integerValue]>=0){float*f=(float*)((uint8_t*)&v+[flag[@"offset"]unsignedIntegerValue]);if(*f<.5&&[row[@"offset"]integerValue]>=0)*(float*)((uint8_t*)&v+[row[@"offset"]unsignedIntegerValue])=[row[@"default"]floatValue];*f=[flag[@"default"]floatValue];}
}
v.postLUTStrength=1;for(int i=0;i<4;i++){v.extraPostLUTStrengths[i]=1;v.extraLookSectionEnableds[i]=1;}
return v;
};
auto visiblePaths=[](NSDictionary*p,DYUniforms v){NSMutableDictionary*out=[[p mutableCopy]autorelease]?:[NSMutableDictionary dictionary];for(int i=0;i<5;i++)if(v.lookSectionEnabled<.5||(i>0&&v.extraLookSectionEnableds[i-1]<.5)||(i==0?v.postLUTStrength:v.extraPostLUTStrengths[i-1])<=0)[out removeObjectForKey:[NSString stringWithFormat:@"look%d",i]];return out;};
NSDictionary*rootPaths=visiblePaths(paths,u);u=normalize(u);NSMutableDictionary*doc=DYMutablePlist(tools);for(NSMutableDictionary*node in doc[@"layers"]){DYUniforms original=DYToolUniforms(node),v=normalize(original);NSMutableDictionary*values=[NSMutableDictionary dictionary];for(NSDictionary*d in DYBaseToolDescriptors(node[@"type"]))if([d[@"offset"]integerValue]>=0)values[d[@"key"]]=@(*(float*)((uint8_t*)&v+[d[@"offset"]unsignedIntegerValue]));node[@"values"]=values;node[@"paths"]=visiblePaths(node[@"paths"],original);}
return DYManagedActiveFinishing(u,rootPaths,spider,doc);
}
@interface DYRenderer(){
NSMutableDictionary *_devices,*_luts,*_preparedLUTs;
NSSet *_activeLUTPaths;
@@ -98,6 +114,7 @@ static NSArray *DYManagedActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
@end
@implementation DYRenderer
#include "DYFilmRender.inc.h"
#include "DYPrimaryRender.inc.h"
#include "DYManagedRender.inc.h"
#include "DYToolRender.inc.h"
- (instancetype)init{if((self=[super init])){_previewLock=[NSObject new];_devices=[NSMutableDictionary new];_luts=[NSMutableDictionary new];_preparedLUTs=[NSMutableDictionary new];_activeLUTPaths=[NSSet new];_lutPreparationQueue=dispatch_queue_create("com.dayu.color.lut-upload",DISPATCH_QUEUE_SERIAL);dispatch_set_target_queue(_lutPreparationQueue,dispatch_get_global_queue(QOS_CLASS_USER_INITIATED,0));_tables=[DYColorTables new];}return self;}
@@ -238,7 +255,7 @@ static NSArray *DYManagedActiveFinishing(DYUniforms u,NSDictionary *paths,NSData
if(ok)[output getBytes:_exportManagedState?(void*)precise.data():(void*)values.data() bytesPerRow:width*(_exportManagedState?16: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=_exportManagedState?precise[i*4+c]:(float)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]];}
if(_exportManagedState){NSData *metadata=[NSJSONSerialization dataWithJSONObject:_exportManagedState options:NSJSONWritingSortedKeys error:nil];if(metadata)[text insertString:[NSString stringWithFormat:@"# DAYU_CMS_STATE %@\n",[[[NSString alloc]initWithData:metadata encoding:NSUTF8StringEncoding]autorelease]] atIndex:0];[text replaceOccurrencesOfString:@"LUT_3D_SIZE 33" withString:@"LUT_3D_SIZE 65" options:0 range:NSMakeRange(0,text.length)];[text insertString:@"# V2 input: declared camera/LUT code values, or sRGB in host mode. Output: sRGB / Rec.709.\n" atIndex:0];}
if(_exportManagedState){NSData *metadata=[NSJSONSerialization dataWithJSONObject:_exportManagedState options:NSJSONWritingSortedKeys error:nil];if(metadata)[text insertString:[NSString stringWithFormat:@"# DAYU_CMS_STATE %@\n",[[[NSString alloc]initWithData:metadata encoding:NSUTF8StringEncoding]autorelease]] atIndex:0];[text replaceOccurrencesOfString:@"LUT_3D_SIZE 33" withString:@"LUT_3D_SIZE 65" options:0 range:NSMakeRange(0,text.length)];if(DYPrimaryColorState(_exportManagedState)){[text insertString:[NSString stringWithFormat:@"# V3 input/output: code values defined by enabled primary CST stages; a disabled primary passes unmanaged host code values.\n# PRIMARY_CST enabled=%d input=%d/%d working=%d/%d output=%d/%d mapping=%d\n",u.primarySectionEnabled>.5,(int)(u.inputSectionEnabled>.5?u.cm.inputTransfer:u.cm.workingTransfer),(int)(u.inputSectionEnabled>.5?u.cm.inputGamut:u.cm.workingGamut),(int)u.cm.workingTransfer,(int)u.cm.workingGamut,(int)(u.cm.outputEnabled>.5?u.cm.outputTransfer:u.cm.workingTransfer),(int)(u.cm.outputEnabled>.5?u.cm.outputGamut:u.cm.workingGamut),(int)u.cm.toneMapping] atIndex:0];}else [text insertString:@"# V2 input: declared camera/LUT code values, or sRGB in host mode. Output: sRGB / Rec.709.\n" atIndex:0];}
return [text writeToURL:url atomically:YES encoding:NSUTF8StringEncoding error:err];
}}
@end
+2 -2
查看文件
@@ -12,7 +12,7 @@
- (void)toolMask:(NSButton*)sender{if(sender.tag<0||sender.tag>=_cards.count)return;[(DYToolMaskPanel*)_cards[sender.tag][@"maskPanel"]addMenu:sender];}
- (void)repeatTool:(NSButton*)sender{
if(sender.tag<0||sender.tag>=_cards.count)return;id<PROAPIAccessing>host=_embedded?[(DYToolManager*)_manager host]:_manager;id<FxCustomParameterActionAPI_v4>a=[host apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(!a)return;[a startAction:self];
NSString *addedID=nil;@try{NSMutableDictionary *doc=DYMutablePlist(DYReadTools(host,a.currentTime).document);if([doc[@"layers"]count]>=DYToolLimit){[self showError:@"最多可添加 32 个独立工具层。"];return;}NSString *type=_cards[sender.tag][@"section"][@"key"],*anchor=_embedded?[(DYToolManager*)_manager nodeID]:[@"base:" stringByAppendingString:type];NSDictionary *node=DYInsertTool(doc,type,anchor);if(!node)return;addedID=[node[@"id"]copy];id<FxUndoAPI>undo=[host apiForProtocol:@protocol(FxUndoAPI)];[undo startUndoGroup:@"再加一层初始化工具"];DYWriteTools(host,doc,a.currentTime);[undo endUndoGroup];}@finally{[a endAction:self];}[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:host userInfo:@{@"scrollToTool":addedID?:@""}];[addedID release];
NSString *addedID=nil;@try{NSMutableDictionary *doc=DYMutablePlist(DYReadTools(host,a.currentTime).document);if([doc[@"layers"]count]>=DYToolLimit){[self showError:@"最多可添加 32 个独立工具层。"];return;}NSString *type=_cards[sender.tag][@"section"][@"key"],*anchor=_embedded?[(DYToolManager*)_manager nodeID]:[@"base:" stringByAppendingString:type];NSMutableDictionary *node=(id)DYInsertTool(doc,type,anchor);if(!node)return;if(DYPrimaryColorState(DYReadAssets(host,a.currentTime).colorManagement)){DYUniforms root;DYReadUniforms(host,a.currentTime,&root);DYSeedPrimaryWorkingSpace(node,root.cm.workingTransfer,root.cm.workingGamut);}addedID=[node[@"id"]copy];id<FxUndoAPI>undo=[host apiForProtocol:@protocol(FxUndoAPI)];[undo startUndoGroup:@"再加一层初始化工具"];DYWriteTools(host,doc,a.currentTime);[undo endUndoGroup];}@finally{[a endAction:self];}[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:host userInfo:@{@"scrollToTool":addedID?:@""}];[addedID release];
}
- (void)addModule:(NSMenuItem *)sender{
if(_embedded)return;NSString *type=sender.representedObject;for(NSUInteger i=0;i<_cards.count;i++)if([_cards[i][@"section"][@"key"]isEqual:type]){NSButton *source=[[[NSButton alloc]init]autorelease];source.tag=i;[self repeatTool:source];return;}
@@ -51,4 +51,4 @@
- (CGFloat)layoutRepeatedToolsAfter:(NSString*)anchor y:(CGFloat)y width:(CGFloat)w {if(_embedded)return y;for(NSString *ID in _stackOrder)if([_stackRoots[ID]isEqual:anchor]){DYInspector *child=_stackViews[ID];child.frame=NSMakeRect(0,y,w,MAX(60,child->_stackHeight));[child layoutSubtreeIfNeeded];CGFloat height=MAX(60,child->_stackHeight);child.frame=NSMakeRect(0,y,w,height);y+=height;}return y;}
- (void)resetRepeatedTool{if(!_embedded)return;id<PROAPIAccessing>host=[(DYToolManager*)_manager host];id<FxCustomParameterActionAPI_v4>a=[host apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(!a)return;[a startAction:self];@try{NSMutableDictionary *doc=DYMutablePlist(DYReadTools(host,a.currentTime).document);NSMutableDictionary *node=(id)DYToolWithID(doc,[(DYToolManager*)_manager nodeID]);if(!node)return;NSDictionary *fresh=DYNewTool(node[@"type"]);node[@"values"]=fresh[@"values"];node[@"paths"]=@{};[node removeObjectForKey:@"spider"];node[@"spiderLinked"]=@YES;id<FxUndoAPI>undo=[host apiForProtocol:@protocol(FxUndoAPI)];[undo startUndoGroup:@"还原独立工具层"];DYWriteTools(host,doc,a.currentTime);[undo endUndoGroup];}@finally{[a endAction:self];}[self postChanged];}
- (void)resetRepeatedTool{if(!_embedded)return;id<PROAPIAccessing>host=[(DYToolManager*)_manager host];id<FxCustomParameterActionAPI_v4>a=[host apiForProtocol:@protocol(FxCustomParameterActionAPI_v4)];if(!a)return;[a startAction:self];@try{NSMutableDictionary *doc=DYMutablePlist(DYReadTools(host,a.currentTime).document);NSMutableDictionary *node=(id)DYToolWithID(doc,[(DYToolManager*)_manager nodeID]);if(!node)return;NSDictionary *fresh=DYNewTool(node[@"type"]);node[@"values"]=DYMutablePlist(fresh[@"values"]);if(DYPrimaryColorState(DYReadAssets(host,a.currentTime).colorManagement)){DYUniforms root;DYReadUniforms(host,a.currentTime,&root);DYSeedPrimaryWorkingSpace(node,root.cm.workingTransfer,root.cm.workingGamut);}node[@"paths"]=@{};[node removeObjectForKey:@"spider"];node[@"spiderLinked"]=@YES;id<FxUndoAPI>undo=[host apiForProtocol:@protocol(FxUndoAPI)];[undo startUndoGroup:@"还原独立工具层"];DYWriteTools(host,doc,a.currentTime);[undo endUndoGroup];}@finally{[a endAction:self];}[self postChanged];}
+2 -1
查看文件
@@ -78,6 +78,7 @@ BOOL DYValidToolDocument(NSDictionary *doc){
NSMutableSet *ids=[NSMutableSet set];for(NSString *key in doc[@"baseMasks"]){if(![DYToolTypes()containsObject:key]||!validMasks(doc[@"baseMasks"][key],ids))return NO;}
NSMutableDictionary *descriptors=[NSMutableDictionary dictionary];for(NSDictionary *d in DYDescriptors())descriptors[d[@"key"]]=d;
for(NSDictionary *node in doc[@"layers"]){if(![node isKindOfClass:NSDictionary.class]||!validID(node[@"id"])||[ids containsObject:node[@"id"]]||![DYToolTypes()containsObject:node[@"type"]]||![node[@"values"]isKindOfClass:NSDictionary.class]||[node[@"values"]count]>descriptors.count||![node[@"paths"]isKindOfClass:NSDictionary.class]||[node[@"paths"]count]>6||!validMasks(node[@"masks"],ids))return NO;[ids addObject:node[@"id"]];
if(node[@"primaryFollow"]&&(![node[@"type"]isEqual:@"primary"]||!finiteNumber(node[@"primaryFollow"])||[node[@"primaryFollow"]doubleValue]!=floor([node[@"primaryFollow"]doubleValue])||[node[@"primaryFollow"]integerValue]<0||[node[@"primaryFollow"]integerValue]>7))return NO;
for(NSString *key in node[@"values"]){NSDictionary *d=descriptors[key];id v=node[@"values"][key];if(!d||!finiteNumber(v)||[v doubleValue]<[d[@"min"]doubleValue]||[v doubleValue]>[d[@"max"]doubleValue]||(d[@"values"]&&![d[@"values"]containsObject:@((int)llround([v doubleValue]))]))return NO;}
for(id key in node[@"paths"]){id p=node[@"paths"][key];if(![@[@"input",@"look0",@"look1",@"look2",@"look3",@"look4"]containsObject:key]||![p isKindOfClass:NSString.class]||[p length]>8192||![p isAbsolutePath]||![[p pathExtension].lowercaseString isEqual:@"cube"])return NO;}if(node[@"spider"]&&(![node[@"spider"]isKindOfClass:NSData.class]||!DYSpiderMeshIsValid(node[@"spider"])))return NO;
}
@@ -137,7 +138,7 @@ BOOL DYToolIsNeutral(NSDictionary *node){NSString *type=node[@"type"];DYUniforms
- (CMTime)currentTime{return _time;}
- (NSDictionary*)node{return DYToolWithID(_pending?:DYReadTools(_host,_time).document,_nodeID);}
- (BOOL)getFloatValue:(double*)out fromParameter:(UInt32)pid atTime:(CMTime)t{NSDictionary *n=[self node];DYUniforms u=DYToolUniforms(n?:@{@"type":_type});for(NSDictionary *d in DYDescriptors())if([d[@"pid"]unsignedIntValue]==pid){*out=[d[@"offset"]integerValue]>=0?*(float*)((uint8_t*)&u+[d[@"offset"]unsignedIntegerValue]):[d[@"default"]doubleValue];return YES;}return NO;}
- (BOOL)setFloatValue:(double)v toParameter:(UInt32)pid atTime:(CMTime)t{if(!_depth||!std::isfinite(v))return NO;NSMutableDictionary *n=(id)[self node];if(!n)return NO;for(NSDictionary *d in DYDescriptors())if([d[@"pid"]unsignedIntValue]==pid){n[@"values"][d[@"key"]]=@(v);return YES;}return NO;}
- (BOOL)setFloatValue:(double)v toParameter:(UInt32)pid atTime:(CMTime)t{if(!_depth||!std::isfinite(v))return NO;NSMutableDictionary *n=(id)[self node];if(!n)return NO;for(NSDictionary *d in DYDescriptors())if([d[@"pid"]unsignedIntValue]==pid){NSString *key=d[@"key"];if(n[@"primaryFollow"]&&([key hasSuffix:@"Transfer"]||[key hasSuffix:@"Gamut"])){NSUInteger bit=[key hasPrefix:@"cminput"]?1:[key hasPrefix:@"cmworking"]?2:[key hasPrefix:@"cmoutput"]?4:0;n[@"primaryFollow"]=@([n[@"primaryFollow"]unsignedIntegerValue]&~bit);}n[@"values"][key]=@(v);return YES;}return NO;}
- (BOOL)getCustomParameterValue:(id*)out fromParameter:(UInt32)pid atTime:(CMTime)t{if(pid==DYAssetsParameterID){DYAssetState *a=[[[DYAssetState alloc]init]autorelease];NSDictionary *n=[self node];a.paths=n[@"paths"]?:@{};a.spiderMesh=n[@"spider"];a.spiderLinked=[n[@"spiderLinked"]boolValue];*out=a;return YES;}if(pid==DYInspectorParameterID){DYInspectorToken *global=_token; if(!global)[[_host apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)]getCustomParameterValue:&global fromParameter:pid atTime:t];DYInspectorToken *local=[[[DYInspectorToken alloc]init]autorelease];NSMutableDictionary *folds=[NSMutableDictionary dictionary];for(NSString *key in global.folds)if([key hasPrefix:[_nodeID stringByAppendingString:@":"]])folds[[key substringFromIndex:_nodeID.length+1]]=global.folds[key];local.folds=folds;*out=local;return YES;}return NO;}
- (BOOL)setCustomParameterValue:(id)v toParameter:(UInt32)pid atTime:(CMTime)t{if(!_depth)return NO;NSMutableDictionary *n=(id)[self node];if(!n)return NO;if(pid==DYAssetsParameterID&&[v isKindOfClass:DYAssetState.class]){n[@"paths"]=DYMutablePlist([v paths]);if([v spiderMesh])n[@"spider"]=[v spiderMesh];else[n removeObjectForKey:@"spider"];n[@"spiderLinked"]=@([v spiderLinked]);return YES;}if(pid==DYInspectorParameterID){DYInspectorToken *old=nil;[[_host apiForProtocol:@protocol(FxParameterRetrievalAPI_v6)]getCustomParameterValue:&old fromParameter:pid atTime:t];[_token release];_token=old?[old copy]:[DYInspectorToken new];NSMutableDictionary *folds=[[_token.folds mutableCopy]autorelease];for(NSString *key in [v folds])folds[[_nodeID stringByAppendingFormat:@":%@",key]]=[v folds][key];_token.folds=folds;return YES;}return NO;}
@end
+3 -3
查看文件
@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.8.0</string>
<string>1.8.1</string>
<key>CFBundleVersion</key>
<string>55</string>
<string>57</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>PlugInKit</key>
@@ -71,7 +71,7 @@
<key>uuid</key>
<string>1C17B73B-F229-4C09-A434-EAF6DFF5F22A</string>
<key>version</key>
<string>1.8.0</string>
<string>1.8.1</string>
</dict>
<dict>
<key>className</key>
+2 -2
查看文件
@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.8.0</string>
<string>1.8.1</string>
<key>CFBundleVersion</key>
<string>55</string>
<string>57</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>