![]() |
Mapper
0.9.0
API documentation
|
#include "types.h"
Classes | |
struct | _Path |
struct | _Transform |
Typedefs | |
typedef struct _Path | Path |
typedef struct _Transform | Transform |
Functions | |
int | path_alloc (Path **ppath, u32 npts) |
Allocates a path with room for a given number of points. More... | |
void | path_map (Path *path, const Transform *mx) |
Transforms all the points in a path according to the given matrix. More... | |
bool | path_unmap (Path *path, const Transform *mx) |
Transforms all the points in a path according to the inverse of the given matrix. More... | |
void | matrix_clear (Transform *matrix) |
Resets the matrix to the identity matrix. More... | |
void | matrix_translate (Transform *matrix, double dx, double dy) |
Translates the matrix by a given amount. More... | |
void | matrix_rotate (Transform *matrix, double angle) |
Rotates the matrix counterclockwise around the origin by the given angle, in degrees. More... | |
void | matrix_rotate_point (Transform *matrix, double x, double y, double angle) |
Rotates the matrix counterclockwise around the given point by the given angle, in degrees. More... | |
void | matrix_scale (Transform *matrix, double sx, double sy) |
Scales the matrix by the given amount on each axis. More... | |
void | matrix_map (const Transform *matrix, const double *pts, double *opts, int count) |
Maps a contiguous set of points from one array to another. More... | |
bool | matrix_unmap (const Transform *matrix, const double *pts, double *opts, int count) |
Maps a contiguous set of points from one array to another, using the inverse of the provided matrix. More... | |
bool | matrix_invert (Transform *dest, const Transform *src) |
Replaces the destination matrix with the inverse of the source matrix. More... | |
void | matrix_dump (const Transform *mx) |
typedef struct _Transform Transform |
void matrix_clear | ( | Transform * | matrix | ) |
Resets the matrix to the identity matrix.
void matrix_dump | ( | const Transform * | mx | ) |
Replaces the destination matrix with the inverse of the source matrix.
Returns TRUE if successful, FALSE if the inversion failed because the source transform is singular.
void matrix_map | ( | const Transform * | matrix, |
const double * | pts, | ||
double * | opts, | ||
int | count | ||
) |
Maps a contiguous set of points from one array to another.
The output array may overlap, or be the same, as the input array.
void matrix_rotate | ( | Transform * | matrix, |
double | angle | ||
) |
Rotates the matrix counterclockwise around the origin by the given angle, in degrees.
void matrix_rotate_point | ( | Transform * | matrix, |
double | x, | ||
double | y, | ||
double | angle | ||
) |
Rotates the matrix counterclockwise around the given point by the given angle, in degrees.
void matrix_scale | ( | Transform * | matrix, |
double | sx, | ||
double | sy | ||
) |
Scales the matrix by the given amount on each axis.
void matrix_translate | ( | Transform * | matrix, |
double | dx, | ||
double | dy | ||
) |
Translates the matrix by a given amount.
Maps a contiguous set of points from one array to another, using the inverse of the provided matrix.
The output array may overlap, or be the same, as the input array. If the matrix is singular, FALSE is returned and no points are changed; otherwise all points will be mapped and TRUE is returned.
Allocates a path with room for a given number of points.
The first parameter can be non-null for a preallocated Path structure, or nullptr to create a new structure on the heap.
Transforms all the points in a path according to the given matrix.