pcb 4.1.1
An interactive printed circuit board layout editor.
|
00001 00020 #ifndef POTRACELIB_H 00021 #define POTRACELIB_H 00022 00023 /* ---------------------------------------------------------------------- */ 00024 /* tracing parameters */ 00025 00026 /* turn policies */ 00027 #define POTRACE_TURNPOLICY_BLACK 0 00028 #define POTRACE_TURNPOLICY_WHITE 1 00029 #define POTRACE_TURNPOLICY_LEFT 2 00030 #define POTRACE_TURNPOLICY_RIGHT 3 00031 #define POTRACE_TURNPOLICY_MINORITY 4 00032 #define POTRACE_TURNPOLICY_MAJORITY 5 00033 #define POTRACE_TURNPOLICY_RANDOM 6 00034 00038 struct potrace_progress_s 00039 { 00040 void (*callback) (double progress, void *privdata); 00042 void *data; 00043 double min, max; 00044 double epsilon; 00045 }; 00046 typedef struct potrace_progress_s potrace_progress_t; 00047 00051 struct potrace_param_s 00052 { 00053 int turdsize; 00054 int turnpolicy; 00055 double alphamax; 00056 int opticurve; 00057 double opttolerance; 00058 potrace_progress_t progress; 00059 }; 00060 typedef struct potrace_param_s potrace_param_t; 00061 00062 /* ---------------------------------------------------------------------- */ 00063 /* bitmaps */ 00064 00068 typedef unsigned long potrace_word; 00069 00078 struct potrace_bitmap_s 00079 { 00080 int w; 00081 int h; 00082 int dy; 00083 potrace_word *map; 00084 }; 00085 typedef struct potrace_bitmap_s potrace_bitmap_t; 00086 00087 /* ---------------------------------------------------------------------- */ 00088 /* curves */ 00089 00093 struct potrace_dpoint_s 00094 { 00095 double x, y; 00096 }; 00097 typedef struct potrace_dpoint_s potrace_dpoint_t; 00098 00099 /* segment tags */ 00100 #define POTRACE_CURVETO 1 00101 #define POTRACE_CORNER 2 00102 00106 struct potrace_curve_s 00107 { 00108 int n; 00109 int *tag; 00110 potrace_dpoint_t (*c)[3]; 00113 }; 00114 typedef struct potrace_curve_s potrace_curve_t; 00115 00121 struct potrace_path_s 00122 { 00123 int area; 00124 int sign; 00125 potrace_curve_t curve; 00127 struct potrace_path_s *next; 00129 struct potrace_path_s *childlist; 00130 struct potrace_path_s *sibling; 00132 struct potrace_privpath_s *priv; 00133 }; 00134 typedef struct potrace_path_s potrace_path_t; 00135 00136 /* ---------------------------------------------------------------------- */ 00137 00138 #define POTRACE_STATUS_OK 0 00139 #define POTRACE_STATUS_INCOMPLETE 1 00140 00143 struct potrace_state_s 00144 { 00145 int status; 00146 potrace_path_t *plist; 00148 struct potrace_privstate_s *priv; 00149 }; 00150 typedef struct potrace_state_s potrace_state_t; 00151 00152 /* ---------------------------------------------------------------------- */ 00153 /* API functions */ 00154 00158 potrace_param_t *potrace_param_default (void); 00159 00163 void potrace_param_free (potrace_param_t * p); 00164 00168 potrace_state_t *potrace_trace (const potrace_param_t * param, 00169 const potrace_bitmap_t * bm); 00170 00174 void potrace_state_free (potrace_state_t * st); 00175 00180 char *potrace_version (void); 00181 00182 #endif /* POTRACELIB_H */