Add dark defaults, modular effect templates and canvas leveling
这个提交包含在:
1 父节点
ffabdca5b1
当前提交
5ca307414c
25 个文件已更改
+1702
-88
没有与搜索条件相匹配的文件
@@ -66,13 +66,38 @@
|
||||
[tile setBounds:bounds origin:source.imageOrigin];[tile setPixelAspect:source.pixelAspect];[tile inheritColorSpace:source.colorSpace];
|
||||
return tile;
|
||||
}
|
||||
- (BOOL)renderSource:(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{
|
||||
- (BOOL)renderSource:(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 {
|
||||
double angle=[tools[@"levelRotation"] doubleValue];
|
||||
if(!angle)return [self renderColorSource:src destination:dst uniforms:u paths:paths spider:spider tools:tools colorManagement:state hostPrimaries:primaries error:error];
|
||||
@synchronized(self){return DYRenderWithPool(error,[&]()->BOOL{
|
||||
if(!DYValidToolDocument(tools))return fail(error,@"水平校正数据无效");
|
||||
NSMutableDictionary *entry=[self device:dst.deviceRegistryID error:error];
|
||||
if(!entry)return NO;
|
||||
id<MTLDevice>device=entry[@"device"];
|
||||
FxRect bounds=src.imagePixelBounds;
|
||||
NSInteger width=bounds.right-bounds.left,height=bounds.top-bounds.bottom;
|
||||
if(width<=0||height<=0)return fail(error,@"画面尺寸无效");
|
||||
MTLTextureDescriptor *desc=[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatRGBA32Float width:width height:height mipmapped:NO];
|
||||
desc.storageMode=MTLStorageModePrivate;
|
||||
desc.usage=MTLTextureUsageRenderTarget|MTLTextureUsageShaderRead|MTLTextureUsageShaderWrite;
|
||||
id<MTLTexture>texture=[device newTextureWithDescriptor:desc];
|
||||
if(!texture)return fail(error,@"无法分配水平校正缓冲区");
|
||||
DYExportTile *frame=[[[DYExportTile alloc]initWithTexture:texture registry:device.registryID]autorelease];
|
||||
[texture release];
|
||||
[frame setBounds:bounds origin:dst.imageOrigin];
|
||||
[frame setPixelAspect:src.pixelAspect];
|
||||
[frame inheritColorSpace:dst.colorSpace];
|
||||
if(![self renderColorSource:src destination:frame uniforms:u paths:paths spider:spider tools:tools colorManagement:state hostPrimaries:primaries error:error])return NO;
|
||||
return [self copyTile:frame to:dst rotation:angle entry:entry error:error];
|
||||
});}
|
||||
}
|
||||
- (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[@"sharedMasks"]){
|
||||
if(!DYValidToolDocument(tools))return fail(error,@"调色层或蒙版数据无效。");
|
||||
FxImageTile *stamped=[self sourceByApplyingStamps:DYSharedMasks(tools) source:src registry:dst.deviceRegistryID error:error];if(!stamped)return NO;
|
||||
return [self renderSource:stamped destination:dst uniforms:u paths:paths spider:spider tools:DYResolvedToolDocument(tools) colorManagement:state hostPrimaries:primaries error:error];
|
||||
return [self renderColorSource:stamped destination:dst uniforms:u paths:paths spider:spider tools:DYResolvedToolDocument(tools) colorManagement:state hostPrimaries:primaries error:error];
|
||||
}
|
||||
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,@"调色层或蒙版数据无效。");
|
||||
|
||||
在新工单中引用
屏蔽一个用户