Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 17 java.desktop.jmod - Desktop Module
JDK 17 java.desktop.jmod is the JMOD file for JDK 17 Desktop module.
JDK 17 Desktop module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\java.desktop.jmod.
JDK 17 Desktop module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Desktop module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\java.desktop.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/sun/imageio/plugins/tiff/TIFFJPEGCompressor.java
/* * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package com.sun.imageio.plugins.tiff; import javax.imageio.plugins.tiff.BaselineTIFFTagSet; import javax.imageio.plugins.tiff.TIFFField; import javax.imageio.plugins.tiff.TIFFTag; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.util.Iterator; import javax.imageio.ImageReader; import javax.imageio.ImageWriteParam; import javax.imageio.metadata.IIOMetadata; import javax.imageio.spi.IIORegistry; import javax.imageio.spi.ImageReaderSpi; import javax.imageio.spi.ServiceRegistry; import javax.imageio.stream.MemoryCacheImageInputStream; import javax.imageio.stream.MemoryCacheImageOutputStream; /** * Compressor for encoding compression type 7, TTN2/Adobe JPEG-in-TIFF. */ public class TIFFJPEGCompressor extends TIFFBaseJPEGCompressor { // Subsampling factor for chroma bands (Cb Cr). static final int CHROMA_SUBSAMPLING = 2; /** * A filter which identifies the ImageReaderSpi of a JPEG reader * which supports JPEG native stream metadata. */ private static class JPEGSPIFilter implements ServiceRegistry.Filter { JPEGSPIFilter() {} public boolean filter(Object provider) { ImageReaderSpi readerSPI = (ImageReaderSpi)provider; if(readerSPI != null) { String streamMetadataName = readerSPI.getNativeStreamMetadataFormatName(); if(streamMetadataName != null) { return streamMetadataName.equals(STREAM_METADATA_NAME); } else { return false; } } return false; } } /** * Retrieves a JPEG reader which supports native JPEG stream metadata. */ private static ImageReader getJPEGTablesReader() { ImageReader jpegReader = null; try { IIORegistry registry = IIORegistry.getDefaultInstance(); Iterator<?> readerSPIs = registry.getServiceProviders(ImageReaderSpi.class, new JPEGSPIFilter(), true); if(readerSPIs.hasNext()) { ImageReaderSpi jpegReaderSPI = (ImageReaderSpi)readerSPIs.next(); jpegReader = jpegReaderSPI.createReaderInstance(); } } catch(Exception e) { // Ignore it ... } return jpegReader; } public TIFFJPEGCompressor(ImageWriteParam param) { super("JPEG", BaselineTIFFTagSet.COMPRESSION_JPEG, false, param); } /** * Sets the value of the {@code metadata} field. * * <p>The implementation in this class also adds the TIFF fields * JPEGTables, YCbCrSubSampling, YCbCrPositioning, and * ReferenceBlackWhite superseding any prior settings of those * fields.</p> * * @param metadata the {@code IIOMetadata} object for the * image being written. * * @see #getMetadata() */ public void setMetadata(IIOMetadata metadata) { super.setMetadata(metadata); if (metadata instanceof TIFFImageMetadata) { TIFFImageMetadata tim = (TIFFImageMetadata)metadata; TIFFIFD rootIFD = tim.getRootIFD(); BaselineTIFFTagSet base = BaselineTIFFTagSet.getInstance(); TIFFField f = tim.getTIFFField(BaselineTIFFTagSet.TAG_SAMPLES_PER_PIXEL); int numBands = f.getAsInt(0); if(numBands == 1) { // Remove YCbCr fields not relevant for grayscale. rootIFD.removeTIFFField(BaselineTIFFTagSet.TAG_Y_CB_CR_SUBSAMPLING); rootIFD.removeTIFFField(BaselineTIFFTagSet.TAG_Y_CB_CR_POSITIONING); rootIFD.removeTIFFField(BaselineTIFFTagSet.TAG_REFERENCE_BLACK_WHITE); } else { // numBands == 3 // Replace YCbCr fields. // YCbCrSubSampling TIFFField YCbCrSubSamplingField = new TIFFField (base.getTag(BaselineTIFFTagSet.TAG_Y_CB_CR_SUBSAMPLING), TIFFTag.TIFF_SHORT, 2, new char[] {CHROMA_SUBSAMPLING, CHROMA_SUBSAMPLING}); rootIFD.addTIFFField(YCbCrSubSamplingField); // YCbCrPositioning TIFFField YCbCrPositioningField = new TIFFField (base.getTag(BaselineTIFFTagSet.TAG_Y_CB_CR_POSITIONING), TIFFTag.TIFF_SHORT, 1, new char[] {BaselineTIFFTagSet.Y_CB_CR_POSITIONING_CENTERED}); rootIFD.addTIFFField(YCbCrPositioningField); // ReferenceBlackWhite TIFFField referenceBlackWhiteField = new TIFFField (base.getTag(BaselineTIFFTagSet.TAG_REFERENCE_BLACK_WHITE), TIFFTag.TIFF_RATIONAL, 6, new long[][] { // no headroon/footroom {0, 1}, {255, 1}, {128, 1}, {255, 1}, {128, 1}, {255, 1} }); rootIFD.addTIFFField(referenceBlackWhiteField); } // JPEGTables field is written if and only if one is // already present in the metadata. If one is present // and has either zero length or does not represent a // valid tables-only stream, then a JPEGTables field // will be written initialized to the standard tables- // only stream written by the JPEG writer. // Retrieve the JPEGTables field. TIFFField JPEGTablesField = tim.getTIFFField(BaselineTIFFTagSet.TAG_JPEG_TABLES); // Initialize JPEG writer to one supporting abbreviated streams. if(JPEGTablesField != null) { // Intialize the JPEG writer to one that supports stream // metadata, i.e., abbreviated streams, and may or may not // support image metadata. initJPEGWriter(true, false); } // Write JPEGTables field if a writer supporting abbreviated // streams was available. if(JPEGTablesField != null && JPEGWriter != null) { // Set the abbreviated stream flag. this.writeAbbreviatedStream = true; //Branch based on field value count. if(JPEGTablesField.getCount() > 0) { // Derive the stream metadata from the field. // Get the field values. byte[] tables = JPEGTablesField.getAsBytes(); // Create an input stream for the tables. ByteArrayInputStream bais = new ByteArrayInputStream(tables); MemoryCacheImageInputStream iis = new MemoryCacheImageInputStream(bais); // Read the tables stream using the JPEG reader. ImageReader jpegReader = getJPEGTablesReader(); jpegReader.setInput(iis); // Initialize the stream metadata object. try { JPEGStreamMetadata = jpegReader.getStreamMetadata(); } catch(Exception e) { // Fall back to default tables. JPEGStreamMetadata = null; } finally { jpegReader.reset(); } } if(JPEGStreamMetadata == null) { // Derive the field from default stream metadata. // Get default stream metadata. JPEGStreamMetadata = JPEGWriter.getDefaultStreamMetadata(JPEGParam); // Create an output stream for the tables. ByteArrayOutputStream tableByteStream = new ByteArrayOutputStream(); MemoryCacheImageOutputStream tableStream = new MemoryCacheImageOutputStream(tableByteStream); // Write a tables-only stream. JPEGWriter.setOutput(tableStream); try { JPEGWriter.prepareWriteSequence(JPEGStreamMetadata); tableStream.flush(); JPEGWriter.endWriteSequence(); // Get the tables-only stream content. byte[] tables = tableByteStream.toByteArray(); // Add the JPEGTables field. JPEGTablesField = new TIFFField (base.getTag(BaselineTIFFTagSet.TAG_JPEG_TABLES), TIFFTag.TIFF_UNDEFINED, tables.length, tables); rootIFD.addTIFFField(JPEGTablesField); } catch(Exception e) { // Do not write JPEGTables field. rootIFD.removeTIFFField(BaselineTIFFTagSet.TAG_JPEG_TABLES); this.writeAbbreviatedStream = false; } } } else { // Do not write JPEGTables field. // Remove any field present. rootIFD.removeTIFFField(BaselineTIFFTagSet.TAG_JPEG_TABLES); // Initialize the writer preferring codecLib. initJPEGWriter(false, false); } } } }
⏎ com/sun/imageio/plugins/tiff/TIFFJPEGCompressor.java
Or download all of them as a single archive file:
File name: java.desktop-17.0.5-src.zip File size: 9152233 bytes Release date: 2022-09-13 Download
⇒ JDK 17 java.instrument.jmod - Instrument Module
2023-09-16, 33409👍, 0💬
Popular Posts:
What Is js.jar in Rhino JavaScript 1.7R5? js.jar in Rhino JavaScript 1.7R5 is the JAR file for Rhino...
GJT (Giant Java Tree) implementation of XML Pull Parser. JAR File Size and Download Location: File n...
How to download and install iText7-Core-7.1.4.zip? iText7-Core-7.1.4.zip is the binary package of iT...
What Is activation.jar? I heard it's related to JAF (JavaBeans Activation Framework) 1.1? The if you...
What Is HttpComponents httpcore-4.4.6.jar? HttpComponents httpcore-4.4.6.jar is the JAR file for Apa...