guides:example-programs
This is an old revision of the document!
Table of Contents
Example programs
Camera slice
When $this has camera slice /slice/ {
Wish $this displays camera slice $slice
}
Points up
When $this points up at /target/ {
Wish $target is labelled "being pointed at"
}
Frame image
When the camera frame is /im/ {
Wish the web server handles route "/frame-image/$" with handler [list apply {{im} {
set filename "/tmp/web-image-frame.jpg"
image saveAsJpeg $im $filename
set fsize [file size $filename]
set fd [open $filename r]
fconfigure $fd -encoding binary -translation binary
set body [read $fd $fsize]
close $fd
dict create statusAndHeaders "HTTP/1.1 200 OK\nConnection: close\nContent-Type: image/jpeg\nContent-Length: $fsize\n\n" body $body
}} $im]
}
guides/example-programs.1698937369.txt.gz · Last modified: by osnr
