WIP integrate eight print looks; pass 393 native checks, reference comparison pending

这个提交包含在:
mac 于 2026-11-02 14:33:33 +08:00 提交
1 父节点 7d895750cf
当前提交 ab7cb759e5
13 个文件已更改
+2199 -16

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

+9 -1
查看文件
@@ -1,7 +1,7 @@
// All work uses the renderer instance's lock and frozen state. No vendor code
// or vendor runtime is loaded by the product.
- (BOOL)renderFilmTool:(NSString*)type source:(FxImageTile*)source destination:(FxImageTile*)destination uniforms:(DYUniforms)u masks:(NSArray*)masks entry:(NSMutableDictionary*)entry error:(NSError**)error {
BOOL mixer=[type isEqual:@"mixer"],active=mixer?DYChannelMixerActive(u):DYFilmActive(u.film);
BOOL mixer=[type isEqual:@"mixer"],active=mixer?DYChannelMixerActive(u):DYFilmToolActive(u);
if(!active)return [self copyTile:source to:destination entry:entry error:error];
id<MTLDevice>d=entry[@"device"];id<MTLTexture>before=[source metalTextureForDevice:d];
if(!before)return fail(error,@"胶片输入纹理不可用");
@@ -49,6 +49,14 @@
id<MTLTexture>aux=texture(2);if(!aux)return fail(error,@"无法分配暗角缓冲区");CIImage *ci=image(current);if(!ci)return fail(error,@"暗角输入不可用");
ci=[ci imageByApplyingFilter:@"CIVignetteEffect" withInputParameters:@{kCIInputCenterKey:[CIVector vectorWithX:before.width*.5 Y:before.height*.5],kCIInputIntensityKey:@(u.film.vignetteIntensity),kCIInputRadiusKey:@(u.film.vignetteRadius/100.f*MAX(before.width,before.height)),@"inputFalloff":@(u.film.vignetteFalloff)}];[context render:ci toMTLTexture:aux commandBuffer:commands bounds:bounds colorSpace:nil];if(!point(5,aux))return fail(error,@"暗角处理失败");
}
if(DYFilmPrintActive(u)){
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)u.filmPrint.x] ofType:@"dylut" inDirectory:@"PrintLooks"];
if(!path)return fail(error,@"印片外观资源缺失,请重新安装正式版。");id<MTLTexture>cube=[self lut:path entry:entry error:error];if(!cube)return NO;
if(cube.width!=65||cube.height!=65||cube.depth!=65)return fail(error,@"印片外观尺寸不正确,请重新安装正式版。");
id<MTLTexture>out=texture(current==slots[0]?1:0);if(!out)return fail(error,@"无法分配印片缓冲区");
encode(@"dyFilmPrint",current,cube,out,&u,sizeof(u));current=out;
}
if(u.film.mix<1){id<MTLTexture>out=texture(current==slots[0]?1:0);if(!out)return fail(error,@"无法分配胶片混合缓冲区");encode(@"dyFilmMix",before,current,out,&u.film.mix,4);current=out;}
}
// Finish the effect before the module's existing mask blend. Source and