private void decodeImage(boolean useInterlacing) { int width = bounds.width; int height = bounds.height; if (!useInterlacing) { decodePass(theTile, 0, 0, 1, 1, width, height); } else { decodePass(theTile, 0, 0, 8, 8, (width + 7)/8, (height + 7)/8); decodePass(theTile, 4, 0, 8, 8, (width + 3)/8, (height + 7)/8); decodePass(theTile, 0, 4, 4, 8, (width + 3)/4, (height + 3)/8); decodePass(theTile, 2, 0, 4, 4, (width + 1)/4, (height + 3)/4); decodePass(theTile, 0, 2, 2, 4, (width + 1)/2, (height + 1)/4); decodePass(theTile, 1, 0, 2, 2, width/2, (height + 1)/2); decodePass(theTile, 0, 1, 1, 2, width, height/2); } }
String chunkType = getChunkType(distream); if (chunkType.equals("IHDR")) { chunk = readChunk(distream); parse_IHDR_chunk(chunk); } else if (chunkType.equals("PLTE")) { chunk = readChunk(distream); parse_PLTE_chunk(chunk); } else if (chunkType.equals("IDAT")) { chunk = readChunk(distream); streamVec.add(new ByteArrayInputStream(chunk.getData())); } else if (chunkType.equals("IEND")) { chunk = readChunk(distream); parse_IEND_chunk(chunk); break; // fall through to the bottom } else if (chunkType.equals("bKGD")) { chunk = readChunk(distream); parse_bKGD_chunk(chunk); } else if (chunkType.equals("cHRM")) { chunk = readChunk(distream); parse_cHRM_chunk(chunk); } else if (chunkType.equals("gAMA")) { chunk = readChunk(distream); parse_gAMA_chunk(chunk); } else if (chunkType.equals("hIST")) { chunk = readChunk(distream); parse_hIST_chunk(chunk); } else if (chunkType.equals("iCCP")) { chunk = readChunk(distream); parse_iCCP_chunk(chunk);
createRaster(passWidth, 1, inputBands, eltsPerRow, bitDepth); break; case PNG_FILTER_SUB: decodeSubFilter(curr, bytesPerRow, bytesPerPixel); break; case PNG_FILTER_UP: decodeUpFilter(curr, prior, bytesPerRow); break; case PNG_FILTER_AVERAGE: decodeAverageFilter(curr, prior, bytesPerRow, bytesPerPixel); break; case PNG_FILTER_PAETH: decodePaethFilter(curr, prior, bytesPerRow, bytesPerPixel); break; default: processPixels(postProcess, passRow, imRas, xOffset, xStep, dstY, passWidth);
(depth == 16) ? (bytesPerRow/2) : bytesPerRow; theTile = createRaster(width, height, outputBands, scanlineStride, depth); initGammaLut(bitDepth); initGrayLut(bitDepth); decodeImage(interlaceMethod == 1); } else { cm = createComponentColorModel(sm); init((CachableRed)null, bounds, cm, sm, 0, 0, properties);
param.setDisplayExponent(2.2f); // sRGB gamma CachableRed cr = new PNGRed(is, param); dr.setBounds(new Rectangle2D.Double (0, 0, cr.getWidth(), cr.getHeight()));
String chunkType = getChunkType(distream); if (chunkType.equals("IHDR")) { chunk = readChunk(distream); parse_IHDR_chunk(chunk); } else if (chunkType.equals("PLTE")) { chunk = readChunk(distream); parse_PLTE_chunk(chunk); } else if (chunkType.equals("IDAT")) { chunk = readChunk(distream); streamVec.add(new ByteArrayInputStream(chunk.getData())); } else if (chunkType.equals("IEND")) { chunk = readChunk(distream); parse_IEND_chunk(chunk); break; // fall through to the bottom } else if (chunkType.equals("bKGD")) { chunk = readChunk(distream); parse_bKGD_chunk(chunk); } else if (chunkType.equals("cHRM")) { chunk = readChunk(distream); parse_cHRM_chunk(chunk); } else if (chunkType.equals("gAMA")) { chunk = readChunk(distream); parse_gAMA_chunk(chunk); } else if (chunkType.equals("hIST")) { chunk = readChunk(distream); parse_hIST_chunk(chunk); } else if (chunkType.equals("iCCP")) { chunk = readChunk(distream); parse_iCCP_chunk(chunk);
createRaster(passWidth, 1, inputBands, eltsPerRow, bitDepth); break; case PNG_FILTER_SUB: decodeSubFilter(curr, bytesPerRow, bytesPerPixel); break; case PNG_FILTER_UP: decodeUpFilter(curr, prior, bytesPerRow); break; case PNG_FILTER_AVERAGE: decodeAverageFilter(curr, prior, bytesPerRow, bytesPerPixel); break; case PNG_FILTER_PAETH: decodePaethFilter(curr, prior, bytesPerRow, bytesPerPixel); break; default: processPixels(postProcess, passRow, imRas, xOffset, xStep, dstY, passWidth);
(depth == 16) ? (bytesPerRow/2) : bytesPerRow; theTile = createRaster(width, height, outputBands, scanlineStride, depth); initGammaLut(bitDepth); initGrayLut(bitDepth); decodeImage(interlaceMethod == 1); } else { cm = createComponentColorModel(sm); init((CachableRed)null, bounds, cm, sm, 0, 0, properties);
param.setDisplayExponent(2.2f); // sRGB gamma CachableRed cr = new PNGRed(is, param); dr.setBounds(new Rectangle2D.Double (0, 0, cr.getWidth(), cr.getHeight()));
String chunkType = getChunkType(distream); if (chunkType.equals("IHDR")) { chunk = readChunk(distream); parse_IHDR_chunk(chunk); } else if (chunkType.equals("PLTE")) { chunk = readChunk(distream); parse_PLTE_chunk(chunk); } else if (chunkType.equals("IDAT")) { chunk = readChunk(distream); streamVec.add(new ByteArrayInputStream(chunk.getData())); } else if (chunkType.equals("IEND")) { chunk = readChunk(distream); parse_IEND_chunk(chunk); break; // fall through to the bottom } else if (chunkType.equals("bKGD")) { chunk = readChunk(distream); parse_bKGD_chunk(chunk); } else if (chunkType.equals("cHRM")) { chunk = readChunk(distream); parse_cHRM_chunk(chunk); } else if (chunkType.equals("gAMA")) { chunk = readChunk(distream); parse_gAMA_chunk(chunk); } else if (chunkType.equals("hIST")) { chunk = readChunk(distream); parse_hIST_chunk(chunk); } else if (chunkType.equals("iCCP")) { chunk = readChunk(distream); parse_iCCP_chunk(chunk);
createRaster(passWidth, 1, inputBands, eltsPerRow, bitDepth); break; case PNG_FILTER_SUB: decodeSubFilter(curr, bytesPerRow, bytesPerPixel); break; case PNG_FILTER_UP: decodeUpFilter(curr, prior, bytesPerRow); break; case PNG_FILTER_AVERAGE: decodeAverageFilter(curr, prior, bytesPerRow, bytesPerPixel); break; case PNG_FILTER_PAETH: decodePaethFilter(curr, prior, bytesPerRow, bytesPerPixel); break; default: processPixels(postProcess, passRow, imRas, xOffset, xStep, dstY, passWidth);
(depth == 16) ? (bytesPerRow/2) : bytesPerRow; theTile = createRaster(width, height, outputBands, scanlineStride, depth); initGammaLut(bitDepth); initGrayLut(bitDepth); decodeImage(interlaceMethod == 1); } else { cm = createComponentColorModel(sm); init((CachableRed)null, bounds, cm, sm, 0, 0, properties);
private void decodeImage(boolean useInterlacing) { int width = bounds.width; int height = bounds.height; if (!useInterlacing) { decodePass(theTile, 0, 0, 1, 1, width, height); } else { decodePass(theTile, 0, 0, 8, 8, (width + 7)/8, (height + 7)/8); decodePass(theTile, 4, 0, 8, 8, (width + 3)/8, (height + 7)/8); decodePass(theTile, 0, 4, 4, 8, (width + 3)/4, (height + 3)/8); decodePass(theTile, 2, 0, 4, 4, (width + 1)/4, (height + 3)/4); decodePass(theTile, 0, 2, 2, 4, (width + 1)/2, (height + 1)/4); decodePass(theTile, 1, 0, 2, 2, width/2, (height + 1)/2); decodePass(theTile, 0, 1, 1, 2, width, height/2); } }
param.setDisplayExponent(2.2f); // sRGB gamma CachableRed cr = new PNGRed(is, param); dr.setBounds(new Rectangle2D.Double (0, 0, cr.getWidth(), cr.getHeight()));
String chunkType = getChunkType(distream); if (chunkType.equals("IHDR")) { chunk = readChunk(distream); parse_IHDR_chunk(chunk); } else if (chunkType.equals("PLTE")) { chunk = readChunk(distream); parse_PLTE_chunk(chunk); } else if (chunkType.equals("IDAT")) { chunk = readChunk(distream); streamVec.add(new ByteArrayInputStream(chunk.getData())); } else if (chunkType.equals("IEND")) { chunk = readChunk(distream); parse_IEND_chunk(chunk); break; // fall through to the bottom } else if (chunkType.equals("bKGD")) { chunk = readChunk(distream); parse_bKGD_chunk(chunk); } else if (chunkType.equals("cHRM")) { chunk = readChunk(distream); parse_cHRM_chunk(chunk); } else if (chunkType.equals("gAMA")) { chunk = readChunk(distream); parse_gAMA_chunk(chunk); } else if (chunkType.equals("hIST")) { chunk = readChunk(distream); parse_hIST_chunk(chunk); } else if (chunkType.equals("iCCP")) { chunk = readChunk(distream); parse_iCCP_chunk(chunk);
createRaster(passWidth, 1, inputBands, eltsPerRow, bitDepth); break; case PNG_FILTER_SUB: decodeSubFilter(curr, bytesPerRow, bytesPerPixel); break; case PNG_FILTER_UP: decodeUpFilter(curr, prior, bytesPerRow); break; case PNG_FILTER_AVERAGE: decodeAverageFilter(curr, prior, bytesPerRow, bytesPerPixel); break; case PNG_FILTER_PAETH: decodePaethFilter(curr, prior, bytesPerRow, bytesPerPixel); break; default: processPixels(postProcess, passRow, imRas, xOffset, xStep, dstY, passWidth);
(depth == 16) ? (bytesPerRow/2) : bytesPerRow; theTile = createRaster(width, height, outputBands, scanlineStride, depth); initGammaLut(bitDepth); initGrayLut(bitDepth); decodeImage(interlaceMethod == 1); } else { cm = createComponentColorModel(sm); init((CachableRed)null, bounds, cm, sm, 0, 0, properties);
private void decodeImage(boolean useInterlacing) { int width = bounds.width; int height = bounds.height; if (!useInterlacing) { decodePass(theTile, 0, 0, 1, 1, width, height); } else { decodePass(theTile, 0, 0, 8, 8, (width + 7)/8, (height + 7)/8); decodePass(theTile, 4, 0, 8, 8, (width + 3)/8, (height + 7)/8); decodePass(theTile, 0, 4, 4, 8, (width + 3)/4, (height + 3)/8); decodePass(theTile, 2, 0, 4, 4, (width + 1)/4, (height + 3)/4); decodePass(theTile, 0, 2, 2, 4, (width + 1)/2, (height + 1)/4); decodePass(theTile, 1, 0, 2, 2, width/2, (height + 1)/2); decodePass(theTile, 0, 1, 1, 2, width, height/2); } }
param.setDisplayExponent(2.2f); // sRGB gamma CachableRed cr = new PNGRed(is, param); dr.setBounds(new Rectangle2D.Double (0, 0, cr.getWidth(), cr.getHeight()));
private void decodeImage(boolean useInterlacing) { int width = bounds.width; int height = bounds.height; if (!useInterlacing) { decodePass(theTile, 0, 0, 1, 1, width, height); } else { decodePass(theTile, 0, 0, 8, 8, (width + 7)/8, (height + 7)/8); decodePass(theTile, 4, 0, 8, 8, (width + 3)/8, (height + 7)/8); decodePass(theTile, 0, 4, 4, 8, (width + 3)/4, (height + 3)/8); decodePass(theTile, 2, 0, 4, 4, (width + 1)/4, (height + 3)/4); decodePass(theTile, 0, 2, 2, 4, (width + 1)/2, (height + 1)/4); decodePass(theTile, 1, 0, 2, 2, width/2, (height + 1)/2); decodePass(theTile, 0, 1, 1, 2, width, height/2); } }