private static PlanarImage createLookupOp(RenderedImage src, byte[][] lookupTable) { LookupTableJAI lookup = new LookupTableJAI(lookupTable); return LookupDescriptor.create(src, lookup, createDefaultRenderingHints(src, null)); }
PlanarImage result = LookupDescriptor.create(source, lut, hints); logImage(logger, ">>>>>>>> planarImage", result);
PlanarImage result = LookupDescriptor.create(source, lut, hints); logImage(log, ">>>>>>>> planarImage", result);
/** * This takes an image with an indexed color model that uses * less than 256 colors and has a 8bit sample model, and transforms it to * one that has the optimal sample model (for example, 1bit if the palette only has 2 colors) * @param source * @return */ private RenderedImage optimizeSampleModel(RenderedImage source) { int w = source.getWidth(); int h = source.getHeight(); ImageLayout layout = new ImageLayout(); layout.setColorModel(source.getColorModel()); layout.setSampleModel(source.getColorModel().createCompatibleSampleModel(w, h)); // if I don't force tiling off with this setting an exception is thrown // when writing the image out... layout.setTileWidth(w); layout.setTileHeight(h); RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout); return LookupDescriptor.create(source, IDENTITY_TABLE, hints); }
PlanarImage luImage = LookupDescriptor.create(image, table, hints);
table = new LookupTableJAI(new int[] { value0, value1 }); image = LookupDescriptor.create(image, table, getRenderingHints()); invalidateStatistics(); return this;
table = new LookupTableJAI(new int[] { value0, value1 }); image = LookupDescriptor.create(image, table, getRenderingHints()); invalidateStatistics(); return this;
return LookupDescriptor.create(sourceImage, lookup, null);
layout.setColorModel(newColorModel); RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout); result = LookupDescriptor.create(image, table, hints); } else { int alphaBand = bands - 1; LookupTableJAI table = buildOpacityLookupTable(opacity, bands, alphaBand); result = LookupDescriptor.create(expanded, table, null);
imageLookup = javax.media.jai.operator.LookupDescriptor.create(testIMG, (LookupTableJAI) table, null); } else {
PlanarImage luImage = LookupDescriptor.create(image, table, hints);
new double[]{keyMax + 1}, hints); return LookupDescriptor.create(sourceImage, lookup, hints);
mask = LookupDescriptor.create(mask, lut, hints);
lutData[0] = (byte) 255; // for transparent pixels. final LookupTableJAI lut = new LookupTableJAI(lutData); mask = LookupDescriptor.create(mask, lut, hints);
for (int i = 1; i < lut.length; i++) lut[i] = (byte) (0.5f + correctionFactor * (Math.exp(i / normalizationFactor) - 1.0)); return LookupDescriptor.create(inputImage, new LookupTableJAI(lut), hints); for (int i = 1; i < lut.length; i++) lut[i] = (byte) (0.5f + normalizationFactor * Math.log((i * correctionFactor / normalizationFactor+ 1.0))); return LookupDescriptor.create(inputImage, new LookupTableJAI(lut), hints);
byte[] gammaCurve = MathUtils.createGammaCurve(gamma, new byte[256]); LookupTableJAI lookupTable = new LookupTableJAI(gammaCurve); image = LookupDescriptor.create(image, lookupTable, createDefaultRenderingHints(image, null));
layout.setColorModel(destinationColorModel); layout.setSampleModel(destinationSampleModel); image = LookupDescriptor.create(image, lut, hints);
view = LookupDescriptor.create(image, lookup, hints); } else { view = FormatDescriptor.create(image, dataType, hints);
hints.put(JAI.KEY_IMAGE_LAYOUT, layout); hints.put(JAI.KEY_REPLACE_INDEX_COLOR_MODEL, Boolean.FALSE); image = LookupDescriptor.create(image, lookupTable, hints); } else {
image = LookupDescriptor.create(image, lookupTable, hints);