Kernel vertical = new Kernel(horizontal.getHeight(), horizontal.getWidth(), horizontal.getKernelData(null));
/** * Sets the Convolution Kernel to use. * @param k Kernel to use for convolution. */ public void setKernel(Kernel k) { touch(); this.kernel = k; kernelHasNegValues = false; float [] kv = k.getKernelData(null); for (float aKv : kv) if (aKv < 0) { kernelHasNegValues = true; break; } }
/** * Sets the Convolution Kernel to use. * @param k Kernel to use for convolution. */ public void setKernel(Kernel k) { touch(); this.kernel = k; kernelHasNegValues = false; float [] kv = k.getKernelData(null); for (int i=0; i<kv.length; i++) if (kv[i] < 0) { kernelHasNegValues = true; break; } }
/** * Sets the Convolution Kernel to use. * @param k Kernel to use for convolution. */ public void setKernel(Kernel k) { touch(); this.kernel = k; kernelHasNegValues = false; float [] kv = k.getKernelData(null); for (float aKv : kv) if (aKv < 0) { kernelHasNegValues = true; break; } }
float[] data = kernel.getKernelData(null); StringBuffer kernelMatrixBuf = new StringBuffer( data.length * 8 ); for (float aData : data) {
int height) float[] matrix = kernel.getKernelData(null); int cols = kernel.getWidth(); int cols2 = cols / 2;
/** * Blur and transpose a block of ARGB pixels. * * @param kernel the blur kernel * @param inPixels the input pixels * @param outPixels the output pixels * @param width the width of the pixel array * @param height the height of the pixel array * @param alpha whether to blur the alpha channel * @param edgeAction what to do at the edges */ 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); }
private void write(Kernel kernel) { imports.add("java.awt.image.Kernel"); out.print("new Kernel("); out.print(kernel.getWidth()); out.print(", "); out.print(kernel.getHeight()); out.print(", "); write(kernel.getKernelData(null)); out.print(")"); }
Kernel vertical = new Kernel(horizontal.getHeight(), horizontal.getWidth(), horizontal.getKernelData(null));
float[] matrix = kernel.getKernelData( null ); int cols = kernel.getWidth(); int cols2 = cols/2;
Kernel vertical = new Kernel(horizontal.getHeight(), horizontal.getWidth(), horizontal.getKernelData(null));
float[] matrix = kernel.getKernelData( null ); int cols = kernel.getWidth(); int cols2 = cols/2;
float[] matrix = kernel.getKernelData( null ); int cols = kernel.getWidth(); int cols2 = cols/2;
float[] matrix = kernel.getKernelData( null ); int rows = kernel.getHeight(); int rows2 = rows/2;
float[] matrix = kernel.getKernelData( null ); int cols = kernel.getWidth(); int cols2 = cols/2;
float[] matrix = kernel.getKernelData( null ); int rows = kernel.getHeight(); int rows2 = rows/2;
float[] matrix = kernel.getKernelData( null ); int rows = kernel.getHeight(); int rows2 = rows/2;
float[] matrix = kernel.getKernelData( null ); int rows = kernel.getHeight(); int rows2 = rows/2;
float[] matrix = kernel.getKernelData(null); int cols = kernel.getWidth(); int cols2 = cols / 2;
float[] matrix = kernel.getKernelData( null ); int rows = kernel.getHeight(); int cols = kernel.getWidth();