You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
557 B

package main
import (
log "github.com/sirupsen/logrus"
)
func getPart(pixelmatrix [][][4]uint32, partCount, partTotal, partBegin int) ([][][4]uint32, int, int) {
xLength := len(pixelmatrix)
if xLength < partTotal {
log.Fatal("more parts then rows not possible")
return nil, 0, 0
}
partStep := (xLength / partTotal)
start := partBegin * partStep
// last part should return last rows
if partBegin + partCount == partTotal {
return pixelmatrix[start: ], start, 0
}
return pixelmatrix[ start : (partBegin + partCount) * partStep], start, 0
}