home *** CD-ROM | disk | FTP | other *** search
/ ftp.sunet.sepub/pictures / 2014.11.ftp.sunet.se-pictures.tar / ftp.sunet.se / pub / pictures / ACiD-artpacks / programs / unix / editors / gimp-plugins-unstable-0_99_23_tar.gz / gimp-plugins-unstable-0_99_23_tar / gimp-plugins-unstable-0.99.23 / gimptcl / frags / g.tcl < prev    next >
Text File  |  1998-02-20  |  2KB  |  77 lines

  1. proc air-box {img drw x1 y1 x2 y2} {
  2.     set p [list \
  3.            $x1 $y1 $x2 $y1\
  4.            $x2 $y1 $x2 $y2\
  5.            $x2 $y2 $x1 $y2\
  6.            $x1 $y2 $x1 $y1]
  7.  
  8.     set lp [llength $p]
  9.     gimp-airbrush $img $drw 70 $lp $p
  10.     gimp-displays-flush
  11. }
  12.  
  13. proc paint-box {img drw x1 y1 x2 y2} {
  14.     set p [list \
  15.            $x1 $y1 $x2 $y1\
  16.            $x2 $y1 $x2 $y2\
  17.            $x2 $y2 $x1 $y2\
  18.            $x1 $y2 $x1 $y1]
  19.  
  20.     set lp [llength $p]
  21.     set fade [expr (abs($x2 - $x1) + abs($y2 - $y1))]
  22.     gimp-paintbrush $img $drw $fade $lp $p
  23.     gimp-displays-flush
  24. }
  25.  
  26. proc air-circle {img drw n x y r} {
  27.     set twopi [expr 2 * 3.1415926]
  28.     set rinc [expr $twopi / $n]
  29.  
  30.     for {set theta 0} {$theta < $twopi} {set theta [expr $theta + $rinc]} {
  31.     set X [expr $x + $r * sin($theta)]
  32.     set Y [expr $y + $r * cos($theta)]
  33.     lappend p $X $Y
  34.     }
  35.     lappend p [lindex $p 0] [lindex $p 1]
  36.     set lp [llength $p]
  37.     gimp-airbrush $img $drw 70 $lp $p
  38.     gimp-displays-flush
  39. }
  40.  
  41. proc paint-circle {img drw n x y r} {
  42.     set twopi [expr 2 * 3.1415926]
  43.     set rinc [expr $twopi / $n]
  44.  
  45.     for {set theta 0} {$theta < $twopi} {set theta [expr $theta + $rinc]} {
  46.     set X [expr $x + $r * sin($theta)]
  47.     set Y [expr $y + $r * cos($theta)]
  48.     lappend p $X $Y
  49.     }
  50.     lappend p [lindex $p 0] [lindex $p 1]
  51.     set lp [llength $p]
  52. # [expr 3.1415926 * $r]
  53.     set fade 0 
  54.     gimp-paintbrush $img $drw $fade $lp $p
  55.     gimp-displays-flush
  56. }
  57.  
  58. proc n {} {
  59.     set i [gimp-image-new 352 240 RGB]
  60.     set d [gimp-layer-new $i 352 240 RGBA_IMAGE "New Layer" 100 NORMAL]
  61.     gimp-image-add-layer $i $d 0
  62.     gimp-drawable-fill $d BG_IMAGE_FILL
  63.     gimp-display-new $i
  64.     return [list $i $d]
  65. }
  66.  
  67. proc t {} {
  68.     set id [n]
  69.     set i [lindex $id 0]
  70.     set d [lindex $id 1]
  71. # there's a bug in gimp-airbrush, this one'll core
  72. # unless you've patched app/airbrush.c
  73. #
  74.     air-box $i $d 10 10 100 100
  75.     paint-box $i $d 110 110 200 200
  76. }
  77.