summaryrefslogtreecommitdiffstats
path: root/virtual-programs
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2023-02-07 08:04:49 +0000
committerOmar Rizwan <omar@omar.website>2023-02-07 08:04:49 +0000
commit6ba71dfdeadd887ae1d2ee6402902084b77dceb9 (patch)
tree41dcc79d5e98dbe946e12b0357eccdbb068d7af7 /virtual-programs
parentc-statements: Don't shimmer statement to dict (diff)
downloadfolk-6ba71dfdeadd887ae1d2ee6402902084b77dceb9.tar.gz
folk-6ba71dfdeadd887ae1d2ee6402902084b77dceb9.zip
Camera: Direct decompress to grayscale from the camera JPEG.
This produces a sort of terrifying performance improvement for the Camera subsystem (~30% faster on Pi 4 720p). Also (for now) heap-allocate a fresh image buffer for each camera frame -- a little gross but seems to work ok. It will probablycause new reactions on each camera frame, though, since pointers will now churn. (This is probably actually the right behavior.) Also temporarily disable camera-slice and images virtual programs, which I haven't tested yet. Calibration and Camera.tcl demo are tested and working here, though, at least on the Pi 4.
Diffstat (limited to 'virtual-programs')
-rw-r--r--virtual-programs/camera-slice.folk2
-rw-r--r--virtual-programs/images.folk2
2 files changed, 4 insertions, 0 deletions
diff --git a/virtual-programs/camera-slice.folk b/virtual-programs/camera-slice.folk
index 4812a302..3fac49da 100644
--- a/virtual-programs/camera-slice.folk
+++ b/virtual-programs/camera-slice.folk
@@ -2,6 +2,8 @@ Wish $this has filename "camera-slice.folk"
Wish $this has camera image
Wish $this is outlined thick palegoldenrod
+return
+
When $this has camera image /im/ {
When $this has region /r/ {
set coords [lmap n [lindex $r 0 0] {expr $n * 1}]
diff --git a/virtual-programs/images.folk b/virtual-programs/images.folk
index 84c74faa..498c79cb 100644
--- a/virtual-programs/images.folk
+++ b/virtual-programs/images.folk
@@ -22,6 +22,8 @@ namespace eval ::image {
namespace ensemble create
}
+return
+
When /someone/ wishes /p/ has camera image {
When the camera frame is /f/ {
When $p has region /r/ {