Gwyscan Library
 All Files Functions Enumerations Enumerator Modules
gwyscan.h
Go to the documentation of this file.
1 
2 #ifdef _MSC_VER
3 #define GWYSCANDLL_API __declspec(dllexport)
4 #else
5 #define GWYSCANDLL_API
6 #endif
7 
8 
9 #include <stdbool.h>
10 
41 typedef enum {
49 
50 typedef enum {
54  GWYSCAN_ALLOCATION_FAILED = 3
62 GWYSCANDLL_API GwyscanResult gwyscan_save_gwyddion_array(const double *data, int xres, int yres, double xreal, double yreal, const char *xyunit, const char *zunit, const char *description, const char *filename);
63 
64 GWYSCANDLL_API GwyscanResult gwyscan_add_gwyddion_array(const double *data, int xres, int yres, double xreal, double yreal, const char *xyunit, const char *zunit, const char *description, const char *filename);
65 
66 GWYSCANDLL_API GwyscanResult gwyscan_save_gwyddion_arrays_general(const double **data, int nchannels, const int *xres, const int *yres, const double *xreal, const double *yreal, const char **xyunit, const char **zunit, const char **description, const char *filename);
67 
68 GWYSCANDLL_API GwyscanResult gwyscan_save_gwyddion_arrays(const double *data, int nchannels, int xres, int yres, double xreal, double yreal, const char **xyunit, const char **zunit, const char **description, const char *filename);
69 
70 GWYSCANDLL_API GwyscanResult gwyscan_save_gwyddion_xyz(const double *xypos, const double *zdata, int n, int nchannels, int xres, int yres, const char **description, const char *filename);
77 GWYSCANDLL_API GwyscanResult gwyscan_generate_xyz_data(double *xypos, double *zdata, int n, double xreal, double yreal, double xoffset, double yoffset, int reserved);
78 
79 GWYSCANDLL_API int gwyscan_create_path_regular(double *xypos, int xres, int yres, double xreal, double yreal, double xoffset, double yoffset, double angle, GwyscanDirection direction);
80 
81 GWYSCANDLL_API int gwyscan_create_path_space_filling(double *xypos, int order, double xreal, double yreal, double xoffset, double yoffset);
82 
83 GWYSCANDLL_API int gwyscan_create_path_space_filling_progressive(double *xypos, int order, int coarse_order, int skip_order, double xreal, double yreal, double xoffset, double yoffset);
84 
85 GWYSCANDLL_API int gwyscan_create_path_spiral(double *xypos, int n, double xreal, double yreal, double xoffset, double yoffset);
86 
87 GWYSCANDLL_API int gwyscan_create_path_random(double *xypos, int n, double xreal, double yreal, double xoffset, double yoffset);
88 
89 GWYSCANDLL_API int gwyscan_create_path_octave_profiles(double *xypos, int order, int noctaves, int nprofiles, double xreal, double yreal, double xoffset, double yoffset);
90 
91 GWYSCANDLL_API int gwyscan_create_path_octave_2d(double *xypos, int order, int noctaves, double xreal, double yreal, double xoffset, double yoffset);
92 
93 GWYSCANDLL_API int gwyscan_create_path_wichmann_profiles(double *xypos, int n, int nprofiles, double xreal, double yreal, double xoffset, double yoffset);
100 GWYSCANDLL_API int gwyscan_modify_path_insert(double *xypos_dest, int *indexes, int *n_indexes, const double *xypos_source, int n_source, double xpos, double ypos, int interval);
101 
102 GWYSCANDLL_API void gwyscan_modify_path_revert(double *xypos_dest, const double *xypos_source, int n);
103 
104 GWYSCANDLL_API void gwyscan_modify_path_flip_horizontal(double *xypos_dest, const double *xypos_source, int n);
105 
106 GWYSCANDLL_API void gwyscan_modify_path_flip_vertical(double *xypos_dest, const double *xypos_source, int n);
109 // TODO: Refine Scan Path routines
110 #if(0)
111 
114 GWYSCANDLL_API int gwyscan_refine_path_threshold(double* xypos,
115  const double* xypos_prev,
116  const double* zdata_prev,
117  int n_prev,
118  int channel_prev,
119  const double* xypos_preprev,
120  const double* zdata_preprev,
121  int n_preprev,
122  int channel_preprev,
123  double threshold,
124  int xdiv,
125  int ydiv,
126  double xstep,
127  double ystep,
128  double xreal,
129  double yreal,
130  double xoffset,
131  double yoffset);
132 
133 GWYSCANDLL_API int gwyscan_refine_path_roughness(double* xypos,
134  const double* xypos_prev,
135  const double* zdata_prev,
136  int n_prev,
137  int channel_prev,
138  double roughness,
139  int xdiv,
140  int ydiv,
141  double xstep,
142  double ystep,
143  double xreal,
144  double yreal,
145  double xoffset,
146  double yoffset);
147 
148 GWYSCANDLL_API int gwyscan_refine_path_edges(double* xypos,
149  const double* xypos_prev,
150  const double* zdata_prev,
151  int n_prev,
152  int channel_prev,
153  double threshold,
154  double xstep,
155  double ystep,
156  double xreal,
157  double yreal,
158  double xoffset,
159  double yoffset);
160 
161 
163 #endif
164 // TODO: Refine Scan Path routines
165 
166 
170 GWYSCANDLL_API GwyscanResult gwyscan_preview(const double *xypos, const double *zdata, int n, int channel, double *preview_image, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle);
171 
172 GWYSCANDLL_API GwyscanResult gwyscan_preview_subset(const double *xypos, const double *zdata, int n, int from, int len, int channel_from, int channel_to, double **preview_images, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle);
173 
174 GWYSCANDLL_API GwyscanResult gwyscan_preview_subset_all_channels(const double *xypos, const double *zdata, int n, int from, int len, int nchannels, double **preview_images, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle);
175 
176 GWYSCANDLL_API GwyscanResult gwyscan_preview_average(const double *xypos, const double *zdata, int n, int channel, double *preview_image, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle);
177 
178 GWYSCANDLL_API GwyscanResult gwyscan_preview_subset_average(const double *xypos, const double *zdata, int n, int from, int len, int channel_from, int channel_to, double **preview_images, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle);
179 
180 GWYSCANDLL_API GwyscanResult gwyscan_preview_subset_average_all_channels(const double *xypos, const double *zdata, int n, int from, int len, int nchannels, double **preview_images, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle);
183 /* vim: set cin et ts=4 sw=4 cino=>1s,e0,n0,f0,{0,}0,^0,\:1s,=0,g1s,h0,t0,+1s,c3,(0,u0 : */
184 
GWYSCANDLL_API GwyscanResult gwyscan_save_gwyddion_array(const double *data, int xres, int yres, double xreal, double yreal, const char *xyunit, const char *zunit, const char *description, const char *filename)
Saves single array as a Gwyddion file.
Definition: gwyscan.c:178
Forward scan direction, even/odd line block order.
Definition: gwyscan.h:47
GWYSCANDLL_API GwyscanResult gwyscan_preview_subset_average(const double *xypos, const double *zdata, int n, int from, int len, int channel_from, int channel_to, double **preview_images, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle)
Quickly interpolates non-equidistant data onto a regular grid in one channel.
Definition: gwyscan.c:3479
Forward scan direction.
Definition: gwyscan.h:42
GWYSCANDLL_API int gwyscan_create_path_octave_2d(double *xypos, int order, int noctaves, double xreal, double yreal, double xoffset, double yoffset)
Creates two-dimensional octave profile scan starting from the finest resolution.
Definition: gwyscan.c:1508
File saving failed.
Definition: gwyscan.h:53
GWYSCANDLL_API GwyscanResult gwyscan_save_gwyddion_xyz(const double *xypos, const double *zdata, int n, int nchannels, int xres, int yres, const char **description, const char *filename)
Saves Gwyddion XYZ file.
Definition: gwyscan.c:468
GWYSCANDLL_API int gwyscan_create_path_wichmann_profiles(double *xypos, int n, int nprofiles, double xreal, double yreal, double xoffset, double yoffset)
Creates Wichmann profile scans on progressive resolutions.
Definition: gwyscan.c:1368
GWYSCANDLL_API int gwyscan_create_path_regular(double *xypos, int xres, int yres, double xreal, double yreal, double xoffset, double yoffset, double angle, GwyscanDirection direction)
Creates scan path for regular (equidistant) measurements.
Definition: gwyscan.c:719
GwyscanDirection
Scan direction.
Definition: gwyscan.h:41
GWYSCANDLL_API GwyscanResult gwyscan_preview_subset_average_all_channels(const double *xypos, const double *zdata, int n, int from, int len, int nchannels, double **preview_images, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle)
Quickly interpolates non-equidistant data onto a regular grid.
Definition: gwyscan.c:3660
GWYSCANDLL_API GwyscanResult gwyscan_preview_average(const double *xypos, const double *zdata, int n, int channel, double *preview_image, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle)
Quickly interpolates non-equidistant data onto a regular grid. Uses fast average algorithm.
Definition: gwyscan.c:2744
GWYSCANDLL_API GwyscanResult gwyscan_preview_subset_all_channels(const double *xypos, const double *zdata, int n, int from, int len, int nchannels, double **preview_images, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle)
Quickly interpolates non-equidistant data onto a regular grid.
Definition: gwyscan.c:2956
Scan bidirectional.
Definition: gwyscan.h:45
GWYSCANDLL_API int gwyscan_create_path_space_filling_progressive(double *xypos, int order, int coarse_order, int skip_order, double xreal, double yreal, double xoffset, double yoffset)
Creates scan path for equidistant measurement on a space-filling curve on progressive resolutions...
Definition: gwyscan.c:1069
GWYSCANDLL_API void gwyscan_modify_path_revert(double *xypos_dest, const double *xypos_source, int n)
Reverts existing path.
Definition: gwyscan.c:2311
GWYSCANDLL_API GwyscanResult gwyscan_save_gwyddion_arrays_general(const double **data, int nchannels, const int *xres, const int *yres, const double *xreal, const double *yreal, const char **xyunit, const char **zunit, const char **description, const char *filename)
Saves multiple arrays to a Gwyddion file.
Definition: gwyscan.c:321
GWYSCANDLL_API GwyscanResult gwyscan_add_gwyddion_array(const double *data, int xres, int yres, double xreal, double yreal, const char *xyunit, const char *zunit, const char *description, const char *filename)
Saves single array as a Gwyddion file, adding it as new channels if the file already exists...
Definition: gwyscan.c:239
GWYSCANDLL_API void gwyscan_modify_path_flip_vertical(double *xypos_dest, const double *xypos_source, int n)
Flips existing path vertically.
Definition: gwyscan.c:2400
GWYSCANDLL_API void gwyscan_modify_path_flip_horizontal(double *xypos_dest, const double *xypos_source, int n)
Flips existing path horizontally.
Definition: gwyscan.c:2358
Error in data passed to the function.
Definition: gwyscan.h:52
Forward scan direction, refine line order.
Definition: gwyscan.h:46
GwyscanResult
Detailed information about an error.
Definition: gwyscan.h:50
GWYSCANDLL_API GwyscanResult gwyscan_preview(const double *xypos, const double *zdata, int n, int channel, double *preview_image, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle)
Quickly interpolates non-equidistant data onto a regular grid.
Definition: gwyscan.c:2710
GWYSCANDLL_API int gwyscan_create_path_octave_profiles(double *xypos, int order, int noctaves, int nprofiles, double xreal, double yreal, double xoffset, double yoffset)
Creates randomized octave profile scans on progressive resolutions.
Definition: gwyscan.c:1274
Success.
Definition: gwyscan.h:51
GWYSCANDLL_API int gwyscan_create_path_spiral(double *xypos, int n, double xreal, double yreal, double xoffset, double yoffset)
Creates spiral scan path incscribed to a rectangle on progressive resolutions.
Definition: gwyscan.c:1154
GWYSCANDLL_API int gwyscan_create_path_space_filling(double *xypos, int order, double xreal, double yreal, double xoffset, double yoffset)
Creates scan path for equidistant measurement on a space-filling curve.
Definition: gwyscan.c:991
GWYSCANDLL_API int gwyscan_modify_path_insert(double *xypos_dest, int *indexes, int *n_indexes, const double *xypos_source, int n_source, double xpos, double ypos, int interval)
Inserts points to existing path.
Definition: gwyscan.c:2224
GWYSCANDLL_API int gwyscan_create_path_random(double *xypos, int n, double xreal, double yreal, double xoffset, double yoffset)
Creates completely random path incscribed to a rectangle.
Definition: gwyscan.c:2113
Reverse scan direction.
Definition: gwyscan.h:43
GWYSCANDLL_API GwyscanResult gwyscan_preview_subset(const double *xypos, const double *zdata, int n, int from, int len, int channel_from, int channel_to, double **preview_images, double *preview_mask, int preview_width, int preview_height, double preview_xreal, double preview_yreal, double preview_xoffset, double preview_yoffset, double preview_angle)
Quickly interpolates non-equidistant data onto a regular grid in one channel.
Definition: gwyscan.c:2814
Scan in both directions.
Definition: gwyscan.h:44
GWYSCANDLL_API GwyscanResult gwyscan_generate_xyz_data(double *xypos, double *zdata, int n, double xreal, double yreal, double xoffset, double yoffset, int reserved)
Fills pre-allocated data with a virtual random scan in requested physical range.
Definition: gwyscan.c:3689