~ubuntu-branches/debian/squeeze/inkscape/squeeze

« back to all changes in this revision

Viewing changes to src/trace/potrace/inkscape-potrace.h

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-09-09 23:29:02 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080909232902-c50iujhk1w79u8e7
Tags: 0.46-2.1
* Non-maintainer upload.
* Add upstream patch fixing a crash in the open dialog
  in the zh_CN.utf8 locale. Closes: #487623.
  Thanks to Luca Bruno for the patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *
4
4
 * Authors:
5
5
 *   Bob Jamison <rjamison@titan.com>
 
6
 *   Stéphane Gimenez <dev@gim.name>
6
7
 *
7
 
 * Copyright (C) 2004 Bob Jamison
 
8
 * Copyright (C) 2004-2006 Authors
8
9
 *
9
10
 * Released under GNU GPL, read the file 'COPYING' for more information
10
11
 *
20
21
#include <trace/trace.h>
21
22
#include <trace/imagemap.h>
22
23
 
 
24
#include "potracelib.h"
 
25
 
23
26
namespace Inkscape {
24
27
 
25
28
namespace Trace {
50
53
    /**
51
54
     *
52
55
     */
53
 
    virtual ~PotraceTracingEngine()
54
 
        {}
 
56
    ~PotraceTracingEngine();
 
57
 
 
58
 
 
59
    /**
 
60
     * Sets/gets potrace parameters
 
61
     */
 
62
    void setParamsTurdSize(int val)
 
63
        {
 
64
        potraceParams->turdsize = val;
 
65
        }
 
66
    int getParamsTurdSize()
 
67
        {
 
68
        return potraceParams->turdsize;
 
69
        }
 
70
 
 
71
    void setParamsAlphaMax(double val)
 
72
        {
 
73
        potraceParams->alphamax = val;
 
74
        }
 
75
    double getParamsAlphaMax()
 
76
        {
 
77
        return potraceParams->alphamax;
 
78
        }
 
79
 
 
80
    void setParamsOptiCurve(bool val)
 
81
        {
 
82
        potraceParams->opticurve = val;
 
83
        }
 
84
    bool getParamsOptiCurve()
 
85
        {
 
86
        return potraceParams->opticurve;
 
87
        }
 
88
 
 
89
    void setParamsOptTolerance(double val)
 
90
        {
 
91
        potraceParams->opttolerance = val;
 
92
        }
 
93
    double getParamsOptTolerance()
 
94
        {
 
95
        return potraceParams->opttolerance;
 
96
        }
55
97
 
56
98
    void setTraceType(TraceType val)
57
99
        {
158
200
        return multiScanSmooth;
159
201
        }
160
202
 
 
203
    /**
 
204
     * Sets whether we want to remove the background (bottom) trace
 
205
     */
 
206
    void setMultiScanRemoveBackground(bool val)
 
207
        {
 
208
        multiScanRemoveBackground= val;
 
209
        }
 
210
    bool getMultiScanRemoveBackground()
 
211
        {
 
212
        return multiScanRemoveBackground;
 
213
        }
 
214
 
161
215
 
162
216
    /**
163
217
     *  This is the working method of this implementing class, and all
165
219
     *  return the path data that is compatible with the d="" attribute
166
220
     *  of an SVG <path> element.
167
221
     */
168
 
    virtual TracingEngineResult *trace(Glib::RefPtr<Gdk::Pixbuf> pixbuf,
169
 
                                       int *nrPaths);
 
222
    virtual std::vector<TracingEngineResult> trace(
 
223
                        Glib::RefPtr<Gdk::Pixbuf> pixbuf);
170
224
 
171
225
    /**
172
226
     *  Abort the thread that is executing getPathDataFromPixbuf()
187
241
 
188
242
    private:
189
243
 
 
244
    potrace_param_t *potraceParams;
190
245
    TraceType traceType;
191
246
 
192
247
    //## do i invert at the end?
206
261
    int multiScanNrColors;
207
262
    bool multiScanStack; //do we tile or stack?
208
263
    bool multiScanSmooth;//do we use gaussian filter?
209
 
 
 
264
    bool multiScanRemoveBackground; //do we remove the bottom trace?
210
265
    /**
211
266
     * This is the actual wrapper of the call to Potrace.  nodeCount
212
267
     * returns the count of nodes created.  May be NULL if ignored.
213
268
     */
214
 
    char *grayMapToPath(GrayMap *gm, long *nodeCount);
 
269
    std::string grayMapToPath(GrayMap *gm, long *nodeCount);
215
270
 
216
 
    TracingEngineResult *traceBrightnessMulti(GdkPixbuf *pixbuf, int *nrPaths);
217
 
    TracingEngineResult *traceQuant(GdkPixbuf *pixbuf, int *nrPaths);
218
 
    TracingEngineResult *traceSingle(GdkPixbuf *pixbuf, int *nrPaths);
 
271
    std::vector<TracingEngineResult>traceBrightnessMulti(GdkPixbuf *pixbuf);
 
272
    std::vector<TracingEngineResult>traceQuant(GdkPixbuf *pixbuf);
 
273
    std::vector<TracingEngineResult>traceSingle(GdkPixbuf *pixbuf);
219
274
 
220
275
 
221
276
};//class PotraceTracingEngine