Camera: C ISP pipeline, contrast autofocus, and VFR video
CI / test (push) Canceled after 0s

- Add chandra-camera-isp.c (C/OpenMP) for Quad-Bayer unpack, CCM, and tone mapping, with a NumPy fallback when it is not built
- Add non-blocking contrast-detection VCM autofocus, with lens subdev discovery on the sensor's I2C bus
- Tune Quad-Bayer AE: a video-mode vblank cap, damped steps, and full analog gain before extending blanking
- Record variable-frame-rate video through a streaming Matroska muxer, and count dropped frames
- Ship libcamera IPA tuning files for imx376, imx519, and uncalibrated sensors
- Map camera buffers by fd and sync them with dma-buf ioctls
This commit is contained in:
nandi committed 2026-11-28 19:25:43 -08:00
1 parent 851c39d827
commit 52b42890d6
34 files changed
+2851 -364

No files matched your search

+55
View File
@@ -137,3 +137,58 @@ test "shm_thumbnail scales a client buffer; set_image swaps an image in place" {
@renderer.draw_ops(dst, [@scene.DrawOp::Image(@scene.Rect::new(0, 0, 2, 1), h)], 0, 0)
assert_eq(dst.pixel(0, 0), Some(@scene.Rgba::new(0, 0, 255, 255)))
}
///|
test "inline emoji source integrates into text_width and draw_ops" {
assert_eq(@renderer.inline_emoji_px(0), 0)
assert_eq(@renderer.inline_emoji_px(12), 15)
assert_eq(@renderer.inline_emoji_px(13), 16)
assert_eq(@renderer.inline_emoji_px(14), 17)
let epx = @renderer.inline_emoji_px(13)
let turtle = @renderer.Pixmap::new(epx, epx)
for y = 0; y < epx; y = y + 1 {
for x = 0; x < epx; x = x + 1 {
let o = (y * epx + x) * 4
turtle.data[o] = (110).to_byte()
turtle.data[o + 1] = (130).to_byte()
turtle.data[o + 2] = (58).to_byte()
turtle.data[o + 3] = b'\xff'
}
}
let th = @renderer.add_image(turtle)
let block = Bytes::make(4 * 8, b'\xff')
@renderer.set_glyph_source(fn(cp, _size, _bold, _mono) {
if cp == 0x1F422 {
{ w: 0, h: 0, xoff: 0, yoff: 0, advance: 6, coverage: b"", embolden: false }
} else if cp == 32 {
{ w: 0, h: 0, xoff: 0, yoff: 0, advance: 6, coverage: b"", embolden: false }
} else {
{ w: 4, h: 8, xoff: 0, yoff: -8, advance: 6, coverage: block, embolden: false }
}
})
@renderer.set_emoji_source(
fn(chars, start, _bold, _mono) {
if start < chars.length() && chars[start].to_int() == 0x1F422 {
Some((start + 1, "🐢"))
} else {
None
}
},
fn(seq, _px) { if seq == "🐢" { th } else { 0U } },
)
assert_eq(@renderer.text_width("Hi 🐢", 13, false, false), 18 + epx)
assert_eq(@renderer.text_width("Hi \u{200D}🐢\u{FE0F}", 13, false, false), 18 + epx)
let pm = @renderer.Pixmap::new(64, 40)
@renderer.draw_ops(
pm,
[@scene.DrawOp::Text(10, 20, "Hi 🐢", 13, @scene.Rgba::new(255, 255, 255, 255), Left, false)],
0,
0,
)
// 'H' at x=10..13, y=(20 + 8/2) - 8 .. = 16..23 is white; inline turtle at x=28..28+epx-1 is olive-green.
assert_eq(pm.pixel(11, 20), Some(@scene.Rgba::new(255, 255, 255, 255)))
assert_eq(pm.pixel(28 + epx / 2, 20), Some(@scene.Rgba::new(110, 130, 58, 255)))
}