Revision 23667 trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/vectorizacion/process/PotraceProcess.java

View differences:

PotraceProcess.java
55 55
 * @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es)
56 56
 */
57 57
public class PotraceProcess extends RasterProcess {
58
	private double       percent      = 0;
59
	private FLyrRasterSE lyr          = null;
60
	private String       fileName     = null;
61
	private IWriter      writer       = null;
62
	private int          bezierPoints = 7;
63
	private Value        values[];
64
	private int          m_iGeometry  = 0;
65
	private int          policy       = 1;
58
	private double       percent               = 0;
59
	private FLyrRasterSE lyr                   = null;
60
	private String       fileName              = null;
61
	private IWriter      writer                = null;
62
	private Value        values[]              = null;
63
	private int          m_iGeometry           = 0;
66 64

  
65
	// Default Values
66
	private int          bezierPoints          = 7;
67
	private int          policy                = VectorizationBinding.POLICY_MINORITY;
68
	private int          despeckle             = 0;
69
	private double       cornerThreshold       = 1.0;
70
	private double       optimizationTolerance = 0.2;
71
	private int          outputQuantization    = 10;
72
	private boolean      curveOptimization     = true;
73

  
74

  
67 75
	/*
68 76
	 * (non-Javadoc)
69 77
	 * @see org.gvsig.raster.RasterProcess#init()
......
73 81
		fileName = getStringParam("filename");
74 82
		policy = getIntParam("policy");
75 83
		bezierPoints = getIntParam("points");
84
		despeckle = getIntParam("despeckle");
85
		cornerThreshold = getDoubleParam("cornerThreshold");
86
		optimizationTolerance = getDoubleParam("optimizationTolerance");
87
		outputQuantization = getIntParam("outputQuantization");
88
		curveOptimization = getBooleanParam("curveoptimization");
76 89
	}
77 90

  
78 91
	/*
......
101 114
	public void generatePotrace() throws Exception {
102 115
		VectorizationBinding binding = new VectorizationBinding(lyr.getBufferFactory());
103 116
		binding.setPolicy(policy);
117
		binding.setDespeckle(despeckle);
118
		binding.setCornerThreshold(cornerThreshold);
119
		binding.setOptimizationTolerance(optimizationTolerance);
120
		binding.setOutputQuantization(outputQuantization);
121
		binding.setEnabledCurveOptimization(curveOptimization);
122
		
104 123
		// binding.setCornerThreshold(-1);
105 124
		double geometrias[] = binding.VectorizeBuffer();
106 125

  

Also available in: Unified diff