version 2.8
gmisc.h File Reference

Detailed Description

GMISC - Miscellaneous Routines header file.

Definition in file gmisc.h.

#include "../../gfx.h"
#include <math.h>

Go to the source code of this file.

Data Structures

struct  MatrixFloat2D
 A matrix for doing 2D graphics using floats. More...
 
struct  MatrixFixed2D
 A matrix for doing 2D graphics using fixed point maths. More...
 

Functions

void gmiscArrayConvert (ArrayDataFormat srcfmt, void *src, ArrayDataFormat dstfmt, void *dst, size_t cnt)
 Convert from one array format to another array format. More...
 
float invsqrt (float n)
 Fast inverse square root function (x^-1/2) More...
 
void gmiscMatrixFloat2DApplyToPoints (point *dst, const point *src, const MatrixFloat2D *m, int cnt)
 Apply the matrix to a set of points. More...
 
void gmiscMatrixFloat2DSetIdentity (MatrixFloat2D *m)
 Set the 2D matrix to the identity matrix. More...
 
void gmiscMatrixFloat2DMultiply (MatrixFloat2D *dst, const MatrixFloat2D *src1, const MatrixFloat2D *src2)
 Multiple two 2D matrixes together. More...
 
void gmiscMatrixFloat2DApplyTranslation (MatrixFloat2D *dst, const MatrixFloat2D *src, float tx, float ty)
 Add an x,y translation to a matrix. More...
 
void gmiscMatrixFloat2DApplyScale (MatrixFloat2D *dst, const MatrixFloat2D *src, float sx, float sy)
 Add x,y scaling to a matrix. More...
 
void gmiscMatrixFloat2DApplyShear (MatrixFloat2D *dst, const MatrixFloat2D *src, float sx, float sy)
 Add x,y shear to a matrix. More...
 
void gmiscMatrixFloat2DApplyRotation (MatrixFloat2D *dst, const MatrixFloat2D *src, int angle)
 Add rotation to a matrix. More...
 
void gmiscMatrixFixed2DApplyToPoints (point *dst, const point *src, const MatrixFixed2D *m, int cnt)
 Apply the matrix to a set of points. More...
 
void gmiscMatrixFixed2DSetIdentity (MatrixFixed2D *m)
 Set the 2D matrix to the identity matrix. More...
 
void gmiscMatrixFixed2DMultiply (MatrixFixed2D *dst, const MatrixFixed2D *src1, const MatrixFixed2D *src2)
 Multiple two 2D matrixes together. More...
 
void gmiscMatrixFixed2DApplyTranslation (MatrixFixed2D *dst, const MatrixFixed2D *src, fixed tx, fixed ty)
 Add an x,y translation to a matrix. More...
 
void gmiscMatrixFixed2DApplyScale (MatrixFixed2D *dst, const MatrixFixed2D *src, fixed sx, fixed sy)
 Add x,y scaling to a matrix. More...
 
void gmiscMatrixFixed2DApplyShear (MatrixFixed2D *dst, const MatrixFixed2D *src, fixed sx, fixed sy)
 Add x,y shear to a matrix. More...
 
void gmiscMatrixFixed2DApplyRotation (MatrixFixed2D *dst, const MatrixFixed2D *src, int angle)
 Add rotation to a matrix. More...
 
bool_t gmiscHittestPoly (const point *pntarray, unsigned cnt, const point *p)
 Check whether a point is inside or on the edge of a polygon. More...
 
double fsin (int degrees)
 Fast Table Based Trig functions. More...
 
fixed ffsin (int degrees)
 Fast Table Based Trig functions. More...
 

Macros

#define gfxSampleFormatIsSigned(fmt)   ((fmt) & 1)
 Is the sample data format a "signed" data format? More...
 
#define gfxSampleFormatBits(fmt)   ((fmt) & ~1)
 How many bits are in the sample data format. More...
 
#define FIXED_PI   FP2FIXED(GFX_PI)
 The famous number pi. More...
 
#define FIXED(x)   ((fixed)(x)<<16) /* @< integer to fixed */
 Macros to convert to and from a fixed point. More...
 
#define FSIN(degrees)   sintabledouble[degrees];
 Fast Table Based Trig functions. More...
 
#define FFSIN(degrees)   sintablefixed[degrees];
 Fast Table Based Trig functions. More...
 

Typedefs

typedef enum ArrayDataFormat_e ArrayDataFormat
 Sample data formats. More...
 
typedef int32_t fixed
 The type for a fixed point type. More...
 
typedef struct MatrixFloat2D MatrixFloat2D
 A matrix for doing 2D graphics using floats. More...
 
typedef struct MatrixFixed2D MatrixFixed2D
 A matrix for doing 2D graphics using fixed point maths. More...
 

Enumerations