reference.getGreens(reference_greens); reference.getBlues(reference_blues); reference.getAlphas(reference_alphas); boolean uniformPalettes = true; final int numSources = sources.size(); sourceColorModel.getGreens(greens); sourceColorModel.getBlues(blues); sourceColorModel.getAlphas(alphas); if (!Arrays.equals(reds, reference_reds) || !Arrays.equals(greens, reference_greens)
icm.getAlphas(alphas);
/** * Extract the palette from an {@link IndexColorModel}. * * @param indexColorModel * @return */ public static byte[][] extractPalette(IndexColorModel indexColorModel) { Utilities.ensureNonNull("indexColorModel", indexColorModel); byte[][] palette = new byte[3][indexColorModel.getMapSize()]; int numBands = indexColorModel.getNumColorComponents(); indexColorModel.getReds(palette[0]); indexColorModel.getGreens(palette[0]); indexColorModel.getBlues(palette[0]); if (numBands == 4) { indexColorModel.getAlphas(palette[0]); } return palette; }
cm.getBlues(rgb[2]); if (numComponents == 4) { cm.getAlphas(rgb[3]); } else { Arrays.fill(rgb[3], (byte) 255);
index.getGreens(greens); index.getBlues(blues); index.getAlphas(alphas);
final IndexColorModel newCM; if (translucent) { oldCM.getAlphas(RGBA[3]); RGBA[3][transparent] = 0; newCM = new IndexColorModel(pixelSize, mapSize, RGBA[0], RGBA[1], RGBA[2], RGBA[3]);
public SimpleColorIndexer(IndexColorModel icm) { this.colors = new byte[4][icm.getMapSize()]; icm.getReds(colors[0]); icm.getGreens(colors[1]); icm.getBlues(colors[2]); icm.getAlphas(colors[3]); }
public SimpleColorIndexer(IndexColorModel icm) { this.colors = new byte[4][icm.getMapSize()]; icm.getReds(colors[0]); icm.getGreens(colors[1]); icm.getBlues(colors[2]); icm.getAlphas(colors[3]); }
if(image.getColorModel() instanceof IndexColorModel) { IndexColorModel icm = (IndexColorModel)image.getColorModel(); byte[][] data = new byte[4][icm.getMapSize()]; icm.getReds(data[0]); icm.getGreens(data[1]); icm.getBlues(data[2]); icm.getAlphas(data[3]); LookupTableJAI lut = new LookupTableJAI(data); image = JAI.create("lookup", image, lut); }
/** Gets the LUT from the <code>IndexColorModel</code> as an two-dimensional * byte array. */ private static byte[][] getLUT(IndexColorModel icm) { int[] comp = icm.getComponentSize(); int size = icm.getMapSize(); byte[][] lut = new byte[comp.length][size]; icm.getReds(lut[0]); icm.getGreens(lut[1]); icm.getBlues(lut[2]); if (comp.length == 4) icm.getAlphas(lut[3]); return lut; }
/** Gets the LUT from the <code>IndexColorModel</code> as an two-dimensional * byte array. */ private static byte[][] getLUT(IndexColorModel icm) { int[] comp = icm.getComponentSize(); int size = icm.getMapSize(); byte[][] lut = new byte[comp.length][size]; icm.getReds(lut[0]); icm.getGreens(lut[1]); icm.getBlues(lut[2]); if (comp.length == 4) icm.getAlphas(lut[3]); return lut; }
/** Gets the LUT from the <code>IndexColorModel</code> as an two-dimensional * byte array. */ private static byte[][] getLUT(IndexColorModel icm) { int[] comp = icm.getComponentSize(); int size = icm.getMapSize(); byte[][] lut = new byte[comp.length][size]; icm.getReds(lut[0]); icm.getGreens(lut[1]); icm.getBlues(lut[2]); if (comp.length == 4) icm.getAlphas(lut[3]); return lut; }
/** * Gets the LUT from the <code>IndexColorModel</code> as a two-dimensional * byte array. */ private static byte[][] getLUT(IndexColorModel icm) { int[] comp = icm.getComponentSize(); int size = icm.getMapSize(); byte[][] lut = new byte[comp.length][size]; icm.getReds(lut[0]); icm.getGreens(lut[1]); icm.getBlues(lut[2]); if (comp.length == 4) icm.getAlphas(lut[3]); return lut; }
/** Gets the LUT from the <code>IndexColorModel</code> as an two-dimensional * byte array. */ private static byte[][] getLUT(IndexColorModel icm) { int[] comp = icm.getComponentSize(); int size = icm.getMapSize(); byte[][] lut = new byte[comp.length][size]; icm.getReds(lut[0]); icm.getGreens(lut[1]); icm.getBlues(lut[2]); if (comp.length == 4) icm.getAlphas(lut[3]); return lut; }
/** Gets the LUT from the <code>IndexColorModel</code> as an two-dimensional * byte array. */ private static byte[][] getLUT(IndexColorModel icm) { int[] comp = icm.getComponentSize(); int size = icm.getMapSize(); byte[][] lut = new byte[comp.length][size]; icm.getReds(lut[0]); icm.getGreens(lut[1]); icm.getBlues(lut[2]); if (comp.length == 4) icm.getAlphas(lut[3]); return lut; }
public static LookupTableJAI createColorLookupTable(IndexColorModel icm) { int numBands = icm.hasAlpha() ? 4 : 3; byte[][] data = new byte[numBands][icm.getMapSize()]; icm.getReds(data[0]); icm.getGreens(data[1]); icm.getBlues(data[2]); if (numBands == 4) { icm.getAlphas(data[3]); } return new LookupTableJAI(data); }
private static Integer getIndexOfFirstTransparentColorInPalette(IndexColorModel icm) { byte[] alphas = new byte[icm.getMapSize()]; byte[] reds = new byte[icm.getMapSize()]; byte[] greens = new byte[icm.getMapSize()]; byte[] blues = new byte[icm.getMapSize()]; icm.getAlphas(alphas); icm.getReds(reds); icm.getGreens(greens); icm.getBlues(blues); for (int i = 0; i < icm.getMapSize(); i++) { if ((alphas[i] & 0xFF) == 0) { return i; } } return null; }
icm.getBlues(ctable[2]); if (icm.getNumComponents() == 4) { icm.getAlphas(ctable[3]);
icm.getGreens(data[1]); icm.getBlues(data[2]); icm.getAlphas(data[3]);