From ffc2429659c05666446b57d441bbf5a302714e28 Mon Sep 17 00:00:00 2001 From: Cristobal Sciutto Date: Sat, 27 May 2023 17:55:57 -0400 Subject: bounds checks --- virtual-programs/images.folk | 72 ++++++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 23 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/images.folk b/virtual-programs/images.folk index 42adeb10..716c4ba5 100644 --- a/virtual-programs/images.folk +++ b/virtual-programs/images.folk @@ -3,29 +3,55 @@ Wish $this has filename "images.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 + 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 /someone/ wishes /p/ has camera image & the camera frame is /f/ & /p/ has region /r/ { - lassign [regionToBbox $r] minX minY maxX maxY - set subimage [image subimage $f \ - $minX $minY \ - [expr {int($maxX - $minX)}] [expr {int($maxY - $minY)}]] - Claim $p has camera image $subimage + +When /someone/ wishes /p/ has camera image { + When the camera frame is /f/ { + When $p has region /r/ { + lassign [regionToBbox $r] minX minY maxX maxY + + set imW [image width $f] + set imH [image height $f] + + set x [expr {int(max($minX * $imW / $Display::WIDTH, 0))}] + set y [expr {int(max($minY * $imH / $Display::HEIGHT, 0))}] + set w [expr {int(min(($maxX - $minX) * $imW / $Display::WIDTH, $imW))}] + set h [expr {int(min(($maxY - $minY) * $imH / $Display::HEIGHT, $imH))}] + + Wish $p is labelled "display: $Display::WIDTH $Display::HEIGHT" + Wish $p is labelled "display bbox: $minX $minY $maxX $maxY" + Wish $p is labelled "image: $imW $imH" + Wish $p is labelled "sub-image: $x $y $w $h" + + set subimage [image subimage $f $x $y $w $h] + Claim $p has camera image $subimage + } + } } + + +# Wish $this has camera image +# Wish $this is outlined thick palegoldenrod +# +# When $this has camera image /im/ & $this has region /r/ { +# set coords [lmap n [lindex $r 0 0] {expr $n * 1}] +# Wish display runs [list Display::image {*}$coords $im] +# } -- cgit v1.2.3 From 14d1cc5528c9775af65a3641439538d4b169ee36 Mon Sep 17 00:00:00 2001 From: Cristobal Sciutto Date: Sat, 27 May 2023 19:08:43 -0400 Subject: label tweaks --- virtual-programs/label.folk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/label.folk b/virtual-programs/label.folk index 66b416ce..5462c5df 100644 --- a/virtual-programs/label.folk +++ b/virtual-programs/label.folk @@ -19,7 +19,8 @@ When /thing/ has region /region/ { set shouldFlip [expr {abs($radians) < 1.57}] if {$::isLaptop} { set shouldFlip false} set ly [expr {$shouldFlip ? $y+$lineNum*$fontSize*18 : $y+$lineNum*$fontSize*18}] - Display::text device $x $ly $fontSize [lindex [expr {$shouldFlip ? [lreverse $lines] : $lines }] $lineNum] $radians + set line [lindex [expr {$shouldFlip ? [lreverse $lines] : $lines }] $lineNum] + Display::text device $x $ly $fontSize $line $radians } } } @@ -33,4 +34,4 @@ When /anyone/ wishes /p/ has halo message /message/ & /p/ has region /r/ { lassign $a x y text $a $message 0 text $d $message 180 -} \ No newline at end of file +} -- cgit v1.2.3 From ea22e4637027868007923e2eaf7b70788e7812dc Mon Sep 17 00:00:00 2001 From: Cristobal Sciutto Date: Mon, 29 May 2023 14:57:37 -0400 Subject: refactor label.folk --- virtual-programs/label.folk | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/label.folk b/virtual-programs/label.folk index 5462c5df..58eccc40 100644 --- a/virtual-programs/label.folk +++ b/virtual-programs/label.folk @@ -1,28 +1,31 @@ Wish $this has filename "label.folk" When /thing/ has region /region/ { - set bbox [regionToBbox $region] - lassign [boxCentroid $bbox] x y - set width [boxWidth $bbox] - set height [boxHeight $bbox] - - set radians [lindex $region 2] - if {$radians eq ""} {set radians 0} - - When the collected matches for [list /someone/ wishes $thing is labelled /text/] are /matches/ { - set text [join [lmap match $matches {dict get $match text}] "\n"] - if {$text eq ""} { return } - - set lines [split $text "\n"] - set fontSize 1 - for {set lineNum 0} {$lineNum < [llength $lines]} {incr lineNum} { - set shouldFlip [expr {abs($radians) < 1.57}] - if {$::isLaptop} { set shouldFlip false} - set ly [expr {$shouldFlip ? $y+$lineNum*$fontSize*18 : $y+$lineNum*$fontSize*18}] - set line [lindex [expr {$shouldFlip ? [lreverse $lines] : $lines }] $lineNum] - Display::text device $x $ly $fontSize $line $radians - } + set bbox [regionToBbox $region] + lassign [boxCentroid $bbox] x y + set width [boxWidth $bbox] + set height [boxHeight $bbox] + + set radians [lindex $region 2] + if {$radians eq ""} {set radians 0} + + set upsidedown [expr {abs($radians) < 1.57}] + if {$::isLaptop} {set upsidedown false} + + When the collected matches for [list /someone/ wishes $thing is labelled /text/] are /matches/ { + set lines [lmap match $matches {dict get $match text}] + if {[llength lines] eq 0} { return } + + set lines [expr {$upsidedown ? [lreverse $lines] : $lines}] + set scale 1 + set fontSize [expr {18 * $scale}] + + for {set lineNum 0} {$lineNum < [llength $lines]} {incr lineNum} { + set line [lindex $lines $lineNum] + set ly [expr {$y + $lineNum * $fontSize}] + Display::text device $x $ly $scale $line $radians } + } } proc text {coords text angle} { -- cgit v1.2.3 From 0e4f3dc5bb3fe4f687c71cfa35c0b2b9d45500e3 Mon Sep 17 00:00:00 2001 From: Cristobal Sciutto Date: Mon, 29 May 2023 15:06:39 -0400 Subject: refactor camera slice --- virtual-programs/images.folk | 82 +++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 43 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/images.folk b/virtual-programs/images.folk index 716c4ba5..bec7bc22 100644 --- a/virtual-programs/images.folk +++ b/virtual-programs/images.folk @@ -3,55 +3,51 @@ Wish $this has filename "images.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] + 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 + namespace export * + namespace ensemble create } When /someone/ wishes /p/ has camera image { - When the camera frame is /f/ { - When $p has region /r/ { - lassign [regionToBbox $r] minX minY maxX maxY - - set imW [image width $f] - set imH [image height $f] - - set x [expr {int(max($minX * $imW / $Display::WIDTH, 0))}] - set y [expr {int(max($minY * $imH / $Display::HEIGHT, 0))}] - set w [expr {int(min(($maxX - $minX) * $imW / $Display::WIDTH, $imW))}] - set h [expr {int(min(($maxY - $minY) * $imH / $Display::HEIGHT, $imH))}] - - Wish $p is labelled "display: $Display::WIDTH $Display::HEIGHT" - Wish $p is labelled "display bbox: $minX $minY $maxX $maxY" - Wish $p is labelled "image: $imW $imH" - Wish $p is labelled "sub-image: $x $y $w $h" - - set subimage [image subimage $f $x $y $w $h] - Claim $p has camera image $subimage + When the camera frame is /f/ { + When $p has region /r/ { + # Convert region in projector coordinates to camera + lassign [regionToBbox $r] minX minY maxX maxY + lassign [projectorToCamera [list $minX $minY]] px0 py0 + lassign [projectorToCamera [list $maxX $maxY]] px1 py1 + + # Clamp to image bounds + set x [expr {int(max($px0, 0))}] + set y [expr {int(max($py0, 0))}] + set w [expr {int(min($px1 - $px0, [image width $f]))}] + set h [expr {int(min($py1 - $py0, [image height $f]))}] + + # Extract and claim the image for the page + set subimage [image subimage $f $x $y $w $h] + Claim $p has camera slice $subimage + } } - } } +Wish $this has camera image +Wish $this is outlined thick palegoldenrod -# Wish $this has camera image -# Wish $this is outlined thick palegoldenrod -# -# When $this has camera image /im/ & $this has region /r/ { -# set coords [lmap n [lindex $r 0 0] {expr $n * 1}] -# Wish display runs [list Display::image {*}$coords $im] -# } +When $this has camera slice /im/ & $this has region /r/ { + set origin [lindex $r 0 0] + Wish display runs [list Display::image {*}$origin $im] +} -- cgit v1.2.3 From a978f492a25605c55fd4cbaea59ec7c7c7359991 Mon Sep 17 00:00:00 2001 From: Cristobal Sciutto Date: Mon, 29 May 2023 15:21:42 -0400 Subject: scale up image to match projector resolution --- virtual-programs/images.folk | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/images.folk b/virtual-programs/images.folk index bec7bc22..d7f8080b 100644 --- a/virtual-programs/images.folk +++ b/virtual-programs/images.folk @@ -44,10 +44,16 @@ When /someone/ wishes /p/ has camera image { } } -Wish $this has camera image Wish $this is outlined thick palegoldenrod + +Wish $this has camera image When $this has camera slice /im/ & $this has region /r/ { - set origin [lindex $r 0 0] - Wish display runs [list Display::image {*}$origin $im] + set origin [lindex $r 0 0] + + lassign [regionToBbox $r] minX minY maxX maxY + set regionWidth [expr {$maxX - $minX}] + set scale [expr {$Display::WIDTH / $regionWidth}] + + Wish display runs [list Display::image {*}$origin $im $scale] } -- cgit v1.2.3 From f30eae538fc27fc3c251a65118c78802ab668506 Mon Sep 17 00:00:00 2001 From: Cristobal Sciutto Date: Mon, 29 May 2023 15:29:38 -0400 Subject: tweak syntax and types --- virtual-programs/images.folk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/images.folk b/virtual-programs/images.folk index d7f8080b..d3810c41 100644 --- a/virtual-programs/images.folk +++ b/virtual-programs/images.folk @@ -39,7 +39,7 @@ When /someone/ wishes /p/ has camera image { # Extract and claim the image for the page set subimage [image subimage $f $x $y $w $h] - Claim $p has camera slice $subimage + Claim $p has camera slice $subimage for region $r } } } @@ -48,7 +48,7 @@ Wish $this is outlined thick palegoldenrod Wish $this has camera image -When $this has camera slice /im/ & $this has region /r/ { +When $this has camera slice /im/ for region /r/ { set origin [lindex $r 0 0] lassign [regionToBbox $r] minX minY maxX maxY -- cgit v1.2.3 From 817b5ae48fcff0fadb86c95fdd488c72a752cba6 Mon Sep 17 00:00:00 2001 From: Cristobal Sciutto Date: Mon, 29 May 2023 15:36:09 -0400 Subject: last image -> slice --- virtual-programs/images.folk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/images.folk b/virtual-programs/images.folk index d3810c41..8cd0c5d1 100644 --- a/virtual-programs/images.folk +++ b/virtual-programs/images.folk @@ -23,7 +23,7 @@ namespace eval ::image { } -When /someone/ wishes /p/ has camera image { +When /someone/ wishes /p/ has camera slice { When the camera frame is /f/ { When $p has region /r/ { # Convert region in projector coordinates to camera @@ -47,7 +47,7 @@ When /someone/ wishes /p/ has camera image { Wish $this is outlined thick palegoldenrod -Wish $this has camera image +Wish $this has camera slice When $this has camera slice /im/ for region /r/ { set origin [lindex $r 0 0] -- cgit v1.2.3 From 652aa361405d3a92369fae332a277e54c0a5834c Mon Sep 17 00:00:00 2001 From: Cristobal Sciutto Date: Fri, 2 Jun 2023 15:09:50 -0400 Subject: & instead of nest --- virtual-programs/images.folk | 45 ++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/images.folk b/virtual-programs/images.folk index 8cd0c5d1..778c0afc 100644 --- a/virtual-programs/images.folk +++ b/virtual-programs/images.folk @@ -23,30 +23,27 @@ namespace eval ::image { } -When /someone/ wishes /p/ has camera slice { - When the camera frame is /f/ { - When $p has region /r/ { - # Convert region in projector coordinates to camera - lassign [regionToBbox $r] minX minY maxX maxY - lassign [projectorToCamera [list $minX $minY]] px0 py0 - lassign [projectorToCamera [list $maxX $maxY]] px1 py1 - - # Clamp to image bounds - set x [expr {int(max($px0, 0))}] - set y [expr {int(max($py0, 0))}] - set w [expr {int(min($px1 - $px0, [image width $f]))}] - set h [expr {int(min($py1 - $py0, [image height $f]))}] - - # Extract and claim the image for the page - set subimage [image subimage $f $x $y $w $h] - Claim $p has camera slice $subimage for region $r - } - } +When \ + /someone/ wishes /p/ has camera slice \ + & the camera frame is /f/ \ + & /p/ has region /r/ \ +{ + # Convert region in projector coordinates to camera + lassign [regionToBbox $r] minX minY maxX maxY + lassign [projectorToCamera [list $minX $minY]] px0 py0 + lassign [projectorToCamera [list $maxX $maxY]] px1 py1 + + # Clamp to image bounds + set x [expr {int(max($px0, 0))}] + set y [expr {int(max($py0, 0))}] + set w [expr {int(min($px1 - $px0, [image width $f]))}] + set h [expr {int(min($py1 - $py0, [image height $f]))}] + + # Extract and claim the image for the page + set subimage [image subimage $f $x $y $w $h] + Claim $p has camera slice $subimage for region $r } -Wish $this is outlined thick palegoldenrod - - Wish $this has camera slice When $this has camera slice /im/ for region /r/ { set origin [lindex $r 0 0] @@ -57,3 +54,7 @@ When $this has camera slice /im/ for region /r/ { Wish display runs [list Display::image {*}$origin $im $scale] } + +Wish $this is outlined thick palegoldenrod + + -- cgit v1.2.3 From 254e73ba9926d6a5123730c5677680f70690df26 Mon Sep 17 00:00:00 2001 From: Cristobal Sciutto Date: Fri, 2 Jun 2023 15:29:41 -0400 Subject: match style guide --- virtual-programs/images.folk | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/images.folk b/virtual-programs/images.folk index 778c0afc..33a10c6a 100644 --- a/virtual-programs/images.folk +++ b/virtual-programs/images.folk @@ -23,11 +23,10 @@ namespace eval ::image { } -When \ - /someone/ wishes /p/ has camera slice \ - & the camera frame is /f/ \ - & /p/ has region /r/ \ -{ +When /someone/ wishes /p/ has camera slice & \ + the camera frame is /f/ & \ + /p/ has region /r/ { + # Convert region in projector coordinates to camera lassign [regionToBbox $r] minX minY maxX maxY lassign [projectorToCamera [list $minX $minY]] px0 py0 -- cgit v1.2.3 From 905a7cfd8f2011fab6dbfa566f3081d1d311412e Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Fri, 2 Jun 2023 16:37:36 -0400 Subject: Fix linebreaks in labels --- virtual-programs/label.folk | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/label.folk b/virtual-programs/label.folk index 002eeca5..3a5f7f38 100644 --- a/virtual-programs/label.folk +++ b/virtual-programs/label.folk @@ -13,18 +13,19 @@ When /thing/ has region /region/ { if {$::isLaptop} {set upsidedown false} When the collected matches for [list /someone/ wishes $thing is labelled /text/] are /matches/ { - set lines [lmap match $matches {dict get $match text}] - if {[llength lines] eq 0} { return } - - set lines [expr {$upsidedown ? [lreverse $lines] : $lines}] - set scale 1 - set fontSize [expr {18 * $scale}] - - for {set lineNum 0} {$lineNum < [llength $lines]} {incr lineNum} { - set line [lindex $lines $lineNum] - set ly [expr {$y + $lineNum * $fontSize}] - Display::text device $x $ly $scale $line $radians - } + set text [join [lmap match $matches {dict get $match text}] "\n"] + if {$text eq ""} { return } + set lines [split $text "\n"] + + set lines [expr {$upsidedown ? [lreverse $lines] : $lines}] + set scale 1 + set fontSize [expr {18 * $scale}] + + for {set lineNum 0} {$lineNum < [llength $lines]} {incr lineNum} { + set line [lindex $lines $lineNum] + set ly [expr {$y + $lineNum * $fontSize}] + Display::text device $x $ly $scale $line $radians + } } } @@ -33,8 +34,8 @@ fn text {coords text angle} { } When /anyone/ wishes /p/ has halo message /message/ & /p/ has region /r/ { - lassign [lindex $r 0] a b c d - lassign $a x y - text $a $message 0 - text $d $message 180 + lassign [lindex $r 0] a b c d + lassign $a x y + text $a $message 0 + text $d $message 180 } -- cgit v1.2.3 From 9c9fa9e8a12a2b3da0d7892806ca1a3337f69968 Mon Sep 17 00:00:00 2001 From: Cristobal Sciutto Date: Fri, 2 Jun 2023 17:17:01 -0400 Subject: better API + display API --- virtual-programs/images.folk | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/images.folk b/virtual-programs/images.folk index 33a10c6a..39eec64d 100644 --- a/virtual-programs/images.folk +++ b/virtual-programs/images.folk @@ -1,7 +1,13 @@ -# Images -Wish $this has filename "images.folk" +# Example program, i.e the public API +# +# When $this has camera slice /slice/ { +# Wish $this is labelled "hello" +# Wish $this displays slice $slice +# } + +# Generic image class for sub-image manipulations namespace eval ::image { proc width {im} { dict get $im width } proc height {im} { dict get $im height } @@ -22,7 +28,7 @@ namespace eval ::image { namespace ensemble create } - +# Callback: extract out a camera slice When /someone/ wishes /p/ has camera slice & \ the camera frame is /f/ & \ /p/ has region /r/ { @@ -40,20 +46,21 @@ When /someone/ wishes /p/ has camera slice & \ # Extract and claim the image for the page set subimage [image subimage $f $x $y $w $h] - Claim $p has camera slice $subimage for region $r + Claim $p has camera slice $subimage +} + +# Auto-trigger callback for `when has camera slice` statements +When when /p/ has camera slice /slice/ /lambda/ with environment /e/ { + Wish $p has camera slice } -Wish $this has camera slice -When $this has camera slice /im/ for region /r/ { +# Display a camera slice +When /someone/ wishes /p/ displays slice /slice/ & /p/ has region /r/ { set origin [lindex $r 0 0] lassign [regionToBbox $r] minX minY maxX maxY set regionWidth [expr {$maxX - $minX}] set scale [expr {$Display::WIDTH / $regionWidth}] - Wish display runs [list Display::image {*}$origin $im $scale] + Wish display runs [list Display::image {*}$origin $slice $scale] } - -Wish $this is outlined thick palegoldenrod - - -- cgit v1.2.3 From 9e5232e4d261332e0b8baa4e32cf0cb6112a4fe2 Mon Sep 17 00:00:00 2001 From: Cristobal Sciutto Date: Fri, 2 Jun 2023 17:21:04 -0400 Subject: kiss --- virtual-programs/images.folk | 1 - 1 file changed, 1 deletion(-) (limited to 'virtual-programs') diff --git a/virtual-programs/images.folk b/virtual-programs/images.folk index 39eec64d..529bfc0b 100644 --- a/virtual-programs/images.folk +++ b/virtual-programs/images.folk @@ -2,7 +2,6 @@ # Example program, i.e the public API # # When $this has camera slice /slice/ { -# Wish $this is labelled "hello" # Wish $this displays slice $slice # } -- cgit v1.2.3 From 5dca1150783dca77f05dc00676f3073c260b06b4 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Fri, 2 Jun 2023 18:02:48 -0400 Subject: Fix float scale, upside-down regions, cam/proj scaling --- virtual-programs/images.folk | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/images.folk b/virtual-programs/images.folk index 529bfc0b..71802c23 100644 --- a/virtual-programs/images.folk +++ b/virtual-programs/images.folk @@ -40,8 +40,8 @@ When /someone/ wishes /p/ has camera slice & \ # Clamp to image bounds set x [expr {int(max($px0, 0))}] set y [expr {int(max($py0, 0))}] - set w [expr {int(min($px1 - $px0, [image width $f]))}] - set h [expr {int(min($py1 - $py0, [image height $f]))}] + set w [expr {int(min(abs($px1 - $px0), [image width $f]))}] + set h [expr {int(min(abs($py1 - $py0), [image height $f]))}] # Extract and claim the image for the page set subimage [image subimage $f $x $y $w $h] @@ -56,10 +56,6 @@ When when /p/ has camera slice /slice/ /lambda/ with environment /e/ { # Display a camera slice When /someone/ wishes /p/ displays slice /slice/ & /p/ has region /r/ { set origin [lindex $r 0 0] - - lassign [regionToBbox $r] minX minY maxX maxY - set regionWidth [expr {$maxX - $minX}] - set scale [expr {$Display::WIDTH / $regionWidth}] - + set scale [expr {$Display::WIDTH / $Camera::WIDTH}] Wish display runs [list Display::image {*}$origin $slice $scale] } -- cgit v1.2.3 From cbfa8a5cb32564f7f43ca850cbb3e044456785a6 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Fri, 2 Jun 2023 18:04:29 -0400 Subject: `displays camera slice` --- virtual-programs/images.folk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/images.folk b/virtual-programs/images.folk index 71802c23..e2af03af 100644 --- a/virtual-programs/images.folk +++ b/virtual-programs/images.folk @@ -2,7 +2,7 @@ # Example program, i.e the public API # # When $this has camera slice /slice/ { -# Wish $this displays slice $slice +# Wish $this displays camera slice $slice # } @@ -54,7 +54,7 @@ When when /p/ has camera slice /slice/ /lambda/ with environment /e/ { } # Display a camera slice -When /someone/ wishes /p/ displays slice /slice/ & /p/ has region /r/ { +When /someone/ wishes /p/ displays camera slice /slice/ & /p/ has region /r/ { set origin [lindex $r 0 0] set scale [expr {$Display::WIDTH / $Camera::WIDTH}] Wish display runs [list Display::image {*}$origin $slice $scale] -- cgit v1.2.3