mirror of https://github.com/status-im/resize.git
Dst pixel coordinate fix
This commit is contained in:
parent
53e9ca890b
commit
0feec06645
|
@ -87,7 +87,7 @@ func createWeights8(dy, filterLength int, blur, scale float64, kernel func(float
|
||||||
coeffs := make([]int16, dy*filterLength)
|
coeffs := make([]int16, dy*filterLength)
|
||||||
start := make([]int, dy)
|
start := make([]int, dy)
|
||||||
for y := 0; y < dy; y++ {
|
for y := 0; y < dy; y++ {
|
||||||
interpX := scale * (float64(y) + 0.5)
|
interpX := scale*(float64(y)+0.5) - 0.5
|
||||||
start[y] = int(interpX) - filterLength/2 + 1
|
start[y] = int(interpX) - filterLength/2 + 1
|
||||||
interpX -= float64(start[y])
|
interpX -= float64(start[y])
|
||||||
for i := 0; i < filterLength; i++ {
|
for i := 0; i < filterLength; i++ {
|
||||||
|
@ -107,7 +107,7 @@ func createWeights16(dy, filterLength int, blur, scale float64, kernel func(floa
|
||||||
coeffs := make([]int32, dy*filterLength)
|
coeffs := make([]int32, dy*filterLength)
|
||||||
start := make([]int, dy)
|
start := make([]int, dy)
|
||||||
for y := 0; y < dy; y++ {
|
for y := 0; y < dy; y++ {
|
||||||
interpX := scale * (float64(y) + 0.5)
|
interpX := scale*(float64(y)+0.5) - 0.5
|
||||||
start[y] = int(interpX) - filterLength/2 + 1
|
start[y] = int(interpX) - filterLength/2 + 1
|
||||||
interpX -= float64(start[y])
|
interpX -= float64(start[y])
|
||||||
for i := 0; i < filterLength; i++ {
|
for i := 0; i < filterLength; i++ {
|
||||||
|
@ -126,7 +126,7 @@ func createWeightsNearest(dy, filterLength int, blur, scale float64) ([]bool, []
|
||||||
coeffs := make([]bool, dy*filterLength)
|
coeffs := make([]bool, dy*filterLength)
|
||||||
start := make([]int, dy)
|
start := make([]int, dy)
|
||||||
for y := 0; y < dy; y++ {
|
for y := 0; y < dy; y++ {
|
||||||
interpX := scale * (float64(y) + 0.5)
|
interpX := scale*(float64(y)+0.5) - 0.5
|
||||||
start[y] = int(interpX) - filterLength/2 + 1
|
start[y] = int(interpX) - filterLength/2 + 1
|
||||||
interpX -= float64(start[y])
|
interpX -= float64(start[y])
|
||||||
for i := 0; i < filterLength; i++ {
|
for i := 0; i < filterLength; i++ {
|
||||||
|
|
Loading…
Reference in New Issue