@img/sharp-libvips-dev 0.0.1 → 0.0.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 (103) hide show
  1. package/README.md +2 -2
  2. package/cplusplus/VConnection.cpp +54 -54
  3. package/cplusplus/VError.cpp +20 -18
  4. package/cplusplus/VImage.cpp +636 -589
  5. package/cplusplus/VInterpolate.cpp +22 -22
  6. package/cplusplus/VRegion.cpp +4 -4
  7. package/cplusplus/vips-operators.cpp +2326 -2301
  8. package/include/aom/aom_codec.h +10 -6
  9. package/include/aom/aom_decoder.h +1 -1
  10. package/include/aom/aom_encoder.h +9 -2
  11. package/include/aom/aomcx.h +72 -3
  12. package/include/cairo/cairo-ft.h +1 -1
  13. package/include/cairo/cairo-gobject.h +8 -0
  14. package/include/cairo/cairo-svg.h +3 -3
  15. package/include/cairo/cairo-version.h +2 -2
  16. package/include/cairo/cairo.h +91 -24
  17. package/include/harfbuzz/hb-version.h +2 -2
  18. package/include/hwy/aligned_allocator.h +211 -0
  19. package/include/hwy/base.h +1517 -0
  20. package/include/hwy/cache_control.h +108 -0
  21. package/include/hwy/detect_compiler_arch.h +281 -0
  22. package/include/hwy/detect_targets.h +644 -0
  23. package/include/hwy/foreach_target.h +340 -0
  24. package/include/hwy/highway.h +435 -0
  25. package/include/hwy/highway_export.h +74 -0
  26. package/include/hwy/nanobenchmark.h +171 -0
  27. package/include/hwy/ops/arm_neon-inl.h +8913 -0
  28. package/include/hwy/ops/arm_sve-inl.h +5105 -0
  29. package/include/hwy/ops/emu128-inl.h +2811 -0
  30. package/include/hwy/ops/generic_ops-inl.h +4745 -0
  31. package/include/hwy/ops/ppc_vsx-inl.h +5716 -0
  32. package/include/hwy/ops/rvv-inl.h +5070 -0
  33. package/include/hwy/ops/scalar-inl.h +1995 -0
  34. package/include/hwy/ops/set_macros-inl.h +578 -0
  35. package/include/hwy/ops/shared-inl.h +539 -0
  36. package/include/hwy/ops/tuple-inl.h +125 -0
  37. package/include/hwy/ops/wasm_128-inl.h +5917 -0
  38. package/include/hwy/ops/x86_128-inl.h +11173 -0
  39. package/include/hwy/ops/x86_256-inl.h +7529 -0
  40. package/include/hwy/ops/x86_512-inl.h +6849 -0
  41. package/include/hwy/per_target.h +44 -0
  42. package/include/hwy/print-inl.h +62 -0
  43. package/include/hwy/print.h +75 -0
  44. package/include/hwy/robust_statistics.h +148 -0
  45. package/include/hwy/targets.h +338 -0
  46. package/include/hwy/timer-inl.h +200 -0
  47. package/include/hwy/timer.h +55 -0
  48. package/include/jconfig.h +2 -2
  49. package/include/jpeglib.h +3 -2
  50. package/include/libheif/heif.h +443 -377
  51. package/include/libheif/heif_cxx.h +4 -1
  52. package/include/libheif/heif_plugin.h +1 -1
  53. package/include/libheif/heif_properties.h +138 -0
  54. package/include/libheif/heif_regions.h +866 -0
  55. package/include/libheif/heif_version.h +3 -3
  56. package/include/vips/VConnection8.h +43 -49
  57. package/include/vips/VError8.h +27 -24
  58. package/include/vips/VImage8.h +4861 -4597
  59. package/include/vips/VInterpolate8.h +24 -27
  60. package/include/vips/VRegion8.h +32 -33
  61. package/include/vips/arithmetic.h +169 -169
  62. package/include/vips/basic.h +33 -33
  63. package/include/vips/buf.h +56 -54
  64. package/include/vips/colour.h +95 -95
  65. package/include/vips/connection.h +190 -193
  66. package/include/vips/conversion.h +91 -91
  67. package/include/vips/convolution.h +36 -30
  68. package/include/vips/create.h +63 -63
  69. package/include/vips/dbuf.h +35 -37
  70. package/include/vips/debug.h +65 -33
  71. package/include/vips/draw.h +41 -41
  72. package/include/vips/enumtypes.h +54 -51
  73. package/include/vips/error.h +63 -63
  74. package/include/vips/foreign.h +263 -223
  75. package/include/vips/format.h +48 -48
  76. package/include/vips/freqfilt.h +22 -22
  77. package/include/vips/gate.h +55 -47
  78. package/include/vips/generate.h +34 -34
  79. package/include/vips/header.h +111 -101
  80. package/include/vips/histogram.h +28 -28
  81. package/include/vips/image.h +213 -213
  82. package/include/vips/interpolate.h +40 -41
  83. package/include/vips/memory.h +61 -52
  84. package/include/vips/morphology.h +24 -24
  85. package/include/vips/mosaicing.h +32 -33
  86. package/include/vips/object.h +371 -357
  87. package/include/vips/operation.h +68 -67
  88. package/include/vips/private.h +76 -76
  89. package/include/vips/rect.h +26 -26
  90. package/include/vips/region.h +92 -92
  91. package/include/vips/resample.h +38 -38
  92. package/include/vips/sbuf.h +53 -54
  93. package/include/vips/semaphore.h +24 -24
  94. package/include/vips/thread.h +30 -27
  95. package/include/vips/threadpool.h +48 -49
  96. package/include/vips/transform.h +39 -39
  97. package/include/vips/type.h +90 -85
  98. package/include/vips/util.h +274 -229
  99. package/include/vips/vector.h +24 -144
  100. package/include/vips/version.h +9 -9
  101. package/include/vips/vips.h +41 -40
  102. package/package.json +1 -1
  103. package/versions.json +7 -7
