sharp 0.25.4 → 0.26.3
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/binding.gyp +54 -67
- package/install/dll-copy.js +3 -1
- package/install/libvips.js +28 -13
- package/lib/constructor.js +16 -2
- package/lib/input.js +15 -6
- package/lib/libvips.js +1 -7
- package/lib/operation.js +99 -0
- package/lib/output.js +96 -7
- package/lib/platform.js +2 -1
- package/lib/resize.js +2 -1
- package/lib/utility.js +22 -1
- package/package.json +22 -16
- package/src/common.cc +122 -57
- package/src/common.h +23 -3
- package/src/libvips/cplusplus/VImage.cpp +451 -450
- package/src/libvips/cplusplus/vips-operators.cpp +117 -1
- package/src/metadata.cc +1 -1
- package/src/operations.cc +0 -23
- package/src/operations.h +0 -10
- package/src/pipeline.cc +100 -16
- package/src/pipeline.h +24 -2
- package/src/stats.cc +25 -6
- package/src/stats.h +7 -1
package/src/common.h
CHANGED
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
|
|
25
25
|
// Verify platform and compiler compatibility
|
|
26
26
|
|
|
27
|
-
#if (VIPS_MAJOR_VERSION < 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION <
|
|
28
|
-
#error "libvips version 8.
|
|
27
|
+
#if (VIPS_MAJOR_VERSION < 8 || (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 10))
|
|
28
|
+
#error "libvips version 8.10.0+ is required - please see https://sharp.pixelplumbing.com/install"
|
|
29
29
|
#endif
|
|
30
30
|
|
|
31
31
|
#if ((!defined(__clang__)) && defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)))
|
|
@@ -88,10 +88,12 @@ namespace sharp {
|
|
|
88
88
|
std::string AttrAsStr(Napi::Object obj, std::string attr);
|
|
89
89
|
uint32_t AttrAsUint32(Napi::Object obj, std::string attr);
|
|
90
90
|
int32_t AttrAsInt32(Napi::Object obj, std::string attr);
|
|
91
|
+
int32_t AttrAsInt32(Napi::Object obj, unsigned int const attr);
|
|
91
92
|
double AttrAsDouble(Napi::Object obj, std::string attr);
|
|
92
93
|
double AttrAsDouble(Napi::Object obj, unsigned int const attr);
|
|
93
94
|
bool AttrAsBool(Napi::Object obj, std::string attr);
|
|
94
|
-
std::vector<double>
|
|
95
|
+
std::vector<double> AttrAsVectorOfDouble(Napi::Object obj, std::string attr);
|
|
96
|
+
std::vector<int32_t> AttrAsInt32Vector(Napi::Object obj, std::string attr);
|
|
95
97
|
|
|
96
98
|
// Create an InputDescriptor instance from a Napi::Object describing an input image
|
|
97
99
|
InputDescriptor* CreateInputDescriptor(Napi::Object input);
|
|
@@ -109,6 +111,7 @@ namespace sharp {
|
|
|
109
111
|
OPENSLIDE,
|
|
110
112
|
PPM,
|
|
111
113
|
FITS,
|
|
114
|
+
EXR,
|
|
112
115
|
VIPS,
|
|
113
116
|
RAW,
|
|
114
117
|
UNKNOWN,
|
|
@@ -125,6 +128,7 @@ namespace sharp {
|
|
|
125
128
|
bool IsJpeg(std::string const &str);
|
|
126
129
|
bool IsPng(std::string const &str);
|
|
127
130
|
bool IsWebp(std::string const &str);
|
|
131
|
+
bool IsGif(std::string const &str);
|
|
128
132
|
bool IsTiff(std::string const &str);
|
|
129
133
|
bool IsHeic(std::string const &str);
|
|
130
134
|
bool IsHeif(std::string const &str);
|
|
@@ -184,6 +188,12 @@ namespace sharp {
|
|
|
184
188
|
*/
|
|
185
189
|
VImage RemoveExifOrientation(VImage image);
|
|
186
190
|
|
|
191
|
+
/*
|
|
192
|
+
Set animation properties if necessary.
|
|
193
|
+
Non-provided properties will be loaded from image.
|
|
194
|
+
*/
|
|
195
|
+
VImage SetAnimationProperties(VImage image, int pageHeight, std::vector<int> delay, int loop);
|
|
196
|
+
|
|
187
197
|
/*
|
|
188
198
|
Does this image have a non-default density?
|
|
189
199
|
*/
|
|
@@ -271,6 +281,16 @@ namespace sharp {
|
|
|
271
281
|
*/
|
|
272
282
|
std::tuple<VImage, std::vector<double>> ApplyAlpha(VImage image, std::vector<double> colour);
|
|
273
283
|
|
|
284
|
+
/*
|
|
285
|
+
Removes alpha channel, if any.
|
|
286
|
+
*/
|
|
287
|
+
VImage RemoveAlpha(VImage image);
|
|
288
|
+
|
|
289
|
+
/*
|
|
290
|
+
Ensures alpha channel, if missing.
|
|
291
|
+
*/
|
|
292
|
+
VImage EnsureAlpha(VImage image);
|
|
293
|
+
|
|
274
294
|
} // namespace sharp
|
|
275
295
|
|
|
276
296
|
#endif // SRC_COMMON_H_
|