FHT newFHT(ImageProcessor ip) { FHT fht; int width = ip.getWidth(); int height = ip.getHeight(); int maxN = Math.max(width, height); int size = 2; while (size<1.5*maxN) size *= 2; rect.x = (int)Math.round((size-width)/2.0); rect.y = (int)Math.round((size-height)/2.0); rect.width = width; rect.height = height; FFTFilter fftFilter = new FFTFilter(); if (ip instanceof ColorProcessor) { showStatus("Extracting brightness"); ImageProcessor ip2 = ((ColorProcessor)ip).getBrightness(); fht = new FHT(fftFilter.tileMirror(ip2, size, size, rect.x, rect.y)); fht.rgb = (ColorProcessor)ip.duplicate(); // save so we can later update the brightness } else fht = new FHT(fftFilter.tileMirror(ip, size, size, rect.x, rect.y)); fht.originalWidth = originalWidth; fht.originalHeight = originalHeight; fht.originalBitDepth = imp.getBitDepth(); return fht; }
FHT newFHT(ImageProcessor ip) { FHT fht; int width = ip.getWidth(); int height = ip.getHeight(); int maxN = Math.max(width, height); int size = 2; while (size<1.5*maxN) size *= 2; rect.x = (int)Math.round((size-width)/2.0); rect.y = (int)Math.round((size-height)/2.0); rect.width = width; rect.height = height; FFTFilter fftFilter = new FFTFilter(); if (ip instanceof ColorProcessor) { showStatus("Extracting brightness"); ImageProcessor ip2 = ((ColorProcessor)ip).getBrightness(); fht = new FHT(fftFilter.tileMirror(ip2, size, size, rect.x, rect.y)); fht.rgb = (ColorProcessor)ip.duplicate(); // save so we can later update the brightness } else fht = new FHT(fftFilter.tileMirror(ip, size, size, rect.x, rect.y)); fht.originalWidth = originalWidth; fht.originalHeight = originalHeight; fht.originalBitDepth = imp.getBitDepth(); return fht; }