DL Logo

ASFixed Definitions

ASFixedNegInf

Header: ASExpT.h:674

Syntax

#define ASFixedNegInf ASMINInt32

ASFixedPosInf

Header: ASExpT.h:671

Syntax

#define ASFixedPosInf ASMAXInt32

ASFixedRectIsEmptyRect

Header: ASExpT.h:1147

Syntax

#define ASFixedRectIsEmptyRect ( r )

ASFixedRoundToInt16

Header: ASExpT.h:756

Description

Converts a fixed point number to an ASInt16, rounding the result.

Syntax

#define ASFixedRoundToInt16 ( f )(( ASInt16 )((( f ) + fixedHalf ) >> 16 ) )

Parameters

f
The fixed point number to convert.

ASFixedRoundToInt32

Header: ASExpT.h:709

Description

Converts a fixed point number to an ASInt32, rounding the result.

Syntax

#define ASFixedRoundToInt32 ( f )(( ASInt32 )((( f ) + fixedHalf ) >> 16 ) )

Parameters

f
The fixed point number to convert.

ASFixedTruncToInt16

Header: ASExpT.h:771

Description

Converts a fixed point number to an ASInt16, truncating the result.

Syntax

#define ASFixedTruncToInt16 ( f )(( ASInt16 )(( f ) >> 16 ) )

Parameters

f
The fixed point number to convert.

ASFixedTruncToInt32

Header: ASExpT.h:724

Description

Converts a fixed point number to an ASInt32, truncating the result.

Syntax

#define ASFixedTruncToInt32 ( f )(( ASInt32 )(( f ) >> 16 ) )

Parameters

f
The fixed point number to convert.

ASInt16ToFixed

Header: ASExpT.h:739

Syntax

#define ASInt16ToFixed ( i )(( ASFixed )( i ) *( 1 << 16 ) )

ASInt32ToFixed

Header: ASExpT.h:691

Description

Converts an ASInt32 to a fixed point number.

Syntax

#define ASInt32ToFixed ( i )

Parameters

i
The ASInt32 to convert.

ASUns16ToFixed

Header: ASExpT.h:741

Syntax

#define ASUns16ToFixed ( i )((( i ) > 32767 ) ? ASFixedPosInf :(( ASFixed )( i ) << 16 ) )

FixedMatrix

Header: CoreExpT.h:254

Syntax

#define FixedMatrix . . Use . ASFixedMatrix . instead . .

FixedMatrixP

Header: CoreExpT.h:255

Syntax

#define FixedMatrixP . . Use . ASFixedMatrixP . instead . .

FixedPointP

Header: CoreExpT.h:250

Syntax

#define FixedPointP . . Use . ASFixedPointP . instead . .

FixedQuad

Header: CoreExpT.h:252

Syntax

#define FixedQuad . . Use . ASFixedQuad . instead . .

FixedQuadP

Header: CoreExpT.h:253

Syntax

#define FixedQuadP . . Use . ASFixedQuadP . instead . .

FixedRectP

Header: CoreExpT.h:251

Syntax

#define FixedRectP . . Use . ASFixedRectP . instead . .

FixedRoundToInt16

Header: ASExpT.h:843

Syntax

#define FixedRoundToInt16 ASFixedRoundToInt16

FixedRoundToInt32

Header: ASExpT.h:840

Syntax

#define FixedRoundToInt32 ASFixedRoundToInt32

FixedTruncToInt16

Header: ASExpT.h:844

Syntax

#define FixedTruncToInt16 ASFixedTruncToInt16

FixedTruncToInt32

Header: ASExpT.h:841

Syntax

#define FixedTruncToInt32 ASFixedTruncToInt32

FloatIToFixed

Header: ASExpT.h:834

Description

FloatI to ASFixed (for use when you know that float numbers are integer values).

Syntax

#define FloatIToFixed ( x )(( x ) > 32767 ) ? ASFixedPosInf :((( ASFixed ) x ) << 16 )

FloatNToFixed

Header: ASExpT.h:831

Description

FloatN to ASFixed (for use when you know that float numbers are non-negative).

Syntax

