root/as3/PotrAs/src/com/nitoyon/potras/ClosedPathList.as

リビジョン 85, 0.9 kB (コミッタ: nitoyon, コミット時期: 4 年 前)

initial version

Line 
1 /* Copyright (C) 2001-2007 Peter Selinger and nitoyon.
2    Original code(Potrace v1.8) by Peter Selinger.
3    Ported to ActionScript 3.0 by nitoyon.
4    This file is part of PotrAs. It is free software and it is covered
5    by the GNU General Public License. See the file COPYING for details. */
6
7 package com.nitoyon.potras
8 {
9 import flash.display.Graphics;
10 import flash.display.BitmapData;
11
12 public class ClosedPathList
13 {
14         /**
15          *  ClosePath array.
16          */
17         public var $a:Array;
18
19         /**
20          *  Constructor.
21          */
22         public function ClosedPathList():void
23         {
24                 $a = [];
25         }
26
27         /**
28          *  trace bitmap
29          */
30         public static function trace(bmpdata:BitmapData):ClosedPathList
31         {
32                 var pathList:Array = PathList.create(bmpdata);
33                 return ProcessPath.processPath(pathList);
34         }
35
36         /**
37          *  draw.
38          */
39         public function draw(g:Graphics):void
40         {
41                 for each(var path:* in $a)
42                 {
43                         if(path is ClosedPath)
44                         {
45                                 path.draw(g);
46                         }
47                 }
48         }
49 }
50 }
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。