@@ -0,0 +1,200 @@
1
+ // Copyright 2023 Google LLC
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ // High-resolution and high-precision timer
17
+
18
+ // Per-target include guard
19
+ #if defined(HIGHWAY_HWY_TIMER_INL_H_) == defined(HWY_TARGET_TOGGLE)
20
+ #ifdef HIGHWAY_HWY_TIMER_INL_H_
21
+ #undef HIGHWAY_HWY_TIMER_INL_H_
22
+ #else
23
+ #define HIGHWAY_HWY_TIMER_INL_H_
24
+ #endif
25
+
26
+ #include "hwy/highway.h"
27
+ #include "hwy/timer.h"
28
+
29
+ #if defined(_WIN32) || defined(_WIN64)
30
+ #ifndef NOMINMAX
31
+ #define NOMINMAX
32
+ #endif // NOMINMAX
33
+ #include <windows.h>
34
+ #endif
35
+
36
+ #if defined(__APPLE__)
37
+ #include <mach/mach.h>
38
+ #include <mach/mach_time.h>
39
+ #endif
40
+
41
+ #if defined(__HAIKU__)
42
+ #include <OS.h>
43
+ #endif
44
+
45
+ #if HWY_ARCH_PPC && defined(__GLIBC__) && defined(__powerpc64__)
46
+ #include <sys/platform/ppc.h> // NOLINT __ppc_get_timebase_freq
47
+ #endif
48
+
49
+ #if HWY_ARCH_X86 && HWY_COMPILER_MSVC
50
+ #include <intrin.h>
51
+ #endif
52
+
53
+ #include <time.h> // clock_gettime
54
+
55
+ HWY_BEFORE_NAMESPACE();
56
+ namespace hwy {
57
+ namespace HWY_NAMESPACE {
58
+ namespace timer {
59
+
60
+ // Ticks := platform-specific timer values (CPU cycles on x86). Must be
61
+ // unsigned to guarantee wraparound on overflow.
62
+ using Ticks = uint64_t;
63
+
64
+ // Start/Stop return absolute timestamps and must be placed immediately before
65
+ // and after the region to measure. We provide separate Start/Stop functions
66
+ // because they use different fences.
67
+ //
68
+ // Background: RDTSC is not 'serializing'; earlier instructions may complete
69
+ // after it, and/or later instructions may complete before it. 'Fences' ensure
70
+ // regions' elapsed times are independent of such reordering. The only
71
+ // documented unprivileged serializing instruction is CPUID, which acts as a
72
+ // full fence (no reordering across it in either direction). Unfortunately
73
+ // the latency of CPUID varies wildly (perhaps made worse by not initializing
74
+ // its EAX input). Because it cannot reliably be deducted from the region's
75
+ // elapsed time, it must not be included in the region to measure (i.e.
76
+ // between the two RDTSC).
77
+ //
78
+ // The newer RDTSCP is sometimes described as serializing, but it actually
79
+ // only serves as a half-fence with release semantics. Although all
80
+ // instructions in the region will complete before the final timestamp is
81
+ // captured, subsequent instructions may leak into the region and increase the
82
+ // elapsed time. Inserting another fence after the final RDTSCP would prevent
83
+ // such reordering without affecting the measured region.
84
+ //
85
+ // Fortunately, such a fence exists. The LFENCE instruction is only documented
86
+ // to delay later loads until earlier loads are visible. However, Intel's
87
+ // reference manual says it acts as a full fence (waiting until all earlier
88
+ // instructions have completed, and delaying later instructions until it
89
+ // completes). AMD assigns the same behavior to MFENCE.
90
+ //
91
+ // We need a fence before the initial RDTSC to prevent earlier instructions
92
+ // from leaking into the region, and arguably another after RDTSC to avoid
93
+ // region instructions from completing before the timestamp is recorded.
94
+ // When surrounded by fences, the additional RDTSCP half-fence provides no
95
+ // benefit, so the initial timestamp can be recorded via RDTSC, which has
96
+ // lower overhead than RDTSCP because it does not read TSC_AUX. In summary,
97
+ // we define Start = LFENCE/RDTSC/LFENCE; Stop = RDTSCP/LFENCE.
98
+ //
99
+ // Using Start+Start leads to higher variance and overhead than Stop+Stop.
100
+ // However, Stop+Stop includes an LFENCE in the region measurements, which
101
+ // adds a delay dependent on earlier loads. The combination of Start+Stop
102
+ // is faster than Start+Start and more consistent than Stop+Stop because
103
+ // the first LFENCE already delayed subsequent loads before the measured
104
+ // region. This combination seems not to have been considered in prior work:
105
+ // http://akaros.cs.berkeley.edu/lxr/akaros/kern/arch/x86/rdtsc_test.c
106
+ //
107
+ // Note: performance counters can measure 'exact' instructions-retired or
108
+ // (unhalted) cycle counts. The RDPMC instruction is not serializing and also
109
+ // requires fences. Unfortunately, it is not accessible on all OSes and we
110
+ // prefer to avoid kernel-mode drivers. Performance counters are also affected
111
+ // by several under/over-count errata, so we use the TSC instead.
112
+
113
+ // Returns a 64-bit timestamp in unit of 'ticks'; to convert to seconds,
114
+ // divide by InvariantTicksPerSecond.
115
+ inline Ticks Start() {
116
+ Ticks t;
117
+ #if HWY_ARCH_PPC && defined(__GLIBC__) && defined(__powerpc64__)
118
+ asm volatile("mfspr %0, %1" : "=r"(t) : "i"(268));
119
+ #elif HWY_ARCH_ARM_A64 && !HWY_COMPILER_MSVC
120
+ // pmccntr_el0 is privileged but cntvct_el0 is accessible in Linux and QEMU.
121
+ asm volatile("mrs %0, cntvct_el0" : "=r"(t));
122
+ #elif HWY_ARCH_X86 && HWY_COMPILER_MSVC
123
+ _ReadWriteBarrier();
124
+ _mm_lfence();
125
+ _ReadWriteBarrier();
126
+ t = __rdtsc();
127
+ _ReadWriteBarrier();
128
+ _mm_lfence();
129
+ _ReadWriteBarrier();
130
+ #elif HWY_ARCH_X86_64
131
+ asm volatile(
132
+ "lfence\n\t"
133
+ "rdtsc\n\t"
134
+ "shl $32, %%rdx\n\t"
135
+ "or %%rdx, %0\n\t"
136
+ "lfence"
137
+ : "=a"(t)
138
+ :
139
+ // "memory" avoids reordering. rdx = TSC >> 32.
140
+ // "cc" = flags modified by SHL.
141
+ : "rdx", "memory", "cc");
142
+ #elif HWY_ARCH_RVV
143
+ asm volatile("rdtime %0" : "=r"(t));
144
+ #elif defined(_WIN32) || defined(_WIN64)
145
+ LARGE_INTEGER counter;
146
+ (void)QueryPerformanceCounter(&counter);
147
+ t = counter.QuadPart;
148
+ #elif defined(__APPLE__)
149
+ t = mach_absolute_time();
150
+ #elif defined(__HAIKU__)
151
+ t = system_time_nsecs(); // since boot
152
+ #else // POSIX
153
+ timespec ts;
154
+ clock_gettime(CLOCK_MONOTONIC, &ts);
155
+ t = static_cast<Ticks>(ts.tv_sec * 1000000000LL + ts.tv_nsec);
156
+ #endif
157
+ return t;
158
+ }
159
+
160
+ // WARNING: on x86, caller must check HasRDTSCP before using this!
161
+ inline Ticks Stop() {
162
+ uint64_t t;
163
+ #if HWY_ARCH_PPC && defined(__GLIBC__) && defined(__powerpc64__)
164
+ asm volatile("mfspr %0, %1" : "=r"(t) : "i"(268));
165
+ #elif HWY_ARCH_ARM_A64 && !HWY_COMPILER_MSVC
166
+ // pmccntr_el0 is privileged but cntvct_el0 is accessible in Linux and QEMU.
167
+ asm volatile("mrs %0, cntvct_el0" : "=r"(t));
168
+ #elif HWY_ARCH_X86 && HWY_COMPILER_MSVC
169
+ _ReadWriteBarrier();
170
+ unsigned aux;
171
+ t = __rdtscp(&aux);
172
+ _ReadWriteBarrier();
173
+ _mm_lfence();
174
+ _ReadWriteBarrier();
175
+ #elif HWY_ARCH_X86_64
176
+ // Use inline asm because __rdtscp generates code to store TSC_AUX (ecx).
177
+ asm volatile(
178
+ "rdtscp\n\t"
179
+ "shl $32, %%rdx\n\t"
180
+ "or %%rdx, %0\n\t"
181
+ "lfence"
182
+ : "=a"(t)
183
+ :
184
+ // "memory" avoids reordering. rcx = TSC_AUX. rdx = TSC >> 32.
185
+ // "cc" = flags modified by SHL.
186
+ : "rcx", "rdx", "memory", "cc");
187
+ #else
188
+ t = Start();
189
+ #endif
190
+ return t;
191
+ }
192
+
193
+ } // namespace timer
194
+
195
+ // NOLINTNEXTLINE(google-readability-namespace-comments)
196
+ } // namespace HWY_NAMESPACE
197
+ } // namespace hwy
198
+ HWY_AFTER_NAMESPACE();
199
+
200
+ #endif // per-target include guard
@@ -0,0 +1,55 @@
1
+ // Copyright 2023 Google LLC
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ #ifndef HIGHWAY_HWY_TIMER_H_
17
+ #define HIGHWAY_HWY_TIMER_H_
18
+
19
+ // Platform-specific timer functions. Provides Now() and functions for
20
+ // interpreting and converting the timer-inl.h Ticks.
21
+
22
+ #include <stdint.h>
23
+
24
+ #include "hwy/highway_export.h"
25
+
26
+ namespace hwy {
27
+ namespace platform {
28
+
29
+ // Returns current timestamp [in seconds] relative to an unspecified origin.
30
+ // Features: monotonic (no negative elapsed time), steady (unaffected by system
31
+ // time changes), high-resolution (on the order of microseconds).
32
+ // Uses InvariantTicksPerSecond and the baseline version of timer::Start().
33
+ HWY_DLLEXPORT double Now();
34
+
35
+ // Functions for use with timer-inl.h:
36
+
37
+ // Returns whether it is safe to call timer::Stop without executing an illegal
38
+ // instruction; if false, fills cpu100 (a pointer to a 100 character buffer)
39
+ // with the CPU brand string or an empty string if unknown.
40
+ HWY_DLLEXPORT bool HaveTimerStop(char* cpu100);
41
+
42
+ // Returns tick rate, useful for converting timer::Ticks to seconds. Invariant
43
+ // means the tick counter frequency is independent of CPU throttling or sleep.
44
+ // This call may be expensive, callers should cache the result.
45
+ HWY_DLLEXPORT double InvariantTicksPerSecond();
46
+
47
+ // Returns ticks elapsed in back to back timer calls, i.e. a function of the
48
+ // timer resolution (minimum measurable difference) and overhead.
49
+ // This call is expensive, callers should cache the result.
50
+ HWY_DLLEXPORT uint64_t TimerResolution();
51
+
52
+ } // namespace platform
53
+ } // namespace hwy
54
+
55
+ #endif // HIGHWAY_HWY_TIMER_H_
package/include/jconfig.h CHANGED
@@ -4,10 +4,10 @@
4
4
  #define JPEG_LIB_VERSION 80
