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/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 < 9))
28
- #error "libvips version 8.9.1+ is required - please see https://sharp.pixelplumbing.com/install"
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> AttrAsRgba(Napi::Object obj, std::string attr);
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_