Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 36 lines (25 sloc) 0.844 kB
058029c @kkaefer add a Palette object and allow passing in Palettes for quantization
kkaefer authored
1 #ifndef __NODE_MAPNIK_PALETTE_H__
2 #define __NODE_MAPNIK_PALETTE_H__
3
4 #include <v8.h>
5 #include <node.h>
6 #include <node_object_wrap.h>
7
8 // boost
9 #include <boost/shared_ptr.hpp>
10
11 #include <mapnik/palette.hpp>
12
13 using namespace v8;
14 using namespace node;
15
16 typedef boost::shared_ptr<mapnik::rgba_palette> palette_ptr;
17
18 class Palette: public node::ObjectWrap {
3a02935 @springmeyer cpp coding style cleanups
springmeyer authored
19 public:
058029c @kkaefer add a Palette object and allow passing in Palettes for quantization
kkaefer authored
20 static Persistent<FunctionTemplate> constructor;
21
cee23af @kkaefer add act palette reading and add palette support to map object
kkaefer authored
22 explicit Palette(std::string const& palette, mapnik::rgba_palette::palette_type type);
058029c @kkaefer add a Palette object and allow passing in Palettes for quantization
kkaefer authored
23 static void Initialize(Handle<Object> target);
24 static Handle<Value> New(const Arguments &args);
25
4fa76d3 @kkaefer fix strings to palette conversion in node module and add tests for pa…
kkaefer authored
26 static Handle<Value> ToString(const Arguments& args);
27 static Handle<Value> ToBuffer(const Arguments& args);
28
058029c @kkaefer add a Palette object and allow passing in Palettes for quantization
kkaefer authored
29 inline palette_ptr palette() { return palette_; }
3a02935 @springmeyer cpp coding style cleanups
springmeyer authored
30 private:
058029c @kkaefer add a Palette object and allow passing in Palettes for quantization
kkaefer authored
31 ~Palette();
32 palette_ptr palette_;
33 };
34
35 #endif
Something went wrong with that request. Please try again.