@@ -206,22 +206,23 @@ class MainActivity : ComponentActivity() {
206206 val largeImageSize = JxlCoder .getSize(buffer4)
207207 if (largeImageSize != null ) {
208208 val decodingTime = measureTimeMillis {
209- val srcImage = JxlCoder .decode(
210- buffer4,
211- preferredColorConfig = PreferredColorConfig .HARDWARE ,
212- com.awxkee.jxlcoder.ScaleMode .FIT ,
213- toneMapper = JxlToneMapper .REC2408 ,
214- )
215-
216- // Resizable version
217- // val srcImage = JxlCoder.decodeSampled(
209+ // val srcImage = JxlCoder.decode(
218210// buffer4,
219- // width = largeImageSize.width / 2,
220- // height = largeImageSize.height / 2,
221211// preferredColorConfig = PreferredColorConfig.HARDWARE,
222212// com.awxkee.jxlcoder.ScaleMode.FIT,
223213// toneMapper = JxlToneMapper.REC2408,
224214// )
215+
216+ // Resizable version
217+ val srcImage = JxlCoder .decodeSampled(
218+ buffer4,
219+ width = largeImageSize.width / 2 ,
220+ height = largeImageSize.height / 2 ,
221+ preferredColorConfig = PreferredColorConfig .HARDWARE ,
222+ com.awxkee.jxlcoder.ScaleMode .FIT ,
223+ toneMapper = JxlToneMapper .REC2408 ,
224+ jxlResizeFilter = JxlResizeFilter .CATMULL_ROM
225+ )
225226 lifecycleScope.launch {
226227 imagesArray.add(srcImage)
227228 }
0 commit comments