summaryrefslogtreecommitdiffstats
path: root/virtual-programs
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2023-04-25 21:09:18 +0000
committerOmar Rizwan <omar@omar.website>2023-04-25 21:09:18 +0000
commitc79a2968d7a38871d90e9cd6a861803a749fca93 (patch)
tree9a17aa98c8e999cba640301d37365b117cb9ce26 /virtual-programs
parentIncrease max results caps. Fixes outlines etc (diff)
downloadfolk-c79a2968d7a38871d90e9cd6a861803a749fca93.tar.gz
folk-c79a2968d7a38871d90e9cd6a861803a749fca93.zip
Support explicit lexical envs. Narrow envs for tags-and-calibration
Another 5ms performance improvement, I think?
Diffstat (limited to 'virtual-programs')
-rw-r--r--virtual-programs/tags-and-calibration.folk10
1 files changed, 7 insertions, 3 deletions
diff --git a/virtual-programs/tags-and-calibration.folk b/virtual-programs/tags-and-calibration.folk
index dd0622be..497d5ecd 100644
--- a/virtual-programs/tags-and-calibration.folk
+++ b/virtual-programs/tags-and-calibration.folk
@@ -74,9 +74,9 @@ proc ::projectorToCamera {projectorPoint} {
When tag /tag/ has center /c/ size /size/ {
Claim tag $tag is a tag
- lassign [cameraToProjector $c] px py
+ lassign [::cameraToProjector $c] px py
Claim $tag is a rectangle with x [expr $px-20] y [expr $py-10] width [expr $size*2] height [expr $size*2]
-}
+} with environment {}
When tag /tag/ is a tag {
puts "Added tag $tag"
@@ -91,7 +91,7 @@ When tag /tag/ is a tag {
When tag /tag/ has corners /corners/ {
- set tagcorners [lmap p $corners {cameraToProjector $p}]
+ set tagcorners [lmap p $corners {::cameraToProjector $p}]
foreach tagcorner $tagcorners { Display::text fb {*}$tagcorner 10 "$tag" }
set tagbottom [sub [lindex $tagcorners 1] [lindex $tagcorners 0]]
set tagright [sub [lindex $tagcorners 2] [lindex $tagcorners 1]]
@@ -105,4 +105,8 @@ When tag /tag/ has corners /corners/ {
lappend edges [list [expr {[llength $corners] - 1}] 0]
set region [list $corners $edges [::tcl::mathfunc::atan2 {*}$tagright]]
Claim $tag has region $region
+} with environment {
+ %matmul ::math::linearalgebra::matmul
+ %sub ::math::linearalgebra::sub
+ %add ::math::linearalgebra::add
}