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

@@ -207,17 +207,57 @@ fn status_line(s : @net.NetStatus) -> String {
}
}
///| Display-cell width of one Unicode scalar value in `fit` (0 for emoji modifiers/tags,
/// 2 for supplementary emoji, 1 otherwise).
fn fit_cells(cp : Int) -> Int {
if cp == 0xFE0E ||
cp == 0xFE0F ||
cp == 0x200D ||
cp == 0x20E3 ||
(cp >= 0x1F3FB && cp <= 0x1F3FF) ||
(cp >= 0xE0020 && cp <= 0xE007F) {
0
} else if cp >= 0x1F000 {
2
} else {
1
}
}
///| `s` cut to fit `w` pixels at font size `fs`.
fn fit(s : String, w : Int, fs : Int) -> String {
let cw = (fs * 6 + 9) / 10
let n = if cw > 0 { w / cw } else { s.length() }
if s.length() <= n {
s
} else if n <= 1 {
""
} else {
s[:n - 1].to_string() + "…"
let chars = s.to_array()
let mut total = 0
for ch in chars {
total = total + fit_cells(ch.to_int())
}
let cw = (fs * 6 + 9) / 10
let n = if cw > 0 { w / cw } else { total }
if total <= n {
return s
}
if n <= 1 {
return ""
}
let kept : Array[Char] = []
let mut used = 0
for ch in chars {
let c = fit_cells(ch.to_int())
if used + c > n - 1 {
break
}
kept.push(ch)
used = used + c
}
while kept.length() > 0 && kept[kept.length() - 1].to_int() == 0x200D {
ignore(kept.pop())
}
let sb = StringBuilder::new()
for ch in kept {
sb.write_char(ch)
}
sb.write_char('…')
sb.to_string()
}
///|