misc/libfreetype/src/cache/ftcimage.h
author sheepluva
Wed, 05 Jun 2013 16:28:30 +0200
changeset 9137 d987230b85ed
parent 5172 88f2e05288ba
permissions -rw-r--r--
fixed all engine compilation hints and notes (that I could see)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5172
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     1
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     2
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     3
/*  ftcimage.h                                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     4
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     5
/*    FreeType Generic Image cache (specification)                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     6
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     7
/*  Copyright 2000-2001, 2002, 2003, 2006 by                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     8
/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     9
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    10
/*  This file is part of the FreeType project, and may only be used,       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    11
/*  modified, and distributed under the terms of the FreeType project      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    12
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    13
/*  this file you indicate that you have read the license and              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    14
/*  understand and accept it fully.                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    15
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    16
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    17
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    18
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    19
 /*
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
  *  FTC_ICache is an _abstract_ cache used to store a single FT_Glyph
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
  *  image per cache node.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
  *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
  *  FTC_ICache extends FTC_GCache.  For an implementation example,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
  *  see FTC_ImageCache in `src/cache/ftbasic.c'.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    26
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    28
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    29
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    30
  /* Each image cache really manages FT_Glyph objects.                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    31
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    32
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    34
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    35
#ifndef __FTCIMAGE_H__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
#define __FTCIMAGE_H__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    38
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    39
#include <ft2build.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
#include FT_CACHE_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
#include "ftcglyph.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
FT_BEGIN_HEADER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    44
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    45
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
  /* the FT_Glyph image node type - we store only 1 glyph per node */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    47
  typedef struct  FTC_INodeRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
    FTC_GNodeRec  gnode;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
    FT_Glyph      glyph;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
  } FTC_INodeRec, *FTC_INode;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
#define FTC_INODE( x )         ( (FTC_INode)( x ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
#define FTC_INODE_GINDEX( x )  FTC_GNODE(x)->gindex
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
#define FTC_INODE_FAMILY( x )  FTC_GNODE(x)->family
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    57
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    58
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    59
  (*FTC_IFamily_LoadGlyphFunc)( FTC_Family  family,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
                                FT_UInt     gindex,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
                                FTC_Cache   cache,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
                                FT_Glyph   *aglyph );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    64
  typedef struct  FTC_IFamilyClassRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    65
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    66
    FTC_MruListClassRec        clazz;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
    FTC_IFamily_LoadGlyphFunc  family_load_glyph;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
  } FTC_IFamilyClassRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
  typedef const FTC_IFamilyClassRec*  FTC_IFamilyClass;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
#define FTC_IFAMILY_CLASS( x )  ((FTC_IFamilyClass)(x))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
#define FTC_CACHE__IFAMILY_CLASS( x ) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
          FTC_IFAMILY_CLASS( FTC_CACHE__GCACHE_CLASS(x)->family_class )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
  /* can be used as a @FTC_Node_FreeFunc */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
  FT_LOCAL( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
  FTC_INode_Free( FTC_INode  inode,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
                  FTC_Cache  cache );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
  /* Can be used as @FTC_Node_NewFunc.  `gquery.index' and `gquery.family'
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
   * must be set correctly.  This function will call the `family_load_glyph'
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
   * method to load the FT_Glyph into the cache node.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
  FT_LOCAL( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    89
  FTC_INode_New( FTC_INode   *pinode,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    90
                 FTC_GQuery   gquery,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
                 FTC_Cache    cache );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    92
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
#if 0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    94
  /* can be used as @FTC_Node_WeightFunc */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
  FT_LOCAL( FT_ULong )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
  FTC_INode_Weight( FTC_INode  inode );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    98
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    99
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
 /* */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   101
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
FT_END_HEADER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   103
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
#endif /* __FTCIMAGE_H__ */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   107
/* END */