/src/freetype/src/cache/ftcimage.h

https://bitbucket.org/cabalistic/ogredeps/ · C++ Header · 107 lines · 41 code · 29 blank · 37 comment · 0 complexity · 0901aa2bdf2c66b3f66d3e1cbfdb49b2 MD5 · raw file

  1. /***************************************************************************/
  2. /* */
  3. /* ftcimage.h */
  4. /* */
  5. /* FreeType Generic Image cache (specification) */
  6. /* */
  7. /* Copyright 2000-2001, 2002, 2003, 2006 by */
  8. /* David Turner, Robert Wilhelm, and Werner Lemberg. */
  9. /* */
  10. /* This file is part of the FreeType project, and may only be used, */
  11. /* modified, and distributed under the terms of the FreeType project */
  12. /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
  13. /* this file you indicate that you have read the license and */
  14. /* understand and accept it fully. */
  15. /* */
  16. /***************************************************************************/
  17. /*
  18. * FTC_ICache is an _abstract_ cache used to store a single FT_Glyph
  19. * image per cache node.
  20. *
  21. * FTC_ICache extends FTC_GCache. For an implementation example,
  22. * see FTC_ImageCache in `src/cache/ftbasic.c'.
  23. */
  24. /*************************************************************************/
  25. /* */
  26. /* Each image cache really manages FT_Glyph objects. */
  27. /* */
  28. /*************************************************************************/
  29. #ifndef __FTCIMAGE_H__
  30. #define __FTCIMAGE_H__
  31. #include <ft2build.h>
  32. #include FT_CACHE_H
  33. #include "ftcglyph.h"
  34. FT_BEGIN_HEADER
  35. /* the FT_Glyph image node type - we store only 1 glyph per node */
  36. typedef struct FTC_INodeRec_
  37. {
  38. FTC_GNodeRec gnode;
  39. FT_Glyph glyph;
  40. } FTC_INodeRec, *FTC_INode;
  41. #define FTC_INODE( x ) ( (FTC_INode)( x ) )
  42. #define FTC_INODE_GINDEX( x ) FTC_GNODE(x)->gindex
  43. #define FTC_INODE_FAMILY( x ) FTC_GNODE(x)->family
  44. typedef FT_Error
  45. (*FTC_IFamily_LoadGlyphFunc)( FTC_Family family,
  46. FT_UInt gindex,
  47. FTC_Cache cache,
  48. FT_Glyph *aglyph );
  49. typedef struct FTC_IFamilyClassRec_
  50. {
  51. FTC_MruListClassRec clazz;
  52. FTC_IFamily_LoadGlyphFunc family_load_glyph;
  53. } FTC_IFamilyClassRec;
  54. typedef const FTC_IFamilyClassRec* FTC_IFamilyClass;
  55. #define FTC_IFAMILY_CLASS( x ) ((FTC_IFamilyClass)(x))
  56. #define FTC_CACHE__IFAMILY_CLASS( x ) \
  57. FTC_IFAMILY_CLASS( FTC_CACHE__GCACHE_CLASS(x)->family_class )
  58. /* can be used as a @FTC_Node_FreeFunc */
  59. FT_LOCAL( void )
  60. FTC_INode_Free( FTC_INode inode,
  61. FTC_Cache cache );
  62. /* Can be used as @FTC_Node_NewFunc. `gquery.index' and `gquery.family'
  63. * must be set correctly. This function will call the `family_load_glyph'
  64. * method to load the FT_Glyph into the cache node.
  65. */
  66. FT_LOCAL( FT_Error )
  67. FTC_INode_New( FTC_INode *pinode,
  68. FTC_GQuery gquery,
  69. FTC_Cache cache );
  70. #if 0
  71. /* can be used as @FTC_Node_WeightFunc */
  72. FT_LOCAL( FT_ULong )
  73. FTC_INode_Weight( FTC_INode inode );
  74. #endif
  75. /* */
  76. FT_END_HEADER
  77. #endif /* __FTCIMAGE_H__ */
  78. /* END */