summaryrefslogtreecommitdiffstats
path: root/virtual-programs/archive
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2022-11-19 17:11:44 +0000
committerOmar Rizwan <omar@omar.website>2022-11-19 17:11:44 +0000
commit677e2fd893ab2ea2fc96c120acf8d6b6b531177d (patch)
tree9d3d0b02033840d38a6402fa20479431d728bde2 /virtual-programs/archive
parentAdapt Display_vk.tcl to use new C FFI (diff)
downloadfolk-677e2fd893ab2ea2fc96c120acf8d6b6b531177d.tar.gz
folk-677e2fd893ab2ea2fc96c120acf8d6b6b531177d.zip
Archive some virtual programs that we already printed
Diffstat (limited to 'virtual-programs/archive')
-rw-r--r--virtual-programs/archive/hello-name.folk12
-rw-r--r--virtual-programs/archive/image.folk32
-rw-r--r--virtual-programs/archive/metrics.folk7
3 files changed, 47 insertions, 4 deletions
diff --git a/virtual-programs/archive/hello-name.folk b/virtual-programs/archive/hello-name.folk
new file mode 100644
index 00000000..bef035e2
--- /dev/null
+++ b/virtual-programs/archive/hello-name.folk
@@ -0,0 +1,12 @@
+Wish $this has filename "hello-name.folk"
+Wish $this is outlined blue
+
+When someone claims /firstName/ is /text/ {
+ Wish $this is outlined blue
+ Wish $this is labelled "
+
+
+
+
+Hi $text!"
+} \ No newline at end of file
diff --git a/virtual-programs/archive/image.folk b/virtual-programs/archive/image.folk
new file mode 100644
index 00000000..a011c09c
--- /dev/null
+++ b/virtual-programs/archive/image.folk
@@ -0,0 +1,32 @@
+Wish $this has filename "image.folk"
+
+namespace eval ::image {
+ proc width {im} { dict get $im width }
+ proc height {im} { dict get $im height }
+ proc subimage {im x y subwidth subheight} {
+ dict with im {
+ set x [expr {int($x)}]
+ set y [expr {int($y)}]
+ set subdata [expr {$data + ($y * $width + $x) * $components}]
+ dict create \
+ width $subwidth height $subheight \
+ components $components \
+ bytesPerRow $bytesPerRow \
+ data [format 0x%x $subdata]
+ }
+ }
+ namespace export *
+ namespace ensemble create
+}
+
+When the camera frame is /f/ {
+ When $this has region /r/ {
+ lassign [projectorToCamera [lindex $r 0 0]] x0 y0
+ lassign [projectorToCamera [lindex $r 0 2]] x1 y1
+ set thisimage [image subimage $f \
+ [expr {min($x0,$x1)}] [expr {min($y0,$y1)}] \
+ [expr {int(abs($x1-$x0))}] [expr {int(abs($y1-$y0))}]]
+ Wish display runs [list Display::image {*}[lindex $r 0 0] $thisimage]
+ }
+}
+Wish $this is outlined red
diff --git a/virtual-programs/archive/metrics.folk b/virtual-programs/archive/metrics.folk
index 71ad66be..cd01e289 100644
--- a/virtual-programs/archive/metrics.folk
+++ b/virtual-programs/archive/metrics.folk
@@ -4,11 +4,10 @@ When $::nodename has step count /c/ {
Wish $this is labelled [string trim "
step count: $c
step time: $::stepTime
-camera time: [expr {[namespace exists Camera] ? [lindex [lindex $Camera::statements 0] end] : {none}}]
+camera time: [expr {[namespace exists Camera] ? [lindex $Camera::statements 0 end] : {none}}]
+display time: $Display::displayTime
statement count: [Statements::size]
logsize: $::logsize
"]
- Wish $this is highlighted green
-# puts "$::nodename statement count: [Statements::size]"
-# puts "$::nodename statement sets-of-parents count: [Statements::countSetsOfParents]"
}
+Wish $this is outlined green \ No newline at end of file