#include <stdio.h>#include <stdlib.h>#include <errno.h>#include <string.h>#include <getopt.h>#include <math.h>#include "main.h"#include "potracelib.h"#include "backend_pdf.h"#include "backend_eps.h"#include "backend_pgm.h"#include "backend_svg.h"#include "backend_hpgl.h"#include "backend_gimp.h"#include "backend_xfig.h"#include "bitmap_io.h"#include "bitmap.h"#include "platform.h"#include "auxiliary.h"
Go to the source code of this file.
Classes | |
| struct | backend_s |
| struct | pageformat_s |
| struct | simple_progress_s |
| struct | turnpolicy_s |
Defines | |
| #define | COL0 "\033[G" /* reset cursor to column 0 */ |
| #define | INFTY ((double)(1e30)) /* a value to represent +infinity */ |
| #define | M_PI 3.14159265358979323846 |
| #define | OPT_FILLCOLOR 302 |
| #define | OPT_GROUP 300 |
| #define | OPT_OPAQUE 301 |
| #define | OPT_PROGRESS 303 |
| #define | TRY(x) if (x) goto try_error |
| #define | UNDEF ((double)(1e30)) /* a value to represent "undefined" */ |
Typedefs | |
| typedef struct backend_s | backend_t |
| typedef struct pageformat_s | pageformat_t |
| typedef struct simple_progress_s | simple_progress_t |
| typedef struct turnpolicy_s | turnpolicy_t |
Functions | |
| static int | backend_list (FILE *fout, int j, int linelen) |
| static int | backend_lookup (char *name, backend_t **bp) |
| static void | calc_dimensions (imginfo_t *imginfo) |
| static void | dopts (int ac, char *av[]) |
| static double | double_of_dim (dim_t d, double def) |
| static void | init_progress (potrace_progress_t *prog, simple_progress_t *p, const char *filename, int count) |
| static void | license (FILE *f) |
| int | main (int ac, char *av[]) |
| static char * | make_outfilename (char *infile, char *ext) |
| static void | my_fclose (FILE *f, char *filename) |
| static FILE * | my_fopen_read (char *filename) |
| static FILE * | my_fopen_write (char *filename) |
| static int | parse_color (char *s) |
| static dim_t | parse_dimension (char *s, char **endptr) |
| static void | parse_dimensions (char *s, char **endptr, dim_t *dxp, dim_t *dyp) |
| static void | process_file (backend_t *b, const char *infile, const char *outfile, FILE *fin, FILE *fout) |
| static void | rotate_dim (double alpha, double w, double h, rect_t *r) |
| static void | show_defaults (FILE *f) |
| static void | simple_progress (double d, void *data) |
| static void | usage (FILE *f) |
Variables | |
| static backend_t | backend [] |
| struct info_s | info |
| static struct option | longopts [] |
| static pageformat_t | pageformat [] |
| static char * | shortopts = "hvlVW:H:r:x:S:M:L:R:T:B:A:P:t:u:c23epsgb:d:C:z:G:nqa:O:o:k:i" |
| static turnpolicy_t | turnpolicy [] |
| #define INFTY ((double)(1e30)) /* a value to represent +infinity */ |
| #define OPT_FILLCOLOR 302 |
| #define OPT_OPAQUE 301 |
| #define OPT_PROGRESS 303 |
| #define UNDEF ((double)(1e30)) /* a value to represent "undefined" */ |
| typedef struct pageformat_s pageformat_t |
| typedef struct simple_progress_s simple_progress_t |
| typedef struct turnpolicy_s turnpolicy_t |
| static int backend_list | ( | FILE * | fout, |
| int | j, | ||
| int | linelen | ||
| ) | [static] |
| static int backend_lookup | ( | char * | name, |
| backend_t ** | bp | ||
| ) | [static] |
| static void calc_dimensions | ( | imginfo_t * | imginfo | ) | [static] |
| static double double_of_dim | ( | dim_t | d, |
| double | def | ||
| ) | [inline, static] |
| static void init_progress | ( | potrace_progress_t * | prog, |
| simple_progress_t * | p, | ||
| const char * | filename, | ||
| int | count | ||
| ) | [inline, static] |
| static char* make_outfilename | ( | char * | infile, |
| char * | ext | ||
| ) | [static] |
| static void my_fclose | ( | FILE * | f, |
| char * | filename | ||
| ) | [static] |
| static FILE* my_fopen_read | ( | char * | filename | ) | [static] |
| static FILE* my_fopen_write | ( | char * | filename | ) | [static] |
| static int parse_color | ( | char * | s | ) | [static] |
| static dim_t parse_dimension | ( | char * | s, |
| char ** | endptr | ||
| ) | [static] |
| static void parse_dimensions | ( | char * | s, |
| char ** | endptr, | ||
| dim_t * | dxp, | ||
| dim_t * | dyp | ||
| ) | [static] |
| static void process_file | ( | backend_t * | b, |
| const char * | infile, | ||
| const char * | outfile, | ||
| FILE * | fin, | ||
| FILE * | fout | ||
| ) | [static] |
| static void rotate_dim | ( | double | alpha, |
| double | w, | ||
| double | h, | ||
| rect_t * | r | ||
| ) | [static] |
| static void show_defaults | ( | FILE * | f | ) | [static] |
| static void simple_progress | ( | double | d, |
| void * | data | ||
| ) | [static] |
{
{"eps", ".eps", 0, 0, 0, NULL, page_eps, NULL, 1},
{"postscript", ".ps", 1, 0, 1, init_ps, page_ps, term_ps, 1},
{"ps", ".ps", 1, 0, 1, init_ps, page_ps, term_ps, 1},
{"pdf", ".pdf", 0, 0, 1, init_pdf,page_pdf, term_pdf, 1},
{"svg", ".svg", 0, 0, 0, NULL, page_svg, NULL, 1},
{"hpgl", ".plt", 0, 0, 0, NULL, page_hpgl, NULL, 1},
{"pgm", ".pgm", 0, 1, 1, NULL, page_pgm, NULL, 1},
{"gimppath", ".gimppath", 0, 1, 0, NULL, page_gimp, NULL, 1},
{"xfig", ".fig", 1, 0, 0, NULL, page_xfig, NULL, 0},
{NULL, NULL, 0, 0, 0, NULL, NULL, NULL},
}
pageformat_t pageformat[] [static] |
{
{ "a4", 595, 842 },
{ "a3", 842, 1191 },
{ "a5", 421, 595 },
{ "b5", 516, 729 },
{ "letter", 612, 792 },
{ "legal", 612, 1008 },
{ "tabloid", 792, 1224 },
{ "statement", 396, 612 },
{ "executive", 540, 720 },
{ "folio", 612, 936 },
{ "quarto", 610, 780 },
{ "10x14", 720, 1008 },
{ NULL, 0, 0 },
}
char* shortopts = "hvlVW:H:r:x:S:M:L:R:T:B:A:P:t:u:c23epsgb:d:C:z:G:nqa:O:o:k:i" [static] |
turnpolicy_t turnpolicy[] [static] |
{
{"black", POTRACE_TURNPOLICY_BLACK},
{"white", POTRACE_TURNPOLICY_WHITE},
{"left", POTRACE_TURNPOLICY_LEFT},
{"right", POTRACE_TURNPOLICY_RIGHT},
{"minority", POTRACE_TURNPOLICY_MINORITY},
{"majority", POTRACE_TURNPOLICY_MAJORITY},
{"random", POTRACE_TURNPOLICY_RANDOM},
{NULL, 0},
}