-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathblend.hpp
More file actions
59 lines (50 loc) · 1.15 KB
/
blend.hpp
File metadata and controls
59 lines (50 loc) · 1.15 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#pragma once
#include <napi.h>
// stl
#include <string>
#include <vector>
#include <memory>
#include "mapnik_palette.hpp"
#include "mapnik_image.hpp"
#include "tint.hpp"
namespace node_mapnik {
struct BImage
{
BImage() : data(nullptr),
dataLength(0),
x(0),
y(0),
width(0),
height(0),
tint(),
im_ptr(nullptr),
im_raw_ptr(nullptr),
im_obj(nullptr) {}
Napi::Reference<Napi::Buffer<char>> buffer;
char const* data;
size_t dataLength;
int x;
int y;
int width, height;
Tinter tint;
std::unique_ptr<mapnik::image_rgba8> im_ptr;
mapnik::image_rgba8* im_raw_ptr;
image_ptr im_obj;
};
typedef std::shared_ptr<BImage> ImagePtr;
typedef std::vector<ImagePtr> Images;
enum BlendFormat
{
BLEND_FORMAT_PNG,
BLEND_FORMAT_JPEG,
BLEND_FORMAT_WEBP
};
enum AlphaMode
{
BLEND_MODE_OCTREE,
BLEND_MODE_HEXTREE
};
Napi::Value rgb2hsl(Napi::CallbackInfo const& info);
Napi::Value hsl2rgb(Napi::CallbackInfo const& info);
Napi::Value blend(Napi::CallbackInfo const& info);
} // namespace node_mapnik