/
mapnik_image_view.hpp
54 lines (43 loc) · 1.52 KB
/
mapnik_image_view.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
#ifndef __NODE_MAPNIK_IMAGE_VIEW_H__
#define __NODE_MAPNIK_IMAGE_VIEW_H__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <nan.h>
#pragma GCC diagnostic pop
#include <mapnik/image_data.hpp> // for image_data_rgba8
#include "mapnik3x_compatibility.hpp"
#include MAPNIK_SHARED_INCLUDE
class Image;
namespace mapnik { template <typename T> class image_view; }
using namespace v8;
typedef MAPNIK_SHARED_PTR<mapnik::image_view<mapnik::image_data_rgba8> > image_view_ptr;
class ImageView: public node::ObjectWrap {
public:
static Persistent<FunctionTemplate> constructor;
static void Initialize(Handle<Object> target);
static NAN_METHOD(New);
static Handle<Value> New(Image * JSImage,
unsigned x,unsigned y, unsigned w, unsigned h);
static NAN_METHOD(encodeSync);
static NAN_METHOD(encode);
static void EIO_Encode(uv_work_t* req);
static void EIO_AfterEncode(uv_work_t* req);
//static NAN_METHOD(view);
static NAN_METHOD(width);
static NAN_METHOD(height);
//static NAN_METHOD(open);
static NAN_METHOD(save);
static NAN_METHOD(isSolid);
static void EIO_IsSolid(uv_work_t* req);
static void EIO_AfterIsSolid(uv_work_t* req);
static Local<Value> _isSolidSync(_NAN_METHOD_ARGS);
static NAN_METHOD(isSolidSync);
static NAN_METHOD(getPixel);
ImageView(Image * JSImage);
inline image_view_ptr get() { return this_; }
private:
~ImageView();
image_view_ptr this_;
Image * JSImage_;
};
#endif