Clone original pixels by translation and keep the tracked footprint stable

这个提交包含在:
mac 于 2026-11-05 22:21:25 +08:00 提交
1 父节点 dff9134be7
当前提交 1659f3d385
12 个文件已更改
+47 -30

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

+2 -4
查看文件
@@ -30,15 +30,13 @@
std::vector<DYCloneStamp> stamps;
FxRect image=source.imagePixelBounds,bounds=source.tilePixelBounds;
if(image.right<=image.left||image.top<=image.bottom)return source;
float aspect=float(image.right-image.left)/(image.top-image.bottom);
for(NSDictionary *mask in masks){
NSArray *patch=mask[@"stampSource"];
if(!patch||![mask[@"enabled"]boolValue])continue;
DYMaskParameters p=DYMaskAtTime(mask,kCMTimeInvalid);
if(p.strength<=0)continue;
float c=cosf(p.angle),s=sinf(p.angle);
stamps.push_back({p.centerX,p.centerY,[patch[0]floatValue],[patch[1]floatValue],[patch[2]floatValue],[patch[3]floatValue],
2*c/p.width,2*s/(p.width*aspect),-2*s*aspect/p.height,2*c/p.height,p.feather,p.strength,p.inputBlack,p.inputWhite,p.inputGamma});
stamps.push_back({p.centerX,p.centerY,[patch[0]floatValue],[patch[1]floatValue],
2/p.width,2/p.height,p.feather,p.strength,p.inputBlack,p.inputWhite,p.inputGamma});
}
if(stamps.empty())return source;
if(image.left!=bounds.left||image.right!=bounds.right||image.top!=bounds.top||image.bottom!=bounds.bottom){