ReactOS  0.4.15-dev-1384-g878186b
ftcimage.c File Reference
#include <ft2build.h>
#include "ftcimage.h"
#include "ftccback.h"
#include "ftcerror.h"
Include dependency graph for ftcimage.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 ftc_inode_free (FTC_Node ftcinode, FTC_Cache cache)
 
 FTC_INode_Free (FTC_INode inode, FTC_Cache cache)
 
 FTC_INode_New (FTC_INode *pinode, FTC_GQuery gquery, FTC_Cache cache)
 
 ftc_inode_new (FTC_Node *ftcpinode, FT_Pointer ftcgquery, FTC_Cache cache)
 
 ftc_inode_weight (FTC_Node ftcinode, FTC_Cache ftccache)
 

Function Documentation

◆ ftc_inode_free()

ftc_inode_free ( FTC_Node  ftcinode,
FTC_Cache  cache 
)

Definition at line 31 of file ftcimage.c.

33  {
34  FTC_INode inode = (FTC_INode)ftcinode;
35  FT_Memory memory = cache->memory;
36 
37 
38  if ( inode->glyph )
39  {
40  FT_Done_Glyph( inode->glyph );
41  inode->glyph = NULL;
42  }
43 
45  FT_FREE( inode );
46  }
Definition: cache.c:48
static char memory[1024 *256]
Definition: process.c:116
Definition: fs.h:78
#define FT_FREE(ptr)
Definition: ftmemory.h:329
#define FTC_GNODE(x)
Definition: ftcglyph.h:156
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
FTC_GNode_Done(FTC_GNode gnode, FTC_Cache cache)
Definition: ftcglyph.c:55
#define NULL
Definition: types.h:112
FT_BEGIN_HEADER struct FTC_INodeRec_ * FTC_INode
FT_Done_Glyph(FT_Glyph glyph)
Definition: ftglyph.c:633

Referenced by FTC_INode_Free().

◆ FTC_INode_Free()

FTC_INode_Free ( FTC_INode  inode,
FTC_Cache  cache 
)

Definition at line 50 of file ftcimage.c.

52  {
54  }
Definition: cache.c:48
#define FTC_NODE(x)
Definition: ftccache.h:69
Definition: fs.h:78
ftc_inode_free(FTC_Node ftcinode, FTC_Cache cache)
Definition: ftcimage.c:31

Referenced by FTC_INode_New().

◆ FTC_INode_New()

FTC_INode_New ( FTC_INode pinode,
FTC_GQuery  gquery,
FTC_Cache  cache 
)

Definition at line 59 of file ftcimage.c.

62  {
63  FT_Memory memory = cache->memory;
66 
67 
68  if ( !FT_NEW( inode ) )
69  {
70  FTC_GNode gnode = FTC_GNODE( inode );
71  FTC_Family family = gquery->family;
72  FT_UInt gindex = gquery->gindex;
74 
75 
76  /* initialize its inner fields */
77  FTC_GNode_Init( gnode, gindex, family );
78 
79  /* we will now load the glyph image */
80  error = clazz->family_load_glyph( family, gindex, cache,
81  &inode->glyph );
82  if ( error )
83  {
85  inode = NULL;
86  }
87  }
88 
89  *pinode = inode;
90  return error;
91  }
Definition: cache.c:48
int FT_Error
Definition: fttypes.h:300
#define error(str)
Definition: mkdosfs.c:1605
FTC_IFamily_LoadGlyphFunc family_load_glyph
Definition: ftcimage.h:67
#define FTC_CACHE_IFAMILY_CLASS(x)
Definition: ftcimage.h:75
static char memory[1024 *256]
Definition: process.c:116
Definition: fs.h:78
FTC_GNode_Init(FTC_GNode gnode, FT_UInt gindex, FTC_Family family)
Definition: ftcglyph.c:31
FTC_INode_Free(FTC_INode inode, FTC_Cache cache)
Definition: ftcimage.c:50
#define FTC_GNODE(x)
Definition: ftcglyph.h:156
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
FT_BEGIN_HEADER struct FTC_FamilyRec_ * FTC_Family
unsigned int FT_UInt
Definition: fttypes.h:231
#define NULL
Definition: types.h:112
FT_BEGIN_HEADER struct FTC_INodeRec_ * FTC_INode
FTC_Family family
Definition: ftcglyph.h:163
#define FT_NEW(ptr)
Definition: ftmemory.h:331
FT_UInt gindex
Definition: ftcglyph.h:162

