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/jpeg/SOFMarkerSegment.java
/*
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.sun.imageio.plugins.jpeg;
//import javax.imageio.IIOException;
import javax.imageio.metadata.IIOInvalidTreeException;
import javax.imageio.metadata.IIOMetadataNode;
import javax.imageio.stream.ImageOutputStream;
import java.io.IOException;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.NamedNodeMap;
/**
* An SOF (Start Of Frame) marker segment.
*/
class SOFMarkerSegment extends MarkerSegment {
int samplePrecision;
int numLines;
int samplesPerLine;
ComponentSpec [] componentSpecs; // Array size is num components
SOFMarkerSegment(boolean wantProg,
boolean wantExtended,
boolean willSubsample,
byte[] componentIDs,
int numComponents) {
super(wantProg ? JPEG.SOF2
: wantExtended ? JPEG.SOF1
: JPEG.SOF0);
samplePrecision = 8;
numLines = 0;
samplesPerLine = 0;
componentSpecs = new ComponentSpec[numComponents];
for(int i = 0; i < numComponents; i++) {
int factor = 1;
int qsel = 0;
if (willSubsample) {
factor = 2;
if ((i == 1) || (i == 2)) {
factor = 1;
qsel = 1;
}
}
componentSpecs[i] = new ComponentSpec(componentIDs[i], factor, qsel);
}
}
SOFMarkerSegment(JPEGBuffer buffer) throws IOException{
super(buffer);
samplePrecision = buffer.buf[buffer.bufPtr++];
numLines = (buffer.buf[buffer.bufPtr++] & 0xff) << 8;
numLines |= buffer.buf[buffer.bufPtr++] & 0xff;
samplesPerLine = (buffer.buf[buffer.bufPtr++] & 0xff) << 8;
samplesPerLine |= buffer.buf[buffer.bufPtr++] & 0xff;
int numComponents = buffer.buf[buffer.bufPtr++] & 0xff;
componentSpecs = new ComponentSpec [numComponents];
for (int i = 0; i < numComponents; i++) {
componentSpecs[i] = new ComponentSpec(buffer);
}
buffer.bufAvail -= length;
}
SOFMarkerSegment(Node node) throws IIOInvalidTreeException {
// All attributes are optional, so setup defaults first
super(JPEG.SOF0);
samplePrecision = 8;
numLines = 0;
samplesPerLine = 0;
updateFromNativeNode(node, true);
}
protected Object clone() {
SOFMarkerSegment newGuy = (SOFMarkerSegment) super.clone();
if (componentSpecs != null) {
newGuy.componentSpecs = componentSpecs.clone();
for (int i = 0; i < componentSpecs.length; i++) {
newGuy.componentSpecs[i] =
(ComponentSpec) componentSpecs[i].clone();
}
}
return newGuy;
}
IIOMetadataNode getNativeNode() {
IIOMetadataNode node = new IIOMetadataNode("sof");
node.setAttribute("process", Integer.toString(tag-JPEG.SOF0));
node.setAttribute("samplePrecision",
Integer.toString(samplePrecision));
node.setAttribute("numLines",
Integer.toString(numLines));
node.setAttribute("samplesPerLine",
Integer.toString(samplesPerLine));
node.setAttribute("numFrameComponents",
Integer.toString(componentSpecs.length));
for (int i = 0; i < componentSpecs.length; i++) {
node.appendChild(componentSpecs[i].getNativeNode());
}
return node;
}
void updateFromNativeNode(Node node, boolean fromScratch)
throws IIOInvalidTreeException {
NamedNodeMap attrs = node.getAttributes();
int value = getAttributeValue(node, attrs, "process", 0, 2, false);
tag = (value != -1) ? value+JPEG.SOF0 : tag;
// If samplePrecision is present, it must be 8.
// This just checks. We don't bother to assign the value.
value = getAttributeValue(node, attrs, "samplePrecision", 8, 8, false);
value = getAttributeValue(node, attrs, "numLines", 0, 65535, false);
numLines = (value != -1) ? value : numLines;
value = getAttributeValue(node, attrs, "samplesPerLine", 0, 65535, false);
samplesPerLine = (value != -1) ? value : samplesPerLine;
int numComponents = getAttributeValue(node, attrs, "numFrameComponents",
1, 4, false);
NodeList children = node.getChildNodes();
if (children.getLength() != numComponents) {
throw new IIOInvalidTreeException
("numFrameComponents must match number of children", node);
}
componentSpecs = new ComponentSpec [numComponents];
for (int i = 0; i < numComponents; i++) {
componentSpecs[i] = new ComponentSpec(children.item(i));
}
}
/**
* Writes the data for this segment to the stream in
* valid JPEG format.
*/
void write(ImageOutputStream ios) throws IOException {
// We don't write SOF segments; the IJG library does.
}
void print () {
printTag("SOF");
System.out.print("Sample precision: ");
System.out.println(samplePrecision);
System.out.print("Number of lines: ");
System.out.println(numLines);
System.out.print("Samples per line: ");
System.out.println(samplesPerLine);
System.out.print("Number of components: ");
System.out.println(componentSpecs.length);
for(int i = 0; i<componentSpecs.length; i++) {
componentSpecs[i].print();
}
}
int getIDencodedCSType () {
for (int i = 0; i < componentSpecs.length; i++) {
if (componentSpecs[i].componentId < 'A') {
return JPEG.JCS_UNKNOWN;
}
}
switch(componentSpecs.length) {
case 3:
if ((componentSpecs[0].componentId == 'R')
&&(componentSpecs[1].componentId == 'G')
&&(componentSpecs[2].componentId == 'B')) {
return JPEG.JCS_RGB;
}
break;
}
return JPEG.JCS_UNKNOWN;
}
ComponentSpec getComponentSpec(byte id, int factor, int qSelector) {
return new ComponentSpec(id, factor, qSelector);
}
/**
* A component spec within an SOF marker segment.
*/
class ComponentSpec implements Cloneable {
int componentId;
int HsamplingFactor;
int VsamplingFactor;
int QtableSelector;
ComponentSpec(byte id, int factor, int qSelector) {
componentId = id;
HsamplingFactor = factor;
VsamplingFactor = factor;
QtableSelector = qSelector;
}
ComponentSpec(JPEGBuffer buffer) {
// Parent already did a loadBuf
componentId = buffer.buf[buffer.bufPtr++];
HsamplingFactor = buffer.buf[buffer.bufPtr] >>> 4;
VsamplingFactor = buffer.buf[buffer.bufPtr++] & 0xf;
QtableSelector = buffer.buf[buffer.bufPtr++];
}
ComponentSpec(Node node) throws IIOInvalidTreeException {
NamedNodeMap attrs = node.getAttributes();
componentId = getAttributeValue(node, attrs, "componentId", 0, 255, true);
HsamplingFactor = getAttributeValue(node, attrs, "HsamplingFactor",
1, 255, true);
VsamplingFactor = getAttributeValue(node, attrs, "VsamplingFactor",
1, 255, true);
QtableSelector = getAttributeValue(node, attrs, "QtableSelector",
0, 3, true);
}
protected Object clone() {
try {
return super.clone();
} catch (CloneNotSupportedException e) {} // won't happen
return null;
}
IIOMetadataNode getNativeNode() {
IIOMetadataNode node = new IIOMetadataNode("componentSpec");
node.setAttribute("componentId",
Integer.toString(componentId));
node.setAttribute("HsamplingFactor",
Integer.toString(HsamplingFactor));
node.setAttribute("VsamplingFactor",
Integer.toString(VsamplingFactor));
node.setAttribute("QtableSelector",
Integer.toString(QtableSelector));
return node;
}
void print () {
System.out.print("Component ID: ");
System.out.println(componentId);
System.out.print("H sampling factor: ");
System.out.println(HsamplingFactor);
System.out.print("V sampling factor: ");
System.out.println(VsamplingFactor);
System.out.print("Q table selector: ");
System.out.println(QtableSelector);
}
}
}
⏎ com/sun/imageio/plugins/jpeg/SOFMarkerSegment.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, ≈366🔥, 0💬
Popular Posts:
What Is poi-scratchpad-3.5.jar? poi-scratchpad-3.5.jar is one of the JAR files for Apache POI 3.5, w...
JDK 11 jdk.httpserver.jmod is the JMOD file for JDK 11 HTTP Server module. JDK 11 HTTP Server module...
Apache Log4j 1.2 Bridge allows applications coded to use Log4j 1.2 API to use Log4j 2 instead. Bytec...
Apache Log4j IOStreams is a Log4j API extension that provides numerous classes from java.io that can...
Where Can I see Java Source Code files for Xerces Java 2.11.2? Here are Java Source Code files for X...