-
Notifications
You must be signed in to change notification settings - Fork 7
/
rasterizer_datasource.hpp
61 lines (50 loc) · 1.37 KB
/
rasterizer_datasource.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* rasterizer_datasource.hpp
*
* Created on: Aug 8, 2011
* Author: stella
*/
#ifndef RASTERIZER_DATASOURCE_HPP
#define RASTERIZER_DATASOURCE_HPP
#include "chained_datasource.hpp"
// Forward defines
class rasterizer_accumulator;
class rasterizer_datasource;
/**
* Accumulates raster results. This is constructed and dispatched internally
* by the rasterizer_datasource and calls back to virtual methods within
* the datasource to do its work.
*/
class rasterize_params {
const mapnik::query& query_;
mapnik::image_data_32& image_;
public:
rasterize_params(const mapnik::query& query, mapnik::image_data_32& image):
query_(query),
image_(image)
{
}
mapnik::image_data_32& image() {
return image_;
}
const mapnik::query& query() {
return query_;
}
};
/**
* rasterizer_datasource
* Base class for constructing datasources that process features from
* another datasource and plot them on an image surface that is returned
* as a raster.
*/
class rasterizer_datasource: public chained_datasource {
protected:
virtual void rasterize(rasterize_params& rp) const = 0;
public:
rasterizer_datasource(const mapnik::parameters& params, bool bind=true);
virtual ~rasterizer_datasource();
int type() const;
mapnik::featureset_ptr features(const mapnik::query& q) const;
mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt) const;
};
#endif