/** ******************************************************************************* * @file parserSVG/Renderer.h * @brief Basic SVG renderer for the AGG librairy (Header) * @author Edouard DUPIN * @date 23/03/2012 * @par Project * parserSVG * * @par Copyright * Copyright 2011 Edouard DUPIN, all right reserved * * This software is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY. * * Licence summary : * You can modify and redistribute the sources code and binaries. * You can send me the bug-fix * * Term of the licence in in the file licence.txt. * ******************************************************************************* */ #ifndef __SVG_RENDERER_H__ #define __SVG_RENDERER_H__ #include #include #include #include #include #include #include #include #include #include #include #include namespace svg { typedef enum { LINECAP_BUTT, LINECAP_ROUND, LINECAP_SQUARE, } lineCap_te; typedef enum { LINEJOIN_MITER, LINEJOIN_ROUND, LINEJOIN_BEVEL, } lineJoin_te; class PaintState { public: draw::Color fill; draw::Color stroke; float strokeWidth; bool flagEvenOdd; lineCap_te lineCap; lineJoin_te lineJoin; etk::Vector2D viewPort; }; // basic definition type for the renderer typedef agg::renderer_base rendererBase_t; typedef agg::renderer_scanline_aa_solid rendererSolid_t; class Renderer { private: uint8_t * m_buffer; uint32_t m_allocatedSize; public: Renderer(uint32_t width, uint32_t height); ~Renderer(void); void WritePpm(etk::UString fileName); etk::Vector2D m_size; agg::rendering_buffer * m_renderingBuffer; agg::pixfmt_rgba32 * m_pixFrame; rendererBase_t * m_renderBase; rendererSolid_t * m_renderArea; agg::rasterizer_scanline_aa<> m_rasterizer; //!< AGG renderer system agg::scanline_p8 m_scanLine; //!< uint8_t* GetDataPointer(void) { return m_buffer; }; uint32_t GetDataSize(void) { return m_allocatedSize; }; }; }; #endif