@@ -32,35 +32,41 @@ public class JXLCoder {
3232 }
3333
3434 /***
35+ - Parameter sampleSize: if image size larger than sampler then it will be resized to sample
3536 - Returns: Decoded JXL image if this is the valid one
3637 **/
3738 public static func decode( srcStream: InputStream ,
3839 sampleSize: CGSize = . zero,
39- pixelFormat: JXLPreferredPixelFormat = . optimal) throws -> JXLPlatformImage {
40- return try shared. decode ( srcStream, sampleSize: sampleSize, pixelFormat: pixelFormat)
40+ pixelFormat: JXLPreferredPixelFormat = . optimal,
41+ sampler: JxlSampler = . cubic) throws -> JXLPlatformImage {
42+ return try shared. decode ( srcStream, sampleSize: sampleSize, pixelFormat: pixelFormat, sampler: sampler)
4143 }
4244
4345 /***
46+ - Parameter sampleSize: if image size larger than sampler then it will be resized to sample
4447 - Returns: Decoded JXL image if this is the valid one
4548 **/
4649 public static func decode( url: URL ,
4750 sampleSize: CGSize = . zero,
48- pixelFormat: JXLPreferredPixelFormat = . optimal) throws -> JXLPlatformImage {
51+ pixelFormat: JXLPreferredPixelFormat = . optimal,
52+ sampler: JxlSampler = . cubic) throws -> JXLPlatformImage {
4953 guard let srcStream = InputStream ( url: url) else {
5054 throw NSError ( domain: " JXLCoder " , code: 500 ,
5155 userInfo: [ NSLocalizedDescriptionKey: " JXLCoder cannot open provided URL " ] )
5256 }
53- return try shared. decode ( srcStream, sampleSize: sampleSize, pixelFormat: pixelFormat)
57+ return try shared. decode ( srcStream, sampleSize: sampleSize, pixelFormat: pixelFormat, sampler : sampler )
5458 }
5559
5660 /***
61+ - Parameter sampleSize: if image size larger than sampler then it will be resized to sample
5762 - Returns: Decoded JXL image if this is the valid one
5863 **/
5964 public static func decode( data: Data ,
6065 sampleSize: CGSize = . zero,
61- pixelFormat: JXLPreferredPixelFormat = . optimal) throws -> JXLPlatformImage {
66+ pixelFormat: JXLPreferredPixelFormat = . optimal,
67+ sampler: JxlSampler = . cubic) throws -> JXLPlatformImage {
6268 let srcStream = InputStream ( data: data)
63- return try shared. decode ( srcStream, sampleSize: sampleSize, pixelFormat: pixelFormat)
69+ return try shared. decode ( srcStream, sampleSize: sampleSize, pixelFormat: pixelFormat, sampler : sampler )
6470 }
6571
6672 /***
0 commit comments