diff --git a/src/modules/Image/doc/Image.GIF.html b/src/modules/Image/doc/Image.GIF.html index e95b9ee043b71fb4546dbaa180382f8e55b89b5b..bb445a749923d884e23b72c6b2b7fe3de94d4d15 100644 --- a/src/modules/Image/doc/Image.GIF.html +++ b/src/modules/Image/doc/Image.GIF.html @@ -115,7 +115,7 @@ Advanced (!) method for writing renderblocks for placement <dt><tt>string colortable</tt> <dd>Colortable with colors to write as palette. If this argument is zero, no local colortable is written. - Colortable string len must be 1<<bpp. + Colortable string len must be 1&lt;&lt;bpp. <dt><tt>int interlace</tt> <dd>Interlace index data and set interlace bit. The given string should _not_ be pre-interlaced. diff --git a/src/modules/Image/doc/Image.colortable.html b/src/modules/Image/doc/Image.colortable.html index 6618c9d98d593c890218559ac7c2a73cd0a321ac..8b0d4d38136c195cc96918a4003ca8ba8f55beaf 100644 --- a/src/modules/Image/doc/Image.colortable.html +++ b/src/modules/Image/doc/Image.colortable.html @@ -662,7 +662,7 @@ Colortable tuning option, this sets the color space in the colorspace and comparing grey levels. <p> Default factors are 3, 4 and 1; blue is much - darker than green. Compare with <tt><a href=Image.image::grey.html>Image.image::grey</a></tt>(). + darker than green. Compare with <tt><a href=Image.image.html#grey>Image.image->grey</a></tt>(). </blockquote> <h4>RETURNS</h4> diff --git a/src/modules/Image/doc/Image.html b/src/modules/Image/doc/Image.html index 751eda8b733057edc551c3b2ca2f52f873063a5b..b6525554008a90a0eacfd84f7bbb49254b24009a 100644 --- a/src/modules/Image/doc/Image.html +++ b/src/modules/Image/doc/Image.html @@ -30,23 +30,23 @@ This module adds image-drawing and -manipulating <h4>NOTE</h4> <blockquote> <font size=-1><pre>Image module documentation is based on these file versions: - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ - $Id: Image.html,v 1.15 1997/11/10 05:41:16 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ + $Id: Image.html,v 1.16 1997/11/10 13:24:27 mirar Exp $ </pre></font> </blockquote> diff --git a/src/modules/Image/doc/Image.image.html b/src/modules/Image/doc/Image.image.html index 2a1084a38434cac17762f452d30173cfb3e228aa..1beac4951289aa28f047c8b87175dd7c5cc3115d 100644 --- a/src/modules/Image/doc/Image.image.html +++ b/src/modules/Image/doc/Image.image.html @@ -396,10 +396,10 @@ Applies a pixel-transform matrix, or filter, to the image. ({1,2,1})}) </pre> </td><td> - <a href=illustrations.html#illustration_41.gif><img border=0 src=illustration_41.gif width=67 height=67></a> + </td><td> - <img src=lena.gif width=67 height=67> - </td> + + </td></tr> <tr><td></td><td>original</td> <tr><td> @@ -410,8 +410,8 @@ Applies a pixel-transform matrix, or filter, to the image. ({-1,-1,-1})}) </pre> </td><td> - <a href=illustrations.html#illustration_43.gif><img border=0 src=illustration_43.gif width=67 height=67></a> - </td> + + </td></tr> <p> <tr><td> edge detect: @@ -421,8 +421,8 @@ Applies a pixel-transform matrix, or filter, to the image. ({1, 1,1})}) </pre> </td><td> - <a href=illustrations.html#illustration_44.gif><img border=0 src=illustration_44.gif width=67 height=67></a> - </td> + + </td></tr> <p> <tr><td> horisontal edge detect (get the idea): @@ -432,8 +432,8 @@ Applies a pixel-transform matrix, or filter, to the image. ({0, 0,0})}) </pre> </td><td> - <a href=illustrations.html#illustration_45.gif><img border=0 src=illustration_45.gif width=67 height=67></a> - </td> + + </td></tr> <p> <tr><td rowspan=2> emboss (might prefer to begin with a <tt><a href=Image.image.html#grey>grey</a></tt> image): @@ -443,11 +443,11 @@ Applies a pixel-transform matrix, or filter, to the image. ({0,-1,-2})}), 128,128,128, 3 </pre> </td><td> - <a href=illustrations.html#illustration_46.gif><img border=0 src=illustration_46.gif width=67 height=67></a> + </td><td> - <a href=illustrations.html#illustration_47.gif><img border=0 src=illustration_47.gif width=67 height=67></a> - </td> - <tr><td></td><td>greyed</td></table> + + </td></tr> + <tr><td></td><td>greyed</td></tr></table> <p> This function is not very fast -- and it's hard to optimize it more, not using assembler. @@ -756,8 +756,8 @@ Colorize an image. <p> If no arguments are given, the current color is used as factors. <p> <table><tr valign=center> - <td><img src=lena.gif width=67 height=67></td> - <td><a href=illustrations.html#illustration_49.gif><img border=0 src=illustration_49.gif width=67 height=67></a></td> + <td></td> + <td></td> </tr><tr valign=center> <td>original</td> <td>->color(128,128,255);</td> @@ -958,8 +958,8 @@ Makes an grey-scale image, for alpha-channel use. </pre> <p> <table><tr valign=center> - <td><img src=lena.gif width=67 height=67></td> - <td><a href=illustrations.html#illustration_51.gif><img border=0 src=illustration_51.gif width=67 height=67></a></td> + <td></td> + <td></td> </tr><tr valign=center> <td>original</td> <td>->distancesq(255,0,128);</td> @@ -1117,9 +1117,9 @@ Makes a grey-scale image (with weighted values). <p> <table><tr valign=center> - <td><img src=lena.gif width=67 height=67></td> - <td><a href=illustrations.html#illustration_53.gif><img border=0 src=illustration_53.gif width=67 height=67></a></td> - <td><a href=illustrations.html#illustration_54.gif><img border=0 src=illustration_54.gif width=67 height=67></a></td> + <td></td> + <td></td> + <td></td> </tr><tr valign=center> <td>original</td> <td>->grey();</td> @@ -1169,17 +1169,17 @@ Converts RGB data to HSV data, or the other way around. the pixels as above. <p> <table><tr valign=center> - <td><img src=lena.gif width=67 height=67></td> - <td><a href=illustrations.html#illustration_56.gif><img border=0 src=illustration_56.gif width=67 height=67></a></td> - <td><a href=illustrations.html#illustration_57.gif><img border=0 src=illustration_57.gif width=67 height=67></a></td> + <td></td> + <td></td> + <td></td> </tr><tr valign=center> <td>original</td> <td>->hsv_to_rgb();</td> <td>->rgb_to_hsv();</td> </tr><tr valign=center> - <td><a href=illustrations.html#illustration_58.gif><img border=0 src=illustration_58.gif width=67 height=67></a></td> - <td><a href=illustrations.html#illustration_59.gif><img border=0 src=illustration_59.gif width=67 height=67></a></td> - <td><a href=illustrations.html#illustration_60.gif><img border=0 src=illustration_60.gif width=67 height=67></a></td> + <td></td> + <td></td> + <td></td> </tr><tr valign=center> <td>tuned box (below)</td> <td>the rainbow (below)</td> @@ -1232,9 +1232,9 @@ Invert an image. Each pixel value gets to be 255-x, where x is the old value. <p> <table><tr valign=center> - <td><img src=lena.gif width=67 height=67></td> - <td><a href=illustrations.html#illustration_62.gif><img border=0 src=illustration_62.gif width=67 height=67></a></td> - <td><a href=illustrations.html#illustration_63.gif><img border=0 src=illustration_63.gif width=67 height=67></a></td> + <td></td> + <td></td> + <td></td> </tr><tr valign=center> <td>original</td> <td>->invert();</td> @@ -1302,6 +1302,18 @@ array <b>select_colors</b>(int num)</tt> <blockquote> Compatibility functions. Do not use! + +<p> Replacement examples: + +<p> Old code: + <pre>img=map_fs(img->select_colors(200));</pre> + New code: + <pre>img=Image.colortable(img,200)->floyd_steinberg()->map(img);</pre> + +<p> Old code: + <pre>img=map_closest(img->select_colors(17)+({({255,255,255}),({0,0,0})}));</pre> + New code: + <pre>img=Image.colortable(img,19,({({255,255,255}),({0,0,0})}))->map(img);</pre> </blockquote> <hr> @@ -1317,8 +1329,8 @@ Compatibility functions. Do not use! <blockquote> mirrors an image: <table><tr valign=center> - <td><img src=lena.gif width=67 height=67></td> - <td><a href=illustrations.html#illustration_65.gif><img border=0 src=illustration_65.gif width=67 height=67></a></td> + <td></td> + <td></td> </tr><tr valign=center> <td>original</td> <td>->mirrorx();</td> @@ -1344,8 +1356,8 @@ the new image object <blockquote> mirrors an image: <table><tr valign=center> - <td><img src=lena.gif width=67 height=67></td> - <td><a href=illustrations.html#illustration_67.gif><img border=0 src=illustration_67.gif width=67 height=67></a></td> + <td></td> + <td></td> </tr><tr valign=center> <td>original</td> <td>->mirrory();</td> @@ -1373,8 +1385,8 @@ Recolor an image from intensity values. representing intensity values between, linear. <p> <table><tr valign=center> - <td><img src=lena.gif width=67 height=67></td> - <td><a href=illustrations.html#illustration_69.gif><img border=0 src=illustration_69.gif width=67 height=67></a></td> + <td></td> + <td></td> </tr><tr valign=center> <td>original</td> <td>->grey()->modify_by_intensity(1,0,0, 0,({255,0,0}),({0,255,0}));</td> @@ -1423,7 +1435,7 @@ Gives a new image with the old image's size, <p> Example: <tt>->noise( ({0,({255,0,0}), 0.3,({0,255,0}), 0.6,({0,0,255}), 0.8,({255,255,0})}), 0.005,0,0,0.5 );</tt> - <br><a href=illustrations.html#illustration_70.gif><img border=0 src=illustration_70.gif width=200 height=100></a> + <br> </blockquote> <h4>ARGUMENTS</h4> <blockquote><dl> @@ -1711,9 +1723,9 @@ Rotates an image a certain amount of degrees (360 a complete rotation) counter-clockwise: <p> <table><tr valign=center> - <td><img src=lena.gif width=67 height=67></td> - <td><a href=illustrations.html#illustration_72.gif><img border=0 src=illustration_72.gif width=87 height=88></a></td> - <td><a href=illustrations.html#illustration_73.gif><img border=0 src=illustration_73.gif width=87 height=88></a></td> + <td></td> + <td></td> + <td></td> </tr><tr valign=center> <td>original</td> <td>->rotate(15,255,0,0);</td> @@ -1756,8 +1768,8 @@ the new image object rotates an image counter-clockwise, 90 degrees. <p> <table><tr valign=center> - <td><img src=lena.gif width=67 height=67></td> - <td><a href=illustrations.html#illustration_75.gif><img border=0 src=illustration_75.gif width=67 height=67></a></td> + <td></td> + <td></td> </tr><tr valign=center> <td>original</td> <td>->rotate_ccw();</td> @@ -1784,8 +1796,8 @@ the new image object rotates an image clockwise, 90 degrees. <p> <table><tr valign=center> - <td><img src=lena.gif width=67 height=67></td> - <td><a href=illustrations.html#illustration_77.gif><img border=0 src=illustration_77.gif width=67 height=67></a></td> + <td></td> + <td></td> </tr><tr valign=center> <td>original</td> <td>->rotate_cw();</td> @@ -1984,9 +1996,9 @@ Skews an image an amount of pixels or a factor; a skew-x is a transformation: <p> <table><tr valign=center> - <td><img src=lena.gif width=67 height=67></td> - <td><a href=illustrations.html#illustration_79.gif><img border=0 src=illustration_79.gif width=82 height=67></a></td> - <td><a href=illustrations.html#illustration_80.gif><img border=0 src=illustration_80.gif width=82 height=67></a></td> + <td></td> + <td></td> + <td></td> </tr><tr valign=center> <td>original</td> <td>->skewx(15,255,0,0);</td> @@ -2037,9 +2049,9 @@ Skews an image an amount of pixels or a factor; a skew-y is a transformation: <p> <table><tr valign=center> - <td><img src=lena.gif width=67 height=67></td> - <td><a href=illustrations.html#illustration_82.gif><img border=0 src=illustration_82.gif width=67 height=82></a></td> - <td><a href=illustrations.html#illustration_83.gif><img border=0 src=illustration_83.gif width=67 height=82></a></td> + <td></td> + <td></td> + <td></td> </tr><tr valign=center> <td>original</td> <td>->skewy(15,255,0,0);</td> @@ -2092,8 +2104,8 @@ Makes a black-white image. for threshold values. <p> <table><tr valign=center> - <td><img src=lena.gif width=67 height=67></td> - <td><a href=illustrations.html#illustration_85.gif><img border=0 src=illustration_85.gif width=67 height=67></a></td> + <td></td> + <td></td> </tr><tr valign=center> <td>original</td> <td>->threshold(90,100,110);</td> @@ -2159,9 +2171,9 @@ Draws a filled rectangle with colors (and alpha values) tuned rectangle. <p> <table><tr valign=center> - <td><img src=lena.gif width=67 height=67></td> - <td><a href=illustrations.html#illustration_87.gif><img border=0 src=illustration_87.gif width=67 height=67></a></td> - <td><a href=illustrations.html#illustration_88.gif><img border=0 src=illustration_88.gif width=67 height=67></a></td> + <td></td> + <td></td> + <td></td> </tr><tr valign=center> <td>original</td> <td>solid tuning<br>(blue,red,green,yellow)</td> @@ -2212,7 +2224,7 @@ gives a new image with the old image's size, <p> Example: <br> <tt>->turbulence( ({0,({229,204,204}), 0.9,({229,20,20}), 0.9,0}) );</tt> - <br><a href=illustrations.html#illustration_89.gif><img border=0 src=illustration_89.gif width=200 height=100></a> + <br> </blockquote> <h4>ARGUMENTS</h4> <blockquote><dl> diff --git a/src/modules/Image/image.c b/src/modules/Image/image.c index 65f8a7996e3f00ca1b02757ac09bfdff50b1ee2e..6d9ff24b3cba7b603c2ba57df0590afa0f2e837e 100644 --- a/src/modules/Image/image.c +++ b/src/modules/Image/image.c @@ -1,9 +1,9 @@ -/* $Id: image.c,v 1.57 1997/11/10 05:41:12 mirar Exp $ */ +/* $Id: image.c,v 1.58 1997/11/10 13:24:21 mirar Exp $ */ /* **! module Image **! note -**! $Id: image.c,v 1.57 1997/11/10 05:41:12 mirar Exp $ +**! $Id: image.c,v 1.58 1997/11/10 13:24:21 mirar Exp $ **! class image **! **! The main object of the <ref>Image</ref> module, this object @@ -84,7 +84,7 @@ #include "stralloc.h" #include "global.h" -RCSID("$Id: image.c,v 1.57 1997/11/10 05:41:12 mirar Exp $"); +RCSID("$Id: image.c,v 1.58 1997/11/10 13:24:21 mirar Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -2081,8 +2081,8 @@ void image_select_from(INT32 args) **! <illustration> **! return lena(); **! </illustration> -**! </td> -**! <tr><td></td><td>original</td> +**! </td></tr> +**! <tr><td></td><td>original</td></tr> **! **! <tr><td> **! sharpen (k>8, preferably 12 or 16): @@ -2099,7 +2099,7 @@ void image_select_from(INT32 args) **! ({-1,-1,-1})}) **! ); **! </illustration> -**! </td> +**! </td></tr> **! **! <tr><td> **! edge detect: @@ -2116,7 +2116,7 @@ void image_select_from(INT32 args) **! ({1, 1,1})}) **! ); **! </illustration> -**! </td> +**! </td></tr> **! **! <tr><td> **! horisontal edge detect (get the idea): @@ -2133,7 +2133,7 @@ void image_select_from(INT32 args) **! ({0, 0,0})}) **! ); **! </illustration> -**! </td> +**! </td></tr> **! **! <tr><td rowspan=2> **! emboss (might prefer to begin with a <ref>grey</ref> image): @@ -2158,11 +2158,10 @@ void image_select_from(INT32 args) **! ({0,-1,-2})}), 128,128,128, 3 **! ); **! </illustration> -**! </td> +**! </td></tr> **! <tr><td></td><td>greyed</td></tr></table> **! -**! This function is not very fast -- and it's hard to -**! optimize it more, not using assembler. +**! This function is not very fast. **! **! returns the new image object **! diff --git a/src/modules/Image/mkwmml.pike b/src/modules/Image/mkwmml.pike index 5d008b017c216a59cce981e838e3f792a7380822..5320f357f2669cc0ebbf5db42635339a933ea467 100644 --- a/src/modules/Image/mkwmml.pike +++ b/src/modules/Image/mkwmml.pike @@ -1,4 +1,4 @@ -/* $Id: mkwmml.pike,v 1.1 1997/11/10 05:41:13 mirar Exp $ */ +/* $Id: mkwmml.pike,v 1.2 1997/11/10 13:24:23 mirar Exp $ */ import Stdio; import Array; @@ -236,6 +236,12 @@ multiset(string) get_method_names(string *decls) return names; } +string *nice_order(string *arr) +{ + sort(map(arr,replace,({"_","`"}),({"�","�"})), + arr); + return arr; +} string addprefix(string suffix,string prefix) { @@ -266,7 +272,7 @@ void document(mapping huh,string name,string prefix,object f) f->write("<dt><encaps>NAME</encaps><dd>\n"); - foreach (names,n) + foreach (nice_order(names),n) f->write("\t<tt>"+n+"</tt><br>\n"); f->write("<p>\n"); @@ -309,9 +315,9 @@ void document(mapping huh,string name,string prefix,object f) if (arg->desc) { f->write("\t<tr align=left><td valign=top>\n" - +rarg+"\t\t<tt>" - +arg->args*"</tt><br>\n\t\t<tt>" - +"</tt></td>\n" + +fixdesc(rarg+"\t\t<tt>" + +arg->args*"</tt><br>\n\t\t<tt>" + +"</tt></td>\n",prefix,arg->_line) +"\t<td valign=bottom>" +fixdesc(arg->desc,prefix,arg->_line) +"</td></tr>\n\n"); @@ -374,7 +380,7 @@ void document(mapping huh,string name,string prefix,object f) foreach (huh->methods,method) method_names|=(method->names=get_method_names(method->decl)); - method_names_arr=sort(indices(method_names)); + method_names_arr=nice_order(indices(method_names)); // alphabetically @@ -391,16 +397,11 @@ void document(mapping huh,string name,string prefix,object f) if (method_names[method_name]) stderr->write("failed to find "+method_name+" again, wierd...\n"); } - - foreach(huh->methods,mapping child) - { - document(child,prefix,prefix,f); - } } if (huh->classes) { - foreach(indices(huh->classes),string n) + foreach(nice_order(indices(huh->classes)),string n) { f->write("\n\n\n<section title=\""+prefix+n+"\">\n"); document(huh->classes[n], @@ -411,7 +412,7 @@ void document(mapping huh,string name,string prefix,object f) if (huh->modules) { - foreach(indices(huh->modules),string n) + foreach(nice_order(indices(huh->modules)),string n) { f->write("\n\n\n<section title=\""+prefix+n+"\">\n"); document(huh->modules[n],