Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 35 lines (25 sloc) 0.848 kb
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
#ifndef __NODE_MAPNIK_PALETTE_H__
#define __NODE_MAPNIK_PALETTE_H__

#include <v8.h>
#include <node.h>
#include <node_object_wrap.h>

// boost
#include <boost/shared_ptr.hpp>

#include <mapnik/palette.hpp>

using namespace v8;
using namespace node;

typedef boost::shared_ptr<mapnik::rgba_palette> palette_ptr;

class Palette: public node::ObjectWrap {
  public:
    static Persistent<FunctionTemplate> constructor;

    explicit Palette(std::string const& palette, mapnik::rgba_palette::palette_type type);
    static void Initialize(Handle<Object> target);
    static Handle<Value> New(const Arguments &args);

    static Handle<Value> ToString(const Arguments& args);
    static Handle<Value> ToBuffer(const Arguments& args);

    inline palette_ptr palette() { return palette_; }
  private:
    ~Palette();
    palette_ptr palette_;
};

#endif
Something went wrong with that request. Please try again.