Mac OS 9
GXMath.h File Reference

QuickDraw GX math routine interfaces. More...

#include <ConditionalMacros.h>
#include <MacTypes.h>
#include <FixMath.h>

Go to the source code of this file.

Data Structures

struct  gxPoint
 
struct  gxPolar
 
struct  gxMapping
 

Macros

#define gxColorValue1   ((gxColorValue)0x0000FFFF)
 
#define gxPositiveInfinity   ((long)0x7FFFFFFFL)
 
#define gxNegativeInfinity   ((long)0x80000000L)
 
#define FixedRound(a)   ((short)((Fixed)(a) + fixed1 / 2 >> 16))
 
#define FixedSquareRoot(a)   ((Fixed)FractSquareRoot(a) + 64 >> 7)
 
#define FixedTruncate(a)   ((short)((Fixed)(a) >> 16))
 
#define FixedToFract(a)   ((Fract)(a) << 14)
 
#define FractToFixed(a)   (((Fixed)(a) + 8192L) >> 14)
 
#define FixedToInt(a)   ((short)(((Fixed)(a) + fixed1 / 2) >> 16))
 
#define IntToFixed(a)   ((Fixed)(a) << 16)
 
#define FixedToFloat(a)   ((float)(a) / fixed1)
 
#define FloatToFixed(a)   ((Fixed)((float)(a) * fixed1))
 
#define FractToFloat(a)   ((float)(a) / fract1)
 
#define FloatToFract(a)   ((Fract)((float)(a) * fract1))
 
#define ColorToFract(a)   (((Fract)(a) << 14) + ((Fract)(a) + 2 >> 2))
 
#define FractToColor(a)   ((gxColorValue)((a) - ((a) >> 16) + 8191 >> 14))
 
#define ff(a)   IntToFixed(a)
 
#define fl(a)   FloatToFixed(a)
 

Typedefs

typedef struct gxPoint gxPoint
 
typedef unsigned short gxColorValue
 
typedef struct gxPolar gxPolar
 
typedef struct gxMapping gxMapping
 

Functions

gxMappingCopyToMapping (gxMapping *target, const gxMapping *source)
 
gxMappingInvertMapping (gxMapping *target, const gxMapping *source)
 
gxMappingMapMapping (gxMapping *target, const gxMapping *source)
 
gxMappingMoveMapping (gxMapping *target, Fixed hOffset, Fixed vOffset)
 
gxMappingMoveMappingTo (gxMapping *target, Fixed hPosition, Fixed vPosition)
 
gxMappingNormalizeMapping (gxMapping *target)
 
gxMappingRotateMapping (gxMapping *target, Fixed angle, Fixed xCenter, Fixed yCenter)
 
gxMappingScaleMapping (gxMapping *target, Fixed hFactor, Fixed vFactor, Fixed xCenter, Fixed yCenter)
 
gxMappingResetMapping (gxMapping *target)
 
gxMappingSkewMapping (gxMapping *target, Fixed skewX, Fixed skewY, Fixed xCenter, Fixed yCenter)
 
void MapPoints (const gxMapping *source, long count, gxPoint theVector[])
 
short FirstBit (unsigned long x)
 
short WideScale (const wide *source)
 
short LinearRoot (Fixed first, Fixed last, Fract t[])
 
short QuadraticRoot (Fixed first, Fixed control, Fixed last, Fract t[])
 
gxPointPolarToPoint (const gxPolar *ra, gxPoint *xy)
 
gxPolarPointToPolar (const gxPoint *xy, gxPolar *ra)
 
Fract FractCubeRoot (Fract source)
 
Fract FractDivide (Fract dividend, Fract divisor)
 
Fract FractMultiply (Fract multiplicand, Fract multiplier)
 
Fract FractSineCosine (Fixed degrees, Fract *cosine)
 
Fract FractSquareRoot (Fract source)
 
Fixed FixedDivide (Fixed dividend, Fixed divisor)
 
Fixed FixedMultiply (Fixed multiplicand, Fixed multiplier)
 
long MultiplyDivide (long source, long multiplier, long divisor)
 
unsigned long Magnitude (long deltaX, long deltaY)
 
long VectorMultiplyDivide (long count, const long *vector1, long step1, const long *vector2, long step2, long divisor)
 
wideVectorMultiply (long count, const long *vector1, long step1, const long *vector2, long step2, wide *dot)
 
unsigned long RandomBits (long count, long focus)
 
void SetRandomSeed (const wide *seed)
 
wideGetRandomSeed (wide *seed)
 

Detailed Description

QuickDraw GX math routine interfaces.

Introduced In: Quickdraw GX 1.1
Avaliable From: Universal Interfaces 3.4.1
Copyright: © 1994-2001 by Apple Computer, Inc., all rights reserved.

For bug reports, consult the following page on the World Wide Web:

