1 #ifndef OSMSCOUT_MAP_MAPPAINTERAGG_H 2 #define OSMSCOUT_MAP_MAPPAINTERAGG_H 25 #include <agg2/agg_conv_curve.h> 26 #include <agg2/agg_conv_contour.h> 27 #include <agg2/agg_path_storage.h> 28 #include <agg2/agg_pixfmt_rgb.h> 29 #include <agg2/agg_rasterizer_scanline_aa.h> 30 #include <agg2/agg_renderer_base.h> 31 #include <agg2/agg_rendering_buffer.h> 32 #include <agg2/agg_renderer_scanline.h> 33 #include <agg2/agg_scanline_p.h> 36 #include <agg2/agg_font_freetype.h> 64 typedef agg::renderer_base<AggPixelFormat> AggRenderBase;
65 typedef agg::rasterizer_scanline_aa<> AggScanlineRasterizer;
66 typedef agg::scanline_p8 AggScanline;
67 typedef agg::renderer_scanline_aa_solid<AggRenderBase> AggScanlineRendererAA;
68 typedef agg::renderer_scanline_bin_solid<AggRenderBase> AggScanlineRendererBin;
70 typedef agg::font_engine_freetype_int32 AggFontEngine;
71 typedef agg::font_cache_manager<AggFontEngine> AggFontManager;
72 typedef agg::conv_curve<AggFontManager::path_adaptor_type> AggTextCurveConverter;
73 typedef agg::conv_contour<AggTextCurveConverter> AggTextContourConverter;
79 AggRenderBase *renderer_base;
80 AggScanlineRasterizer *rasterizer;
81 AggScanline *scanlineP8;
82 AggScanlineRendererAA *renderer_aa;
83 AggScanlineRendererBin *renderer_bin;
84 AggFontEngine *fontEngine;
85 AggFontManager *fontCacheManager;
86 AggTextCurveConverter *convTextCurves;
87 AggTextContourConverter *convTextContours;
93 const MapParameter& parameter,
95 agg::glyph_rendering ren_type = agg::glyph_ren_native_gray8);
97 void GetTextDimension(
const std::wstring& text,
100 void DrawText(
double x,
102 const std::wstring& text);
104 void DrawGlyph(
double x,
double y,
105 const agg::glyph_cache* glyph);
107 void DrawGlyphVector(
double x,
double baselineY,
108 const std::vector<MapPainterAgg::NativeGlyph> &glyphs);
111 const MapParameter& parameter,
114 agg::path_storage& path);
119 const MapParameter& parameter,
122 double GetFontHeight(
const Projection& projection,
123 const MapParameter& parameter,
124 double fontSize)
override;
127 const MapParameter& parameter,
131 double centerX,
double centerY,
132 double width,
double height)
override;
135 const MapParameter& parameter,
137 double x,
double y)
override;
140 const MapParameter& parameter,
143 const std::vector<double>& dash,
146 size_t transStart,
size_t transEnd)
override;
149 const MapParameter& parameter,
155 const MapParameter ¶meter,
157 const std::vector<AggGlyph> &glyphs);
161 std::shared_ptr<AggLabel> Layout(
const Projection& projection,
162 const MapParameter& parameter,
163 const std::string& text,
166 bool enableWrapping =
false,
167 bool contourLabel =
false);
173 virtual void RegisterRegularLabel(
const Projection &projection,
174 const MapParameter ¶meter,
175 const std::vector<LabelData> &labels,
176 const Vertex2D &position,
177 double objectWidth)
override;
182 virtual void RegisterContourLabel(
const Projection &projection,
183 const MapParameter ¶meter,
188 const MapParameter& parameter,
189 const MapData& data)
override;
191 virtual void BeforeDrawing(
const StyleConfig& styleConfig,
193 const MapParameter& parameter,
194 const MapData& data)
override;
196 void DrawContourSymbol(
const Projection& projection,
197 const MapParameter& parameter,
200 size_t transStart,
size_t transEnd)
override;
203 const MapParameter& parameter,
211 const MapParameter& parameter,
Definition: LabelLayouter.h:144
std::shared_ptr< FillStyle > FillStyleRef
Definition: Styles.h:349
double x
Definition: MapPainterAgg.h:50
Index selectors by type and level.
Definition: StyleConfig.h:553
Definition: LabelLayouter.h:87
std::shared_ptr< BorderStyle > BorderStyleRef
Definition: Styles.h:458
std::wstring text
Definition: MapPainterAgg.h:55
const agg::glyph_cache * aggGlyph
Definition: MapPainterAgg.h:52
Definition: Projection.h:43
Definition: MapPainter.h:75
std::shared_ptr< PathTextStyle > PathTextStyleRef
Definition: Styles.h:877
std::vector< NativeGlyph > glyphs
Definition: MapPainterAgg.h:56
Definition: Styles.h:1135
Definition: LabelPath.h:42
Definition: LabelLayouter.h:98
std::shared_ptr< StyleConfig > StyleConfigRef
Definition: StyleConfig.h:849
Definition: MapPainter.h:87
Definition: MapPainterAgg.h:49
Definition: LabelLayouter.h:129
agg::pixfmt_rgb24 AggPixelFormat
Definition: MapPainterAgg.h:47
friend AggLabelLayouter
Definition: MapPainterAgg.h:61
double y
Definition: MapPainterAgg.h:51
Definition: MapPainterAgg.h:54
Definition: MapPainter.h:179
Definition: MapPainterAgg.h:44
#define OSMSCOUT_MAP_AGG_API
Definition: MapAggImportExport.h:45
CapStyle
Definition: Styles.h:69