<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Weblogue de Kiroukou</title>
	<atom:link href="http://kiroukou.media-box.net/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://kiroukou.media-box.net/blog</link>
	<description>Ingénieur développeur Flash</description>
	<pubDate>Wed, 02 Jul 2008 08:28:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>Créer son aide pour Flash IDE - Flash Help Book creator</title>
		<link>http://kiroukou.media-box.net/blog/mes-recherches-sur-flash/160-creer-son-aide-pour-flash-ide-flash-help-book-creator.html</link>
		<comments>http://kiroukou.media-box.net/blog/mes-recherches-sur-flash/160-creer-son-aide-pour-flash-ide-flash-help-book-creator.html#comments</comments>
		<pubDate>Wed, 02 Jul 2008 08:27:35 +0000</pubDate>
		<dc:creator>kiroukou</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Projets]]></category>

		<category><![CDATA[annonce]]></category>

		<guid isPermaLink="false">http://kiroukou.media-box.net/blog/?p=160</guid>
		<description><![CDATA[Je suis fier d&#8217;annoncer que Dan Allen, un membre de l&#8217;équipe de Sandy3D, a décidé de distribuer son script FlashHelpBook qui permet de générer les fichiers d&#8217;aide pour Flash IDE à partir d&#8217;une librairie AS3.
En gros, l&#8217;utilisation de ce script permet d&#8217;obtenir la coloration syntaxique, et les raccourcis directs depuis un mot clé de votre [...]]]></description>
			<content:encoded><![CDATA[<p>Je suis fier d&#8217;annoncer que <a href="http://www.thewebpageofdan.com/">Dan Allen</a>, un membre de l&#8217;équipe de Sandy3D, a décidé de distribuer son script <a href="http://www.thewebpageofdan.com/portfolio/flashhelpbook/">FlashHelpBook</a> qui permet de générer les fichiers d&#8217;aide pour Flash IDE à partir d&#8217;une librairie AS3.</p>
<p>En gros, l&#8217;utilisation de ce script permet d&#8217;obtenir la coloration syntaxique, et les raccourcis directs depuis un mot clé de votre code AS3 vers la documentation Flash de la librairie associée (librairies testées, Sandy, Away, Papervision, Box2D).</p>
<p>C&#8217;est vraiment un outil très intéressant qui a permis à pas mal d&#8217;utilisateurs de Sandy developpant dans l&#8217;IDE flash de se passer de la documentation online, améliorant leur productivité (il devient très facile et rapide de regarder la documentation, ce qui en général, permet de gagner pas mal de temps ;)).</p>
<p>Vous pouvez <a href="http://www.flashsandy.org/forum/viewtopic.php?f=9&amp;t=741">voir l&#8217;annonce officielle dans le forum Sandy3D [en]</a> pour avoir plus d&#8217;informations et laisser vos commentaires.</p>
<p>Donc si vous êtes l&#8217;heureux développeur d&#8217;une librarie AS3 (documentée!!) allez donc tester <a href="http://www.thewebpageofdan.com/portfolio/flashhelpbook/">FlashHelpBook</a>!</p>
<p>Merci Dan <img src='http://kiroukou.media-box.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://kiroukou.media-box.net/blog/mes-recherches-sur-flash/160-creer-son-aide-pour-flash-ide-flash-help-book-creator.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Site flash avec 3D superbe &#8230; vraiment superbe !</title>
		<link>http://kiroukou.media-box.net/blog/mes-recherches-sur-flash/158-site-avec-3d-superbe-vraiment-superbe.html</link>
		<comments>http://kiroukou.media-box.net/blog/mes-recherches-sur-flash/158-site-avec-3d-superbe-vraiment-superbe.html#comments</comments>
		<pubDate>Thu, 05 Jun 2008 08:32:46 +0000</pubDate>
		<dc:creator>kiroukou</dc:creator>
		
		<category><![CDATA[3D]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://kiroukou.media-box.net/blog/?p=158</guid>
		<description><![CDATA[Alors là, je suis bluffé, et pourtant en 3D flash, il en faut je pense  

Vraiment, en terme de concept, réalisation artistique, de réalisation technique (regardez la fluidité de ce moteur), bref en tout points je suis bluffé.
Je vous recommande donc vivement d&#8217;aller voir ce site: http://ecodazoo.com/
Vous passerez un agréable moment, promis.
]]></description>
			<content:encoded><![CDATA[<p>Alors là, je suis bluffé, et pourtant en 3D flash, il en faut je pense <img src='http://kiroukou.media-box.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <a href="http://ecodazoo.com/"></a></p>
<p style="text-align: center;"><a href="http://ecodazoo.com/"><img class="size-medium wp-image-159" title="http://ecodazoo.com/" src="http://kiroukou.media-box.net/blog/wp-content/uploads/2008/06/image-1-285x300.png" alt="" width="285" height="300" /></a></p>
<p>Vraiment, en terme de concept, réalisation artistique, de réalisation technique (regardez la fluidité de ce moteur), bref en tout points je suis bluffé.</p>
<p>Je vous recommande donc vivement d&#8217;aller voir ce site: <a href="http://ecodazoo.com/">http://ecodazoo.com/</a></p>
<p>Vous passerez un agréable moment, promis.</p>
]]></content:encoded>
			<wfw:commentRss>http://kiroukou.media-box.net/blog/mes-recherches-sur-flash/158-site-avec-3d-superbe-vraiment-superbe.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>FlexBuilder et son debugger bloqué</title>
		<link>http://kiroukou.media-box.net/blog/flexbuilder/157-flexbuilder-et-son-debugger-bloque.html</link>
		<comments>http://kiroukou.media-box.net/blog/flexbuilder/157-flexbuilder-et-son-debugger-bloque.html#comments</comments>
		<pubDate>Wed, 04 Jun 2008 09:19:50 +0000</pubDate>
		<dc:creator>kiroukou</dc:creator>
		
		<category><![CDATA[FlexBuilder]]></category>

		<guid isPermaLink="false">http://kiroukou.media-box.net/blog/?p=157</guid>
		<description><![CDATA[Bon je ne sais pas vous, mais je suis tombé sur ce problème dernièrement: lorsque je spécifie un breakpoint quelque part dans mon appli, je me retrouve dans l&#8217;incapacité de faire lancer l&#8217;anim et donc de debugguer tranquillement.
Le debugger et le flash player n&#8217;arrivent pas à se connecter.
En fait cela semble être un problème assez [...]]]></description>
			<content:encoded><![CDATA[<p>Bon je ne sais pas vous, mais je suis tombé sur ce problème dernièrement: lorsque je spécifie un breakpoint quelque part dans mon appli, je me retrouve dans l&#8217;incapacité de faire lancer l&#8217;anim et donc de debugguer tranquillement.</p>
<p>Le debugger et le flash player n&#8217;arrivent pas à se connecter.</p>
<p>En fait cela semble être un problème assez connu, mais dont la solution semble l&#8217;être moins.</p>
<p>Ouvrir le fichier:</p>
<p>C:\Documents and Settings\[user name]\mm.cfg pour Windows</p>
<p>/Users/[user name]/mm.cfg sous Mac OSX</p>
<p>Et vous devriez y trouver la ligne:</p>
<blockquote><p>&#8230;3/.metadata/.plugins/com.adobe.flash.profiler/ProfilerAgent.swf?host=localhost&amp;port=99</p></blockquote>
<p>Il suffit de la supprimer purement et simplement.</p>
<p>Généralement ce problème arrive à la suite d&#8217;une tentative de &#8220;Profiling&#8221; échouée, qui à pour conséquence de bloquer le debugger ou le port&#8230;.</p>
<p>En espérant faire gagner quelques heures de prise de tête à certains parmis vous <img src='http://kiroukou.media-box.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://kiroukou.media-box.net/blog/flexbuilder/157-flexbuilder-et-son-debugger-bloque.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Extraction des contours d&#8217;un bitmap</title>
		<link>http://kiroukou.media-box.net/blog/mes-recherches-sur-flash/155-extraction-des-contours-dun-bitmap.html</link>
		<comments>http://kiroukou.media-box.net/blog/mes-recherches-sur-flash/155-extraction-des-contours-dun-bitmap.html#comments</comments>
		<pubDate>Fri, 21 Mar 2008 10:19:25 +0000</pubDate>
		<dc:creator>kiroukou</dc:creator>
		
		<category><![CDATA[AS3]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[demo]]></category>

		<category><![CDATA[experimentation]]></category>

		<guid isPermaLink="false">http://kiroukou.media-box.net/blog/?p=155</guid>
		<description><![CDATA[Voilà une petite expérimentation, déja expérimentée en AS2 avec les moyens de l'époque, inspirée d'un effet similaire réalisé par JL Gaujal sur Flash-France il y a déja pas mal de temps, et ça rendait super bien.
Et comme dernièrement je voulais me lancer dans un peu de traitement d'image afin de réaliser un vieux projet de [...]]]></description>
			<content:encoded><![CDATA[<p>Voilà une petite expérimentation, <a target="_self" title="houla que c'est vieux..." href="http://flash.mediabox.fr/index.php?showtopic=31484&amp;pid=233400&amp;mode=threaded&amp;show=&amp;st=">déja expérimentée en AS2 avec les moyens de l'époque</a>, inspirée d'un effet similaire réalisé par JL Gaujal sur Flash-France il y a déja pas mal de temps, et ça rendait super bien.</p>
<p>Et comme dernièrement je voulais me lancer dans un peu de traitement d'image afin de réaliser un vieux projet de composant texte 3D dans Sandy, j'ai commencé par le tout début, l'extraction des contours du bitmap. Après il y aura énormément de choses à rajouter, notament la gestion des trous, puis la tesselation etc etc. Mais bon, fallait bien commencer <img src='http://kiroukou.media-box.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Une fois tous les points du contours extraits, j'applique une très simple vectorisation, en essayant de garder que les points de contrôle. Mais là, c'est encore vraiment très très sommaire, faudrait l'améliorer, si ça tente d'autres personnes que moi d'ailleurs.</p>
<p>Sur cet exemple, cliquez dans le swf pour avoir le focus, puis pressez une touche du clavier pour changer de caractère. Son contours devrait être automatiquement tracé. On remarque qu'a cause de l'aliasing les parties en diagonale sont très mal vectorisées pour l'instant et ca devient presque du dessin point par point.</p>
<p style="text-align: center;">
<object height="200" width="200" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"><param value="http://kiroukou.media-box.net/blog/wp-content/uploads/2008/03/fontvector.swf" name="src" /><embed height="200" width="200" src="http://kiroukou.media-box.net/blog/wp-content/uploads/2008/03/fontvector.swf" type="application/x-shockwave-flash"></embed></object>
</p>
<p style="text-align: center;"><span id="more-155"></span></p>
<p style="text-align: center;">
<p style="text-align: left;">L'embryon de classe si vous voulez jouer un peu avec vous aussi.</p>
<p style="text-align: left;">
<div class="igBar"><span id="ljavascript-2"><a href="#" onclick="javascript:showPlainTxt('javascript-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-2">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">package</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">BitmapData</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">import</span> flash.<span style="color: #006600;">geom</span>.<span style="color: #006600;">Point</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">Dictionary</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* ShapeExtractor class</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* Extracts the shape information from a bitmapdata instance</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* @author Thomas PFEIFFER (kiroukou)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* @date March 19th 2008</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* @version 0.1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* @licence http://creativecommons.org/licenses/by-sa/3.0/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* &lt;example&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* &nbsp; &nbsp; var format:TextFormat = new TextFormat( null, 45 );</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;var tf:TextField = new TextField();</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;tf.textColor = 0xFFFFFF;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp; &nbsp; tf.autoSize = TextFieldAutoSize.LEFT;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;tf.text = &quot;D&quot;;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;tf.setTextFormat( format );</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;var b1:Bitmap = new Bitmap( new BitmapData( tf.textWidth + 5, tf.textHeight + 5, false, 0 ) );</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;b1.bitmapData.draw( tf, null, null, null, null, true );</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;addChild( b1 );</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;var extractor:ShapeExtractor = new ShapeExtractor( b1.bitmapData );</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;extractor.extract();</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;extractor.vectorize();</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;var l_oPt:Point;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;var l_oShape:Sprite = new Sprite();</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;l_oShape.graphics.beginFill( 0xFF0000 );</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;for each( l_oPt in extractor.points )</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;{</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;l_oShape.graphics.drawRect( l_oPt.x, l_oPt.y, 1, 1 );</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;}</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;l_oShape.graphics.endFill();</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;l_oShape.graphics.beginFill( 0x00FF );</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;for each( l_oPt in extractor.controlPoints )</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;{</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;l_oShape.graphics.drawRect( l_oPt.x, l_oPt.y, 1, 1 );</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;}</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;l_oShape.graphics.endFill();</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*&nbsp; &nbsp;&nbsp; &nbsp;addChild( l_oShape );</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* &lt;/example&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">public</span> <span style="color: #003366; font-weight: bold;">class</span> ShapeExtractor</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">public</span> <span style="color: #003366; font-weight: bold;">const</span> controlPoints:Array = <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">public</span> <span style="color: #003366; font-weight: bold;">const</span> points:Array = <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* @p_oBitmapData The bitmapdata instance to extract information from.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">public</span> <span style="color: #003366; font-weight: bold;">function</span> ShapeExtractor<span style="color: #66cc66;">&#40;</span> p_oBitmapData:BitmapData <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">setBitmap<span style="color: #66cc66;">&#40;</span> p_oBitmapData <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* @p_oBitmapData The bitmapdata instance to extract information from.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">public</span> <span style="color: #003366; font-weight: bold;">function</span> setBitmap<span style="color: #66cc66;">&#40;</span> p_oBitmapData:BitmapData <span style="color: #66cc66;">&#41;</span>:<span style="color: #000066; font-weight: bold;">void</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">b = p_oBitmapData;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">h = b.<span style="color: #006600;">height</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">w = b.<span style="color: #006600;">width</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* Clear all the arrays and storage objects</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* Important to call this before ShapeExtractor instance reuse</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">public</span> <span style="color: #003366; font-weight: bold;">function</span> clear<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #000066; font-weight: bold;">void</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">controlPoints.<span style="color: #006600;">splice</span><span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">points.<span style="color: #006600;">splice</span><span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span> <span style="color: #003366; font-weight: bold;">var</span> i:* <span style="color: #000066; font-weight: bold;">in</span> visited <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">visited<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span> = <span style="color: #003366; font-weight: bold;">null</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">crt = <span style="color: #003366; font-weight: bold;">null</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* Extract the edges pixels from the given bitmapdata object</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">public</span> <span style="color: #003366; font-weight: bold;">function</span> extract<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #000066; font-weight: bold;">void</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> startPos:Point = getStartPoint<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> startPos == <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// --</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">visited<span style="color: #66cc66;">&#91;</span> startPos.<span style="color: #006600;">x</span> * w + startPos.<span style="color: #006600;">y</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #003366; font-weight: bold;">true</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">lastDir = <span style="color: #CC0000;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">points.<span style="color: #006600;">push</span><span style="color: #66cc66;">&#40;</span> startPos <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">crt = startPos;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// --</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">while</span><span style="color: #66cc66;">&#40;</span> <span style="color: #003366; font-weight: bold;">true</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> ! process<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">crtId -= <span style="color: #CC0000;color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">crt = points<span style="color: #66cc66;">&#91;</span> crtId <span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">lastDir = <span style="color: #CC0000;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// si on est revenu au depart...</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> crt == startPos <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">return</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">else</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">//crtId += 1;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">crtId = points.<span style="color: #006600;">length</span>-<span style="color: #CC0000;color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* Vectorize the information picked up by the extract method call.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* THis method will populate the controlPoints public array which will contain all the control points of the shape.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* TODO: Allows some optimization of the path when points have a quite close direction and for edges in stairs.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* MANDATORY: call extract method first</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">public</span> <span style="color: #003366; font-weight: bold;">function</span> vectorize<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #000066; font-weight: bold;">void</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> crtDirX:int=points<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">x</span> - points<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">x</span>, crtDirY:int=points<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">y</span> - points<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">y</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// --</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">controlPoints.<span style="color: #006600;">push</span><span style="color: #66cc66;">&#40;</span> points<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">controlPoints.<span style="color: #006600;">push</span><span style="color: #66cc66;">&#40;</span> points<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// --</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> i:int = <span style="color: #CC0000;color:#800000;">0</span>, l:int = points.<span style="color: #006600;">length</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> previous:Point = points<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// --</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span> i=<span style="color: #CC0000;color:#800000;">2</span>; i &amp;lt;l; i += <span style="color: #CC0000;color:#800000;">1</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> p:Point = points<span style="color: #66cc66;">&#91;</span>int<span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// --</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> dx:Number = p.<span style="color: #006600;">x</span> - previous.<span style="color: #006600;">x</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> dy:Number = p.<span style="color: #006600;">y</span> - previous.<span style="color: #006600;">y</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// si pas meme direction</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> dx == crtDirX &amp;amp;&amp;amp; dy == crtDirY <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">controlPoints<span style="color: #66cc66;">&#91;</span> controlPoints.<span style="color: #006600;">length</span> - <span style="color: #CC0000;color:#800000;">1</span> <span style="color: #66cc66;">&#93;</span> = p;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">else</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">crtDirX = dx;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">crtDirY = dy;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// --</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">controlPoints.<span style="color: #006600;">push</span><span style="color: #66cc66;">&#40;</span> p <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// --</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">previous = p;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* @private</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">function</span> process<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Boolean</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> i:int;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> dir:Point;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> crx:int, cry:int;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> max:int = <span style="color: #CC0000;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> bestDirId:int = -<span style="color: #CC0000;color:#800000;">1</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> nextPos:Point = <span style="color: #003366; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span> i=<span style="color: #CC0000;color:#800000;">0</span>; i &amp;lt;<span style="color: #CC0000;color:#800000;">8</span>; i+= <span style="color: #CC0000;color:#800000;">1</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">dir = dirs<span style="color: #66cc66;">&#91;</span>int<span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// --</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">crx = crt.<span style="color: #006600;">x</span> + dir.<span style="color: #006600;">x</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cry = crt.<span style="color: #006600;">y</span> + dir.<span style="color: #006600;">y</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> crx &amp;lt;<span style="color: #CC0000;color:#800000;">0</span> || crx&amp;gt;= w <span style="color: #66cc66;">&#41;</span> <span style="color: #000066; font-weight: bold;">continue</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> cry &amp;lt;<span style="color: #CC0000;color:#800000;">0</span> || cry&amp;gt;= h <span style="color: #66cc66;">&#41;</span> <span style="color: #000066; font-weight: bold;">continue</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> b.<span style="color: #006600;">getPixel</span><span style="color: #66cc66;">&#40;</span> crx, cry <span style="color: #66cc66;">&#41;</span> == <span style="color: #CC0000;color:#800000;">0</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">continue</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// si ce point a deja ete etudié, byebye</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> visited<span style="color: #66cc66;">&#91;</span> <span style="color: #66cc66;">&#40;</span>crx<span style="color: #66cc66;">&#41;</span> * w + cry <span style="color: #66cc66;">&#93;</span> == <span style="color: #003366; font-weight: bold;">true</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">continue</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> count:int = isExtremity<span style="color: #66cc66;">&#40;</span> crx, cry <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> count&amp;gt; <span style="color: #CC0000;color:#800000;">0</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">max = count;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">bestDirId = i;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">nextPos.<span style="color: #006600;">x</span> = crx;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">nextPos.<span style="color: #006600;">y</span> = cry;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">visited<span style="color: #66cc66;">&#91;</span> <span style="color: #66cc66;">&#40;</span>nextPos.<span style="color: #006600;">x</span><span style="color: #66cc66;">&#41;</span> * w + nextPos.<span style="color: #006600;">y</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #003366; font-weight: bold;">true</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">points.<span style="color: #006600;">push</span><span style="color: #66cc66;">&#40;</span> nextPos <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">crt = nextPos;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">lastDir = bestDirId;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* @private</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">function</span> isExtremity<span style="color: #66cc66;">&#40;</span> px:int, py:int <span style="color: #66cc66;">&#41;</span>:int</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> i:int, crx:int, cry:int, dir:Point, iin:int=<span style="color: #CC0000;color:#800000;">0</span>, out:int=<span style="color: #CC0000;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span> i=<span style="color: #CC0000;color:#800000;">0</span>; i &amp;lt;<span style="color: #CC0000;color:#800000;">4</span>; i+= <span style="color: #CC0000;color:#800000;">1</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">dir = dirs<span style="color: #66cc66;">&#91;</span>int<span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// --</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">crx = px + dir.<span style="color: #006600;">x</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cry = py + dir.<span style="color: #006600;">y</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> crx &amp;lt;<span style="color: #CC0000;color:#800000;">0</span> || crx&amp;gt;= w <span style="color: #66cc66;">&#41;</span> <span style="color: #000066; font-weight: bold;">continue</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> cry &amp;lt;<span style="color: #CC0000;color:#800000;">0</span> || cry&amp;gt;= h <span style="color: #66cc66;">&#41;</span> <span style="color: #000066; font-weight: bold;">continue</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> visited<span style="color: #66cc66;">&#91;</span> <span style="color: #66cc66;">&#40;</span>crx<span style="color: #66cc66;">&#41;</span> * w + cry <span style="color: #66cc66;">&#93;</span> == <span style="color: #003366; font-weight: bold;">true</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">continue</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> b.<span style="color: #006600;">getPixel</span><span style="color: #66cc66;">&#40;</span> crx, cry <span style="color: #66cc66;">&#41;</span> == <span style="color: #CC0000;color:#800000;">0</span> <span style="color: #66cc66;">&#41;</span> out++;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">else</span> iin++;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">return</span> out;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">* @private</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">function</span> getStartPoint<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Point</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> i:int, j:int;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span>&nbsp; j=<span style="color: #CC0000;color:#800000;">0</span>; j &amp;lt;h; j += <span style="color: #CC0000;color:#800000;">1</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span>&nbsp; i=<span style="color: #CC0000;color:#800000;">0</span>; i &amp;lt;w; i += <span style="color: #CC0000;color:#800000;">1</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> b.<span style="color: #006600;">getPixel</span><span style="color: #66cc66;">&#40;</span> i, j <span style="color: #66cc66;">&#41;</span>&amp;gt; <span style="color: #CC0000;color:#800000;">0</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span> i, j <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">null</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">const</span> dirs:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #003366; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">1</span>,<span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #003366; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">0</span>,<span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #003366; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span>-<span style="color: #CC0000;color:#800000;">1</span>, <span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #003366; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">0</span>, -<span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #003366; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">1</span>,-<span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #003366; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span>-<span style="color: #CC0000;color:#800000;">1</span>, -<span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #003366; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span>-<span style="color: #CC0000;color:#800000;">1</span>, <span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #003366; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">1</span>,<span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">var</span> visited:Dictionary = <span style="color: #003366; font-weight: bold;">new</span> Dictionary<span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">var</span> lastDir:int = -<span style="color: #CC0000;color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">var</span> crtId:int = <span style="color: #CC0000;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">var</span> b:BitmapData;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">var</span> crt:Point;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">var</span> w:int;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">var</span> h:int;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />
Cette création est mise à disposition sous un <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">contrat Creative Commons</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kiroukou.media-box.net/blog/mes-recherches-sur-flash/155-extraction-des-contours-dun-bitmap.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Sandy3D 3.0.2</title>
		<link>http://kiroukou.media-box.net/blog/mes-recherches-sur-flash/154-sandy3d-302.html</link>
		<comments>http://kiroukou.media-box.net/blog/mes-recherches-sur-flash/154-sandy3d-302.html#comments</comments>
		<pubDate>Tue, 26 Feb 2008 13:10:32 +0000</pubDate>
		<dc:creator>kiroukou</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Projets]]></category>

		<category><![CDATA[demo]]></category>

		<category><![CDATA[sandy]]></category>

		<guid isPermaLink="false">http://kiroukou.media-box.net/blog/mes-recherches-sur-flash/154-sandy3d-302.html</guid>
		<description><![CDATA[4 mois après la 3.0.1, voici cette nouvelle mise à jour de la librarie.
Au menu, et bien pas mal de petites choses:

Nouveaux attributs pour de l'éclairage avancé comme Gouraud, Phong et du Celshading.
Ajout d'une classe utilitaire, ParserStack qui permet de préloader plusieurs fichiers et de séquentialliser leur création.
Ajout de l'objet Sound3D.
et pas mal de petites [...]]]></description>
			<content:encoded><![CDATA[<p>4 mois après la 3.0.1, voici cette nouvelle mise à jour de la librarie.</p>
<p>Au menu, et bien pas mal de petites choses:</p>
<ul>
<li>Nouveaux attributs pour de l'éclairage avancé comme Gouraud, Phong et du Celshading.</li>
<li>Ajout d'une classe utilitaire, ParserStack qui permet de préloader plusieurs fichiers et de séquentialliser leur création.</li>
<li>Ajout de l'objet Sound3D.</li>
<li>et pas mal de petites choses plutôt utiles...</li>
</ul>
<p>Un composant permet aussi d'installer la documentation de Sandy directement dans Flash CS3, facilitant grandement son utilisation.</p>
<p>Une jolie petite démo est aussi disponible pour vous présenter les  ajouts principaux:</p>
<p><a href="http://www.flashsandy.org/demos/v302"><img src="http://www.flashsandy.org/blog/wp-content/uploads/2008/02/image-1.png" alt="3.0.2 demo" height="301" width="600" /></a></p>
<p>Une nouvelle série de tutoriels est aussi disponible (en anglais) montrant la création d'une voiture depuis la modélisation dans 3DS jusqu'à son exploitation avancée dans Flash avec Sandy.</p>
<p>Pour les quelques uns restants sur leur a priori de la version AS2, plutôt difficile à prendre en main il faut bien le reconnaitre, j'ai préparé un rapide tutoriel montrant l'affichage d'un objet 3D en 3 lignes de code seulement:<a href="http://www.flashsandy.org/tutorials/3.0/simplest_sandy_flash_cs3">http://www.flashsandy.org/tutorials/3.0/simplest_sandy_flash_cs3</a></p>
<p>Voilà je pense que vous connaissez déja l'adresse, mais au cas ou, la voici à nouveau : <a href="http://www.flashsandy.org">flashsandy.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kiroukou.media-box.net/blog/mes-recherches-sur-flash/154-sandy3d-302.html/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
