本文整理汇总了Java中javax.imageio.plugins.jpeg.JPEGHuffmanTable类的典型用法代码示例。如果您正苦于以下问题:Java JPEGHuffmanTable类的具体用法?Java JPEGHuffmanTable怎么用?Java JPEGHuffmanTable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JPEGHuffmanTable类属于javax.imageio.plugins.jpeg包,在下文中一共展示了JPEGHuffmanTable类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: print
import javax.imageio.plugins.jpeg.JPEGHuffmanTable; //导入依赖的package包/类
void print() {
System.out.println("Huffman Table");
System.out.println("table class: "
+ ((tableClass == 0) ? "DC":"AC"));
System.out.println("table id: " + Integer.toString(tableID));
(new JPEGHuffmanTable(numCodes, values)).toString();
/*
System.out.print("Lengths:");
for (int i=0; i<16; i++) {
System.out.print(" " + Integer.toString(numCodes[i]));
}
int count = 0;
if (values.length > 16) {
System.out.println("\nFirst 16 Values:");
count = 16;
} else {
System.out.println("\nValues:");
count = values.length;
}
for (int i=0; i<count; i++) {
System.out.println(Integer.toString(values[i]&0xff));
}
*/
}
示例2: writeImage
import javax.imageio.plugins.jpeg.JPEGHuffmanTable; //导入依赖的package包/类
/**
* Returns <code>true</code> if the write was aborted.
*/
private native boolean writeImage(long structPointer,
byte [] data,
int inCsType, int outCsType,
int numBands,
int [] bandSizes,
int srcWidth,
int destWidth, int destHeight,
int stepX, int stepY,
JPEGQTable [] qtables,
boolean writeDQT,
JPEGHuffmanTable[] DCHuffmanTables,
JPEGHuffmanTable[] ACHuffmanTables,
boolean writeDHT,
boolean optimizeHuffman,
boolean progressive,
int numScans,
int [] scans,
int [] componentIds,
int [] HsamplingFactors,
int [] VsamplingFactors,
int [] QtableSelectors,
boolean haveMetadata,
int restartInterval);
示例3: readImage
import javax.imageio.plugins.jpeg.JPEGHuffmanTable; //导入依赖的package包/类
/**
* Returns {@code true} if the read was aborted.
*/
private native boolean readImage(int imageIndex,
long structPointer,
byte [] buffer,
int numRasterBands,
int [] srcBands,
int [] bandSizes,
int sourceXOffset, int sourceYOffset,
int sourceWidth, int sourceHeight,
int periodX, int periodY,
JPEGQTable [] abbrevQTables,
JPEGHuffmanTable [] abbrevDCHuffmanTables,
JPEGHuffmanTable [] abbrevACHuffmanTables,
int minProgressivePass,
int maxProgressivePass,
boolean wantUpdates);
示例4: writeImage
import javax.imageio.plugins.jpeg.JPEGHuffmanTable; //导入依赖的package包/类
/**
* Returns {@code true} if the write was aborted.
*/
private native boolean writeImage(long structPointer,
byte [] data,
int inCsType, int outCsType,
int numBands,
int [] bandSizes,
int srcWidth,
int destWidth, int destHeight,
int stepX, int stepY,
JPEGQTable [] qtables,
boolean writeDQT,
JPEGHuffmanTable[] DCHuffmanTables,
JPEGHuffmanTable[] ACHuffmanTables,
boolean writeDHT,
boolean optimizeHuffman,
boolean progressive,
int numScans,
int [] scans,
int [] componentIds,
int [] HsamplingFactors,
int [] VsamplingFactors,
int [] QtableSelectors,
boolean haveMetadata,
int restartInterval);
示例5: readImage
import javax.imageio.plugins.jpeg.JPEGHuffmanTable; //导入依赖的package包/类
/**
* Returns <code>true</code> if the read was aborted.
*/
private native boolean readImage(int imageIndex,
long structPointer,
byte [] buffer,
int numRasterBands,
int [] srcBands,
int [] bandSizes,
int sourceXOffset, int sourceYOffset,
int sourceWidth, int sourceHeight,
int periodX, int periodY,
JPEGQTable [] abbrevQTables,
JPEGHuffmanTable [] abbrevDCHuffmanTables,
JPEGHuffmanTable [] abbrevACHuffmanTables,
int minProgressivePass,
int maxProgressivePass,
boolean wantUpdates);
示例6: getDefaultHuffmanTables
import javax.imageio.plugins.jpeg.JPEGHuffmanTable; //导入依赖的package包/类
/**
* Return an array of default Huffman tables.
*/
static JPEGHuffmanTable [] getDefaultHuffmanTables(boolean wantDC) {
JPEGHuffmanTable [] tables = new JPEGHuffmanTable[2];
if (wantDC) {
tables[0] = JPEGHuffmanTable.StdDCLuminance;
tables[1] = JPEGHuffmanTable.StdDCChrominance;
} else {
tables[0] = JPEGHuffmanTable.StdACLuminance;
tables[1] = JPEGHuffmanTable.StdACChrominance;
}
return tables;
}
示例7: DHTMarkerSegment
import javax.imageio.plugins.jpeg.JPEGHuffmanTable; //导入依赖的package包/类
DHTMarkerSegment(boolean needFour) {
super(JPEG.DHT);
tables.add(new Htable(JPEGHuffmanTable.StdDCLuminance, true, 0));
if (needFour) {
tables.add(new Htable(JPEGHuffmanTable.StdDCChrominance, true, 1));
}
tables.add(new Htable(JPEGHuffmanTable.StdACLuminance, false, 0));
if (needFour) {
tables.add(new Htable(JPEGHuffmanTable.StdACChrominance, false, 1));
}
}
示例8: Htable
import javax.imageio.plugins.jpeg.JPEGHuffmanTable; //导入依赖的package包/类
Htable(Node node) throws IIOInvalidTreeException {
if (node.getNodeName().equals("dhtable")) {
NamedNodeMap attrs = node.getAttributes();
int count = attrs.getLength();
if (count != 2) {
throw new IIOInvalidTreeException
("dhtable node must have 2 attributes", node);
}
tableClass = getAttributeValue(node, attrs, "class", 0, 1, true);
tableID = getAttributeValue(node, attrs, "htableId", 0, 3, true);
if (node instanceof IIOMetadataNode) {
IIOMetadataNode ourNode = (IIOMetadataNode) node;
JPEGHuffmanTable table =
(JPEGHuffmanTable) ourNode.getUserObject();
if (table == null) {
throw new IIOInvalidTreeException
("dhtable node must have user object", node);
}
numCodes = table.getLengths();
values = table.getValues();
} else {
throw new IIOInvalidTreeException
("dhtable node must have user object", node);
}
} else {
throw new IIOInvalidTreeException
("Invalid node, expected dqtable", node);
}
}
示例9: getNativeNode
import javax.imageio.plugins.jpeg.JPEGHuffmanTable; //导入依赖的package包/类
IIOMetadataNode getNativeNode() {
IIOMetadataNode node = new IIOMetadataNode("dhtable");
node.setAttribute("class", Integer.toString(tableClass));
node.setAttribute("htableId", Integer.toString(tableID));
node.setUserObject(new JPEGHuffmanTable(numCodes, values));
return node;
}
示例10: readImage
import javax.imageio.plugins.jpeg.JPEGHuffmanTable; //导入依赖的package包/类
/**
* Returns <code>true</code> if the read was aborted.
*/
private native boolean readImage(long structPointer,
byte [] buffer,
int numRasterBands,
int [] srcBands,
int [] bandSizes,
int sourceXOffset, int sourceYOffset,
int sourceWidth, int sourceHeight,
int periodX, int periodY,
JPEGQTable [] abbrevQTables,
JPEGHuffmanTable [] abbrevDCHuffmanTables,
JPEGHuffmanTable [] abbrevACHuffmanTables,
int minProgressivePass,
int maxProgressivePass,
boolean wantUpdates);