w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

backend_geojson.c File Reference
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include "potracelib.h"
#include "curve.h"
#include "main.h"
#include "backend_geojson.h"
#include "lists.h"
#include "auxiliary.h"
Include dependency graph for backend_geojson.c:

Go to the source code of this file.

Functions

static double bezier (double t, double x0, double x1, double x2, double x3)
 
static char * round_to_unit (double x)
 
static void set_format (trans_t tr)
 
static void geojson_moveto (FILE *fout, dpoint_t p, trans_t tr)
 
static void geojson_lineto (FILE *fout, dpoint_t p, trans_t tr)
 
static void geojson_curveto (FILE *fout, dpoint_t p1, dpoint_t p2, dpoint_t p3, trans_t tr)
 
static int geojson_path (FILE *fout, potrace_curve_t *curve, trans_t tr)
 
static void write_polygons (FILE *fout, potrace_path_t *tree, trans_t tr, int first)
 
int page_geojson (FILE *fout, potrace_path_t *plist, imginfo_t *imginfo)
 

Variables

static const char * format = "%f"
 
static dpoint_t cur
 

Function Documentation

◆ bezier()

◆ geojson_curveto()

static void geojson_curveto ( FILE fout,
dpoint_t  p1,
dpoint_t  p2,
dpoint_t  p3,
trans_t  tr 
)
static

Definition at line 99 of file backend_geojson.c.

References bezier(), cur, fout, fprintf, i, p1, p2, q1, q2, q3, round_to_unit(), step(), t, trans, cordic::x, potrace_dpoint_s::x, y, and potrace_dpoint_s::y.

Referenced by geojson_path().

◆ geojson_lineto()

static void geojson_lineto ( FILE fout,
dpoint_t  p,
trans_t  tr 
)
static

Definition at line 89 of file backend_geojson.c.

References cur, fout, fprintf, p, q, round_to_unit(), and trans.

Referenced by geojson_path().

◆ geojson_moveto()

static void geojson_moveto ( FILE fout,
dpoint_t  p,
trans_t  tr 
)
static

Definition at line 79 of file backend_geojson.c.

References cur, fout, fprintf, p, q, round_to_unit(), and trans.

Referenced by geojson_path().

◆ geojson_path()

static int geojson_path ( FILE fout,
potrace_curve_t curve,
trans_t  tr 
)
static

◆ page_geojson()

◆ round_to_unit()

static char* round_to_unit ( double  x)
static

Definition at line 38 of file backend_geojson.c.

References buf, format, n, sprintf, and cordic::x.

Referenced by geojson_curveto(), geojson_lineto(), and geojson_moveto().

◆ set_format()

static void set_format ( trans_t  tr)
static

Definition at line 53 of file backend_geojson.c.

References buf, ceil(), d, fabs, format, info, int(), log(), min, s, trans_s::scalex, trans_s::scaley, and sprintf.

Referenced by page_geojson().

◆ write_polygons()

static void write_polygons ( FILE fout,
potrace_path_t tree,
trans_t  tr,
int  first 
)
static

Definition at line 155 of file backend_geojson.c.

References first, fout, fprintf, geojson_path(), p, and q.

Referenced by page_geojson().

Variable Documentation

◆ cur

dpoint_t cur
static

Definition at line 77 of file backend_geojson.c.

Referenced by geojson_curveto(), geojson_lineto(), and geojson_moveto().

◆ format

const char* format = "%f"
static

Definition at line 33 of file backend_geojson.c.

Referenced by round_to_unit(), and set_format().