sdk-world
v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Toggle main menu visibility
Loading...
Searching...
No Matches
psfixed.h
Go to the documentation of this file.
1
/****************************************************************************
2
*
3
* psfixed.h
4
*
5
* Adobe's code for Fixed-Point Mathematics (specification only).
6
*
7
* Copyright 2007-2013 Adobe Systems Incorporated.
8
*
9
* This software, and all works of authorship, whether in source or
10
* object code form as indicated by the copyright notice(s) included
11
* herein (collectively, the "Work") is made available, and may only be
12
* used, modified, and distributed under the FreeType Project License,
13
* LICENSE.TXT. Additionally, subject to the terms and conditions of the
14
* FreeType Project License, each contributor to the Work hereby grants
15
* to any individual or legal entity exercising permissions granted by
16
* the FreeType Project License and this section (hereafter, "You" or
17
* "Your") a perpetual, worldwide, non-exclusive, no-charge,
18
* royalty-free, irrevocable (except as stated in this section) patent
19
* license to make, have made, use, offer to sell, sell, import, and
20
* otherwise transfer the Work, where such license applies only to those
21
* patent claims licensable by such contributor that are necessarily
22
* infringed by their contribution(s) alone or by combination of their
23
* contribution(s) with the Work to which such contribution(s) was
24
* submitted. If You institute patent litigation against any entity
25
* (including a cross-claim or counterclaim in a lawsuit) alleging that
26
* the Work or a contribution incorporated within the Work constitutes
27
* direct or contributory patent infringement, then any patent licenses
28
* granted to You under this License for that Work shall terminate as of
29
* the date such litigation is filed.
30
*
31
* By using, modifying, or distributing the Work you indicate that you
32
* have read and understood the terms and conditions of the
33
* FreeType Project License as well as those provided in this section,
34
* and you accept them fully.
35
*
36
*/
37
38
43
#ifndef PSFIXED_H_
44
#define PSFIXED_H_
45
46
47
FT_BEGIN_HEADER
48
49
50
/* rasterizer integer and fixed-point arithmetic must be 32-bit */
51
52
#define CF2_Fixed CF2_F16Dot16
53
typedef
FT_Int32 CF2_Frac;
/* 2.30 fixed-point */
54
55
56
#define CF2_FIXED_MAX ( (CF2_Fixed)0x7FFFFFFFL )
57
#define CF2_FIXED_MIN ( (CF2_Fixed)0x80000000L )
58
#define CF2_FIXED_ONE ( (CF2_Fixed)0x10000L )
59
#define CF2_FIXED_EPSILON ( (CF2_Fixed)0x0001 )
60
61
/* in C 89, left and right shift of negative numbers is */
62
/* implementation specific behaviour in the general case */
63
64
#define cf2_intToFixed( i ) \
65
( (CF2_Fixed)( (FT_UInt32)(i) << 16 ) )
66
#define cf2_fixedToInt( x ) \
67
( (FT_Short)( ( (FT_UInt32)(x) + 0x8000U ) >> 16 ) )
68
#define cf2_fixedRound( x ) \
69
( (CF2_Fixed)( ( (FT_UInt32)(x) + 0x8000U ) & 0xFFFF0000UL ) )
70
#define cf2_doubleToFixed( f ) \
71
( (CF2_Fixed)( (f) * 65536.0 + 0.5 ) )
72
#define cf2_fixedAbs( x ) \
73
( (x) < 0 ? NEG_INT32( x ) : (x) )
74
#define cf2_fixedFloor( x ) \
75
( (CF2_Fixed)( (FT_UInt32)(x) & 0xFFFF0000UL ) )
76
#define cf2_fixedFraction( x ) \
77
( (x) - cf2_fixedFloor( x ) )
78
#define cf2_fracToFixed( x ) \
79
( ( (x) + 0x2000 - ( (x) < 0 ) ) >> 14 )
80
81
82
/* signed numeric types */
83
typedef
enum
CF2_NumberType_
84
{
85
CF2_NumberFixed,
/* 16.16 */
86
CF2_NumberFrac,
/* 2.30 */
87
CF2_NumberInt
/* 32.0 */
88
89
} CF2_NumberType;
90
91
92
FT_END_HEADER
93
94
95
#endif
/* PSFIXED_H_ */
96
97
98
/* END */
freetype
src
psaux
psfixed.h
Generated by
1.18.0