![]() |
Mapper
0.9.0
API documentation
|
Classes | |
struct | _IntPath |
Macros | |
#define | MAX_PATH_POINTS 32768 |
#define | F_PATH_CONTROL 1 |
#define | F_PATH_CORNER 2 |
#define | F_PATH_DASH 4 |
#define | F_PATH_MOVE 8 |
#define | F_PATH_NO_STROKE 16 |
#define | F_PATH_HOLE 0x80 |
Typedefs | |
typedef struct _IntPath | IntPath |
Functions | |
bool | ocad_path_iterate (u32 npts, const OCADPoint *pts, IntPathCallback callback, void *param) |
Iterates over an OCADPath by first converting it to an IntPath, and then calling ocad_internal_path_iterate. More... | |
s64 | ocad_path_area (s32 *path, u32 start, u32 count) |
Returns the signed area of a subsection of path, in map units. More... | |
void | ocad_path_map (const Transform *matrix, const OCADPoint *pts, OCADPoint *opts, u32 npts) |
Applies a matrix transformation to a collection of contiguous OCADPoints. More... | |
bool | ocad_path_unmap (const Transform *matrix, const OCADPoint *pts, OCADPoint *opts, u32 npts) |
Applies the inverse of a matrix transformation to a collection of contiguous OCADPoints. More... | |
bool | ocad_path_bounds_rect (OCADRect *rect, u32 npts, const OCADPoint *pts) |
Stores the smallest bounding rectangle that contains all the provided OCADPoints into rect. More... | |
bool | ocad_path_bounds (s32 *rect, u32 npts, const OCADPoint *pts) |
Stores the smallest bounding rectangle that contains all the provided OCADPoints into rect, as an array of four integers in the order (min-x, min-y, max-x, max-y). More... | |
bool | ocad_rect_grow (OCADRect *prect, s32 amount) |
Grows the boundaries of an OCADRect by the given amount, in map units. More... | |
bool | ocad_rect_intersects (const OCADRect *r1, const OCADRect *r2) |
Calculates the intersection of r2 with r1. More... | |
void | ocad_rect_union (OCADRect *r1, const OCADRect *r2) |
Merges the second rectangle into the first. More... | |
#define F_PATH_CONTROL 1 |
#define F_PATH_CORNER 2 |
#define F_PATH_DASH 4 |
#define F_PATH_HOLE 0x80 |
#define F_PATH_MOVE 8 |
#define F_PATH_NO_STROKE 16 |
#define MAX_PATH_POINTS 32768 |
Returns the signed area of a subsection of path, in map units.
Stores the smallest bounding rectangle that contains all the provided OCADPoints into rect, as an array of four integers in the order (min-x, min-y, max-x, max-y).
Calculates the bounds of the given path and returns it in the provided rectangle.
If npts is 0, then the array is not modified and FALSE is returned; otherwise, it is modified and TRUE is returned.
Stores the smallest bounding rectangle that contains all the provided OCADPoints into rect.
Calculates the bounds of the given path and returns it in the provided rectangle.
All flags within the OCADRect are set to 0. If npts is 0, then rect is not modified and FALSE is returned; otherwise, it is modified and TRUE is returned.
bool ocad_path_iterate | ( | u32 | npts, |
const OCADPoint * | pts, | ||
IntPathCallback | callback, | ||
void * | param | ||
) |
Iterates over an OCADPath by first converting it to an IntPath, and then calling ocad_internal_path_iterate.
Iterates over an set of OCAD points, providing a list of PostScript-like path segments.
Applies a matrix transformation to a collection of contiguous OCADPoints.
Typically one or both of the point arrays would be part of an OCADPath. All flags within the OCADPoints are preserved; only the positions are modified. The arrays may point to the same location in order to map a set of points in-place.
bool ocad_path_unmap | ( | const Transform * | matrix, |
const OCADPoint * | pts, | ||
OCADPoint * | opts, | ||
u32 | npts | ||
) |
Applies the inverse of a matrix transformation to a collection of contiguous OCADPoints.
This is done by inverting the matrix and then calling ocad_path_map. Returns TRUE if the call was successful, or FALSE if the supplied matrix was not invertible.
Grows the boundaries of an OCADRect by the given amount, in map units.
Grows the given rectangle by the given amount, which may be negative.
The flags in the OCADRect are unaffected. This function always returns TRUE.
bool ocad_rect_intersects | ( | const OCADRect * | r1, |
const OCADRect * | r2 | ||
) |
Calculates the intersection of r2 with r1.
Returns true if the two rectangle intersect, FALSE otherwise.
If the result is empty, r1 is unchanged and FALSE is returned. Otherwise, the result is stored in r1 and TRUE is returned.
void ocad_rect_union | ( | OCADRect * | r1, |
const OCADRect * | r2 | ||
) |
Merges the second rectangle into the first.
Combines two OCADRects.
The flags in the OCADRect are unaffected. This function always returns TRUE.