public static void convolveAndTranspose(Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, boolean premultiply, boolean unpremultiply,
int edgeAction, ProgressTracker pt) {
float[] matrix = kernel.getKernelData(null);
int cols = kernel.getWidth();
int cols2 = cols / 2;
Future<?>[] resultLines = new Future[height];
for (int y = 0; y < height; y++) {
int finalY = y;
Runnable lineTask = () -> convolveAndTransposeLine(inPixels, outPixels, width, height, alpha, premultiply, unpremultiply, edgeAction, matrix, cols2, finalY);
resultLines[y] = ThreadPool.submit(lineTask);
}
ThreadPool.waitToFinish(resultLines, pt);
}