@ohos-ports/canvas 3.2.3-beta.0 → 3.2.3-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/build/Release/canvas-postbuild.node +0 -0
  2. package/build/Release/canvas.node +0 -0
  3. package/build/Release/libcairo.so.2.11802.2 +0 -0
  4. package/build/Release/libexpat.so +0 -0
  5. package/build/Release/libffi.so.8.1.3 +0 -0
  6. package/build/Release/libfontconfig.so.1.15.0 +0 -0
  7. package/build/Release/libfribidi.so.0.4.0 +0 -0
  8. package/build/Release/libjpeg.so +0 -0
  9. package/build/Release/liblibpng16.so +0 -0
  10. package/build/Release/libpango-1.0.so.0.5000.14 +0 -0
  11. package/build/Release/libpangocairo-1.0.so.0.5000.14 +0 -0
  12. package/build/Release/libpangoft2-1.0.so.0.5000.14 +0 -0
  13. package/build/Release/libpcre2-8.so.0.11.0 +0 -0
  14. package/build/Release/libpixman-1.so.0.46.4 +0 -0
  15. package/build/Release/libpng16.so.16 +0 -0
  16. package/index.js +9 -91
  17. package/install.js +64 -0
  18. package/package.json +11 -66
  19. package/Readme.md +0 -657
  20. package/binding.gyp +0 -229
  21. package/browser.js +0 -31
  22. package/index.d.ts +0 -507
  23. package/install-prebuilt.js +0 -117
  24. package/lib/DOMMatrix.js +0 -678
  25. package/lib/bindings.js +0 -43
  26. package/lib/canvas.js +0 -113
  27. package/lib/context2d.js +0 -11
  28. package/lib/image.js +0 -97
  29. package/lib/jpegstream.js +0 -41
  30. package/lib/pattern.js +0 -15
  31. package/lib/pdfstream.js +0 -35
  32. package/lib/pngstream.js +0 -42
  33. package/src/Backends.h +0 -9
  34. package/src/Canvas.cc +0 -1026
  35. package/src/Canvas.h +0 -128
  36. package/src/CanvasError.h +0 -37
  37. package/src/CanvasGradient.cc +0 -113
  38. package/src/CanvasGradient.h +0 -20
  39. package/src/CanvasPattern.cc +0 -129
  40. package/src/CanvasPattern.h +0 -33
  41. package/src/CanvasRenderingContext2d.cc +0 -3527
  42. package/src/CanvasRenderingContext2d.h +0 -238
  43. package/src/CharData.h +0 -233
  44. package/src/FontParser.cc +0 -605
  45. package/src/FontParser.h +0 -115
  46. package/src/Image.cc +0 -1719
  47. package/src/Image.h +0 -146
  48. package/src/ImageData.cc +0 -138
  49. package/src/ImageData.h +0 -26
  50. package/src/InstanceData.h +0 -12
  51. package/src/JPEGStream.h +0 -157
  52. package/src/PNG.h +0 -292
  53. package/src/Point.h +0 -11
  54. package/src/Util.h +0 -9
  55. package/src/bmp/BMPParser.cc +0 -459
  56. package/src/bmp/BMPParser.h +0 -60
  57. package/src/bmp/LICENSE.md +0 -24
  58. package/src/closure.cc +0 -52
  59. package/src/closure.h +0 -98
  60. package/src/color.cc +0 -796
  61. package/src/color.h +0 -30
  62. package/src/dll_visibility.h +0 -20
  63. package/src/init.cc +0 -114
  64. package/src/register_font.cc +0 -352
  65. package/src/register_font.h +0 -7
  66. package/util/has_lib.js +0 -119
  67. package/util/win_jpeg_lookup.js +0 -21
package/binding.gyp DELETED
@@ -1,229 +0,0 @@
1
- {
2
- 'conditions': [
3
- ['OS=="win"', {
4
- 'variables': {
5
- 'GTK_Root%': 'C:/GTK', # Set the location of GTK all-in-one bundle
6
- 'with_jpeg%': 'false',
7
- 'with_gif%': 'false',
8
- 'with_rsvg%': 'false',
9
- 'variables': { # Nest jpeg_root to evaluate it before with_jpeg
10
- 'jpeg_root%': '<!(node ./util/win_jpeg_lookup)'
11
- },
12
- 'jpeg_root%': '<(jpeg_root)', # Take value of nested variable
13
- 'conditions': [
14
- ['jpeg_root==""', {
15
- 'with_jpeg%': 'false'
16
- }, {
17
- 'with_jpeg%': 'true'
18
- }]
19
- ]
20
- }
21
- }, { # 'OS!="win"'
22
- 'variables': {
23
- 'with_jpeg%': '<!(node ./util/has_lib.js jpeg)',
24
- 'with_gif%': '<!(node ./util/has_lib.js gif)',
25
- 'with_rsvg%': '<!(node ./util/has_lib.js rsvg)'
26
- }
27
- }]
28
- ],
29
- 'targets': [
30
- {
31
- 'target_name': 'canvas-postbuild',
32
- 'dependencies': ['canvas'],
33
- 'conditions': [
34
- ['OS=="win"', {
35
- 'copies': [{
36
- 'destination': '<(PRODUCT_DIR)',
37
- 'files': [
38
- '<(GTK_Root)/bin/zlib1.dll',
39
- '<(GTK_Root)/bin/libintl-8.dll',
40
- '<(GTK_Root)/bin/libpng14-14.dll',
41
- '<(GTK_Root)/bin/libpangocairo-1.0-0.dll',
42
- '<(GTK_Root)/bin/libpango-1.0-0.dll',
43
- '<(GTK_Root)/bin/libpangoft2-1.0-0.dll',
44
- '<(GTK_Root)/bin/libpangowin32-1.0-0.dll',
45
- '<(GTK_Root)/bin/libcairo-2.dll',
46
- '<(GTK_Root)/bin/libfontconfig-1.dll',
47
- '<(GTK_Root)/bin/libfreetype-6.dll',
48
- '<(GTK_Root)/bin/libglib-2.0-0.dll',
49
- '<(GTK_Root)/bin/libgobject-2.0-0.dll',
50
- '<(GTK_Root)/bin/libgmodule-2.0-0.dll',
51
- '<(GTK_Root)/bin/libgthread-2.0-0.dll',
52
- '<(GTK_Root)/bin/libexpat-1.dll'
53
- ]
54
- }]
55
- }]
56
- ]
57
- },
58
- {
59
- 'target_name': 'canvas',
60
- 'include_dirs': ["<!(node -p \"require('node-addon-api').include_dir\")"],
61
- 'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS', 'NODE_ADDON_API_ENABLE_MAYBE' ],
62
- 'sources': [
63
- 'src/bmp/BMPParser.cc',
64
- 'src/Canvas.cc',
65
- 'src/CanvasGradient.cc',
66
- 'src/CanvasPattern.cc',
67
- 'src/CanvasRenderingContext2d.cc',
68
- 'src/closure.cc',
69
- 'src/color.cc',
70
- 'src/Image.cc',
71
- 'src/ImageData.cc',
72
- 'src/init.cc',
73
- 'src/register_font.cc',
74
- 'src/FontParser.cc'
75
- ],
76
- 'conditions': [
77
- ['OS=="win"', {
78
- 'libraries': [
79
- '-l<(GTK_Root)/lib/cairo.lib',
80
- '-l<(GTK_Root)/lib/libpng.lib',
81
- '-l<(GTK_Root)/lib/pangocairo-1.0.lib',
82
- '-l<(GTK_Root)/lib/pango-1.0.lib',
83
- '-l<(GTK_Root)/lib/freetype.lib',
84
- '-l<(GTK_Root)/lib/glib-2.0.lib',
85
- '-l<(GTK_Root)/lib/gobject-2.0.lib'
86
- ],
87
- 'include_dirs': [
88
- '<(GTK_Root)/include',
89
- '<(GTK_Root)/include/cairo',
90
- '<(GTK_Root)/include/pango-1.0',
91
- '<(GTK_Root)/include/glib-2.0',
92
- '<(GTK_Root)/include/freetype2',
93
- '<(GTK_Root)/lib/glib-2.0/include'
94
- ],
95
- 'defines': [
96
- '_USE_MATH_DEFINES', # for M_PI
97
- 'NOMINMAX' # allow std::min/max to work
98
- ],
99
- 'configurations': {
100
- 'Debug': {
101
- 'msvs_settings': {
102
- 'VCCLCompilerTool': {
103
- 'WarningLevel': 4,
104
- 'ExceptionHandling': 1,
105
- 'DisableSpecificWarnings': [
106
- 4100, 4611
107
- ]
108
- }
109
- }
110
- },
111
- 'Release': {
112
- 'msvs_settings': {
113
- 'VCCLCompilerTool': {
114
- 'WarningLevel': 4,
115
- 'ExceptionHandling': 1,
116
- 'DisableSpecificWarnings': [
117
- 4100, 4611
118
- ]
119
- }
120
- }
121
- }
122
- }
123
- }, { # 'OS!="win"'
124
- 'libraries': [
125
- '<!@(pkg-config pixman-1 --libs)',
126
- '<!@(pkg-config cairo --libs)',
127
- '<!@(pkg-config libpng --libs)',
128
- '<!@(pkg-config pangocairo --libs)',
129
- '<!@(pkg-config freetype2 --libs)'
130
- ],
131
- 'include_dirs': [
132
- '<!@(pkg-config cairo --cflags-only-I | sed s/-I//g)',
133
- '<!@(pkg-config libpng --cflags-only-I | sed s/-I//g)',
134
- '<!@(pkg-config pangocairo --cflags-only-I | sed s/-I//g)',
135
- '<!@(pkg-config freetype2 --cflags-only-I | sed s/-I//g)'
136
- ],
137
- 'cflags': ['-Wno-cast-function-type'],
138
- 'cflags!': ['-fno-exceptions'],
139
- 'cflags_cc!': ['-fno-exceptions']
140
- }],
141
- ['OS=="mac"', {
142
- 'cflags+': ['-fvisibility=hidden'],
143
- 'xcode_settings': {
144
- 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
145
- 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES'
146
- }
147
- }],
148
- ['with_jpeg=="true"', {
149
- 'defines': [
150
- 'HAVE_JPEG'
151
- ],
152
- 'conditions': [
153
- ['OS=="win"', {
154
- 'copies': [{
155
- 'destination': '<(PRODUCT_DIR)',
156
- 'files': [
157
- '<(jpeg_root)/bin/jpeg62.dll',
158
- ]
159
- }],
160
- 'include_dirs': [
161
- '<(jpeg_root)/include'
162
- ],
163
- 'libraries': [
164
- '-l<(jpeg_root)/lib/jpeg.lib',
165
- ]
166
- }, {
167
- 'include_dirs': [
168
- '<!@(pkg-config libjpeg --cflags-only-I | sed s/-I//g)'
169
- ],
170
- 'libraries': [
171
- '<!@(pkg-config libjpeg --libs)'
172
- ]
173
- }]
174
- ]
175
- }],
176
- ['with_gif=="true"', {
177
- 'defines': [
178
- 'HAVE_GIF'
179
- ],
180
- 'conditions': [
181
- ['OS=="win"', {
182
- 'libraries': [
183
- '-l<(GTK_Root)/lib/gif.lib'
184
- ]
185
- }, {
186
- 'include_dirs': [
187
- '/opt/homebrew/include'
188
- ],
189
- 'libraries': [
190
- '-L/opt/homebrew/lib',
191
- '-lgif'
192
- ]
193
- }]
194
- ]
195
- }],
196
- ['with_rsvg=="true"', {
197
- 'defines': [
198
- 'HAVE_RSVG'
199
- ],
200
- 'conditions': [
201
- ['OS=="win"', {
202
- 'copies': [{
203
- 'destination': '<(PRODUCT_DIR)',
204
- 'files': [
205
- '<(GTK_Root)/bin/librsvg-2-2.dll',
206
- '<(GTK_Root)/bin/libgdk_pixbuf-2.0-0.dll',
207
- '<(GTK_Root)/bin/libgio-2.0-0.dll',
208
- '<(GTK_Root)/bin/libcroco-0.6-3.dll',
209
- '<(GTK_Root)/bin/libgsf-1-114.dll',
210
- '<(GTK_Root)/bin/libxml2-2.dll'
211
- ]
212
- }],
213
- 'libraries': [
214
- '-l<(GTK_Root)/lib/librsvg-2-2.lib'
215
- ]
216
- }, {
217
- 'include_dirs': [
218
- '<!@(pkg-config librsvg-2.0 --cflags-only-I | sed s/-I//g)'
219
- ],
220
- 'libraries': [
221
- '<!@(pkg-config librsvg-2.0 --libs)'
222
- ]
223
- }]
224
- ]
225
- }]
226
- ]
227
- }
228
- ]
229
- }
package/browser.js DELETED
@@ -1,31 +0,0 @@
1
- /* globals document, ImageData */
2
-
3
- exports.createCanvas = function (width, height) {
4
- return Object.assign(document.createElement('canvas'), { width: width, height: height })
5
- }
6
-
7
- exports.createImageData = function (array, width, height) {
8
- // Browser implementation of ImageData looks at the number of arguments passed
9
- switch (arguments.length) {
10
- case 0: return new ImageData()
11
- case 1: return new ImageData(array)
12
- case 2: return new ImageData(array, width)
13
- default: return new ImageData(array, width, height)
14
- }
15
- }
16
-
17
- exports.loadImage = function (src, options) {
18
- return new Promise(function (resolve, reject) {
19
- const image = Object.assign(document.createElement('img'), options)
20
-
21
- function cleanup () {
22
- image.onload = null
23
- image.onerror = null
24
- }
25
-
26
- image.onload = function () { cleanup(); resolve(image) }
27
- image.onerror = function () { cleanup(); reject(new Error('Failed to load the image "' + src + '"')) }
28
-
29
- image.src = src
30
- })
31
- }