Skip to content

Commit 3652cf4

Browse files
committed
improve scaler
1 parent 40c3502 commit 3652cf4

File tree

5 files changed

+164
-140
lines changed

5 files changed

+164
-140
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.2.1'
3+
s.version = '1.2.2'
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/jxlc/JxlInternalCoder.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,12 @@ typedef NS_ENUM(NSInteger, JxlSampler) {
4949
kNearestNeighbor NS_SWIFT_NAME(nearestNeighbor),
5050
kBilinear NS_SWIFT_NAME(bilinear),
5151
kCubic NS_SWIFT_NAME(cubic),
52+
kBSpline NS_SWIFT_NAME(bSpline),
5253
kMitchell NS_SWIFT_NAME(mitchell),
5354
kLanczos NS_SWIFT_NAME(lanczos),
54-
kCatmullRom NS_SWIFT_NAME(catmullRom)
55+
kCatmullRom NS_SWIFT_NAME(catmullRom),
56+
kHermite NS_SWIFT_NAME(hermite),
57+
kHann NS_SWIFT_NAME(hann)
5558
};
5659

5760
@interface JxlInternalCoder: NSObject

Sources/jxlc/JxlInternalCoder.mm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,15 @@ - (nullable JXLSystemImage *)decode:(nonnull NSInputStream *)inputStream
290290
case kCatmullRom:
291291
xSampler = catmullRom;
292292
break;
293+
case kHermite:
294+
xSampler = hermite;
295+
break;
296+
case kBSpline:
297+
xSampler = bSpline;
298+
break;
299+
case kHann:
300+
xSampler = hann;
301+
break;
293302
}
294303

295304
auto scaleResult = [RgbaScaler scaleData:outputData width:(int)xSize height:(int)ySize

Sources/jxlc/XScaler.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ enum XSampler {
2020
mitchell = 4,
2121
lanczos = 5,
2222
catmullRom = 6,
23+
hermite = 7,
24+
bSpline = 8,
25+
hann = 9
2326
};
2427

2528
void scaleImageFloat16(uint16_t* input,

0 commit comments

Comments
 (0)