diff --git a/research/MaskWorkflow1.4.1.md b/research/MaskWorkflow1.4.1.md index 9fd8157..ae370d8 100644 --- a/research/MaskWorkflow1.4.1.md +++ b/research/MaskWorkflow1.4.1.md @@ -20,7 +20,7 @@ HSL与后续颜色分级、红通道曲线与HSL的独立非交换参照,以 修复检视器添加钢笔未携带绘制态的问题,提供“重画钢笔”“完成绘制”“取消绘制”。点击放点、按住拖出共线双柄,鼠标移动显示下一段预览;至少三个点时点首节点、Return或完成按钮闭合。Delete回退未提交点,选中已闭合路径节点可删除(至少保留三点)。Esc/取消恢复原作者路径。绘制中禁用跟踪,完成或取消后恢复。 -OSC回调只在锁内更新内存草稿,立即供下一次绘制读取;宿主参数提交留到回调结束后的主队列,形成一次撤销。连续手势排队保留,跨帧草稿、过期目标和迟到模式通知拒绝覆盖。绘制、命中和坐标缓存也有自身互斥。原生检查覆盖检视器入口、默认形状外放点、即时预览、曲柄、首节点/Return闭合、完成/取消按钮、归档、连续手势和跨帧拒绝。 +OSC回调只在锁内更新内存草稿,立即供下一次绘制读取;宿主参数提交留到回调结束后的主队列,形成一次撤销。连续手势排队保留,跨帧草稿、过期目标和迟到模式通知拒绝覆盖。绘制、命中和坐标缓存也有自身互斥。画面位图上下坐标与AppKit上下文方向保持一致,修正钢笔提示条文字翻转。原生检查覆盖检视器入口、默认形状外放点、即时预览、曲柄、首节点/Return闭合、完成/取消按钮、归档、连续手势和跨帧拒绝。 ## Color Finale 对照与跟踪 diff --git a/tools/create_mask_host_fixture.py b/tools/create_mask_host_fixture.py index 6e17d5d..eee69c7 100644 --- a/tools/create_mask_host_fixture.py +++ b/tools/create_mask_host_fixture.py @@ -6,7 +6,7 @@ out=Path('/Users/mac/Library/Caches/CodexBuilds/com.dayu.color/fcp-qa');out.mkdi media=out/'大鱼调色_蒙版合成运动.mov' if not media.exists(): subprocess.run(['/opt/homebrew/bin/ffmpeg','-v','error','-f','lavfi','-i',"nullsrc=s=1080x640:r=25:d=4,geq=lum='128+70*sin(X/11)*cos(Y/9)+35*sin((X+Y)/4)':cb='128+35*sin(X/17)':cr='128+35*cos(Y/21)',crop=960:540:'40+10*t':'40+5*t'",'-c:v','prores_ks','-profile:v','2','-pix_fmt','yuv422p10le','-color_primaries','bt709','-color_trc','bt709','-colorspace','bt709',str(media)],check=True) -root=E.Element('fcpxml',version='1.12');res=E.SubElement(root,'resources');E.SubElement(res,'format',id='f1',width='960',height='540',frameDuration='1/25s',colorSpace='1-1-1 (Rec. 709)');a=E.SubElement(res,'asset',id='a1',name='合成运动纹理',start='0s',duration='4s',format='f1',hasVideo='1',videoSources='1');E.SubElement(a,'media-rep',kind='original-media',src=media.as_uri());template=Path('/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef');E.SubElement(res,'effect',id='fx',name='大鱼调色',uid='~/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef',src=template.as_uri());lib=E.SubElement(root,'library');event=E.SubElement(lib,'event',name='大鱼调色_1.4.1_25_蒙版与工具层验收') -for name in ['大鱼调色_1.4.1_25_独立工具与蒙版','大鱼调色_1.4.1_25_逐帧跟踪']: +root=E.Element('fcpxml',version='1.12');res=E.SubElement(root,'resources');E.SubElement(res,'format',id='f1',width='960',height='540',frameDuration='1/25s',colorSpace='1-1-1 (Rec. 709)');a=E.SubElement(res,'asset',id='a1',name='合成运动纹理',start='0s',duration='4s',format='f1',hasVideo='1',videoSources='1');E.SubElement(a,'media-rep',kind='original-media',src=media.as_uri());template=Path('/Users/mac/Movies/Motion Templates.localized/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef');E.SubElement(res,'effect',id='fx',name='大鱼调色',uid='~/Effects.localized/大鱼调色/大鱼调色/大鱼调色.moef',src=template.as_uri());lib=E.SubElement(root,'library');event=E.SubElement(lib,'event',name='大鱼调色_1.4.1_26_蒙版与工具层验收') +for name in ['大鱼调色_1.4.1_26_独立工具与蒙版','大鱼调色_1.4.1_26_逐帧跟踪']: project=E.SubElement(event,'project',name=name);seq=E.SubElement(project,'sequence',format='f1',tcStart='0s',tcFormat='NDF',audioLayout='stereo',audioRate='48k',duration='4s');spine=E.SubElement(seq,'spine');clip=E.SubElement(spine,'asset-clip',ref='a1',name=name,offset='0s',start='0s',duration='4s');E.SubElement(clip,'filter-video',ref='fx',name='大鱼调色',enabled='1') -E.indent(root);xml=out/'大鱼调色_1.4.1_25_蒙版与工具层.fcpxml';xml.write_text('\n\n'+E.tostring(root,encoding='unicode')+'\n');print(xml) +E.indent(root);xml=out/'大鱼调色_1.4.1_26_蒙版与工具层.fcpxml';xml.write_text('\n\n'+E.tostring(root,encoding='unicode')+'\n');print(xml) diff --git a/大鱼调色/Plugin/DYToolOSC.inc.h b/大鱼调色/Plugin/DYToolOSC.inc.h index 26c2eb5..7bc6939 100644 --- a/大鱼调色/Plugin/DYToolOSC.inc.h +++ b/大鱼调色/Plugin/DYToolOSC.inc.h @@ -23,6 +23,8 @@ DYPlugIn *plugin=[self pluginAtTime:time];NSDictionary *mask=[plugin toolCanvasMaskAtTime:time];NSInteger route=(plugin?1:0)+(mask?2:0);if(route!=_lastRoute||_drawCount++<2){_lastRoute=route;os_log(OS_LOG_DEFAULT,"dayu_tool_osc_route plugin=%{public}d mask=%{public}d width=%{public}.2f height=%{public}.2f",plugin!=nil,mask!=nil,_imageRect.size.width,_imageRect.size.height);}[_mask release];_mask=[mask copy];[_handles removeAllObjects];[_outline release];_outline=nil; if(mask&&canvasWidth>0&&_height>0&&canvasWidth<16384&&_height<16384&&_imageRect.size.width>0&&_imageRect.size.height>0){ NSBitmapImageRep *bitmap=[[[NSBitmapImageRep alloc]initWithBitmapDataPlanes:NULL pixelsWide:(NSInteger)canvasWidth pixelsHigh:(NSInteger)_height bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bytesPerRow:(NSInteger)canvasWidth*4 bitsPerPixel:32]autorelease];memset(bitmap.bitmapData,0,bitmap.bytesPerRow*bitmap.pixelsHigh);[NSGraphicsContext saveGraphicsState];[NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:bitmap]];NSAffineTransform *flip=[NSAffineTransform transform];[flip translateXBy:0 yBy:_height];[flip scaleXBy:1 yBy:-1];[flip concat]; + // Match AppKit text/image drawing to the top-down canvas CTM. + [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithCGContext:NSGraphicsContext.currentContext.CGContext flipped:YES]]; DYMaskParameters p;[mask[@"parameters"]getBytes:&p length:sizeof(p)];p.imageAspect=_imageRect.size.width/_imageRect.size.height;_outline=[[NSBezierPath bezierPath]retain]; if(p.kind==DYMaskBezier){NSData *data=mask[@"nodes"];auto *nodes=(const DYBezierNode*)data.bytes;NSUInteger count=data.length/sizeof(DYBezierNode);for(NSUInteger i=0;i3){NSBezierPath *line=[NSBezierPath bezierPath];[line moveToPoint:anchor];[line lineToPoint:handle];[[NSColor colorWithWhite:1 alpha:.55]setStroke];[line stroke];[self addHandle:handle part:1000+i*3+j+1];}}} NSArray *hover=mask[@"hover"];if(count&&[mask[@"drawing"]boolValue]&&hover.count==2){NSPoint target=NSMakePoint(_imageRect.origin.x+[hover[0]doubleValue]*_imageRect.size.width,_imageRect.origin.y+[hover[1]doubleValue]*_imageRect.size.height);[_outline curveToPoint:target controlPoint1:[self canvasPoint:nodes[count-1].outX y:nodes[count-1].outY parameters:p] controlPoint2:target];} diff --git a/大鱼调色/Plugin/Info.plist b/大鱼调色/Plugin/Info.plist index aee1127..fcbc8ae 100644 --- a/大鱼调色/Plugin/Info.plist +++ b/大鱼调色/Plugin/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.4.1 CFBundleVersion - 25 + 26 NSHumanReadableCopyright PlugInKit diff --git a/大鱼调色/Wrapper Application/Info.plist b/大鱼调色/Wrapper Application/Info.plist index 9752059..654c3a4 100644 --- a/大鱼调色/Wrapper Application/Info.plist +++ b/大鱼调色/Wrapper Application/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.4.1 CFBundleVersion - 25 + 26 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright