Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
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 (322)
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/TIFFRenderedImage.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 java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.Raster;
import java.awt.image.RenderedImage;
import java.awt.image.SampleModel;
import java.awt.image.WritableRaster;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import javax.imageio.ImageReadParam;
import javax.imageio.ImageTypeSpecifier;
import javax.imageio.plugins.tiff.TIFFImageReadParam;
import javax.imageio.plugins.tiff.TIFFTagSet;
public class TIFFRenderedImage implements RenderedImage {
private TIFFImageReader reader;
private int imageIndex;
private ImageReadParam tileParam;
private int subsampleX;
private int subsampleY;
private boolean isSubsampling;
private int width;
private int height;
private int tileWidth;
private int tileHeight;
private ImageTypeSpecifier its;
public TIFFRenderedImage(TIFFImageReader reader,
int imageIndex,
ImageReadParam readParam,
int width, int height) throws IOException {
this.reader = reader;
this.imageIndex = imageIndex;
this.tileParam = cloneImageReadParam(readParam, false);
this.subsampleX = tileParam.getSourceXSubsampling();
this.subsampleY = tileParam.getSourceYSubsampling();
this.isSubsampling = this.subsampleX != 1 || this.subsampleY != 1;
this.width = width/subsampleX;
this.height = height/subsampleY;
// If subsampling is being used, we may not match the
// true tile grid exactly, but everything should still work
this.tileWidth = reader.getTileWidth(imageIndex)/subsampleX;
this.tileHeight = reader.getTileHeight(imageIndex)/subsampleY;
Iterator<ImageTypeSpecifier> iter = reader.getImageTypes(imageIndex);
this.its = iter.next();
tileParam.setDestinationType(its);
}
/**
* Creates a copy of {@code param}. The source subsampling and
* and bands settings and the destination bands and offset settings
* are copied. If {@code param} is a {@code TIFFImageReadParam}
* then the {@code TIFFDecompressor} and
* {@code TIFFColorConverter} settings are also copied; otherwise
* they are explicitly set to {@code null}.
*
* @param param the parameters to be copied.
* @param copyTagSets whether the {@code TIFFTagSet} settings
* should be copied if set.
* @return copied parameters.
*/
private ImageReadParam cloneImageReadParam(ImageReadParam param,
boolean copyTagSets) {
// Create a new TIFFImageReadParam.
TIFFImageReadParam newParam = new TIFFImageReadParam();
// Copy the basic settings.
newParam.setSourceSubsampling(param.getSourceXSubsampling(),
param.getSourceYSubsampling(),
param.getSubsamplingXOffset(),
param.getSubsamplingYOffset());
newParam.setSourceBands(param.getSourceBands());
newParam.setDestinationBands(param.getDestinationBands());
newParam.setDestinationOffset(param.getDestinationOffset());
if (param instanceof TIFFImageReadParam && copyTagSets) {
// Copy the settings from the input parameter.
TIFFImageReadParam tparam = (TIFFImageReadParam) param;
List<TIFFTagSet> tagSets = tparam.getAllowedTagSets();
if (tagSets != null) {
Iterator<TIFFTagSet> tagSetIter = tagSets.iterator();
if (tagSetIter != null) {
while (tagSetIter.hasNext()) {
TIFFTagSet tagSet = tagSetIter.next();
newParam.addAllowedTagSet(tagSet);
}
}
}
}
return newParam;
}
public Vector<RenderedImage> getSources() {
return null;
}
public Object getProperty(String name) {
return java.awt.Image.UndefinedProperty;
}
public String[] getPropertyNames() {
return null;
}
public ColorModel getColorModel() {
return its.getColorModel();
}
public SampleModel getSampleModel() {
return its.getSampleModel();
}
public int getWidth() {
return width;
}
public int getHeight() {
return height;
}
public int getMinX() {
return 0;
}
public int getMinY() {
return 0;
}
public int getNumXTiles() {
return (width + tileWidth - 1)/tileWidth;
}
public int getNumYTiles() {
return (height + tileHeight - 1)/tileHeight;
}
public int getMinTileX() {
return 0;
}
public int getMinTileY() {
return 0;
}
public int getTileWidth() {
return tileWidth;
}
public int getTileHeight() {
return tileHeight;
}
public int getTileGridXOffset() {
return 0;
}
public int getTileGridYOffset() {
return 0;
}
public Raster getTile(int tileX, int tileY) {
Rectangle tileRect = new Rectangle(tileX*tileWidth,
tileY*tileHeight,
tileWidth,
tileHeight);
return getData(tileRect);
}
public Raster getData() {
return read(new Rectangle(0, 0, getWidth(), getHeight()));
}
public Raster getData(Rectangle rect) {
return read(rect);
}
// This method needs to be synchronized as it updates the instance
// variable 'tileParam'.
public synchronized WritableRaster read(Rectangle rect) {
tileParam.setSourceRegion(isSubsampling ?
new Rectangle(subsampleX*rect.x,
subsampleY*rect.y,
subsampleX*rect.width,
subsampleY*rect.height) :
rect);
try {
BufferedImage bi = reader.read(imageIndex, tileParam);
WritableRaster ras = bi.getRaster();
return ras.createWritableChild(0, 0,
ras.getWidth(), ras.getHeight(),
rect.x, rect.y,
null);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public WritableRaster copyData(WritableRaster raster) {
if (raster == null) {
return read(new Rectangle(0, 0, getWidth(), getHeight()));
} else {
Raster src = read(raster.getBounds());
raster.setRect(src);
return raster;
}
}
}
⏎ com/sun/imageio/plugins/tiff/TIFFRenderedImage.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, ≈330🔥, 0💬
Popular Posts:
How to download and install mysql-connector-j-8.0.31 .zip?Connector/J Java library is a JDBC Driver ...
What Is commons-io-2.11.jar? commons-io-2.11.jar is the JAR file for Commons IO 2.5, which is a libr...
Java Servlet 3.0 Specification API. JAR File Size and Download Location: File name: servlet-api.jar,...
ANTLR is a powerful parser generator for multiple programming languages including Java. ANTLR contai...
Jetty provides an HTTP server, HTTP client, and javax.servlet container. These components are open s...