Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
ftmisc.h
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* ftmisc.h */
4 /* */
5 /* Miscellaneous macros for stand-alone rasterizer (specification */
6 /* only). */
7 /* */
8 /* Copyright 2005, 2009, 2010 by */
9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 /* */
11 /* This file is part of the FreeType project, and may only be used */
12 /* modified and distributed under the terms of the FreeType project */
13 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14 /* this file you indicate that you have read the license and */
15 /* understand and accept it fully. */
16 /* */
17 /***************************************************************************/
18 
19 
20  /***************************************************/
21  /* */
22  /* This file is *not* portable! You have to adapt */
23  /* its definitions to your platform. */
24  /* */
25  /***************************************************/
26 
27 #ifndef __FTMISC_H__
28 #define __FTMISC_H__
29 
30 
31  /* memset */
32 #include FT_CONFIG_STANDARD_LIBRARY_H
33 
34 #define FT_BEGIN_HEADER
35 #define FT_END_HEADER
36 
37 #define FT_LOCAL_DEF( x ) static x
38 
39 
40  /* from include/freetype2/fttypes.h */
41 
42  typedef unsigned char FT_Byte;
43  typedef signed int FT_Int;
44  typedef unsigned int FT_UInt;
45  typedef signed long FT_Long;
46  typedef unsigned long FT_ULong;
47  typedef signed long FT_F26Dot6;
48  typedef int FT_Error;
49 
50 #define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
51  ( ( (FT_ULong)_x1 << 24 ) | \
52  ( (FT_ULong)_x2 << 16 ) | \
53  ( (FT_ULong)_x3 << 8 ) | \
54  (FT_ULong)_x4 )
55 
56 
57  /* from include/freetype2/ftsystem.h */
58 
59  typedef struct FT_MemoryRec_* FT_Memory;
60 
61  typedef void* (*FT_Alloc_Func)( FT_Memory memory,
62  long size );
63 
64  typedef void (*FT_Free_Func)( FT_Memory memory,
65  void* block );
66 
67  typedef void* (*FT_Realloc_Func)( FT_Memory memory,
68  long cur_size,
69  long new_size,
70  void* block );
71 
72  typedef struct FT_MemoryRec_
73  {
74  void* user;
75 
79 
80  } FT_MemoryRec;
81 
82 
83  /* from src/ftcalc.c */
84 
85 #if ( defined _WIN32 || defined _WIN64 )
86 
87  typedef __int64 FT_Int64;
88 
89 #else
90 
91 #include "inttypes.h"
92 
93  typedef int64_t FT_Int64;
94 
95 #endif
96 
97 
98  static FT_Long
100  FT_Long b,
101  FT_Long c )
102  {
103  FT_Int s;
104  FT_Long d;
105 
106 
107  s = 1;
108  if ( a < 0 ) { a = -a; s = -1; }
109  if ( b < 0 ) { b = -b; s = -s; }
110  if ( c < 0 ) { c = -c; s = -s; }
111 
112  d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c
113  : 0x7FFFFFFFL );
114 
115  return ( s > 0 ) ? d : -d;
116  }
117 
118 
119  static FT_Long
121  FT_Long b,
122  FT_Long c )
123  {
124  FT_Int s;
125  FT_Long d;
126 
127 
128  s = 1;
129  if ( a < 0 ) { a = -a; s = -1; }
130  if ( b < 0 ) { b = -b; s = -s; }
131  if ( c < 0 ) { c = -c; s = -s; }
132 
133  d = (FT_Long)( c > 0 ? (FT_Int64)a * b / c
134  : 0x7FFFFFFFL );
135 
136  return ( s > 0 ) ? d : -d;
137  }
138 
139 #endif /* __FTMISC_H__ */
140 
141 
142 /* END */
FT_Free_Func free
Definition: ftsystem.h:175
FT_MulDiv_No_Round(FT_Long a, FT_Long b, FT_Long c)
Definition: ftcalc.c:450
signed long FT_Long
Definition: fttypes.h:238
GLboolean GLboolean GLboolean GLboolean a
int FT_Error
Definition: ftmisc.h:48
signed int FT_Int
Definition: fttypes.h:216
void(* FT_Free_Func)(FT_Memory memory, void *block)
Definition: ftmisc.h:64
signed long FT_F26Dot6
Definition: ftmisc.h:47
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
GLboolean GLboolean GLboolean b
unsigned int FT_UInt
Definition: ftmisc.h:44
FT_Alloc_Func alloc
Definition: ftsystem.h:174
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
Definition: ftcalc.c:412
struct FT_MemoryRec_ * FT_Memory
Definition: ftmisc.h:59
const GLubyte * c
int64_t FT_Int64
Definition: ftmisc.h:93
signed long FT_Long
Definition: ftmisc.h:45
signed int FT_Int
Definition: ftmisc.h:43
struct FT_MemoryRec_ FT_MemoryRec
GLdouble s
FT_Realloc_Func realloc
Definition: ftsystem.h:176
void *(* FT_Alloc_Func)(FT_Memory memory, long size)
Definition: ftmisc.h:61
void *(* FT_Realloc_Func)(FT_Memory memory, long cur_size, long new_size, void *block)
Definition: ftmisc.h:67
struct FT_Int64_ FT_Int64
void * user
Definition: ftsystem.h:173
GLsizeiptr size
unsigned long FT_ULong
Definition: ftmisc.h:46
unsigned char FT_Byte
Definition: ftmisc.h:42