Classes | Defines | Typedefs | Functions | Variables
main.c File Reference
#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"
Include dependency graph for main.c:

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 Documentation

#define COL0   "\033[G" /* reset cursor to column 0 */

Definition at line 42 of file main.c.

#define INFTY   ((double)(1e30)) /* a value to represent +infinity */

Definition at line 38 of file main.c.

#define M_PI   3.14159265358979323846

Definition at line 34 of file main.c.

#define OPT_FILLCOLOR   302

Definition at line 433 of file main.c.

#define OPT_GROUP   300

Definition at line 431 of file main.c.

#define OPT_OPAQUE   301

Definition at line 432 of file main.c.

#define OPT_PROGRESS   303

Definition at line 434 of file main.c.

#define TRY (   x)    if (x) goto try_error

Definition at line 1163 of file main.c.

#define UNDEF   ((double)(1e30)) /* a value to represent "undefined" */

Definition at line 37 of file main.c.


Typedef Documentation

typedef struct backend_s backend_t

Definition at line 170 of file main.c.

typedef struct pageformat_s pageformat_t

Definition at line 120 of file main.c.

Definition at line 51 of file main.c.

typedef struct turnpolicy_s turnpolicy_t

Definition at line 143 of file main.c.


Function Documentation

static int backend_list ( FILE *  fout,
int  j,
int  linelen 
) [static]

Definition at line 217 of file main.c.

static int backend_lookup ( char *  name,
backend_t **  bp 
) [static]

Definition at line 188 of file main.c.

static void calc_dimensions ( imginfo_t imginfo) [static]

Definition at line 875 of file main.c.

static void dopts ( int  ac,
char *  av[] 
) [static]

Definition at line 484 of file main.c.

static double double_of_dim ( dim_t  d,
double  def 
) [inline, static]

Definition at line 397 of file main.c.

static void init_progress ( potrace_progress_t prog,
simple_progress_t p,
const char *  filename,
int  count 
) [inline, static]

Definition at line 76 of file main.c.

static void license ( FILE *  f) [static]

Definition at line 236 of file main.c.

int main ( int  ac,
char *  av[] 
)

Definition at line 1165 of file main.c.

static char* make_outfilename ( char *  infile,
char *  ext 
) [static]

Definition at line 1043 of file main.c.

static void my_fclose ( FILE *  f,
char *  filename 
) [static]

Definition at line 1035 of file main.c.

static FILE* my_fopen_read ( char *  filename) [static]

Definition at line 1019 of file main.c.

static FILE* my_fopen_write ( char *  filename) [static]

Definition at line 1027 of file main.c.

static int parse_color ( char *  s) [static]

Definition at line 405 of file main.c.

static dim_t parse_dimension ( char *  s,
char **  endptr 
) [static]

Definition at line 331 of file main.c.

static void parse_dimensions ( char *  s,
char **  endptr,
dim_t dxp,
dim_t dyp 
) [static]

Definition at line 359 of file main.c.

static void process_file ( backend_t b,
const char *  infile,
const char *  outfile,
FILE *  fin,
FILE *  fout 
) [static]

Definition at line 1077 of file main.c.

static void rotate_dim ( double  alpha,
double  w,
double  h,
rect_t r 
) [static]

Definition at line 854 of file main.c.

static void show_defaults ( FILE *  f) [static]

Definition at line 254 of file main.c.

static void simple_progress ( double  d,
void *  data 
) [static]

Definition at line 56 of file main.c.

static void usage ( FILE *  f) [static]

Definition at line 260 of file main.c.


Variable Documentation

backend_t backend[] [static]
Initial value:
 {
  {"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},
}

Definition at line 172 of file main.c.

struct info_s info

Definition at line 40 of file main.c.

struct option longopts[] [static]

Definition at line 436 of file main.c.

Initial value:
 {
  { "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 },
}

Definition at line 123 of file main.c.

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]

Definition at line 482 of file main.c.

Initial value:

Definition at line 146 of file main.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


portrait_painter
Author(s): Niklas Meinzer, Ina Baumgarten
autogenerated on Wed Dec 26 2012 16:00:43