feat: WIP unified workspace shared mask objects and OpenCV tracker core

这个提交包含在:
mac 于 2026-11-05 03:16:17 +08:00 提交
1 父节点 78e53b3889
当前提交 ca352248c1
36 个文件已更改
+5298 -164

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

+1 -1
查看文件
@@ -55,6 +55,6 @@ kernel void dyTrackFlow(device const float*prev[[buffer(0)]],device const float*
// This analysis-only image never changes the full-resolution color render.
kernel void dyToolCapture(texture2d<float> source [[texture(0)]],device float* pixels [[buffer(0)]],constant uint3& info [[buffer(1)]],uint2 pos [[thread_position_in_grid]]){
if(pos.x>=info.x||pos.y>=info.y)return;constexpr sampler f(coord::normalized,address::clamp_to_edge,filter::linear);uint2 taps=clamp(uint2(ceil(float2(source.get_width(),source.get_height())/float2(info.xy))),uint2(1),uint2(8));float sum=0;
for(uint y=0;y<taps.y;y++)for(uint x=0;x<taps.x;x++){float2 uv=(float2(pos)+(float2(x,y)+.5f)/float2(taps))/float2(info.xy);if(info.z)uv.y=1-uv.y;float4 sample=source.sample(f,uv);float3 linear=sample.a>0?sample.rgb/sample.a:float3(0);float3 encoded=select(1.055f*pow(max(linear,float3(0)),float3(1.f/2.4f))-.055f,linear*12.92f,linear<=.0031308f);sum+=dot(clamp(encoded,0.f,1.f),float3(.2126f,.7152f,.0722f));}
for(uint y=0;y<taps.y;y++)for(uint x=0;x<taps.x;x++){float2 uv=(float2(pos)+(float2(x,y)+.5f)/float2(taps))/float2(info.xy);if(info.z)uv.y=1-uv.y;float4 sample=source.sample(f,uv);float3 linear=sample.a>0?sample.rgb/sample.a:float3(0);float3 encoded=select(1.055f*pow(max(linear,float3(0)),float3(1.f/2.4f))-.055f,linear*12.92f,linear<=.0031308f);sum+=dot(clamp(encoded,0.f,1.f),float3(.299f,.587f,.114f));}
pixels[pos.y*info.x+pos.x]=sum/float(taps.x*taps.y);
}