Replace legacy automatic stamp keys on the same host analysis frame

这个提交包含在:
mac 于 2026-11-06 00:34:23 +08:00 提交
1 父节点 52a7422004
当前提交 810bbf4dfb
9 个文件已更改
+101 -23

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

@@ -130,6 +130,17 @@ if(faceFixture.length){
DYMergeTracking(stamp,@[DYStampKey(CMTimeMake(2,50),differentTarget,NO,.9,endMotion)])&&
[stamp[@"keys"] count]==1&&DYMaskAtTime(stamp,next).centerY==moved.centerY&&
DYStampMotionAtTime(stamp,next).sourceScaleX==1.25f);
CMTime frameDuration=CMTimeMake(1,25),nearStart=CMTimeMake(-1,150),nearEnd=CMTimeMake(7,150);
CMTime previous=CMTimeMake(-1,25),following=CMTimeMake(2,25),authored=CMTimeMake(1,150);
stamp[@"keys"]=@[DYMaskKey(previous,p,NO,1),DYMaskKey(nearStart,p,NO,1),
DYMaskKey(authored,p,YES,1),DYMaskKey(nearEnd,p,NO,1),DYMaskKey(following,p,NO,1)];
NSArray *pairKeys=@[DYStampKey(kCMTimeZero,p,NO,1,startMotion),DYStampKey(next,moved,NO,1,endMotion)];
BOOL merged=DYMergeTracking(stamp,pairKeys,frameDuration);
NSArray *mergedKeys=stamp[@"keys"];
run.record(@"clone-stamp-replaces-same-frame-automatic-keys-from-offset-host-clock",
merged&&mergedKeys.count==5&&[mergedKeys[0] isEqual:DYMaskKey(previous,p,NO,1)]&&
[mergedKeys[1] isEqual:pairKeys[0]]&&[mergedKeys[2] isEqual:DYMaskKey(authored,p,YES,1)]&&
[mergedKeys[3] isEqual:pairKeys[1]]&&[mergedKeys[4] isEqual:DYMaskKey(following,p,NO,1)]);
stamp[@"enabled"]=@NO;Pixels disabled=frame(next,@"clone-stamp-disabled-render");
run.record(@"clone-stamp-disabled-is-identical",difference(disabled,baseline).maximum==0);
stamp[@"enabled"]=@YES;NSError *failure=nil;
+2 -2
查看文件
@@ -62,7 +62,7 @@
if(selection){
[NSNotificationCenter.defaultCenter postNotificationName:DYModelChanged object:self->_apiManager];
[NSNotificationCenter.defaultCenter postNotificationName:@"DYToolCanvasSelection" object:self->_apiManager userInfo:selection];
[self postToolCanvasStatus:@"仿制图章已保存 · 可跟踪目标区域"];
[self postToolCanvasStatus:@"仿制图章已保存 · 可跟踪取样与覆盖区域"];
}else [self postToolCanvasStatus:failure];
completion(failure);
});
@@ -191,7 +191,7 @@
}@finally{_trackingInFrame.store(false);}
}
- (BOOL)cleanupAnalysis:(NSError**)error {
if(!_trackingActive.load()||_trackingFinishing.exchange(true))return YES;BOOL changed=_trackingSamples.count>1;if(changed&&!DYMergeTracking(_trackingCandidate,_trackingSamples)){[_trackingMessage release];_trackingMessage=[@"轨迹合并失败,原蒙版已保留" copy];_trackingDiscard=YES;}
if(!_trackingActive.load()||_trackingFinishing.exchange(true))return YES;BOOL changed=_trackingSamples.count>1;if(changed&&!DYMergeTracking(_trackingCandidate,_trackingSamples,_trackingFrameDuration)){[_trackingMessage release];_trackingMessage=[@"轨迹合并失败,原蒙版已保留" copy];_trackingDiscard=YES;}
_toolTracker.stop();
if(_trackingStampMotion.active)_stampSourceTracker.stop();
uint64_t generation=_trackingGeneration;BOOL second=_trackingBoth&&!_trackingBackward&&!_trackingCancelled.load()&&!_trackingDiscard;
+1 -1
查看文件
@@ -54,7 +54,7 @@ DYStampMotion DYStampMotionAtTime(NSDictionary *stamp,CMTime time);
NSArray *DYStampSourceAtTime(NSDictionary *stamp,CMTime time);
NSArray *DYStampSamplingScaleAtTime(NSDictionary *stamp,CMTime time);
NSDictionary *DYStampKey(CMTime time,DYMaskParameters parameters,BOOL manual,float confidence,DYStampMotion motion);
BOOL DYMergeTracking(NSMutableDictionary *mask,NSArray *samples);
BOOL DYMergeTracking(NSMutableDictionary *mask,NSArray *samples,CMTime frameDuration=kCMTimeInvalid);
NSDictionary *DYToolRenderSnapshot(NSDictionary *document,CMTime time);
DYUniforms DYToolUniforms(NSDictionary *node);
BOOL DYToolIsNeutral(NSDictionary *node);
+7 -1
查看文件
@@ -251,12 +251,18 @@ NSDictionary *DYStampKey(CMTime time,DYMaskParameters p,BOOL manual,float confid
@(motion.sourceScaleY),@(motion.targetScaleX),@(motion.targetScaleY)];
return paired;
}
BOOL DYMergeTracking(NSMutableDictionary *m,NSArray *samples){
BOOL DYMergeTracking(NSMutableDictionary *m,NSArray *samples,CMTime frameDuration){
if(!samples.count)return YES;
NSMutableArray *all=[NSMutableArray array];
NSMutableDictionary *manualByTime=[NSMutableDictionary dictionary];
CMTime lo=keyTime(samples.firstObject),hi=keyTime(samples.lastObject);
if(CMTimeCompare(lo,hi)>0)std::swap(lo,hi);
if(m[@"stampSource"]&&CMTIME_IS_NUMERIC(frameDuration)&&frameDuration.value>0){
// FCP can shift analysis timestamps by a fraction of a frame between passes.
// Replace an older automatic key belonging to the first or last new frame.
CMTime half=CMTimeMultiplyByRatio(frameDuration,1,2);
lo=CMTimeSubtract(lo,half);hi=CMTimeAdd(hi,half);
}
// Normalize equivalent time fractions when preserving authored keys.
auto timeID=[](NSDictionary *key){
CMTime time=keyTime(key);
+1 -1
查看文件
@@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.14.0</string>
<key>CFBundleVersion</key>
<string>89</string>
<string>90</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>PlugInKit</key>
+1 -1
查看文件
@@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.14.0</string>
<key>CFBundleVersion</key>
<string>89</string>
<string>90</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>