Skip to content

Commit a4fd578

Browse files
committed
fix scaler
1 parent bef2873 commit a4fd578

File tree

4 files changed

+89
-244
lines changed

4 files changed

+89
-244
lines changed

JxlCoder.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'JxlCoder'
3-
s.version = '1.3.5'
3+
s.version = '1.3.6'
44
s.summary = 'JXL coder for iOS and MacOS'
55
s.description = 'Provides support for JXL files in iOS and MacOS'
66
s.homepage = 'https://github.com/awxkee/jxl-coder-swift'

Sources/JxlCoder/JXLCoder.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public class JXLCoder {
5050
}
5151

5252
/***
53+
- Parameter scale: scale of UIImage
5354
- Parameter rescale: image will be rescaled to provided size
5455
- Returns: Decoded JXL image if this is the valid one
5556
**/
@@ -62,6 +63,7 @@ public class JXLCoder {
6263
}
6364

6465
/***
66+
- Parameter scale: scale of UIImage
6567
- Parameter sampleSize: if image size larger than sampler then it will be resized to sample
6668
- Returns: Decoded JXL image if this is the valid one
6769
**/
@@ -78,6 +80,7 @@ public class JXLCoder {
7880
}
7981

8082
/***
83+
- Parameter scale: scale of UIImage
8184
- Parameter rescale: image will be rescaled to provided size
8285
- Returns: Decoded JXL image if this is the valid one
8386
**/

Sources/jxlc/ScaleInterpolator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ inline T LanczosWindow(T x, const T a) {
218218

219219
template <typename T>
220220
inline T HannWindow(T x, const T length) {
221-
const float size = length * 2 - 1;
221+
const float size = length * 2 + 1;
222222
if (abs(x) <= size) {
223-
return 0.5f * (1 - fastCos(T(2)*T(M_PI) * size / length));
223+
return 0.5f * (1 - fastCos(T(2)*T(M_PI) * x / length));
224224
}
225225
return T(0);
226226
}

0 commit comments

Comments
 (0)