#define FloatNToFixed ( x )(( x ) <( - 32767 ) ) ? ASFixedNegInf :(( x ) > 32767 ) ? ASFixedPosInf :((( ASFixed )((( x ) *65536.0f + 0.5f ) ) )

Int16ToFixed

Header: ASExpT.h:842

Syntax

#define Int16ToFixed ASInt16ToFixed

Int32ToFixed

Header: ASExpT.h:839

Syntax

#define Int32ToFixed ASInt32ToFixed

fixedEight

Header: ASExpT.h:989

Syntax

#define fixedEight (( ASFixed ) 0x00080000L )

fixedEighth

Header: ASExpT.h:874

Syntax

#define fixedEighth (( ASFixed ) 0x00002000L )

fixedEleven

Header: ASExpT.h:1004

Syntax

#define fixedEleven (( ASFixed ) 0x000B0000L )

fixedFifty

Header: ASExpT.h:1024

Syntax

#define fixedFifty (( ASFixed ) 0x00320000L )

fixedFive

Header: ASExpT.h:974

Syntax

#define fixedFive (( ASFixed ) 0x00050000L )

fixedFiveHundred

Header: ASExpT.h:1059

Syntax

#define fixedFiveHundred (( ASFixed ) 0x01F40000L )

fixedFour

Header: ASExpT.h:969

Syntax

#define fixedFour (( ASFixed ) 0x00040000L )

fixedFourThirds

Header: ASExpT.h:929

Syntax

#define fixedFourThirds (( ASFixed ) 0x00015555L )

fixedGolden

Header: ASExpT.h:954

Syntax

#define fixedGolden (( ASFixed ) 0x00019e37L )

fixedHalf

Header: ASExpT.h:889

Syntax

#define fixedHalf (( ASFixed ) 0x00008000L )

fixedHundred

Header: ASExpT.h:1039

Syntax

#define fixedHundred (( ASFixed ) 0x00640000L )

fixedHundredFifty

Header: ASExpT.h:1044

Syntax

#define fixedHundredFifty (( ASFixed ) 0x00960000L )

fixedHundredth

Header: ASExpT.h:854

Syntax

#define fixedHundredth (( ASFixed ) 0x0000028FL )

fixedNegativeInfinity

Header: ASExpT.h:1074

Syntax

#define fixedNegativeInfinity ASFixedNegInf

fixedNine

Header: ASExpT.h:994

Syntax

#define fixedNine (( ASFixed ) 0x00090000L )

fixedNinety

Header: ASExpT.h:1034

Syntax

#define fixedNinety (( ASFixed ) 0x005a0000L )

fixedOne

Header: ASExpT.h:919

Syntax

#define fixedOne (( ASFixed ) 0x00010000L )

fixedOne1

Header: ASExpT.h:914

Syntax

#define fixedOne1 (( ASFixed ) 0x0000ffffL )

fixedOneAnd3Qtr

Header: ASExpT.h:944

Syntax

#define fixedOneAnd3Qtr (( ASFixed ) 0x0001C000L )

fixedOneAndQuarter

Header: ASExpT.h:924

Syntax

#define fixedOneAndQuarter (( ASFixed ) 0x00014000L )

fixedOneEighty

Header: ASExpT.h:1049

Syntax

#define fixedOneEighty (( ASFixed ) 0x00b40000L )

fixedPi2

Header: ASExpT.h:949

Syntax

#define fixedPi2 (( ASFixed ) 0x00019220L )

fixedPi4

Header: ASExpT.h:904

Syntax

#define fixedPi4 (( ASFixed ) 0x0000c910L )

fixedPositiveInfinity

Header: ASExpT.h:1079

Syntax

#define fixedPositiveInfinity ASFixedPosInf

fixedQuarter

Header: ASExpT.h:879

Syntax

#define fixedQuarter (( ASFixed ) 0x00004000L )

fixedSeven

Header: ASExpT.h:984

Syntax

#define fixedSeven (( ASFixed ) 0x00070000L )

fixedSevenEighths

Header: ASExpT.h:909

Syntax

#define fixedSevenEighths (( ASFixed ) 0x0000E000L )

fixedSeventyTwo

Header: ASExpT.h:1029

Syntax

#define fixedSeventyTwo (( ASFixed ) 0x00480000L )

fixedSix

