WIP: implement module artwork, adaptive inspector, ordered CMS and local mosaic; host validation pending

这个提交包含在:
mac 于 2026-11-06 13:01:58 +08:00 提交
1 父节点 3452f2344f
当前提交 4b73db8a17
57 个文件已更改
+631 -38

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

@@ -95,6 +95,12 @@
- (BOOL)renderColorSource:(FxImageTile*)src destination:(FxImageTile*)dst uniforms:(DYUniforms)u paths:(NSDictionary*)paths spider:(NSData*)spider tools:(NSDictionary*)tools colorManagement:(NSDictionary*)state hostPrimaries:(NSInteger)primaries error:(NSError**)error {@synchronized(self){return DYRenderWithPool(error,[&]()->BOOL{
if(state&&![state isKindOfClass:NSDictionary.class])return fail(error,@"色彩管理状态无效。");
NSDictionary*context=DYHostColorContext(src,dst,primaries);@synchronized(_previewLock){[_colorContext release];_colorContext=[context copy];}
if([tools[@"mosaic"][@"enabled"]boolValue]){
if(!DYValidToolDocument(tools))return fail(error,@"局部马赛克设置无效。");
FxImageTile *mosaic=[self sourceByApplyingMosaic:tools source:src registry:dst.deviceRegistryID error:error];if(!mosaic)return NO;
NSMutableDictionary *remaining=[[tools mutableCopy]autorelease];[remaining removeObjectForKey:@"mosaic"];[remaining removeObjectForKey:@"mosaicRenderMask"];
return [self renderColorSource:mosaic destination:dst uniforms:u paths:paths spider:spider tools:remaining colorManagement:state hostPrimaries:primaries error:error];
}
if(tools[@"sharedMasks"]){
if(!DYValidToolDocument(tools))return fail(error,@"调色层或蒙版数据无效。");
FxImageTile *stamped=[self sourceByApplyingStamps:DYSharedMasks(tools) source:src registry:dst.deviceRegistryID error:error];if(!stamped)return NO;
@@ -103,6 +109,7 @@
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(tools[@"sharedMasks"])tools=DYResolvedToolDocument(tools);
if(DYUnifiedColorState(state))return [self renderUnifiedSource:src destination:dst uniforms:u paths:paths spider:spider tools:tools hostPrimaries:primaries error: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,@"当前画面超过色彩管理内存预算。");