Clone original pixels by translation and keep the tracked footprint stable
这个提交包含在:
1 父节点
dff9134be7
当前提交
1659f3d385
12 个文件已更改
+47
-30
没有与搜索条件相匹配的文件
@@ -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){
|
||||
|
||||
在新工单中引用
屏蔽一个用户