Error processing request
Parameters
CONTENT_LENGTH | 0 |
REQUEST_METHOD | GET |
REQUEST_URI | /revision/Coloring+a+gray+image?V=6 |
QUERY_STRING | V=6 |
CONTENT_TYPE | |
DOCUMENT_URI | /revision/Coloring+a+gray+image |
DOCUMENT_ROOT | /var/www/nikit/nikit/nginx/../docroot |
SCGI | 1 |
SERVER_PROTOCOL | HTTP/1.1 |
HTTPS | on |
REMOTE_ADDR | 172.70.127.89 |
REMOTE_PORT | 45268 |
SERVER_PORT | 4443 |
SERVER_NAME | wiki.tcl-lang.org |
HTTP_HOST | wiki.tcl-lang.org |
HTTP_CONNECTION | Keep-Alive |
HTTP_ACCEPT_ENCODING | gzip, br |
HTTP_X_FORWARDED_FOR | 3.128.203.143 |
HTTP_CF_RAY | 87bd4de0f9332af6-ORD |
HTTP_X_FORWARDED_PROTO | https |
HTTP_CF_VISITOR | {"scheme":"https"} |
HTTP_ACCEPT | */* |
HTTP_USER_AGENT | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected]) |
HTTP_CF_CONNECTING_IP | 3.128.203.143 |
HTTP_CDN_LOOP | cloudflare |
HTTP_CF_IPCOUNTRY | US |
Body
Error
Unknow state transition: LINE -> END
-code
1
-level
0
-errorstack
INNER {returnImm {Unknow state transition: LINE -> END} {}} CALL {my render_wikit {Coloring a gray image} {[ulis], 2003-08-22: A little proc to adapt a gray image with transparency to a colored background.
Before:
[http://perso.wanadoo.fr/maurice.ulis/tcl/gray-image.gif]
After:
[http://perso.wanadoo.fr/maurice.ulis/tcl/colorize.gif]
----
**The proc**
======
proc colorize {image color} {
# get image sizes
set width [image width $image]
set height [image height $image]
# get color's R G B
lassign [winfo rgb . $color] rr gg bb
# compute new colors
set colors {}
for {set y 0} {$y < $height} {incr y} {
set row {}
for {set x 0} {$x < $width} {incr x} {
# save transparency
lappend trans $x $y [$image transparency get $x $y]
# compute the new color
lassign [$image get $x $y] r g b
set r [expr {round($r * $rr / 256)}]
set g [expr {round($g * $gg / 256)}]
set b [expr {round($b * $bb / 256)}]
# append to the current row
lappend row [format #%4.4x%4.4x%4.4x $r $g $b]
}
# append the row
lappend colors $row
}
# set new image
img put $colors
# restore transparency
foreach {x y t} $trans {
$image transparency set $x $y $t
}
}
======
----
**The demo**
====
# =========
# demo
# =========
wm title . colorize
# get a gray image
image create photo img -file gray-image.gif
# add colors
colorize img azure
# display
set width [image width img]
set height [image height img]
canvas .c -width [incr width 4] -height [incr height 4] -bg beige
.c create image 2 2 -anchor nw -image img
pack .c
======
<<categories>> Example | Graphics | Image processing} regexp2} CALL {my render {Coloring a gray image} {[ulis], 2003-08-22: A little proc to adapt a gray image with transparency to a colored background.
Before:
[http://perso.wanadoo.fr/maurice.ulis/tcl/gray-image.gif]
After:
[http://perso.wanadoo.fr/maurice.ulis/tcl/colorize.gif]
----
**The proc**
======
proc colorize {image color} {
# get image sizes
set width [image width $image]
set height [image height $image]
# get color's R G B
lassign [winfo rgb . $color] rr gg bb
# compute new colors
set colors {}
for {set y 0} {$y < $height} {incr y} {
set row {}
for {set x 0} {$x < $width} {incr x} {
# save transparency
lappend trans $x $y [$image transparency get $x $y]
# compute the new color
lassign [$image get $x $y] r g b
set r [expr {round($r * $rr / 256)}]
set g [expr {round($g * $gg / 256)}]
set b [expr {round($b * $bb / 256)}]
# append to the current row
lappend row [format #%4.4x%4.4x%4.4x $r $g $b]
}
# append the row
lappend colors $row
}
# set new image
img put $colors
# restore transparency
foreach {x y t} $trans {
$image transparency set $x $y $t
}
}
======
----
**The demo**
====
# =========
# demo
# =========
wm title . colorize
# get a gray image
image create photo img -file gray-image.gif
# add colors
colorize img azure
# display
set width [image width img]
set height [image height img]
canvas .c -width [incr width 4] -height [incr height 4] -bg beige
.c create image 2 2 -anchor nw -image img
pack .c
======
<<categories>> Example | Graphics | Image processing}} CALL {my revision {Coloring a gray image}} CALL {::oo::Obj2940717 process revision/Coloring+a+gray+image} CALL {::oo::Obj2940715 process}
-errorcode
NONE
-errorinfo
Unknow state transition: LINE -> END
while executing
"error $msg"
(class "::Wiki" method "render_wikit" line 6)
invoked from within
"my render_$default_markup $N $C $mkup_rendering_engine"
(class "::Wiki" method "render" line 8)
invoked from within
"my render $name $C"
(class "::Wiki" method "revision" line 31)
invoked from within
"my revision $page"
(class "::Wiki" method "process" line 56)
invoked from within
"$server process [string trim $uri /]"
-errorline
4