/***************************************************************************/ /* */ /* ftcimage.h */ /* */ /* FreeType Image cache (body). */ /* */ /* Copyright 2000-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* Each image cache really manages FT_Glyph objects. */ /* */ /*************************************************************************/ #ifndef __FTCIMAGE_H__ #define __FTCIMAGE_H__ #include #include FT_CACHE_H #include FT_CACHE_INTERNAL_GLYPH_H FT_BEGIN_HEADER /*************************************************************************/ /* */ /*
*/ /* cache_subsystem */ /* */ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** IMAGE CACHE OBJECT *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ #define FTC_IMAGE_FORMAT( x ) ( (x) & 7 ) #define ftc_image_format_bitmap 0 #define ftc_image_format_outline 1 #define ftc_image_flag_monochrome 16 #define ftc_image_flag_unhinted 32 #define ftc_image_flag_autohinted 64 #define ftc_image_flag_unscaled 128 #define ftc_image_flag_no_sbits 256 /* monochrome bitmap */ #define ftc_image_mono ftc_image_format_bitmap | \ ftc_image_flag_monochrome /* anti-aliased bitmap */ #define ftc_image_grays ftc_image_format_bitmap /* scaled outline */ #define ftc_image_outline ftc_image_format_outline /*************************************************************************/ /* */ /* */ /* FTC_Image_Desc */ /* */ /* */ /* A simple structure used to describe a given glyph image category. */ /* */ /* */ /* size :: An FTC_SizeRec used to describe the glyph's face & */ /* size. */ /* */ /* image_type :: The glyph image's type. */ /* */ typedef struct FTC_Image_Desc_ { FTC_FontRec font; FT_UInt image_type; } FTC_Image_Desc; /*************************************************************************/ /* */ /* */ /* FTC_Image_Cache */ /* */ /* */ /* A handle to an glyph image cache object. They are designed to */ /* hold many distinct glyph images, while not exceeding a certain */ /* memory threshold. */ /* */ typedef struct FTC_Image_CacheRec_* FTC_Image_Cache; /*************************************************************************/ /* */ /* */ /* FTC_Image_Cache_New */ /* */ /* */ /* Creates a new glyph image cache. */ /* */ /* */ /* manager :: The parent manager for the image cache. */ /* */ /* */ /* acache :: A handle to the new glyph image cache object. */ /* */ /* */ /* FreeType error code. 0 means success. */ /* */ FT_EXPORT( FT_Error ) FTC_Image_Cache_New( FTC_Manager manager, FTC_Image_Cache *acache ); /*************************************************************************/ /* */ /* */ /* FTC_Image_Cache_Lookup */ /* */ /* */ /* Retrieves a given glyph image from a glyph image cache. */ /* */ /* */ /* cache :: A handle to the source glyph image cache. */ /* */ /* desc :: A pointer to a glyph image descriptor. */ /* */ /* gindex :: The glyph index to retrieve. */ /* */ /* */ /* aglyph :: The corresponding FT_Glyph object. 0 in case of */ /* failure. */ /* */ /* */ /* FreeType error code. 0 means success. */ /* */ /* */ /* The returned glyph is owned and managed by the glyph image cache. */ /* Never try to transform or discard it manually! You can however */ /* create a copy with FT_Glyph_Copy() and modify the new one. */ /* */ /* Because the glyph image cache limits the total amount of memory */ /* taken by the glyphs it holds, the returned glyph might disappear */ /* on a later invocation of this function! It's a cache after all... */ /* */ FT_EXPORT( FT_Error ) FTC_Image_Cache_Lookup( FTC_Image_Cache cache, FTC_Image_Desc* desc, FT_UInt gindex, FT_Glyph *aglyph ); /* */ FT_END_HEADER #endif /* __FTCIMAGE_H__ */ /* END */