Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.
C++
feat(color): T2a ColorSettings model and preset schema v18
Veyra Goal Agentd3fbdb7aadd1
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex cbc2e68b..1686852b 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -1,5 +1,27 @@# 2026-09-11 继续修复目标模式执行中+## 2026-09-17 色彩页 P1:T2a 色彩数据模型 + 预设 schema v18++- 新增 `include/veyra/engine/ColorSettings.h`:LR 对齐的 P1 色彩模型(白平衡、亮、存在感、参数/点曲线 5 通道、+ 混色器 HSL 8 色、黑白混色器、颜色分级 4 区 + 混合/平衡、校准、3D LUT 引用与强度/输入空间),+ 默认值全中性,`validate()` 覆盖每个控件范围、曲线点必须按 x 递增;`neutral()` 供"未调色直接跳过 pass"使用;+- LUT 引用用**定长宽字符缓冲 + 文件名校验**(禁路径分隔符)而不是 `std::wstring`:+ `EnhancementSettings` 要能进导出作业的共享内存头(`ExportJobManager` 的+ `static_assert(is_trivially_copyable_v<Shared>)`),绝对路径在跨进程导出里也是错的,导出端按名字在+ `runtime_local/luts` 解析;+- `EnhancementSettings` 增加 `ColorSettings color`,`validate()` 转发;**加入 `sameVideoConfiguration()` 的+ 排除清单**:改调色只更新 uniform/资源,不重建图(P1 验收项之一);+- `PresetStore` schema v17 → **v18**:每条记录行尾追加色彩块(`writeColorSettings`/`readColorSettings`,+ UTF-8,由 PresetStore 负责 LUT 名字的宽窄转换);v1–v17 旧文件仍可读,新版本读到旧文件走默认色彩;+- `tests/unit/RepairPresetTests.cpp`:全字段往返加入色彩(含曲线、分级、混色器、黑白、校准、LUT),+ 负例覆盖"分级色相 400 / 曝光 6 / LUT 空间 3 / 曲线点乱序"必须被拒绝;legacy 迁移用例的版本断言改为 18。++命令与结果:构建 exit 0;`veyra_repair_preset_tests <新文件>` → `legacy/current backend migration cases=66` ++`preset roundtrip, all fields, ...=1`(exit 0);`scripts/gates/delivery.ps1` → `DELIVERY SHORT GATE PASS`+(`logs/delivery/fa493da345634e74b7f866115d6bc879/result.json`,覆盖导出作业与共享内存头)。++未完成:T2b(全浮点调色 pass + `gpuGradeP95Ms` 计时)、T3–T6。+## 2026-09-17 色彩页 P1:T0 删预设入口 + T1 NR 剔除区羽化(含两个设置记忆缺陷修复)目标(用户指令):按 `docs/COLOR_TAB_LR_FEATURE_PLAN_2026-09-17.md` v3 开工,先落 T0/T1。diff --git a/include/veyra/engine/ColorSettings.h b/include/veyra/engine/ColorSettings.hnew file mode 100644index 00000000..4a5f8537--- /dev/null+++ b/include/veyra/engine/ColorSettings.h@@ -0,0 +1,183 @@+#pragma once+#include <array>+#include <cmath>+#include <cstdint>+#include <iomanip>+#include <ios>+#include <istream>+#include <ostream>+#include <string>+namespace veyra::engine {+// Lightroom-aligned colour grade (P1). Every field is neutral at its default+// value, and a default-constructed ColorSettings must leave the frame+// bit-identical: veyra_color_grade_tests asserts that identity path, and the+// graph keeps the stage disabled until something actually changes.+//+// Units follow the Lightroom controls the UI mirrors:+// temperature/tint, contrast..saturation, mixer, grading, calibration: -100..100+// exposure: EV (-5..5) grading hue: 0..360 grading saturation: 0..100+// curve points: 0..1 normalised input/output+constexpr int kColorMixerBands=8; // red, orange, yellow, green, aqua, blue, purple, magenta+constexpr int kColorCurveCount=5; // RGB, red, green, blue, and the parametric helper+constexpr int kColorCurvePoints=8;+constexpr int kColorGradingZones=4; // shadows, midtones, highlights, global++struct ColorCurvePoint { float x=0,y=0; };+struct ColorCurve {+ // Two points are the identity ramp; extra points must stay sorted by x.+ std::array<ColorCurvePoint,kColorCurvePoints> points{};+ int count=2;+ ColorCurve(){points[0]={0,0};points[1]={1,1};}+ bool identity()const{+ return count==2&&points[0].x==0.0f&&points[0].y==0.0f&&points[1].x==1.0f&&points[1].y==1.0f;+ }+ void reset(){*this=ColorCurve{};}+ bool operator==(const ColorCurve& other)const{+ if(count!=other.count)return false;+ for(int i=0;i<count;++i)if(points[i].x!=other.points[i].x||points[i].y!=other.points[i].y)return false;+ return true;+ }+};+struct ColorGradingWheel {+ float hue=0,saturation=0,luminance=0;+ bool operator==(const ColorGradingWheel&)const=default;+};++struct ColorSettings {+ // White balance: relative to the source metadata (capture has no as-shot WB,+ // so the UI must label these as relative values - plan section 5).+ float temperature=0,tint=0;+ // Light.+ float exposure=0,contrast=0,highlights=0,shadows=0,whites=0,blacks=0;+ // Presence. texture/clarity/dehaze are spatial and land in P2; they are part+ // of the model now so schema and UI do not need another format bump.+ float texture=0,clarity=0,dehaze=0,vibrance=0,saturation=0;+ // Tone curve: parametric regions plus five point curves (0 RGB, 1 R, 2 G, 3 B,+ // 4 reserved for the luminance helper used by the UI preview).+ float paramHighlights=0,paramLights=0,paramDarks=0,paramShadows=0;+ float splitHighlights=0,splitMidtones=0,splitShadows=0;+ std::array<ColorCurve,kColorCurveCount> curves{};+ // Colour mixer (HSL) and the black & white mixer.+ std::array<float,kColorMixerBands> mixerHue{};+ std::array<float,kColorMixerBands> mixerSaturation{};+ std::array<float,kColorMixerBands> mixerLuminance{};+ bool blackWhite=false;+ std::array<float,kColorMixerBands> blackWhiteMix{};+ // Colour grading: shadows, midtones, highlights, global.+ std::array<ColorGradingWheel,kColorGradingZones> grading{};+ float gradingBlending=50,gradingBalance=0;+ // Calibration.+ float calibrationShadowTint=0;+ std::array<float,3> calibrationHue{};+ std::array<float,3> calibrationSaturation{};+ // 3D LUT (.cube) reference, stored as the file *name* inside+ // runtime_local/luts - the export job runs in a separate process and+ // resolves the same folder, so an absolute path would be wrong there.+ // Fixed-size POD keeps EnhancementSettings trivially copyable for the+ // shared-memory export header (ExportJobManager static_assert).+ static constexpr int kLutNameChars=260;+ std::array<wchar_t,kLutNameChars> lutName{};+ float lutStrength=100;+ // Input space: 0 = Cineon log (default for creative LUTs), 1 = sRGB display+ // reference, 2 = PQ. The plan forbids silently applying a display-referred+ // LUT to HDR content, so the choice is explicit and logged.+ int lutInputSpace=0;++ bool operator==(const ColorSettings&)const=default;+ bool neutral()const{return *this==ColorSettings{};}++ // P1 knows only these two LUT spaces plus "no LUT"; anything else is a bug.+ static constexpr int kLutInputCineon=0,kLutInputSrgb=1,kLutInputPq=2;++ bool hasLut()const{return lutName[0]!=0;}+ std::wstring lutNameString()const{return std::wstring(lutName.data());}+ // Rejects separators and drive letters: only a bare file name is accepted.+ bool setLutName(std::wstring_view name){+ if(name.size()>=kLutNameChars)return false;+ if(name.find_first_of(L"\\/:*?\"<>|")!=std::wstring_view::npos)return false;+ lutName.fill(0);+ for(std::size_t i=0;i<name.size();++i)lutName[i]=name[i];+ return true;+ }+ void clearLut(){lutName.fill(0);}++ std::string validate()const{+ const auto unit=[](float v){return std::isfinite(v)&&v>=-100.0f&&v<=100.0f;};+ for(float v:{temperature,tint,contrast,highlights,shadows,whites,blacks,texture,clarity,dehaze,vibrance,saturation,+ paramHighlights,paramLights,paramDarks,paramShadows,splitHighlights,splitMidtones,splitShadows,+ gradingBalance,calibrationShadowTint})if(!unit(v))return "colour slider out of range";+ for(float v:{exposure})if(!std::isfinite(v)||v<-5.0f||v>5.0f)return "colour exposure out of range";+ for(float v:mixerHue)if(!unit(v))return "mixer hue out of range";+ for(float v:mixerSaturation)if(!unit(v))return "mixer saturation out of range";+ for(float v:mixerLuminance)if(!unit(v))return "mixer luminance out of range";+ for(float v:blackWhiteMix)if(!unit(v))return "black and white mix out of range";+ for(float v:calibrationHue)if(!unit(v))return "calibration hue out of range";+ for(float v:calibrationSaturation)if(!unit(v))return "calibration saturation out of range";+ for(const auto& wheel:grading){+ if(!std::isfinite(wheel.hue)||wheel.hue<0||wheel.hue>360)return "grading hue out of range";+ if(!std::isfinite(wheel.saturation)||wheel.saturation<0||wheel.saturation>100)return "grading saturation out of range";+ if(!unit(wheel.luminance))return "grading luminance out of range";+ }+ if(!std::isfinite(gradingBlending)||gradingBlending<0||gradingBlending>100)return "grading blending out of range";+ for(const auto& curve:curves){+ if(curve.count<2||curve.count>kColorCurvePoints)return "colour curve point count out of range";+ for(int i=0;i<curve.count;++i){+ const auto& p=curve.points[i];+ if(!std::isfinite(p.x)||!std::isfinite(p.y)||p.x<0||p.x>1||p.y<0||p.y>1)return "colour curve point out of range";+ if(i>0&&p.x<=curve.points[i-1].x)return "colour curve points must be sorted by x";+ }+ }+ if(!std::isfinite(lutStrength)||lutStrength<0||lutStrength>100)return "lut strength out of range";+ if(lutInputSpace<kLutInputCineon||lutInputSpace>kLutInputPq)return "lut input space out of range";+ if(lutName.back()!=0)return "lut name missing terminator";+ for(wchar_t c:lutName){if(c==0)break;if(c<32||c==L'\\'||c==L'/'||c==L':')return "lut name contains invalid characters";}+ return {};+ }+};++// PresetStore schema v18: one appended block per entry. The field order is part+// of the on-disk format - never reorder without a new version. The stream is+// narrow UTF-8 (PresetStore owns the wide/UTF-8 conversion of lutPath) so this+// header stays free of platform includes.+inline void writeColorSettings(std::ostream& out,const ColorSettings& c,const std::string& lutPathUtf8){+ out<<c.temperature<<' '<<c.tint<<' '<<c.exposure<<' '<<c.contrast<<' '<<c.highlights<<' '<<c.shadows<<' '<<c.whites<<' '<<c.blacks<<' '+ <<c.texture<<' '<<c.clarity<<' '<<c.dehaze<<' '<<c.vibrance<<' '<<c.saturation<<' '+ <<c.paramHighlights<<' '<<c.paramLights<<' '<<c.paramDarks<<' '<<c.paramShadows<<' '+ <<c.splitHighlights<<' '<<c.splitMidtones<<' '<<c.splitShadows<<' '+ <<(c.blackWhite?1:0)<<' '<<c.gradingBlending<<' '<<c.gradingBalance<<' '<<c.calibrationShadowTint<<' '+ <<c.lutStrength<<' '<<c.lutInputSpace<<' '<<std::quoted(lutPathUtf8);+ for(const auto& curve:c.curves){+ out<<' '<<curve.count;+ for(int i=0;i<curve.count;++i)out<<' '<<curve.points[std::size_t(i)].x<<' '<<curve.points[std::size_t(i)].y;+ }+ for(float v:c.mixerHue)out<<' '<<v;+ for(float v:c.mixerSaturation)out<<' '<<v;+ for(float v:c.mixerLuminance)out<<' '<<v;+ for(float v:c.blackWhiteMix)out<<' '<<v;+ for(const auto& wheel:c.grading)out<<' '<<wheel.hue<<' '<<wheel.saturation<<' '<<wheel.luminance;+ for(float v:c.calibrationHue)out<<' '<<v;+ for(float v:c.calibrationSaturation)out<<' '<<v;+}+inline bool readColorSettings(std::istream& in,ColorSettings& c,std::string& lutPathUtf8){+ int blackWhite=0;+ if(!(in>>c.temperature>>c.tint>>c.exposure>>c.contrast>>c.highlights>>c.shadows>>c.whites>>c.blacks+ >>c.texture>>c.clarity>>c.dehaze>>c.vibrance>>c.saturation+ >>c.paramHighlights>>c.paramLights>>c.paramDarks>>c.paramShadows+ >>c.splitHighlights>>c.splitMidtones>>c.splitShadows+ >>blackWhite>>c.gradingBlending>>c.gradingBalance>>c.calibrationShadowTint+ >>c.lutStrength>>c.lutInputSpace>>std::quoted(lutPathUtf8))||(blackWhite!=0&&blackWhite!=1))return false;+ c.blackWhite=blackWhite!=0;+ for(auto& curve:c.curves){+ if(!(in>>curve.count))return false;+ for(int i=0;i<curve.count&&i<kColorCurvePoints;++i)if(!(in>>curve.points[std::size_t(i)].x>>curve.points[std::size_t(i)].y))return false;+ }+ for(float& v:c.mixerHue)if(!(in>>v))return false;+ for(float& v:c.mixerSaturation)if(!(in>>v))return false;+ for(float& v:c.mixerLuminance)if(!(in>>v))return false;+ for(float& v:c.blackWhiteMix)if(!(in>>v))return false;+ for(auto& wheel:c.grading)if(!(in>>wheel.hue>>wheel.saturation>>wheel.luminance))return false;+ for(float& v:c.calibrationHue)if(!(in>>v))return false;+ for(float& v:c.calibrationSaturation)if(!(in>>v))return false;+ return c.validate().empty();+}+} // namespace veyra::enginediff --git a/include/veyra/engine/EnhancementSettings.h b/include/veyra/engine/EnhancementSettings.hindex 21b0ce31..cdf6431d 100644--- a/include/veyra/engine/EnhancementSettings.h+++ b/include/veyra/engine/EnhancementSettings.h@@ -6,6 +6,7 @@#include <string_view>#include "veyra/pipeline/ResolutionPlan.h"#include "veyra/source/CaptureBuffer.h"+#include "veyra/engine/ColorSettings.h"namespace veyra::engine {enum class FrameGenerationBackend { Dlss, XeSS, Fsr };// Frame generation that runs inside the present sink (external frame@@ -127,6 +128,9 @@ struct EnhancementSettings {// default (NVENC CONSTQP / MFT quality mode). Only the export job consumes// it: preview never re-encodes.uint32_t exportBitrateMbps=0;+ // Lightroom-aligned colour grade. Live: the engine uploads it per frame, so+ // changing it never rebuilds the graph (see sameVideoConfiguration below).+ ColorSettings color;pipeline::NrSizePolicy nrPolicy=pipeline::NrSizePolicy::Realtime;FlowQuality flow=FlowQuality::Balanced;OpticalFlowBackend opticalFlowBackend=OpticalFlowBackend::Nvidia;@@ -146,6 +150,8 @@ struct EnhancementSettings {// Export-only fields: changing the bitrate must never invalidate the// running preview graph (the controller would otherwise rebuild it).video.exportBitrateMbps=other.exportBitrateMbps;+ // Colour grade: uniform-only update, never a graph rebuild.+ video.color=other.color;return video==other;}void rejectVideoRequest(const EnhancementSettings& attempted,const EnhancementSettings& previous) {@@ -183,6 +189,7 @@ struct EnhancementSettings {// 0 = auto quality; explicit values are capped at 300 Mbps so a typo// cannot ask a driver for a nonsense rate.if(exportBitrateMbps>300)return "export bitrate out of range";+ if(auto error=color.validate();!error.empty())return error;if(!pipeline::validNrSizePolicy(nrPolicy))return "invalid NR size policy";if(flow<FlowQuality::Performance||flow>FlowQuality::Quality||content<ContentRate::Transport||content>ContentRate::Capture60To30)return "invalid flow/content mode";return {};diff --git a/src/engine/PresetStore.cpp b/src/engine/PresetStore.cppindex 06597404..4690edc8 100644--- a/src/engine/PresetStore.cpp+++ b/src/engine/PresetStore.cpp@@ -13,12 +13,12 @@ bool nameOk(const std::wstring& s){return !s.empty()&&s.size()<=48&&s.front()!=Lstd::wstring trim(std::wstring s){auto a=s.find_first_not_of(L" \t\r\n");if(a==s.npos)return {};auto b=s.find_last_not_of(L" \t\r\n");return s.substr(a,b-a+1);}}std::string PresetStore::serialize()const{- std::ostringstream o;o.imbue(std::locale::classic());o<<std::setprecision(std::numeric_limits<float>::max_digits10)<<"VEYRA_PRESETS 17\n"<<std::quoted(utf8(default_))<<' '<<entries_.size()<<'\n';- for(auto& p:entries_){const auto& s=p.settings;const auto& m=s.model;const auto& r=s.residual;o<<std::quoted(utf8(p.name))<<' '<<m.intensity<<' '<<m.tone<<' '<<m.structure<<' '<<m.skin<<' '<<m.style<<' '<<m.autoMask<<' '<<m.uiCorrection<<' '<<r.total<<' '<<r.darken<<' '<<r.brighten<<' '<<r.color<<' '<<r.luminance<<' '<<s.nr<<' '<<s.sr<<' '<<s.multiplier<<' '<<int(s.nrPolicy)<<' '<<int(s.flow)<<' '<<int(s.content)<<' '<<s.protection.enabled<<' '<<s.protection.featherPixels;for(auto q:s.protection.regions)o<<' '<<q.left<<' '<<q.top<<' '<<q.right<<' '<<q.bottom;o<<' '<<s.videoSrQuality<<' '<<int(s.frameGenerationBackend)<<' '<<int(s.srTarget)<<' '<<int(s.opticalFlowBackend)<<' '<<s.amdFlowHalfResolution<<' '<<int(s.audioSync)<<' '<<s.audioOffsetMs<<' '<<int(s.nrRuntime)<<' '<<s.captureCompatible<<' '<<s.lowLatency<<' '<<s.forceSdrPreview<<' '<<int(s.captureAudio)<<' '<<s.exportBitrateMbps<<' '<<s.captureFlipVertical<<' '<<int(s.captureBuffer)<<'\n';}return o.str();+ std::ostringstream o;o.imbue(std::locale::classic());o<<std::setprecision(std::numeric_limits<float>::max_digits10)<<"VEYRA_PRESETS 18\n"<<std::quoted(utf8(default_))<<' '<<entries_.size()<<'\n';+ for(auto& p:entries_){const auto& s=p.settings;const auto& m=s.model;const auto& r=s.residual;o<<std::quoted(utf8(p.name))<<' '<<m.intensity<<' '<<m.tone<<' '<<m.structure<<' '<<m.skin<<' '<<m.style<<' '<<m.autoMask<<' '<<m.uiCorrection<<' '<<r.total<<' '<<r.darken<<' '<<r.brighten<<' '<<r.color<<' '<<r.luminance<<' '<<s.nr<<' '<<s.sr<<' '<<s.multiplier<<' '<<int(s.nrPolicy)<<' '<<int(s.flow)<<' '<<int(s.content)<<' '<<s.protection.enabled<<' '<<s.protection.featherPixels;for(auto q:s.protection.regions)o<<' '<<q.left<<' '<<q.top<<' '<<q.right<<' '<<q.bottom;o<<' '<<s.videoSrQuality<<' '<<int(s.frameGenerationBackend)<<' '<<int(s.srTarget)<<' '<<int(s.opticalFlowBackend)<<' '<<s.amdFlowHalfResolution<<' '<<int(s.audioSync)<<' '<<s.audioOffsetMs<<' '<<int(s.nrRuntime)<<' '<<s.captureCompatible<<' '<<s.lowLatency<<' '<<s.forceSdrPreview<<' '<<int(s.captureAudio)<<' '<<s.exportBitrateMbps<<' '<<s.captureFlipVertical<<' '<<int(s.captureBuffer)<<' ';writeColorSettings(o,s.color,utf8(s.color.lutNameString()));o<<'\n';}return o.str();}bool PresetStore::parse(const std::string& data,std::vector<UserPreset>& out,std::wstring& def){if(data.size()>65536)return false;std::istringstream in(data);in.imbue(std::locale::classic());std::string magic,d;int version=0;size_t count=0;- if(!(in>>magic>>version)||magic!="VEYRA_PRESETS"||(version<1||version>17)||!(in>>std::quoted(d)>>count)||count>64)return false;def=wide(d);if(!d.empty()&&def.empty())return false;+ if(!(in>>magic>>version)||magic!="VEYRA_PRESETS"||(version<1||version>18)||!(in>>std::quoted(d)>>count)||count>64)return false;def=wide(d);if(!d.empty()&&def.empty())return false;for(size_t i=0;i<count;++i){UserPreset p;std::string n;int policy,flow,content,nr,sr;auto& s=p.settings;auto& m=s.model;auto& r=s.residual;if(!(in>>std::quoted(n)>>m.intensity>>m.tone>>m.structure>>m.skin>>m.style>>m.autoMask>>m.uiCorrection>>r.total>>r.darken>>r.brighten>>r.color>>r.luminance>>nr>>sr>>s.multiplier>>policy>>flow>>content))return false;if(version>=2){int enabled;if(!(in>>enabled>>s.protection.featherPixels)||enabled<0||enabled>1)return false;s.protection.enabled=enabled!=0;@@ -43,6 +43,8 @@ bool PresetStore::parse(const std::string& data,std::vector<UserPreset>& out,stdif(version>=16){int flip;if(!(in>>flip)||flip<0||flip>1)return false;s.captureFlipVertical=flip!=0;}// v17 appends the capture video-pin buffer policy.if(version>=17){int buffer;if(!(in>>buffer)||buffer<0||buffer>2)return false;s.captureBuffer=static_cast<veyra::source::CaptureBufferMode>(buffer);}+ // v18 appends the full colour grade block (see ColorSettings.h).+ if(version>=18){std::string lut;if(!readColorSettings(in,s.color,lut))return false;if(!lut.empty()&&!s.color.setLutName(wide(lut)))return false;}p.name=wide(n);if(!nameOk(p.name)||std::any_of(out.begin(),out.end(),[&](auto& a){return a.name==p.name;})||nr<0||nr>1||sr<0||sr>1)return false;s.nr=nr;s.sr=sr;s.nrPolicy=static_cast<pipeline::NrSizePolicy>(policy);s.flow=static_cast<FlowQuality>(flow);s.content=static_cast<ContentRate>(content);if(!s.validate().empty())return false;out.push_back(std::move(p));diff --git a/tests/unit/RepairPresetTests.cpp b/tests/unit/RepairPresetTests.cppindex ef677136..34a46eae 100644--- a/tests/unit/RepairPresetTests.cpp+++ b/tests/unit/RepairPresetTests.cpp@@ -42,7 +42,7 @@ bool legacyBackends(const std::filesystem::path& path) {if(version>=7&&(value.audioSync!=AudioSyncMode::Manual||value.audioOffsetMs!=137))return false;if(!store.put(L"legacy",value,true))return false;std::ifstream file(path);std::string magic;int savedVersion=0;file>>magic>>savedVersion;- if(magic!="VEYRA_PRESETS"||savedVersion!=17)return false;+ if(magic!="VEYRA_PRESETS"||savedVersion!=18)return false; // schema v18 adds the colour blockPresetStore reloaded(path);if(!reloaded.load()||reloaded.defaultSettings()!=value)return false;}else{@@ -63,8 +63,25 @@ int main(int argc,char** argv){if(argc!=2)return 2;using namespace veyra::engine}s.srTarget=veyra::pipeline::SrTarget::Uhd8K;s.audioSync=AudioSyncMode::Manual;s.audioOffsetMs=137;- s.nrRuntime=NrRuntime::Community;s.captureCompatible=true;s.lowLatency=true;s.forceSdrPreview=true;+s.nrRuntime=NrRuntime::Community;s.captureCompatible=true;s.lowLatency=true;s.forceSdrPreview=true;+// Colour grade round-trips through schema v18 (plan P1: named colour presets).+s.color.temperature=-40;s.color.tint=7.5f;s.color.exposure=1.25f;s.color.contrast=-12.5f;s.color.highlights=18;s.color.shadows=-22;+s.color.whites=9;s.color.blacks=-4;s.color.vibrance=33;s.color.saturation=-8;+s.color.paramHighlights=20;s.color.paramShadows=-25;s.color.splitHighlights=-15;s.color.splitMidtones=12;s.color.splitShadows=-6;+s.color.curves[0].count=3;s.color.curves[0].points[1]={0.25f,0.35f};s.color.curves[0].points[2]={1,1};+s.color.curves[2].count=2;s.color.curves[2].points[0]={0,0.05f};s.color.curves[2].points[1]={0.95f,1};+s.color.mixerHue[3]=25.5f;s.color.mixerSaturation[0]=-60;s.color.mixerLuminance[5]=12;+s.color.blackWhite=true;s.color.blackWhiteMix[2]=-33.5f;+s.color.grading[1]={210.5f,45,-20};s.color.gradingBlending=62.5f;s.color.gradingBalance=-18;+s.color.calibrationShadowTint=9.5f;s.color.calibrationHue[1]=-22;s.color.calibrationSaturation[2]=17.5f;+ok=ok&&s.color.setLutName(L"film.cube");s.color.lutStrength=75;s.color.lutInputSpace=1;ok=ok&&a.put(L"test",s)&&a.setDefault(0)&&!a.put(L"test",s);PresetStore b(p);ok=ok&&b.load()&&b.defaultSettings()==s&&b.rename(0,L"renamed")&&b.defaultSettings()==s;+// Colour validation guards the same ranges the panel exposes.+auto badGrading=s;badGrading.color.grading[2].hue=400;ok=ok&&!b.put(L"invalid grading hue",badGrading);+auto badCurve=s;badCurve.color.curves[1].count=3;badCurve.color.curves[1].points[1]={0.6f,0.5f};badCurve.color.curves[1].points[2]={0.2f,0.7f};ok=ok&&!b.put(L"unsorted curve",badCurve);+auto badLut=s;badLut.color.lutInputSpace=3;ok=ok&&!b.put(L"invalid lut space",badLut);+auto badExposure=s;badExposure.color.exposure=6;ok=ok&&!b.put(L"invalid exposure",badExposure);+ok=ok&&b.entries().size()==1&&b.defaultSettings()==s;auto badTarget=s;badTarget.srTarget=static_cast<veyra::pipeline::SrTarget>(3);ok=ok&&!b.put(L"invalid target",badTarget);