diff --git a/src/dense/ftdense.h b/src/dense/ftdense.h index 9321aa3db..677b2ea33 100644 --- a/src/dense/ftdense.h +++ b/src/dense/ftdense.h @@ -1,7 +1,59 @@ +/* Dense rasterizer header*/ #ifndef FTDENSE_H_ #define FTDENSE_H_ +#include +#include FT_CONFIG_CONFIG_H +#include + +FT_BEGIN_HEADER + +#ifndef FT_EXPORT_VAR +#define FT_EXPORT_VAR( x ) extern x +#endif +FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_dense_raster; + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct + { + /** The array used to store signed area differences. */ + float* m_a; + /** The number of elements in m_a. */ + int m_a_size; + /** The width of the current raster in pixels. */ + int m_w; + /** The height of the current raster in pixels. */ + int m_h; + /** The x origin of the raster. */ + int m_origin_x; + /** The y origin of the raster. */ + int m_origin_y; + + FT_Pos prev_x, prev_y; + + FT_Outline outline; + } dense_worker; + + void dense_render_line( dense_worker* worker, FT_Pos to_x, FT_Pos to_y ); + void dense_render_quadratic( dense_worker* worker, + FT_Vector* control, + FT_Vector* to ); + void dense_render_cubic( dense_worker* worker, + FT_Vector* control_1, + FT_Vector* control_2, + FT_Vector* to ); + +#ifdef __cplusplus +} // extern "C" +#endif + +FT_END_HEADER + #endif /* FTDENSE_H_ */ /* END */ diff --git a/src/dense/ftdenseerrs.h b/src/dense/ftdenseerrs.h index b7897e9cb..e1755c2c1 100644 --- a/src/dense/ftdenseerrs.h +++ b/src/dense/ftdenseerrs.h @@ -1,8 +1,17 @@ -/** Common error defines */ - +/* Dense Renderer Error Codes */ #ifndef FTDENSEERRS_H_ #define FTDENSEERRS_H_ +#include + +#undef FTERRORS_H_ + +#undef FT_ERR_PREFIX +#define FT_ERR_PREFIX Dense_Err_ +#define FT_ERR_BASE FT_Mod_Err_Dense + +#include + #endif /* FTDENSEERRS_H_ */ /* END */ diff --git a/src/dense/ftdenserend.h b/src/dense/ftdenserend.h index 409f7fe8c..c91b230ab 100644 --- a/src/dense/ftdenserend.h +++ b/src/dense/ftdenserend.h @@ -1,7 +1,27 @@ - +/* Dense renderer interface (specification) */ #ifndef FTDENSEREND_H_ #define FTDENSEREND_H_ + +#include +#include +#include + +FT_BEGIN_HEADER + +/************************************************************************** + * + * @renderer: + * ft_dense_renderer_class + * + * @description: + * Renderer to convert @FT_Outline to bitmaps. + * + */ +FT_DECLARE_RENDERER( ft_dense_renderer_class ) + +FT_END_HEADER + #endif /* FTDENSEREND_H_ */ /* END */