Header: ASExpT.h:979

Syntax

#define fixedSix (( ASFixed ) 0x00060000L )

fixedSixteen

Header: ASExpT.h:1014

Syntax

#define fixedSixteen (( ASFixed ) 0x00100000L )

fixedSixteenth

Header: ASExpT.h:859

Syntax

#define fixedSixteenth (( ASFixed ) 0x00001000L )

fixedSqrtTwo

Header: ASExpT.h:934

Syntax

#define fixedSqrtTwo (( ASFixed ) 0x00016A0AL )

fixedTen

Header: ASExpT.h:999

Syntax

#define fixedTen (( ASFixed ) 0x000A0000L )

fixedTenThousand

Header: ASExpT.h:1069

Syntax

#define fixedTenThousand (( ASFixed ) 0x27100000L )

fixedTenth

Header: ASExpT.h:869

Syntax

#define fixedTenth (( ASFixed ) 0x00001999L )

fixedThird

Header: ASExpT.h:884

Syntax

#define fixedThird (( ASFixed ) 0x00005555L )

fixedThirtyTwo

Header: ASExpT.h:1019

Syntax

#define fixedThirtyTwo (( ASFixed ) 0x00200000L )

fixedThousand

Header: ASExpT.h:1064

Syntax

#define fixedThousand (( ASFixed ) 0x03E80000L )

fixedThree

Header: ASExpT.h:964

Syntax

#define fixedThree (( ASFixed ) 0x00030000L )

fixedThreeHalves

Header: ASExpT.h:939

Syntax

#define fixedThreeHalves (( ASFixed ) 0x00018000L )

fixedThreeQuarters

Header: ASExpT.h:899

Syntax

#define fixedThreeQuarters (( ASFixed ) 0x0000C000L )

fixedTwelfth

Header: ASExpT.h:864

Syntax

#define fixedTwelfth (( ASFixed ) 0x00001555L )

fixedTwelve

Header: ASExpT.h:1009

Syntax

#define fixedTwelve (( ASFixed ) 0x000C0000L )

fixedTwo

Header: ASExpT.h:959

Syntax

#define fixedTwo (( ASFixed ) 0x00020000L )

fixedTwoSeventy

Header: ASExpT.h:1054

Syntax

#define fixedTwoSeventy (( ASFixed ) 0x010e0000L )

fixedTwoThirds

Header: ASExpT.h:894

Syntax

#define fixedTwoThirds (( ASFixed ) 0x0000AAAAL )

fixedZero

Header: ASExpT.h:849

Syntax

#define fixedZero (( ASFixed ) 0x00000000L )

ASFixed Typedefs

ASFixed

Header: ASExpT.h:664

Description

The ASFixed type is a 32-bit quantity representing a rational number with the high (low on little-endian machines) 16 bits representing the number's mantissa and the low (high on little-endian machines) 16 bits representing the fractional part. The definition is platform-dependent.

ASFixedP is a pointer to an ASFixed object.

Addition, subtraction, and negation with ASFixed types can be done with + and- operators, unless you are concerned with overflow. Overflow in ASFixed-value operations is indicated by the values fixedPositiveInfinity and fixedNegativeInfinity.

Syntax

typedef ASInt32 ASFixed, *ASFixedP;

Returned From

Used By

Used In

ASFixed Structures

_t_ASFixedMatrix

Header: ASExpT.h:1085

Description

Matrix containing fixed numbers.

Syntax

struct _t_ASFixedMatrix {
} ASFixedMatrix, *ASFixedMatrixP;

Used By

Used In

_t_ASFixedPoint

Header: ASExpT.h:1110

Description

A point (in two-dimensional space) represented by two fixed numbers.

Syntax

struct _t_ASFixedPoint {
} ASFixedPoint, *ASFixedPointP;

Used By

Used In

_t_ASFixedQuad

Header: ASExpT.h:1180

Description

A quadrilateral represented by four fixed points (one at each corner). In the Acrobat viewer, a quadrilateral differs from a rectangle in that a rectangle must always have horizontal and vertical sides, and opposite sides must be parallel.

Syntax

struct _t_ASFixedQuad {
ASFixedPoint tl, tr, bl, br;
} ASFixedQuad, *ASFixedQuadP;

