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(ui): professional colour page pass 3 - mixer correction dropdown + eight-band strip (one range on screen)
Veyra Goal Agent225036f984ad
diff --git a/apps/veyra/SettingsWindow.cpp b/apps/veyra/SettingsWindow.cppindex baae25d1..6e83b13f 100644--- a/apps/veyra/SettingsWindow.cpp+++ b/apps/veyra/SettingsWindow.cpp@@ -122,6 +122,9 @@ struct ColorParam{}};std::vector<ColorParam> colorParams;+// Defined with the mixer controls further down; the layout needs it to decide+// which of the 24 mixer rows is on screen.+int mixerModeOf(const ColorParam& param);// id layout: master 800, reset 801, undo 802, header 810+s, label 830+i,// edit 850+i, slider 870+i.// The colour page owns 1200..1499: label/edit/slider per parameter, so the four@@ -133,6 +136,12 @@ constexpr int colorSliderId(int i){return 1400+i;}// Colour wheels (4 zones) and their class name; ids sit above the button block.constexpr int colorWheelId(int zone){return 840+zone;}constexpr const wchar_t* kColorWheelClass=L"VeyraColorWheel";+// Colour-mixer band strip and the "correction" dropdown that decide which of the+// 24 mixer rows is on screen (Lightroom shows one colour range at a time).+constexpr int colorMixerModeId=830,colorBandsId=831;+constexpr const wchar_t* kColorBandsClass=L"VeyraColorBands";+int colourMixerMode=0; // 0 hue, 1 saturation, 2 luminance, 3 black & white+int colourMixerBand=0; // 0..7, the eight colour rangesconstexpr int kColorMaxParams=100;engine::ColorSettings colourTarget(){return (enhancementEnabled?controller->snapshot().desired:configuredSettings).color;@@ -242,13 +251,21 @@ void layoutColorPage(){place(colorWheelId(3),y+196,190,collapsed,12+cellWidth+8,cellWidth);y+=400;}+ // Mixer header: correction dropdown + the eight colour ranges. The 24+ // rows stay in the table but only the selected range is on screen.+ if(section==3){+ place(colorMixerModeId,y,30,collapsed,12,bodyWidthDip-24);y+=36;+ place(colorBandsId,y,34,collapsed,12,bodyWidthDip-24);y+=42;+ }for(size_t i=0;i<colorParams.size();++i){const auto& param=colorParams[i];if(param.section!=section)continue;- place(colorLabelId(int(i)),y,24,collapsed);- place(colorEditId(int(i)),y-2,26,collapsed);- place(colorSliderId(int(i)),y+24,16,collapsed);- if(!collapsed)y+=46;+ const int mode=mixerModeOf(param);+ const bool hidden=collapsed||(mode>=0&&(mode!=colourMixerMode||param.index!=colourMixerBand));+ place(colorLabelId(int(i)),y,24,hidden);+ place(colorEditId(int(i)),y-2,26,hidden);+ place(colorSliderId(int(i)),y+24,16,hidden);+ if(!hidden)y+=46;}if(section==6){place(817,y,200,collapsed);y+=32;@@ -277,7 +294,8 @@ void syncColorControls(){}}if(auto space=item(819))if(int(SendMessageW(space,CB_GETCURSEL,0,0))!=colour.lutInputSpace)SendMessageW(space,CB_SETCURSEL,WPARAM(colour.lutInputSpace),0);- check(820,colour.blackWhite?BST_CHECKED:BST_UNCHECKED);+ if(auto mode=item(colorMixerModeId))if(int(SendMessageW(mode,CB_GETCURSEL,0,0))!=colourMixerMode)SendMessageW(mode,CB_SETCURSEL,WPARAM(colourMixerMode),0);+ if(auto bands=item(colorBandsId))InvalidateRect(bands,nullptr,FALSE);for(int zone=0;zone<engine::kColorGradingZones;++zone)if(auto wheel=item(colorWheelId(zone)))InvalidateRect(wheel,nullptr,FALSE);syncingColour=false;}@@ -456,6 +474,72 @@ void registerColorWheelClass(){classDescription.hCursor=LoadCursorW(nullptr,IDC_ARROW);RegisterClassW(&classDescription);}+// Which of the four mixer corrections a row belongs to (-1 = not a mixer row).+int mixerModeOf(const ColorParam& param){+ switch(param.target){+ case ColorTarget::MixerHue:return 0;+ case ColorTarget::MixerSaturation:return 1;+ case ColorTarget::MixerLuminance:return 2;+ case ColorTarget::BlackWhiteMix:return 3;+ default:break;+ }+ return -1;+}+const COLORREF kBandColours[engine::kColorMixerBands]={+ RGB(226,64,64),RGB(226,152,58),RGB(226,214,58),RGB(74,200,80),+ RGB(58,206,190),RGB(58,116,226),RGB(168,64,214),RGB(226,64,168)};+RECT bandDotRect(HWND h,const RECT& area,int band){+ const int count=engine::kColorMixerBands;+ const int cellWidth=std::max(1,int(area.right-area.left)/count);+ const int radius=std::max(dip(h,7),std::min(dip(h,12),cellWidth/2-dip(h,3)));+ const int centreX=area.left+cellWidth*band+cellWidth/2;+ const int centreY=(area.top+area.bottom)/2;+ return {centreX-radius,centreY-radius,centreX+radius,centreY+radius};+}+void paintColorBands(HWND h,HDC dc,RECT r){+ fillSurface(dc,r,h);+ AlphaGraphics drawing(dc);+ auto& graphics=drawing.get();+ graphics.SetSmoothingMode(Gdiplus::SmoothingModeAntiAlias);+ for(int band=0;band<engine::kColorMixerBands;++band){+ const auto dot=bandDotRect(h,r,band);+ const float radius=float(dot.right-dot.left)*0.5f;+ Gdiplus::SolidBrush brush(color(kBandColours[band]));+ graphics.FillEllipse(&brush,float(dot.left),float(dot.top),radius*2,radius*2);+ if(band==colourMixerBand){+ Gdiplus::Pen ring(color(RGB(245,247,249)),float(dip(h,2)));+ graphics.DrawEllipse(&ring,float(dot.left)-radius*0.35f,float(dot.top)-radius*0.35f,radius*2.7f,radius*2.7f);+ }+ }+}+void registerColorBandsClass(){+ static bool registered=false;+ if(registered)return;+ registered=true;+ WNDCLASSW classDescription{};+ classDescription.style=CS_DBLCLKS;+ classDescription.lpfnWndProc=[](HWND h,UINT msg,WPARAM wp,LPARAM lp)->LRESULT{+ if(msg==WM_ERASEBKGND)return 1;+ if(msg==WM_PAINT||msg==WM_PRINTCLIENT){PaintBuffer paint(h,reinterpret_cast<HDC>(wp));paintColorBands(h,paint.dc,paint.rect);return 0;}+ if(msg==WM_LBUTTONDOWN){+ RECT r{};GetClientRect(h,&r);+ const int cellWidth=std::max(1,int(r.right-r.left)/engine::kColorMixerBands);+ const int band=std::clamp(GET_X_LPARAM(lp)/cellWidth,0,engine::kColorMixerBands-1);+ if(band!=colourMixerBand){+ colourMixerBand=band;+ veyra::log::info("color-ui",std::format("mixer band={}",band));+ }+ InvalidateRect(h,nullptr,FALSE);+ arrange();+ return 0;+ }+ return DefWindowProcW(h,msg,wp,lp);+ };+ classDescription.hInstance=GetModuleHandleW(nullptr);+ classDescription.lpszClassName=kColorBandsClass;+ classDescription.hCursor=LoadCursorW(nullptr,IDC_HAND);+ RegisterClassW(&classDescription);+}bool colourFieldEdited(int index,float value){if(index<0||size_t(index)>=colorParams.size())return false;auto colour=colourTarget();@@ -768,17 +852,24 @@ LRESULT CALLBACK proc(HWND h,UINT msg,WPARAM wp,LPARAM lp){}syncColorControls();arrange();return 0;}- if(msg==WM_COMMAND&&LOWORD(wp)==820&&HIWORD(wp)==BN_CLICKED){+ if(msg==WM_COMMAND&&LOWORD(wp)==colorMixerModeId&&HIWORD(wp)==CBN_SELCHANGE){+ colourMixerMode=std::clamp(int(SendMessageW(item(colorMixerModeId),CB_GETCURSEL,0,0)),0,3);+ // Picking 黑白 is the B&W mixer switch itself (Lightroom's B&W panel),+ // so the model flag follows the dropdown instead of a second checkbox.auto colour=colourTarget();- colour.blackWhite=SendMessageW(item(820),BM_GETCHECK,0,0)==BST_CHECKED;- if(!applyColour(colour,true)){- veyra::log::warn("color-ui","black and white mixer switch rejected");- syncColorControls();- return 0;+ const bool wantBlackWhite=colourMixerMode==3;+ if(colour.blackWhite!=wantBlackWhite){+ colour.blackWhite=wantBlackWhite;+ if(!applyColour(colour,true)){+ veyra::log::warn("color-ui","mixer correction switch rejected");+ syncColorControls();+ return 0;+ }}- veyra::log::info("color-ui",std::format("black and white mixer={}",colour.blackWhite?1:0));- message(colour.blackWhite?L"黑白混色器已打开:下面八个“黑白”滑块控制各色系的灰阶明暗。":L"黑白混色器已关闭,回到 HSL 混色。");+ veyra::log::info("color-ui",std::format("mixer correction={} blackWhite={}",colourMixerMode,wantBlackWhite?1:0));+ message(wantBlackWhite?L"黑白:画面转成单色,下方滑块控制各色系的灰阶明暗。":L"用下方滑块按色系微调(点色点切换色系)。");syncColorControls();+ arrange();return 0;}if(msg==WM_COMMAND&&LOWORD(wp)>=810&&LOWORD(wp)<810+kColorSections&&HIWORD(wp)==BN_CLICKED){@@ -1000,10 +1091,14 @@ case WM_CREATE:{window=h;font=makeFont(h);items.clear();displayedBackendWarning.SetPropW(item(822),L"veyra.tip",HANDLE(L"复制当前色彩设置,用来粘贴到别的预设或下一段素材。"));SetPropW(item(823),L"veyra.tip",HANDLE(L"粘贴刚才复制的色彩设置。"));SetPropW(item(821),L"veyra.tip",HANDLE(L"按住不放:临时显示没有调色的原图;松开恢复。用中性调色实现,不重建管线。"));- // group 2 = the colour page; 3 was the section index, not the page, and a- // control on another page is hidden (and therefore ignores BM_CLICK).- check(820,BST_UNCHECKED);add(L"BUTTON",L"黑白混色器(把画面转成黑白)",820,BS_AUTOCHECKBOX|WS_TABSTOP,2,12,0,-1,28);- SetPropW(item(820),L"veyra.tip",HANDLE(L"打开后画面变成黑白,下面八个“黑白”滑块控制各色系对应的灰阶明暗(和 Lightroom 的黑白混色器同一套语义)。"));+ // Mixer header: "校正" dropdown + the eight colour ranges. Only the+ // selected range's rows are on screen, like Lightroom's colour mixer.+ registerColorBandsClass();+ combo(colorMixerModeId,2,0,{L"色相",L"饱和度",L"明亮度",L"黑白"});+ send(colorMixerModeId,CB_SETCURSEL,WPARAM(colourMixerMode),0);+ add(kColorBandsClass,L"",colorBandsId,WS_TABSTOP,2,12,0,-1,34);+ SetPropW(item(colorMixerModeId),L"veyra.tip",HANDLE(L"校正方式:色相/饱和度/明亮度按色系微调;黑白把画面转成单色,并用同一组滑块控制各色系的灰阶明暗。"));+ SetPropW(item(colorBandsId),L"veyra.tip",HANDLE(L"点色点切换要调整的色系;下方滑块只作用于选中的色系。"));for(int section=0;section<kColorSections;++section)add(L"BUTTON",L"",810+section,BS_PUSHBUTTON|WS_TABSTOP,2,12,12,-1,32);// Preset toolbar.combo(803,2,0,{});add(L"EDIT",L"",804,ES_AUTOHSCROLL|WS_TABSTOP,2,12,0,-1,26);send(804,EM_SETLIMITTEXT,48,0);@@ -1170,6 +1265,7 @@ bool settingsColorWheelTestBarPoint(int zone,float luminance,POINT& out){return true;}int colourWheelControlId(int zone){return colorWheelId(zone);}+int colourBandsControlId(){return colorBandsId;}void settingsColorScrollToTest(int id){if(!window||!body)return;for(auto& entry:items)if(GetDlgCtrlID(entry.h)==id&&entry.page==2){@@ -1181,6 +1277,22 @@ void settingsColorScrollToTest(int id){return;}}+void settingsColorMixerModeForTest(int mode){+ colourMixerMode=std::clamp(mode,0,3);+ if(auto combo=item(colorMixerModeId))SendMessageW(combo,CB_SETCURSEL,WPARAM(colourMixerMode),0);+ auto colour=colourTarget();+ const bool wantBlackWhite=colourMixerMode==3;+ bool applied=true;+ if(colour.blackWhite!=wantBlackWhite){colour.blackWhite=wantBlackWhite;applied=applyColour(colour,true);}+ veyra::log::info("color-ui",std::format("mixer mode={} blackWhiteAsked={} applied={}",colourMixerMode,wantBlackWhite?1:0,applied?1:0));+ syncColorControls();+ arrange();+}+void settingsColorBandForTest(int band){+ colourMixerBand=std::clamp(band,0,engine::kColorMixerBands-1);+ if(auto bands=item(colorBandsId))InvalidateRect(bands,nullptr,FALSE);+ arrange();+}int colourParamEditId(const wchar_t* label){if(!label)return -1;for(size_t i=0;i<colorParams.size();++i)if(std::wcscmp(colorParams[i].label,label)==0)return colorEditId(int(i));diff --git a/apps/veyra/SettingsWindow.h b/apps/veyra/SettingsWindow.hindex 6d49fb0d..7dbe64ed 100644--- a/apps/veyra/SettingsWindow.h+++ b/apps/veyra/SettingsWindow.h@@ -21,4 +21,9 @@ int colourWheelControlId(int zone);// Scroll the colour page so the given control is inside the viewport (used by// acceptance screenshots and by the smoke before it drives a control).void settingsColorScrollToTest(int id);+// Mixer correction mode (0 hue / 1 saturation / 2 luminance / 3 black & white)+// and the selected colour range, driven through the same code path the UI uses.+void settingsColorMixerModeForTest(int mode);+void settingsColorBandForTest(int band);+int colourBandsControlId();}diff --git a/apps/veyra/ui/AppShell.cpp b/apps/veyra/ui/AppShell.cppindex 6b066f3d..0cc85139 100644--- a/apps/veyra/ui/AppShell.cpp+++ b/apps/veyra/ui/AppShell.cpp@@ -775,10 +775,12 @@ else if(colorStep==50){colorStep=(colourSnapshot.desired.color.gradingBlending==// Black & white mixer (T4): the switch must reach the engine and the per-band// row must then change the monochrome result instead of being an inert slider.else if(colorStep==51){- if(auto box=colourControl(820)){- SendMessageW(box,BM_CLICK,0,0);- veyra::log::info("color-ui-test",std::format("bw switch checkedAfter={}",int(SendMessageW(box,BM_GETCHECK,0,0))));- }else veyra::log::info("color-ui-test","bw switch missing");+ // The mixer's 黑白 correction is the black & white switch now; the green+ // range is selected so the row under test is the one on screen.+ veyra::ui::settingsColorMixerModeForTest(3);+ veyra::ui::settingsColorBandForTest(3);+ veyra::ui::settingsColorScrollToTest(veyra::ui::colourBandsControlId());+ veyra::log::info("color-ui-test","mixer set to 黑白 correction with the green range selected");colorStep=45;}else if(colorStep==45&&colourSnapshot.desired.color.blackWhite){colorStep=46;diff --git a/docs/WORKLOG.md b/docs/WORKLOG.mdindex 906b4278..297db219 100644--- a/docs/WORKLOG.md+++ b/docs/WORKLOG.md@@ -1,5 +1,26 @@# 2026-09-11 继续修复目标模式执行中+## 2026-09-17 色彩页 UI:混色器专业布局(校正下拉 + 8 色点条,专业型第三批)++24 条混色器滑块(8 色系 × 色相/饱和度/明亮度)改成 Lightroom 的做法:**一次只显示选中色系的滑块**。++- 顶部“**校正**”下拉(id 830):色相 / 饱和度 / 明亮度 / **黑白**。选“黑白”**本身就是黑白混色器开关**+ (`ColorSettings::blackWhite` 跟着下拉走),所以原来的复选框(820)删掉了,语义与 LR 的 B&W 面板一致;+- 下方 **8 色点条**(自绘控件 `VeyraColorBands`,id 831):红/橙/黄/绿/浅绿/蓝/紫/洋红八个色点,+ 选中的色点带白色描边;点一下就切换下面显示的 3 条滑块;+- 布局:混色器组里,24 行仍在参数表里(索引/标签/预设 schema 都没动),但只有+ `(校正方式, 选中色系)` 匹配的那一行会被摆放并显示,其余行 `hidden`;+- 测试钩子:`settingsColorMixerModeForTest` / `settingsColorBandForTest` / `colourBandsControlId`,+ 烟测走的就是 UI 同一条代码路径。++**验证**:`--smoke-color` **exit 0**,日志:+`mixer mode=3 blackWhiteAsked=1 applied=1` → `T4 the black and white mixer switch reached the engine` →+`T4 the black and white band row reached the engine` → 色轮三步依旧全过。+真机截图:`logs/color/ui-preview-mixer.png`(校正=黑白、绿色系被选中)。++**下一批**:真曲线编辑器(网格 + 可拖控制点 + RGB/R/G/B 通道)、分组眼睛 bypass(schema v19)、+分区图标与间距抛光。+## 2026-09-17 色彩页 UI:颜色分级四色轮(专业型第二批)把颜色分级从 12 条滑块(4 区 × 色相/饱和度/明亮度)换成**四个自绘色轮**,就是专业调色面板的样子: