sharp 0.29.3 → 0.30.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.
- package/README.md +5 -5
- package/install/libvips.js +39 -8
- package/lib/composite.js +0 -1
- package/lib/constructor.js +10 -3
- package/lib/input.js +21 -4
- package/lib/libvips.js +24 -5
- package/lib/operation.js +14 -1
- package/lib/output.js +129 -69
- package/lib/platform.js +1 -1
- package/lib/resize.js +19 -0
- package/lib/sharp.js +2 -1
- package/lib/utility.js +22 -4
- package/package.json +27 -12
- package/src/common.cc +102 -19
- package/src/common.h +29 -5
- package/src/libvips/cplusplus/VImage.cpp +34 -16
- package/src/libvips/cplusplus/vips-operators.cpp +29 -1
- package/src/metadata.cc +6 -0
- package/src/metadata.h +1 -0
- package/src/operations.cc +94 -0
- package/src/operations.h +12 -0
- package/src/pipeline.cc +296 -270
- package/src/pipeline.h +17 -19
package/src/pipeline.h
CHANGED
|
@@ -27,14 +27,6 @@
|
|
|
27
27
|
|
|
28
28
|
Napi::Value pipeline(const Napi::CallbackInfo& info);
|
|
29
29
|
|
|
30
|
-
enum class Canvas {
|
|
31
|
-
CROP,
|
|
32
|
-
EMBED,
|
|
33
|
-
MAX,
|
|
34
|
-
MIN,
|
|
35
|
-
IGNORE_ASPECT
|
|
36
|
-
};
|
|
37
|
-
|
|
38
30
|
struct Composite {
|
|
39
31
|
sharp::InputDescriptor *input;
|
|
40
32
|
VipsBlendMode mode;
|
|
@@ -75,7 +67,7 @@ struct PipelineBaton {
|
|
|
75
67
|
int width;
|
|
76
68
|
int height;
|
|
77
69
|
int channels;
|
|
78
|
-
Canvas canvas;
|
|
70
|
+
sharp::Canvas canvas;
|
|
79
71
|
int position;
|
|
80
72
|
std::vector<double> resizeBackground;
|
|
81
73
|
bool hasCropOffset;
|
|
@@ -127,13 +119,14 @@ struct PipelineBaton {
|
|
|
127
119
|
int extendRight;
|
|
128
120
|
std::vector<double> extendBackground;
|
|
129
121
|
bool withoutEnlargement;
|
|
122
|
+
bool withoutReduction;
|
|
130
123
|
std::vector<double> affineMatrix;
|
|
131
124
|
std::vector<double> affineBackground;
|
|
132
125
|
double affineIdx;
|
|
133
126
|
double affineIdy;
|
|
134
127
|
double affineOdx;
|
|
135
128
|
double affineOdy;
|
|
136
|
-
|
|
129
|
+
std::string affineInterpolator;
|
|
137
130
|
int jpegQuality;
|
|
138
131
|
bool jpegProgressive;
|
|
139
132
|
std::string jpegChromaSubsampling;
|
|
@@ -147,6 +140,7 @@ struct PipelineBaton {
|
|
|
147
140
|
bool pngAdaptiveFiltering;
|
|
148
141
|
bool pngPalette;
|
|
149
142
|
int pngQuality;
|
|
143
|
+
int pngEffort;
|
|
150
144
|
int pngBitdepth;
|
|
151
145
|
double pngDither;
|
|
152
146
|
int jp2Quality;
|
|
@@ -159,7 +153,10 @@ struct PipelineBaton {
|
|
|
159
153
|
bool webpNearLossless;
|
|
160
154
|
bool webpLossless;
|
|
161
155
|
bool webpSmartSubsample;
|
|
162
|
-
int
|
|
156
|
+
int webpEffort;
|
|
157
|
+
int gifBitdepth;
|
|
158
|
+
int gifEffort;
|
|
159
|
+
double gifDither;
|
|
163
160
|
int tiffQuality;
|
|
164
161
|
VipsForeignTiffCompression tiffCompression;
|
|
165
162
|
VipsForeignTiffPredictor tiffPredictor;
|
|
@@ -170,9 +167,10 @@ struct PipelineBaton {
|
|
|
170
167
|
int tiffTileWidth;
|
|
171
168
|
double tiffXres;
|
|
172
169
|
double tiffYres;
|
|
170
|
+
VipsForeignTiffResunit tiffResolutionUnit;
|
|
173
171
|
int heifQuality;
|
|
174
172
|
VipsForeignHeifCompression heifCompression;
|
|
175
|
-
int
|
|
173
|
+
int heifEffort;
|
|
176
174
|
std::string heifChromaSubsampling;
|
|
177
175
|
bool heifLossless;
|
|
178
176
|
VipsBandFormat rawDepth;
|
|
@@ -196,7 +194,6 @@ struct PipelineBaton {
|
|
|
196
194
|
double ensureAlpha;
|
|
197
195
|
VipsInterpretation colourspaceInput;
|
|
198
196
|
VipsInterpretation colourspace;
|
|
199
|
-
int pageHeight;
|
|
200
197
|
std::vector<int> delay;
|
|
201
198
|
int loop;
|
|
202
199
|
int tileSize;
|
|
@@ -217,7 +214,7 @@ struct PipelineBaton {
|
|
|
217
214
|
topOffsetPre(-1),
|
|
218
215
|
topOffsetPost(-1),
|
|
219
216
|
channels(0),
|
|
220
|
-
canvas(Canvas::CROP),
|
|
217
|
+
canvas(sharp::Canvas::CROP),
|
|
221
218
|
position(0),
|
|
222
219
|
resizeBackground{ 0.0, 0.0, 0.0, 255.0 },
|
|
223
220
|
hasCropOffset(false),
|
|
@@ -264,13 +261,14 @@ struct PipelineBaton {
|
|
|
264
261
|
extendRight(0),
|
|
265
262
|
extendBackground{ 0.0, 0.0, 0.0, 255.0 },
|
|
266
263
|
withoutEnlargement(false),
|
|
264
|
+
withoutReduction(false),
|
|
267
265
|
affineMatrix{ 1.0, 0.0, 0.0, 1.0 },
|
|
268
266
|
affineBackground{ 0.0, 0.0, 0.0, 255.0 },
|
|
269
267
|
affineIdx(0),
|
|
270
268
|
affineIdy(0),
|
|
271
269
|
affineOdx(0),
|
|
272
270
|
affineOdy(0),
|
|
273
|
-
affineInterpolator(
|
|
271
|
+
affineInterpolator("bicubic"),
|
|
274
272
|
jpegQuality(80),
|
|
275
273
|
jpegProgressive(false),
|
|
276
274
|
jpegChromaSubsampling("4:2:0"),
|
|
@@ -284,6 +282,7 @@ struct PipelineBaton {
|
|
|
284
282
|
pngAdaptiveFiltering(false),
|
|
285
283
|
pngPalette(false),
|
|
286
284
|
pngQuality(100),
|
|
285
|
+
pngEffort(7),
|
|
287
286
|
pngBitdepth(8),
|
|
288
287
|
pngDither(1.0),
|
|
289
288
|
jp2Quality(80),
|
|
@@ -296,7 +295,7 @@ struct PipelineBaton {
|
|
|
296
295
|
webpNearLossless(false),
|
|
297
296
|
webpLossless(false),
|
|
298
297
|
webpSmartSubsample(false),
|
|
299
|
-
|
|
298
|
+
webpEffort(4),
|
|
300
299
|
tiffQuality(80),
|
|
301
300
|
tiffCompression(VIPS_FOREIGN_TIFF_COMPRESSION_JPEG),
|
|
302
301
|
tiffPredictor(VIPS_FOREIGN_TIFF_PREDICTOR_HORIZONTAL),
|
|
@@ -307,9 +306,10 @@ struct PipelineBaton {
|
|
|
307
306
|
tiffTileWidth(256),
|
|
308
307
|
tiffXres(1.0),
|
|
309
308
|
tiffYres(1.0),
|
|
309
|
+
tiffResolutionUnit(VIPS_FOREIGN_TIFF_RESUNIT_INCH),
|
|
310
310
|
heifQuality(50),
|
|
311
311
|
heifCompression(VIPS_FOREIGN_HEIF_COMPRESSION_AV1),
|
|
312
|
-
|
|
312
|
+
heifEffort(4),
|
|
313
313
|
heifChromaSubsampling("4:4:4"),
|
|
314
314
|
heifLossless(false),
|
|
315
315
|
rawDepth(VIPS_FORMAT_UCHAR),
|
|
@@ -329,8 +329,6 @@ struct PipelineBaton {
|
|
|
329
329
|
ensureAlpha(-1.0),
|
|
330
330
|
colourspaceInput(VIPS_INTERPRETATION_LAST),
|
|
331
331
|
colourspace(VIPS_INTERPRETATION_LAST),
|
|
332
|
-
pageHeight(0),
|
|
333
|
-
delay{-1},
|
|
334
332
|
loop(-1),
|
|
335
333
|
tileSize(256),
|
|
336
334
|
tileOverlap(0),
|