Used By

Used In

_t_ASFixedRect

Header: ASExpT.h:1125

Description

A rectangle represented by the coordinates of its four sides. In the Acrobat viewer, a rectangle differs from a quadrilateral in that a rectangle must always have horizontal and vertical sides, and opposite sides must be parallel.

Syntax

struct _t_ASFixedRect {
ASFixed left;
ASFixed top;
ASFixed right;
ASFixed bottom;
} ASFixedRect, *ASFixedRectP;

Returned From

Used By

Used In

ASFixed Functions

ASCStringToFixed

Header: ASProcs.h:385

Description

Converts a CString to a fixed point number. It processes the string from left to right only until the first invalid character is located (for example, a-z, A-Z).

Syntax

ASFixed ASCStringToFixed(const char *s);

Parameters

s
A CString to convert.

Returns

Fixed number corresponding to s. Returns 0 if the string does not contain any valid number.

ASCStringToFixed

Header: ASProcs.h:560

Description

Converts a CString to a fixed point number. Processes the string from left to right only until the first invalid character is located (for example, a-z, A-Z).

Syntax

ASFixed ASCStringToFixed(const char *s);

Parameters

s
A CString to convert.

Returns

A fixed number corresponding to s, 0 if the string does not contain any valid number.

ASFixedDiv

Header: ASProcs.h:348

Description

Divides two fixed numbers.

Syntax

ASFixed ASFixedDiv(ASFixed a, ASFixed b);

Parameters

a
The dividend.
b
The divisor.

Returns

The quotient a / b.

ASFixedDiv

Header: ASProcs.h:523

Description

Divides two fixed numbers.

Syntax

ASFixed ASFixedDiv(ASFixed a, ASFixed b);

Parameters

a
The dividend.
b
The divisor.

Returns

The quotient a / b.

ASFixedMatrixConcat

Header: ASProcs.h:410

Description

Multiplies two matrices.

Syntax

void ASFixedMatrixConcat(ASFixedMatrixP result, const ASFixedMatrix *m1, const ASFixedMatrix *m2);

Parameters

result
(Filled by the method) A pointer to matrix m2 x m1. It is allowed for the result to point to the same location as either m1 or m2.
m1
A pointer to the ASFixedMatrix value for the first matrix to multiply.
m2
A pointer to the ASFixedMatrix value for the second matrix to multiply.

ASFixedMatrixConcat

Header: ASProcs.h:585

Description

Multiplies two matrices.

Syntax

void ASFixedMatrixConcat(ASFixedMatrixP result, const ASFixedMatrix *m1, const ASFixedMatrix *m2);

Parameters

result
(Filled by the method) A pointer to matrix m2 x m1. It is allowed for the result to point to the same location as either m1 or m2.
m1
A pointer to the ASFixedMatrix value for the first matrix to multiply.
m2
A pointer to the ASFixedMatrix value for the second matrix to multiply.

ASFixedMatrixInvert

Header: ASProcs.h:431

Description

Inverts a matrix.

If a matrix is nearly singular (which means that it has a determinant that is nearly zero), inverting and re-inverting the matrix may not yield the original matrix.

Syntax

void ASFixedMatrixInvert(ASFixedMatrixP result, const ASFixedMatrixP m);

Parameters

result
(Filled by the method) A pointer to m-1. It is allowed for the result to point to the same location as m.
m
A pointer to the ASFixedMatrix to invert.

ASFixedMatrixInvert

Header: ASProcs.h:607

Description

Inverts a matrix.

If a matrix is nearly singular (meaning that it has a determinant of nearly zero), inverting and re-inverting the matrix may not yield the original matrix.

Syntax

void ASFixedMatrixInvert(ASFixedMatrixP result, const ASFixedMatrixP m);

Parameters

result
(Filled by the method) A pointer to m-1. It is allowed for the result to point to the same location as m.
m
A pointer to the ASFixedMatrix to invert.

ASFixedMatrixTransform

Header: ASProcs.h:457

Description

Transforms the point p through the matrix m, and puts the result in result. p and result can point to the same location.

Syntax

void ASFixedMatrixTransform(ASFixedPointP result, const ASFixedMatrixP m, const ASFixedPointP p);

