📄 ftimage.h
字号:
/* */ /* 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. */ /* */ /* 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. */ /* */ typedef struct FT_Raster_Params_ { FT_Bitmap* target; void* source; int flags; FT_Raster_Span_Func gray_spans; FT_Raster_Span_Func black_spans; FT_Raster_BitTest_Func bit_test; FT_Raster_BitSet_Func bit_set; void* user; } FT_Raster_Params; /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Raster_New_Func */ /* */ /* <Description> */ /* A function used to create a new raster object. */ /* */ /* <Input> */ /* memory :: A handle to the memory allocator. */ /* */ /* <Output> */ /* raster :: A handle to the new raster object. */ /* */ /* <Return> */ /* Error code. 0 means success. */ /* */ /* <Note> */ /* 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. */ /* */ typedef int (*FT_Raster_New_Func)( void* memory, FT_Raster* raster ); /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Raster_Done_Func */ /* */ /* <Description> */ /* A function used to destroy a given raster object. */ /* */ /* <Input> */ /* raster :: A handle to the raster object. */ /* */ typedef void (*FT_Raster_Done_Func)( FT_Raster raster ); /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Raster_Reset_Func */ /* */ /* <Description> */ /* 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. */ /* */ /* This function is called each time the render pool changes, or just */ /* after a new raster object is created. */ /* */ /* <Input> */ /* raster :: A handle to the new raster object. */ /* */ /* pool_base :: The address in memory of the render pool. */ /* */ /* pool_size :: The size in bytes of the render pool. */ /* */ /* <Note> */ /* 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. */ /* */ typedef void (*FT_Raster_Reset_Func)( FT_Raster raster, unsigned char* pool_base, unsigned long pool_size ); /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Raster_Set_Mode_Func */ /* */ /* <Description> */ /* 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. */ /* */ /* <Input> */ /* raster :: A handle to the new raster object. */ /* */ /* mode :: A 4-byte tag used to name the mode or property. */ /* */ /* args :: A pointer to the new mode/property to use. */ /* */ typedef int (*FT_Raster_Set_Mode_Func)( FT_Raster raster, unsigned long mode, void* args ); /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Raster_Render_Func */ /* */ /* <Description> */ /* Invokes a given raster to scan-convert a given glyph image into a */ /* target bitmap. */ /* */ /* <Input> */ /* raster :: A handle to the raster object. */ /* */ /* params :: A pointer to a FT_Raster_Params structure used to store */ /* the rendering parameters. */ /* */ /* <Return> */ /* Error code. 0 means success. */ /* */ /* <Note> */ /* 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. */ /* */ /* 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. */ /* */ /* 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). */ /* */ typedef int (*FT_Raster_Render_Func)( FT_Raster raster, FT_Raster_Params* params ); /*************************************************************************/ /* */ /* <Struct> */ /* FT_Raster_Funcs */ /* */ /* <Description> */ /* A structure used to describe a given raster class to the library. */ /* */ /* <Fields> */ /* glyph_format :: The supported glyph format for this raster. */ /* */ /* raster_new :: The raster constructor. */ /* */ /* raster_reset :: Used to reset the render pool within the raster. */ /* */ /* raster_render :: A function to render a glyph into a given bitmap. */ /* */ /* raster_done :: The raster destructor. */ /* */ typedef struct FT_Raster_Funcs_ { FT_Glyph_Format glyph_format; FT_Raster_New_Func raster_new; FT_Raster_Reset_Func raster_reset; FT_Raster_Set_Mode_Func raster_set_mode; FT_Raster_Render_Func raster_render; FT_Raster_Done_Func raster_done; } FT_Raster_Funcs;FT_END_HEADER#endif /* __FTIMAGE_H__ *//* END */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -