Show synchronized frame previews and progress for stamp and mask tracking

这个提交包含在:
mac 于 2026-11-06 01:45:18 +08:00 提交
1 父节点 7b6a3106ca
当前提交 687a366e1c
11 个文件已更改
+363 -17

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

+13
查看文件
@@ -58,3 +58,16 @@ kernel void dyToolCapture(texture2d<float> source [[texture(0)]],device float* p
if(pos.x>=info.x||pos.y>=info.y)return;uint2 point=uint2(pos.x,info.z?info.y-1-pos.y:pos.y);uint3 rgb=uint3(rint(source.read(point).rgb*255.f));
pixels[pos.y*info.x+pos.x]=float((rgb.r*9798u+rgb.g*19235u+rgb.b*3735u+16384u)>>15)/255.f;
}
// Reuse the analysis source texture for the lightweight color preview.
kernel void dyToolTrackingPreview(texture2d<float> source [[texture(0)]],
device uchar4 *pixels [[buffer(0)]],
constant uint3 &info [[buffer(1)]],
uint2 pos [[thread_position_in_grid]]){
if(any(pos>=info.xy))return;
constexpr sampler filter(coord::normalized,address::clamp_to_edge,filter::linear);
float2 uv=(float2(pos)+.5f)/float2(info.xy);
if(info.z)uv.y=1-uv.y;
float3 rgb=source.sample(filter,uv).rgb;
pixels[pos.y*info.x+pos.x]=uchar4(uchar3(rint(saturate(rgb)*255)),255);
}