5
5
 
6
6
  /* libjpeg-turbo version */
7
- #define LIBJPEG_TURBO_VERSION 4.1.4
7
+ #define LIBJPEG_TURBO_VERSION 4.1.5
8
8
 
9
9
  /* libjpeg-turbo version in integer form */
10
- #define LIBJPEG_TURBO_VERSION_NUMBER 4001004
10
+ #define LIBJPEG_TURBO_VERSION_NUMBER 4001005
11
11
 
12
12
  /* Support arithmetic encoding */
13
13
  #define C_ARITH_CODING_SUPPORTED 1
package/include/jpeglib.h CHANGED
@@ -5,7 +5,7 @@
5
5
  * Copyright (C) 1991-1998, Thomas G. Lane.
6
6
  * Modified 2002-2009 by Guido Vollbeding.
7
7
  * libjpeg-turbo Modifications:
8
- * Copyright (C) 2009-2011, 2013-2014, 2016-2017, 2020, D. R. Commander.
8
+ * Copyright (C) 2009-2011, 2013-2014, 2016-2017, 2020, 2023, D. R. Commander.
9
9
  * Copyright (C) 2015, Google, Inc.
10
10
  * mozjpeg Modifications:
11
11
  * Copyright (C) 2014, Mozilla Corporation.
@@ -240,7 +240,8 @@ typedef enum {
240
240
  JCS_EXT_BGRA, /* blue/green/red/alpha */
241
241
  JCS_EXT_ABGR, /* alpha/blue/green/red */
242
242
  JCS_EXT_ARGB, /* alpha/red/green/blue */
243
- JCS_RGB565 /* 5-bit red/6-bit green/5-bit blue */
243
+ JCS_RGB565 /* 5-bit red/6-bit green/5-bit blue
244
+ [decompression only] */
244
245
  } J_COLOR_SPACE;
245
246
 
246
247
  /* DCT/IDCT algorithm options. */