http://developer.apple.com/bugreporter/

Macro Definition Documentation

◆ ff

#define ff (   a)    IntToFixed(a)

ff is already defined on some platforms

◆ FixedRound

#define FixedRound (   a)    ((short)((Fixed)(a) + fixed1 / 2 >> 16))

CALL_NOT_IN_CARBON

Function Documentation

◆ CopyToMapping()

gxMapping* CopyToMapping ( gxMapping target,
const gxMapping source 
)

CopyToMapping()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ FirstBit()

short FirstBit ( unsigned long  x)

FirstBit()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ FixedDivide()

Fixed FixedDivide ( Fixed  dividend,
Fixed  divisor 
)

FixedDivide()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ FixedMultiply()

Fixed FixedMultiply ( Fixed  multiplicand,
Fixed  multiplier 
)

FixedMultiply()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ FractCubeRoot()

Fract FractCubeRoot ( Fract  source)

FractCubeRoot()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ FractDivide()

Fract FractDivide ( Fract  dividend,
Fract  divisor 
)

FractDivide()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ FractMultiply()

Fract FractMultiply ( Fract  multiplicand,
Fract  multiplier 
)

FractMultiply()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ FractSineCosine()

Fract FractSineCosine ( Fixed  degrees,
Fract *  cosine 
)

FractSineCosine()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ FractSquareRoot()

Fract FractSquareRoot ( Fract  source)

FractSquareRoot()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ GetRandomSeed()

wide* GetRandomSeed ( wide seed)

GetRandomSeed()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ InvertMapping()

gxMapping* InvertMapping ( gxMapping target,
const gxMapping source 
)

InvertMapping()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ LinearRoot()

short LinearRoot ( Fixed  first,
Fixed  last,
Fract  t[] 
)

LinearRoot()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ Magnitude()

unsigned long Magnitude ( long  deltaX,
long  deltaY 
)

Magnitude()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ MapMapping()

gxMapping* MapMapping ( gxMapping target,
const gxMapping source 
)

MapMapping()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ MapPoints()

void MapPoints ( const gxMapping source,
long  count,
gxPoint  theVector[] 
)

MapPoints()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ MoveMapping()

gxMapping* MoveMapping ( gxMapping target,
Fixed  hOffset,
Fixed  vOffset 
)

MoveMapping()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ MoveMappingTo()

gxMapping* MoveMappingTo ( gxMapping target,
Fixed  hPosition,
Fixed  vPosition 
)

MoveMappingTo()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ MultiplyDivide()

long MultiplyDivide ( long  source,
long  multiplier,
long  divisor 
)

This next call is (source * multiplier / divisor) – it avoids underflow, overflow by using wides MultiplyDivide()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ NormalizeMapping()

gxMapping* NormalizeMapping ( gxMapping target)

NormalizeMapping()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ PointToPolar()

gxPolar* PointToPolar ( const gxPoint xy,
gxPolar ra 
)

PointToPolar()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ PolarToPoint()

gxPoint* PolarToPoint ( const gxPolar ra,
gxPoint xy 
)

PolarToPoint()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ QuadraticRoot()

short QuadraticRoot ( Fixed  first,
Fixed  control,
Fixed  last,
Fract  t[] 
)

QuadraticRoot()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ RandomBits()

unsigned long RandomBits ( long  count,
long  focus 
)

RandomBits()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ ResetMapping()

gxMapping* ResetMapping ( gxMapping target)

ResetMapping()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ RotateMapping()

gxMapping* RotateMapping ( gxMapping target,
Fixed  angle,
Fixed  xCenter,
Fixed  yCenter 
)

RotateMapping()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ ScaleMapping()

gxMapping* ScaleMapping ( gxMapping target,
Fixed  hFactor,
Fixed  vFactor,
Fixed  xCenter,
Fixed  yCenter 
)

ScaleMapping()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ SetRandomSeed()

void SetRandomSeed ( const wide seed)

SetRandomSeed()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ SkewMapping()

gxMapping* SkewMapping ( gxMapping target,
Fixed  skewX,
Fixed  skewY,
Fixed  xCenter,
Fixed  yCenter 
)

SkewMapping()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ VectorMultiply()

wide* VectorMultiply ( long  count,
const long *  vector1,
long  step1,
const long *  vector2,
long  step2,
wide dot 
)

wide operations are defined within FixMath.h for PowerPC CALL_NOT_IN_CARBON TARGET_OS_MAC && TARGET_CPU_68K VectorMultiply()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ VectorMultiplyDivide()

long VectorMultiplyDivide ( long  count,
const long *  vector1,
long  step1,
const long *  vector2,
long  step2,
long  divisor 
)

VectorMultiplyDivide()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available

◆ WideScale()

short WideScale ( const wide source)

WideScale()

Non-Carbon CFM: not available
Carbon Lib: not available
Mac OS X: not available