gvsig-raster / libjni-potrace / trunk / libjni-potrace / src / main / native / jpotrace / potrace_raster.h @ 1780
History | View | Annotate | Download (3.89 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*/
|
19 |
#ifndef POTRACE_RASTER_H
|
20 |
#define POTRACE_RASTER_H
|
21 |
|
22 |
#include "potracelib.h" |
23 |
|
24 |
/* structure to hold a tilted rectangle */
|
25 |
struct rect_s {
|
26 |
double bb[2]; /* dimensions of bounding box */ |
27 |
double orig[2]; /* origin relative to bounding box */ |
28 |
}; |
29 |
typedef struct rect_s rect_t; |
30 |
|
31 |
#ifdef USE_A4
|
32 |
#define DEFAULT_PAPERWIDTH 595 |
33 |
#define DEFAULT_PAPERHEIGHT 842 |
34 |
#define DEFAULT_PAPERFORMAT "a4" |
35 |
#else
|
36 |
#define DEFAULT_PAPERWIDTH 612 |
37 |
#define DEFAULT_PAPERHEIGHT 792 |
38 |
#define DEFAULT_PAPERFORMAT "letter" |
39 |
#endif
|
40 |
|
41 |
/* structure to hold a dimensioned value */
|
42 |
struct dim_s {
|
43 |
double x; /* value */ |
44 |
double d; /* dimension (in pt), or 0 if not given */ |
45 |
}; |
46 |
typedef struct dim_s dim_t; |
47 |
|
48 |
/* structure to hold command line options */
|
49 |
struct info_s {
|
50 |
struct backend_s *backend; /* type of backend (eps,ps,pgm etc) */ |
51 |
potrace_param_t *param; /* tracing parameters, see potracelib.h */
|
52 |
int debug; /* type of output (0-2) (for BACKEND_PS/EPS only) */ |
53 |
dim_t width_d; /* desired width of image */
|
54 |
dim_t height_d; /* desired height of image */
|
55 |
double rx; /* desired x resolution (in dpi) */ |
56 |
double ry; /* desired y resolution (in dpi) */ |
57 |
double sx; /* desired x scaling factor */ |
58 |
double sy; /* desired y scaling factor */ |
59 |
double stretch; /* ry/rx, if not otherwise determined */ |
60 |
dim_t lmar_d, rmar_d, tmar_d, bmar_d; /* margins */
|
61 |
double angle; /* rotate by this many degrees */ |
62 |
int paperwidth, paperheight; /* paper size for ps backend (in pt) */ |
63 |
double unit; /* granularity of output grid */ |
64 |
int compress; /* apply compression? */ |
65 |
int pslevel; /* postscript level to use: affects only compression */ |
66 |
int color; /* rgb color code 0xrrggbb: line color */ |
67 |
int fillcolor; /* rgb color code 0xrrggbb: fill color */ |
68 |
double gamma; /* gamma value for pgm backend */ |
69 |
int longcoding; /* do not optimize for file size? */ |
70 |
char *outfile; /* output filename, if given */ |
71 |
char **infiles; /* array of input filenames */ |
72 |
int infilecount; /* number of input filenames */ |
73 |
double blacklevel; /* 0 to 1: black/white cutoff in input file */ |
74 |
int invert; /* invert bitmap? */ |
75 |
int opaque; /* paint white shapes opaquely? */ |
76 |
int group; /* group paths together? */ |
77 |
int progress; /* should we display a progress bar? */ |
78 |
}; |
79 |
typedef struct info_s info_t; |
80 |
|
81 |
extern info_t info;
|
82 |
|
83 |
/* structure to hold per-image information, set e.g. by calc_dimensions */
|
84 |
struct imginfo_s {
|
85 |
int pixwidth; /* width of input pixmap */ |
86 |
int pixheight; /* height of input pixmap */ |
87 |
double width; /* desired width of image (in pt or pixels) */ |
88 |
double height; /* desired height of image (in pt or pixels) */ |
89 |
double lmar, rmar, tmar, bmar; /* requested margins (in pt) */ |
90 |
rect_t trans; /* specify relative position of a tilted rectangle */
|
91 |
}; |
92 |
typedef struct imginfo_s imginfo_t; |
93 |
|
94 |
double* vectorizarBuffer(const long *cbufferIn, int width, int height, int argc, char *argv[]); |
95 |
|
96 |
#endif /* POTRACE_RASTER_H */ |