Gwyscan Library
 All Files Functions Enumerations Enumerator Modules
Modify Scan Path
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. More...
 
GWYSCANDLL_API void gwyscan_modify_path_revert (double *xypos_dest, const double *xypos_source, int n)
 Reverts existing path. More...
 
GWYSCANDLL_API void gwyscan_modify_path_flip_horizontal (double *xypos_dest, const double *xypos_source, int n)
 Flips existing path horizontally. More...
 
GWYSCANDLL_API void gwyscan_modify_path_flip_vertical (double *xypos_dest, const double *xypos_source, int n)
 Flips existing path vertically. More...
 

Detailed Description

Function Documentation

GWYSCANDLL_API void gwyscan_modify_path_flip_horizontal ( double *  xypos_dest,
const double *  xypos_source,
int  n 
)

Flips existing path horizontally.

The function flips points of existing input path horizontally and put them to existing output path. Size of input and output array must be the same.

Parameters
xypos_destis an allocated array of xy positions to fill.
xypos_sourceis an allocated array of source xy positions.
nis the number of points.
Examples:
modify_path_flip_horizontal.c.
GWYSCANDLL_API void gwyscan_modify_path_flip_vertical ( double *  xypos_dest,
const double *  xypos_source,
int  n 
)

Flips existing path vertically.

The function flips points of existing input path vertically and put them to existing output path. Size of input and output array must be the same.

Parameters
xypos_destis an allocated array of xy positions to fill.
xypos_sourceis an allocated array of source xy positions.
nis the number of points.
Examples:
modify_path_flip_vertical.c.
GWYSCANDLL_API int gwyscan_modify_path_insert ( double *  xypos_dest,
int *  indexes,
int *  nindexes,
const double *  xypos_source,
int  n_source,
double  xpos,
double  ypos,
int  interval 
)

Inserts points to existing path.

The function inserts [xpos, ypos] points to existing path in intervals distant interval indexes. First [xpos, ypos] point is inserted as the first element at index 0, then [xpos, ypos] point are inserted every interval elements. Last [xpos, ypos] point is inserted at the last index.

If you pass NULL for xypos_dest the function then just calculates and returns the number of positions in the path (n). This is the recommended way of finding out how large xypos_dest array you need to create. Note that each position has two coordinates so you must allocate xypos_dest as array with 2*n elements.

Parameters
xypos_destis an allocated array of xy positions to fill. Pass NULL to just calculate number of positions.
indexesis an allocated array of inserted indexes to fill. Pass NULL when calculating number of positions.
nindexesis a number of indexes in indexes array.
xypos_sourceis an allocated array of source xy positions.
n_sourceis the number of points in xypos_source array.
xposis a x coordinate of inserted point.
yposis a y coordinate of inserted point.
intervalis a distance of inserted points.
Returns
number of set elements or number of elements to allocate if xypos_dest is NULL.
GWYSCANDLL_API void gwyscan_modify_path_revert ( double *  xypos_dest,
const double *  xypos_source,
int  n 
)

Reverts existing path.

The function reverts points of existing input path and put them to existing output path. Size of input and output array must be the same.

Parameters
xypos_destis an allocated array of xy positions to fill.
xypos_sourceis an allocated array of source xy positions.
nis the number of points.
Examples:
modify_path_revert.c.