gvsig-raster / libjni-potrace / trunk / libjni-potrace / src / main / native / jpotrace / main.h @ 1780
History | View | Annotate | Download (3.45 KB)
1 |
/* Copyright (C) 2001-2007 Peter Selinger.
|
---|---|
2 |
This file is part of Potrace. It is free software and it is covered
|
3 |
by the GNU General Public License. See the file COPYING for details. */
|
4 |
|
5 |
/* $Id: main.h 147 2007-04-09 00:44:09Z selinger $ */
|
6 |
|
7 |
#ifndef MAIN_H
|
8 |
#define MAIN_H
|
9 |
|
10 |
#ifdef HAVE_CONFIG_H
|
11 |
#include "config.h" |
12 |
#endif
|
13 |
|
14 |
#include "potracelib.h" |
15 |
|
16 |
/* structure to hold a tilted rectangle */
|
17 |
struct rect_s {
|
18 |
double bb[2]; /* dimensions of bounding box */ |
19 |
double orig[2]; /* origin relative to bounding box */ |
20 |
}; |
21 |
typedef struct rect_s rect_t; |
22 |
|
23 |
/* structure to hold a dimensioned value */
|
24 |
struct dim_s {
|
25 |
double x; /* value */ |
26 |
double d; /* dimension (in pt), or 0 if not given */ |
27 |
}; |
28 |
typedef struct dim_s dim_t; |
29 |
|
30 |
#define DIM_IN (72) |
31 |
#define DIM_CM (72 / 2.54) |
32 |
#define DIM_MM (72 / 25.4) |
33 |
#define DIM_PT (1) |
34 |
|
35 |
/* set some regional defaults */
|
36 |
|
37 |
#ifdef USE_METRIC
|
38 |
#define DEFAULT_DIM DIM_CM
|
39 |
#define DEFAULT_DIM_NAME "centimeters" |
40 |
#else
|
41 |
#define DEFAULT_DIM DIM_IN
|
42 |
#define DEFAULT_DIM_NAME "inches" |
43 |
#endif
|
44 |
|
45 |
#ifdef USE_A4
|
46 |
#define DEFAULT_PAPERWIDTH 595 |
47 |
#define DEFAULT_PAPERHEIGHT 842 |
48 |
#define DEFAULT_PAPERFORMAT "a4" |
49 |
#else
|
50 |
#define DEFAULT_PAPERWIDTH 612 |
51 |
#define DEFAULT_PAPERHEIGHT 792 |
52 |
#define DEFAULT_PAPERFORMAT "letter" |
53 |
#endif
|
54 |
|
55 |
struct backend_s;
|
56 |
|
57 |
/* structure to hold command line options */
|
58 |
struct info_s {
|
59 |
struct backend_s *backend; /* type of backend (eps,ps,pgm etc) */ |
60 |
potrace_param_t *param; /* tracing parameters, see potracelib.h */
|
61 |
int debug; /* type of output (0-2) (for BACKEND_PS/EPS only) */ |
62 |
dim_t width_d; /* desired width of image */
|
63 |
dim_t height_d; /* desired height of image */
|
64 |
double rx; /* desired x resolution (in dpi) */ |
65 |
double ry; /* desired y resolution (in dpi) */ |
66 |
double sx; /* desired x scaling factor */ |
67 |
double sy; /* desired y scaling factor */ |
68 |
double stretch; /* ry/rx, if not otherwise determined */ |
69 |
dim_t lmar_d, rmar_d, tmar_d, bmar_d; /* margins */
|
70 |
double angle; /* rotate by this many degrees */ |
71 |
int paperwidth, paperheight; /* paper size for ps backend (in pt) */ |
72 |
double unit; /* granularity of output grid */ |
73 |
int compress; /* apply compression? */ |
74 |
int pslevel; /* postscript level to use: affects only compression */ |
75 |
int color; /* rgb color code 0xrrggbb: line color */ |
76 |
int fillcolor; /* rgb color code 0xrrggbb: fill color */ |
77 |
double gamma; /* gamma value for pgm backend */ |
78 |
int longcoding; /* do not optimize for file size? */ |
79 |
char *outfile; /* output filename, if given */ |
80 |
char **infiles; /* array of input filenames */ |
81 |
int infilecount; /* number of input filenames */ |
82 |
double blacklevel; /* 0 to 1: black/white cutoff in input file */ |
83 |
int invert; /* invert bitmap? */ |
84 |
int opaque; /* paint white shapes opaquely? */ |
85 |
int group; /* group paths together? */ |
86 |
int progress; /* should we display a progress bar? */ |
87 |
}; |
88 |
typedef struct info_s info_t; |
89 |
|
90 |
extern info_t info;
|
91 |
|
92 |
/* structure to hold per-image information, set e.g. by calc_dimensions */
|
93 |
struct imginfo_s {
|
94 |
int pixwidth; /* width of input pixmap */ |
95 |
int pixheight; /* height of input pixmap */ |
96 |
double width; /* desired width of image (in pt or pixels) */ |
97 |
double height; /* desired height of image (in pt or pixels) */ |
98 |
double lmar, rmar, tmar, bmar; /* requested margins (in pt) */ |
99 |
rect_t trans; /* specify relative position of a tilted rectangle */
|
100 |
}; |
101 |
typedef struct imginfo_s imginfo_t; |
102 |
|
103 |
#endif /* MAIN_H */ |