Referenced by ftc_inode_new().

◆ ftc_inode_new()

ftc_inode_new ( FTC_Node ftcpinode,
FT_Pointer  ftcgquery,
FTC_Cache  cache 
)

Definition at line 95 of file ftcimage.c.

98  {
99  FTC_INode *pinode = (FTC_INode*)ftcpinode;
100  FTC_GQuery gquery = (FTC_GQuery)ftcgquery;
101 
102 
103  return FTC_INode_New( pinode, gquery, cache );
104  }
Definition: cache.c:48
FTC_INode_New(FTC_INode *pinode, FTC_GQuery gquery, FTC_Cache cache)
Definition: ftcimage.c:59
FT_BEGIN_HEADER struct FTC_INodeRec_ * FTC_INode
struct FTC_GQueryRec_ * FTC_GQuery

◆ ftc_inode_weight()

ftc_inode_weight ( FTC_Node  ftcinode,
FTC_Cache  ftccache 
)

Definition at line 108 of file ftcimage.c.

110  {
111  FTC_INode inode = (FTC_INode)ftcinode;
112  FT_Offset size = 0;
113  FT_Glyph glyph = inode->glyph;
114 
115  FT_UNUSED( ftccache );
116 
117 
118  switch ( glyph->format )
119  {
120  case FT_GLYPH_FORMAT_BITMAP:
121  {
122  FT_BitmapGlyph bitg;
123 
124 
125  bitg = (FT_BitmapGlyph)glyph;
126  size = bitg->bitmap.rows * (FT_Offset)FT_ABS( bitg->bitmap.pitch ) +
127  sizeof ( *bitg );
128  }
129  break;
130 
132  {
133  FT_OutlineGlyph outg;
134 
135 
136  outg = (FT_OutlineGlyph)glyph;
137  size = (FT_Offset)outg->outline.n_points *
138  ( sizeof ( FT_Vector ) + sizeof ( FT_Byte ) ) +
140  sizeof ( *outg );
141  }
142  break;
143 
144  default:
145  ;
146  }
147 
148  size += sizeof ( *inode );
149  return size;
150  }
FT_Bitmap bitmap
Definition: ftglyph.h:165
struct FT_OutlineGlyphRec_ * FT_OutlineGlyph
Definition: ftglyph.h:179
unsigned int rows
Definition: ftimage.h:263
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define FT_ABS(a)
Definition: ftobjs.h:74
FT_Glyph_Format format
Definition: ftglyph.h:112
struct FT_BitmapGlyphRec_ * FT_BitmapGlyph
Definition: ftglyph.h:127
Definition: fs.h:78
unsigned char FT_Byte
Definition: fttypes.h:154
GLsizeiptr size
Definition: glext.h:5919
smooth FT_Module_Constructor FT_Module_Destructor FT_Module_Requester FT_GLYPH_FORMAT_OUTLINE
Definition: ftsmooth.c:416
signed short FT_Short
Definition: fttypes.h:198
short n_points
Definition: ftimage.h:337
int pitch
Definition: ftimage.h:265
FT_BEGIN_HEADER struct FTC_INodeRec_ * FTC_INode
FT_Outline outline
Definition: ftglyph.h:211
#define FT_UNUSED(arg)
Definition: ftconfig.h:101
short n_contours
Definition: ftimage.h:336
size_t FT_Offset
Definition: fttypes.h:324