Parameters

result
(Filled by the method) A pointer to the ASFixedPoint containing the result of transforming p through m. It is allowed for the result to point to the same location as m.
m
A pointer to the ASFixedMatrix through which p is transformed.
p
A pointer to the ASFixedPoint representing the point to transform through m.

ASFixedMatrixTransform

Header: ASProcs.h:633

Description

Transforms the point p through the matrix m, puts result in result. p and result can point to the same place.

Syntax

void ASFixedMatrixTransform(ASFixedPointP result, const ASFixedMatrixP m, const ASFixedPointP p);

Parameters

result
(Filled by the method) A pointer to the ASFixedPoint containing the result of transforming p through m. It is allowed for the result to point to the same location as m.
m
A pointer to the ASFixedMatrix through which p is transformed.
p
A pointer to the ASFixedPoint representing the point to transform through m.

ASFixedMatrixTransformRect

Header: ASProcs.h:484

Description

Transforms a rectangle through a matrix.

Syntax

void ASFixedMatrixTransformRect(ASFixedRectP result, const ASFixedMatrixP m, const ASFixedRectP r);

Parameters

result
(Filled by the method) A pointer to the ASFixedRect containing the smallest bounding box for the transformed rectangle. It is allowed for the result to point to the same location as m. result will always have bottom < top and left < right.
m
A pointer to the ASFixedMatrix containing the matrix through which r is transformed.
r
A pointer to the ASFixedRect containing the rectangle to transform through m.

ASFixedMatrixTransformRect

Header: ASProcs.h:660

Description

Transforms a rectangle through a matrix.

Syntax

void ASFixedMatrixTransformRect(ASFixedRectP result, const ASFixedMatrixP m, const ASFixedRectP rectIn);

Parameters

result
(Filled by the method) A pointer to the ASFixedRect containing the smallest bounding box for the transformed rectangle. It is allowed for the result to point to the same location as m. The result will always have bottom < top and left < right.
m
A pointer to the ASFixedMatrix containing the matrix through which r is transformed.
rectIn
A pointer to the ASFixedRect containing the rectangle to transform through m.

ASFixedMul

Header: ASProcs.h:329

Description

Multiplies two fixed numbers.

Syntax

ASFixed ASFixedMul(ASFixed a, ASFixed b);

Parameters

a
The first number to multiply.
b
The second number to multiply.

Returns

The product of a and b.

ASFixedMul

Header: ASProcs.h:504

Description

Multiplies two fixed numbers.

Syntax

ASFixed ASFixedMul(ASFixed a, ASFixed b);

Parameters

a
The first number to multiply.
b
The second number to multiply.

Returns

The product of a and b.

ASFixedToCString

Header: ASProcs.h:368

Description

Converts a fixed number to a CString.

Note: The precision for Mac OS numbers is valid to 9 significant digits.

Syntax

void ASFixedToCString(ASFixed f, char *s, os_size_t maxLength, ASSmallCount precision);

Parameters

f
The fixed number to convert.
s
(Filled by the method) The string corresponding to f.
maxLength
The maximum number of characters that s can contain.
precision
The number of digits to retain in the converted number.

ASFixedToCString

Header: ASProcs.h:543

Description

Converts a fixed number to a CString.

Note: The precision for Mac OS numbers is valid to 9 significant digits.

Syntax

void ASFixedToCString(ASFixed f, char *s, os_size_t maxLength, ASSmallCount precision);

Parameters

f
The fixed number to convert.
s
(Filled by the method) The string corresponding to f.
maxLength
The maximum number of characters that s can contain.
precision
The number of digits to retain in the converted number.

ASFixedToFloat

Header: ASProcs.h:2625

Description

Converts an ASFixed to a float.

Syntax

float ASFixedToFloat(ASFixed inASFixed);

Parameters

inASFixed
IN The ASFixed value to convert.

Returns

The float representation of the ASFixed value.

FloatToASFixed

Header: ASProcs.h:2634

Description

Converts a float to an ASFixed value.

Syntax

ASFixed FloatToASFixed(double inFloat);

Parameters

inFloat
IN The float value to convert.

Returns

The ASFixed representation of the float value.