Later.
#!/usr/bin/tclsh
proc createFrame { fileName imageL targets } {
array set image $imageL
set tL ""
foreach e $targets {
switch [lindex $e 0] {
circle
{
set x0 [lindex [split [lindex $e 1] ,] 0]
set y0 [lindex [split [lindex $e 1] ,] 1]
set r [lindex $e 2]
set x1 [expr $x0 + $r]
set y1 $y0
set tL [concat $tL "-fill red -draw 'circle $x0,$y0 $x1,$y1'"]
}
}
}
set cmd "/usr/bin/convert -size $image(width)x$image(height) xc:white $tL $fileName"
puts $cmd
exec bash -c $cmd
}
#---main---
set image(width) 640
set image(height) 480
set fileName /tmp/frame00000001.pnm
lappend targets [list circle 320,240 10]
lappend targets [list circle 100,100 10]
createFrame $fileName [array get image] $targets
No comments:
Post a Comment