/* Copyright (C) 2001-2007 Peter Selinger and nitoyon. Original code(Potrace v1.8) by Peter Selinger. Ported to ActionScript 3.0 by nitoyon. This file is part of PotrAs. It is free software and it is covered by the GNU General Public License. See the file COPYING for details. */ package com.nitoyon.potras { import flash.geom.Point; public class Curve { public var tag:int; /* tag[n]: POTRACE_CORNER or POTRACE_CURVETO */ public var c:Array = new Array(3); /* c[n][i]: control points. c[n][0] is unused for tag[n]=POTRACE_CORNER */ /* the remainder of this structure is special to privcurve, and is used in EPS debug output and special EPS "short coding". These fields are valid only if "alphacurve" is set. */ public var vertex:Point; /* for POTRACE_CORNER, this equals c[1] */ public var alpha:Number; /* only for POTRACE_CURVETO */ public var alpha0:Number; /* "uncropped" alpha parameter - for debug output only */ public var beta:Number; /** * Constructor. * * initialize the members of the given curve structure to size m. * Return 0 on success, 1 on error with errno set. */ public function Curve():void { c[0] = new Point(); c[1] = new Point(); c[2] = new Point(); vertex = new Point(); } public function toString():String { return "alpha0: " + alpha0 + "\n" + "alpha: " + alpha + "\n" + "beta: " + beta + "\n" + "corner: " + (tag == ProcessPath.POTRACE_CORNER) + "\n" + "bezier: " + c[0] + "," + c[1] + "," + c[2]; } } }