comparison app/src/main/java/com/bartsent/simpleresizer/lib/LanczosKernel.kt @ 13:b1605be35bcc memo.oo

Dumping Bitmap yields 2x improvement!
author David Barts <n5jrn@me.com>
date Thu, 18 Feb 2021 14:15:26 -0800
parents 678adef4774f
children 86740f593b6c
comparison
equal deleted inserted replaced
11:678adef4774f 13:b1605be35bcc
2 2
3 import kotlin.math.PI 3 import kotlin.math.PI
4 import kotlin.math.abs 4 import kotlin.math.abs
5 import kotlin.math.sin 5 import kotlin.math.sin
6 6
7 object LanczosKernel: ScalingKernel { 7 class LanczosKernel: ScalingKernel {
8 override val size = 3.0 8 override val size = 3.0
9 private val memory = HashMap<Double, Double>() 9 private val memory = HashMap<Double, Double>()
10 init { 10 init {
11 memory.put(0.0, 1.0) 11 memory.put(0.0, 1.0)
12 } 12 }