📄 ft2-raster.html
字号:
<span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Raster_Params_
{
<span class="keyword">const</span> <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>* target;
<span class="keyword">const</span> <span class="keyword">void</span>* source;
<span class="keyword">int</span> flags;
<a href="ft2-raster.html#FT_SpanFunc">FT_SpanFunc</a> gray_spans;
<a href="ft2-raster.html#FT_SpanFunc">FT_SpanFunc</a> black_spans;
<a href="ft2-raster.html#FT_Raster_BitTest_Func">FT_Raster_BitTest_Func</a> bit_test; /* doesn't work! */
<a href="ft2-raster.html#FT_Raster_BitSet_Func">FT_Raster_BitSet_Func</a> bit_set; /* doesn't work! */
<span class="keyword">void</span>* user;
<a href="ft2-basic_types.html#FT_BBox">FT_BBox</a> clip_box;
} <b>FT_Raster_Params</b>;
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A structure to hold the arguments used by a raster's render function.</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>target</b></td><td>
<p>The target bitmap.</p>
</td></tr>
<tr valign=top><td><b>source</b></td><td>
<p>A pointer to the source glyph image (e.g. an FT_Outline).</p>
</td></tr>
<tr valign=top><td><b>flags</b></td><td>
<p>The rendering flags.</p>
</td></tr>
<tr valign=top><td><b>gray_spans</b></td><td>
<p>The gray span drawing callback.</p>
</td></tr>
<tr valign=top><td><b>black_spans</b></td><td>
<p>The black span drawing callback.</p>
</td></tr>
<tr valign=top><td><b>bit_test</b></td><td>
<p>The bit test callback. UNIMPLEMENTED!</p>
</td></tr>
<tr valign=top><td><b>bit_set</b></td><td>
<p>The bit set callback. UNIMPLEMENTED!</p>
</td></tr>
<tr valign=top><td><b>user</b></td><td>
<p>User-supplied data that is passed to each drawing callback.</p>
</td></tr>
<tr valign=top><td><b>clip_box</b></td><td>
<p>An optional clipping box. It is only used in direct rendering mode. Note that coordinates here should be expressed in <i>integer</i> pixels (and not in 26.6 fixed-point units).</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
<p>An anti-aliased glyph bitmap is drawn if the FT_RASTER_FLAG_AA bit flag is set in the `flags' field, otherwise a monochrome bitmap will be generated.</p>
<p>If the FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the raster will call the `gray_spans' callback to draw gray pixel spans, in the case of an aa glyph bitmap, it will call `black_spans', and `bit_test' and `bit_set' in the case of a monochrome bitmap. This allows direct composition over a pre-existing bitmap through user-provided callbacks to perform the span drawing/composition.</p>
<p>Note that the `bit_test' and `bit_set' callbacks are required when rendering a monochrome bitmap, as they are crucial to implement correct drop-out control as defined in the TrueType specification.</p>
</td></tr></table>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FT_Raster_NewFunc">FT_Raster_NewFunc</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
<span class="keyword">typedef</span> <span class="keyword">int</span>
(*<b>FT_Raster_NewFunc</b>)( <span class="keyword">void</span>* memory,
<a href="ft2-raster.html#FT_Raster">FT_Raster</a>* raster );
#define FT_Raster_New_Func <b>FT_Raster_NewFunc</b>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A function used to create a new raster object.</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>memory</b></td><td>
<p>A handle to the memory allocator.</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>raster</b></td><td>
<p>A handle to the new raster 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>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 `memory' parameter is a typeless pointer in order to avoid un-wanted dependencies on the rest of the FreeType code. In practice, it is a FT_Memory, i.e., a handle to the standard FreeType memory allocator. However, this field can be completely ignored by a given raster implementation.</p>
</td></tr></table>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FT_Raster_DoneFunc">FT_Raster_DoneFunc</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
<span class="keyword">typedef</span> <span class="keyword">void</span>
(*<b>FT_Raster_DoneFunc</b>)( <a href="ft2-raster.html#FT_Raster">FT_Raster</a> raster );
#define FT_Raster_Done_Func <b>FT_Raster_DoneFunc</b>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A function used to destroy a given raster object.</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>raster</b></td><td>
<p>A handle to the raster object.</p>
</td></tr>
</table>
</td></tr></table>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FT_Raster_ResetFunc">FT_Raster_ResetFunc</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
<span class="keyword">typedef</span> <span class="keyword">void</span>
(*<b>FT_Raster_ResetFunc</b>)( <a href="ft2-raster.html#FT_Raster">FT_Raster</a> raster,
<span class="keyword">unsigned</span> <span class="keyword">char</span>* pool_base,
<span class="keyword">unsigned</span> <span class="keyword">long</span> pool_size );
#define FT_Raster_Reset_Func <b>FT_Raster_ResetFunc</b>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>FreeType provides an area of memory called the `render pool', available to all registered rasters. This pool can be freely used during a given scan-conversion but is shared by all rasters. Its content is thus transient.</p>
<p>This function is called each time the render pool changes, or just after a new raster object is created.</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>raster</b></td><td>
<p>A handle to the new raster object.</p>
</td></tr>
<tr valign=top><td><b>pool_base</b></td><td>
<p>The address in memory of the render pool.</p>
</td></tr>
<tr valign=top><td><b>pool_size</b></td><td>
<p>The size in bytes of the render pool.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
<p>Rasters can ignore the render pool and rely on dynamic memory allocation if they want to (a handle to the memory allocator is passed to the raster constructor). However, this is not recommended for efficiency purposes.</p>
</td></tr></table>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FT_Raster_SetModeFunc">FT_Raster_SetModeFunc</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
<span class="keyword">typedef</span> <span class="keyword">int</span>
(*<b>FT_Raster_SetModeFunc</b>)( <a href="ft2-raster.html#FT_Raster">FT_Raster</a> raster,
<span class="keyword">unsigned</span> <span class="keyword">long</span> mode,
<span class="keyword">void</span>* args );
#define FT_Raster_Set_Mode_Func <b>FT_Raster_SetModeFunc</b>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>This function is a generic facility to change modes or attributes in a given raster. This can be used for debugging purposes, or simply to allow implementation-specific `features' in a given raster module.</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>raster</b></td><td>
<p>A handle to the new raster object.</p>
</td></tr>
<tr valign=top><td><b>mode</b></td><td>
<p>A 4-byte tag used to name the mode or property.</p>
</td></tr>
<tr valign=top><td><b>args</b></td><td>
<p>A pointer to the new mode/property to use.</p>
</td></tr>
</table>
</td></tr></table>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FT_Raster_RenderFunc">FT_Raster_RenderFunc</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
<span class="keyword">typedef</span> <span class="keyword">int</span>
(*<b>FT_Raster_RenderFunc</b>)( <a href="ft2-raster.html#FT_Raster">FT_Raster</a> raster,
<a href="ft2-raster.html#FT_Raster_Params">FT_Raster_Params</a>* params );
#define FT_Raster_Render_Func <b>FT_Raster_RenderFunc</b>
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Invokes a given raster to scan-convert a given glyph image into a target bitmap.</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>raster</b></td><td>
<p>A handle to the raster object.</p>
</td></tr>
<tr valign=top><td><b>params</b></td><td>
<p>A pointer to a FT_Raster_Params structure used to store the rendering parameters.</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>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 exact format of the source image depends on the raster's glyph format defined in its FT_Raster_Funcs structure. It can be an FT_Outline or anything else in order to support a large array of glyph formats.</p>
<p>Note also that the render function can fail and return a FT_Err_Unimplemented_Feature error code if the raster used does not support direct composition.</p>
<p>XXX: For now, the standard raster doesn't support direct composition but this should change for the final release (see the files demos/src/ftgrays.c and demos/src/ftgrays2.c for examples of distinct implementations which support direct composition).</p>
</td></tr></table>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FT_Raster_Funcs">FT_Raster_Funcs</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
<span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Raster_Funcs_
{
<a href="ft2-basic_types.html#FT_Glyph_Format">FT_Glyph_Format</a> glyph_format;
<a href="ft2-raster.html#FT_Raster_NewFunc">FT_Raster_NewFunc</a> raster_new;
<a href="ft2-raster.html#FT_Raster_ResetFunc">FT_Raster_ResetFunc</a> raster_reset;
<a href="ft2-raster.html#FT_Raster_SetModeFunc">FT_Raster_SetModeFunc</a> raster_set_mode;
<a href="ft2-raster.html#FT_Raster_RenderFunc">FT_Raster_RenderFunc</a> raster_render;
<a href="ft2-raster.html#FT_Raster_DoneFunc">FT_Raster_DoneFunc</a> raster_done;
} <b>FT_Raster_Funcs</b>;
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A structure used to describe a given raster class to the library.</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>glyph_format</b></td><td>
<p>The supported glyph format for this raster.</p>
</td></tr>
<tr valign=top><td><b>raster_new</b></td><td>
<p>The raster constructor.</p>
</td></tr>
<tr valign=top><td><b>raster_reset</b></td><td>
<p>Used to reset the render pool within the raster.</p>
</td></tr>
<tr valign=top><td><b>raster_render</b></td><td>
<p>A function to render a glyph into a given bitmap.</p>
</td></tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -