1 /* 2 * Copyright 2005-2007, Stephan Aßmus <superstippi@gmx.de>. 3 * Copyright 2008, Andrej Spielmann <andrej.spielmann@seh.ox.ac.uk>. 4 * Copyright 2015, Julian Harnath <julian.harnath@rwth-aachen.de> 5 * All rights reserved. Distributed under the terms of the MIT License. 6 */ 7 #ifndef PAINTER_DATA_H 8 #define PAINTER_DATA_H 9 10 11 #include "defines.h" 12 13 #include <agg_path_storage.h> 14 15 16 struct PainterAggInterface { 17 PainterAggInterface(PatternHandler& patternHandler) 18 : 19 fBuffer(), 20 fPixelFormat(fBuffer, &patternHandler), 21 fBaseRenderer(fPixelFormat), 22 fUnpackedScanline(), 23 fPackedScanline(), 24 fRasterizer(), 25 fRenderer(fBaseRenderer), 26 fRendererBin(fBaseRenderer), 27 fSubpixPackedScanline(), 28 fSubpixUnpackedScanline(), 29 fSubpixRasterizer(), 30 fSubpixRenderer(fBaseRenderer), 31 fMaskedUnpackedScanline(NULL), 32 fClippedAlphaMask(NULL), 33 fPath(), 34 fCurve(fPath) 35 { 36 } 37 38 agg::rendering_buffer fBuffer; 39 40 // AGG rendering and rasterization classes 41 pixfmt fPixelFormat; 42 renderer_base fBaseRenderer; 43 44 // Regular drawing mode: pixel-aligned, no alpha masking 45 scanline_unpacked_type fUnpackedScanline; 46 scanline_packed_type fPackedScanline; 47 rasterizer_type fRasterizer; 48 renderer_type fRenderer; 49 50 // Fast mode: no antialiasing needed (horizontal/vertical lines, ...) 51 renderer_bin_type fRendererBin; 52 53 // Subpixel mode 54 scanline_packed_subpix_type fSubpixPackedScanline; 55 scanline_unpacked_subpix_type fSubpixUnpackedScanline; 56 rasterizer_subpix_type fSubpixRasterizer; 57 renderer_subpix_type fSubpixRenderer; 58 59 // Alpha-Masked mode: for ClipToPicture 60 // (this uses the standard rasterizer and renderer) 61 scanline_unpacked_masked_type* fMaskedUnpackedScanline; 62 agg::clipped_alpha_mask* fClippedAlphaMask; 63 64 agg::path_storage fPath; 65 agg::conv_curve<agg::path_storage> fCurve; 66 }; 67 68 69 #endif // PAINTER_DATA_H 70