ft2-cache_subsystem.html
来自「嵌入式freetype库的应用文档包含freetype的简要说明和应用examp」· HTML 代码 · 共 951 行 · 第 1/4 页
HTML
951 行
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td><p>This function doesn't return <a href="ft2-cache_subsystem.html#FTC_Node">FTC_Node</a> handles, since there is no real use for them with typical uses of charmaps.</p></td></tr></table></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FTC_ImageCache">FTC_ImageCache</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre> <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ImageCacheRec_* <b>FTC_ImageCache</b>;</pre></table><br><table align=center width="87%"><tr><td><p>A handle to an glyph image cache object. They are designed to hold many distinct glyph images while not exceeding a certain memory threshold.</p></td></tr></table><br></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FTC_ImageCache_New">FTC_ImageCache_New</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre> FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> ) <b>FTC_ImageCache_New</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> manager, <a href="ft2-cache_subsystem.html#FTC_ImageCache">FTC_ImageCache</a> *acache );</pre></table><br><table align=center width="87%"><tr><td><p>Creates a new glyph image cache.</p></td></tr></table><br><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td><table cellpadding=3><tr valign=top><td><b>manager</b></td><td><p>The parent manager for the image cache.</p></td></tr></table></td></tr></table><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td><table cellpadding=3><tr valign=top><td><b>acache</b></td><td><p>A handle to the new glyph image cache object.</p></td></tr></table></td></tr></table><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td><p>FreeType error code. 0 means success.</p></td></tr></table></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FTC_ImageCache_Lookup">FTC_ImageCache_Lookup</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre> FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> ) <b>FTC_ImageCache_Lookup</b>( <a href="ft2-cache_subsystem.html#FTC_ImageCache">FTC_ImageCache</a> cache, FTC_ImageType type, <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> gindex, <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> *aglyph, <a href="ft2-cache_subsystem.html#FTC_Node">FTC_Node</a> *anode );</pre></table><br><table align=center width="87%"><tr><td><p>Retrieves a given glyph image from a glyph image cache.</p></td></tr></table><br><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td><table cellpadding=3><tr valign=top><td><b>cache</b></td><td><p>A handle to the source glyph image cache.</p></td></tr><tr valign=top><td><b>type</b></td><td><p>A pointer to a glyph image type descriptor.</p></td></tr><tr valign=top><td><b>gindex</b></td><td><p>The glyph index to retrieve.</p></td></tr></table></td></tr></table><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td><table cellpadding=3><tr valign=top><td><b>aglyph</b></td><td><p>The corresponding <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> object. 0 in case of failure.</p></td></tr><tr valign=top><td><b>anode</b></td><td><p>Used to return the address of of the corresponding cache node after incrementing its reference count (see note below).</p></td></tr></table></td></tr></table><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td><p>FreeType error code. 0 means success.</p></td></tr></table><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td><p>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 <a href="ft2-glyph_management.html#FT_Glyph_Copy">FT_Glyph_Copy</a> and modify the new one.</p><p>If `anode' is <i>not</i> NULL, it receives the address of the cache node containing the glyph image, after increasing its reference count. This ensures that the node (as well as the FT_Glyph) will always be kept in the cache until you call <a href="ft2-cache_subsystem.html#FTC_Node_Unref">FTC_Node_Unref</a> to `release' it.</p><p>If `anode' is NULL, the cache node is left unchanged, which means that the FT_Glyph could be flushed out of the cache on the next call to one of the caching sub-system APIs. Don't assume that it is persistent!</p></td></tr></table></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FTC_SBit">FTC_SBit</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre> <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_SBitRec_* <b>FTC_SBit</b>;</pre></table><br><table align=center width="87%"><tr><td><p>A handle to a small bitmap descriptor. See the <a href="ft2-cache_subsystem.html#FTC_SBitRec">FTC_SBitRec</a> structure for details.</p></td></tr></table><br></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FTC_SBitRec">FTC_SBitRec</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre> <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_SBitRec_ { <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a> width; <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a> height; <a href="ft2-basic_types.html#FT_Char">FT_Char</a> left; <a href="ft2-basic_types.html#FT_Char">FT_Char</a> top; <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a> format; <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a> max_grays; <a href="ft2-basic_types.html#FT_Short">FT_Short</a> pitch; <a href="ft2-basic_types.html#FT_Char">FT_Char</a> xadvance; <a href="ft2-basic_types.html#FT_Char">FT_Char</a> yadvance; <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>* buffer; } <b>FTC_SBitRec</b>;</pre></table><br><table align=center width="87%"><tr><td><p>A very compact structure used to describe a small glyph bitmap.</p></td></tr></table><br><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td><table cellpadding=3><tr valign=top><td><b>width</b></td><td><p>The bitmap width in pixels.</p></td></tr><tr valign=top><td><b>height</b></td><td><p>The bitmap height in pixels.</p></td></tr><tr valign=top><td><b>left</b></td><td><p>The horizontal distance from the pen position to the left bitmap border (a.k.a. `left side bearing', or `lsb').</p></td></tr><tr valign=top><td><b>top</b></td><td><p>The vertical distance from the pen position (on the baseline) to the upper bitmap border (a.k.a. `top side bearing'). The distance is positive for upwards Y coordinates.</p></td></tr><tr valign=top><td><b>format</b></td><td><p>The format of the glyph bitmap (monochrome or gray).</p></td></tr><tr valign=top><td><b>max_grays</b></td><td><p>Maximum gray level value (in the range 1 to 255).</p></td></tr><tr valign=top><td><b>pitch</b></td><td><p>The number of bytes per bitmap line. May be positive or negative.</p></td></tr><tr valign=top><td><b>xadvance</b></td><td><p>The horizontal advance width in pixels.</p></td></tr><tr valign=top><td><b>yadvance</b></td><td><p>The vertical advance height in pixels.</p></td></tr><tr valign=top><td><b>buffer</b></td><td><p>A pointer to the bitmap pixels.</p></td></tr></table></td></tr></table></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FTC_SBitCache">FTC_SBitCache</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre> <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_SBitCacheRec_* <b>FTC_SBitCache</b>;</pre></table><br><table align=center width="87%"><tr><td><p>A handle to a small bitmap cache. These are special cache objects used to store small glyph bitmaps (and anti-aliased pixmaps) in a much more efficient way than the traditional glyph image cache implemented by <a href="ft2-cache_subsystem.html#FTC_ImageCache">FTC_ImageCache</a>.</p></td></tr></table><br></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FTC_SBitCache_New">FTC_SBitCache_New</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre> FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> ) <b>FTC_SBitCache_New</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> manager, <a href="ft2-cache_subsystem.html#FTC_SBitCache">FTC_SBitCache</a> *acache );</pre></table><br><table align=center width="87%"><tr><td><p>Creates a new cache to store small glyph bitmaps.</p></td></tr></table><br><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td><table cellpadding=3><tr valign=top><td><b>manager</b></td><td><p>A handle to the source cache manager.</p></td></tr></table></td></tr></table><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td><table cellpadding=3><tr valign=top><td><b>acache</b></td><td><p>A handle to the new sbit cache. NULL in case of error.</p></td></tr></table></td></tr></table><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td><p>FreeType error code. 0 means success.</p></td></tr></table></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FTC_SBitCache_Lookup">FTC_SBitCache_Lookup</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre> FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> ) <b>FTC_SBitCache_Lookup</b>( <a href="ft2-cache_subsystem.html#FTC_SBitCache">FTC_SBitCache</a> cache, FTC_ImageType type, <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> gindex, <a href="ft2-cache_subsystem.html#FTC_SBit">FTC_SBit</a> *sbit, <a href="ft2-cache_subsystem.html#FTC_Node">FTC_Node</a> *anode );</pre></table><br><table align=center width="87%"><tr><td><p>Looks up a given small glyph bitmap in a given sbit cache and `lock' it to prevent its flushing from the cache until needed.</p></td></tr></table><br><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td><table cellpadding=3><tr valign=top><td><b>cache</b></td><td><p>A handle to the source sbit cache.</p></td></tr><tr valign=top><td><b>type</b></td><td><p>A pointer to the glyph image type descriptor.</p></td></tr><tr valign=top><td><b>gindex</b></td><td><p>The glyph index.</p></td></tr></table></td></tr></table><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td><table cellpadding=3><tr valign=top><td><b>sbit</b></td><td><p>A handle to a small bitmap descriptor.</p></td></tr><tr valign=top><td><b>anode</b></td><td>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?