Commit: 01ecca9
Parent: aa34d60

Avoid hot-path int[] creation

Mårten Åsberg committed on 2026-06-10 at 17:46
src/Integrations/FaceCamera/FaceDetectionService.cs +3 -3
diff --git a/src/Integrations/FaceCamera/FaceDetectionService.cs b/src/Integrations/FaceCamera/FaceDetectionService.cs
index e010e4d..45522c7 100644
@@ -152,9 +152,9 @@ public sealed class FaceDetectionService : IDisposable
var row = accessor.GetRowSpan(y);
for (var x = 0; x < image.Width; x++)
{
tensor[0, 2, y, x] = row[x].R;
tensor[0, 1, y, x] = row[x].G;
tensor[0, 0, y, x] = row[x].B;
tensor.SetValue(2 * image.Width * image.Height + y * image.Width + x, row[x].R);
tensor.SetValue(1 * image.Width * image.Height + y * image.Width + x, row[x].G);
tensor.SetValue(0 * image.Width * image.Height + y * image.Width + x, row[x].B);
}
}
});