public class JPEGParam extends Object implements JPEGEncodeParam, Cloneable
APP0_MARKER, APP1_MARKER, APP2_MARKER, APP3_MARKER, APP4_MARKER, APP5_MARKER, APP6_MARKER, APP7_MARKER, APP8_MARKER, APP9_MARKER, APPA_MARKER, APPB_MARKER, APPC_MARKER, APPD_MARKER, APPE_MARKER, APPF_MARKER, COLOR_ID_CMYK, COLOR_ID_GRAY, COLOR_ID_PYCC, COLOR_ID_PYCCA, COLOR_ID_RGB, COLOR_ID_RGBA, COLOR_ID_RGBA_INVERTED, COLOR_ID_UNKNOWN, COLOR_ID_YCbCr, COLOR_ID_YCbCrA, COLOR_ID_YCbCrA_INVERTED, COLOR_ID_YCCK, COMMENT_MARKER, DENSITY_UNIT_ASPECT_RATIO, DENSITY_UNIT_DOTS_CM, DENSITY_UNIT_DOTS_INCH, NUM_COLOR_ID, NUM_DENSITY_UNIT, NUM_TABLES| 构造器和说明 |
|---|
JPEGParam(int var1) |
JPEGParam(int var1,
int var2) |
JPEGParam(JPEGDecodeParam var1) |
JPEGParam(JPEGEncodeParam var1) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addMarkerData(int var1,
byte[] var2)
Appends 'data' to the array of byte[] associated with
marker.
|
Object |
clone() |
int |
getACHuffmanComponentMapping(int var1)
Get the number of the AC Huffman table that will be used for
a particular component.
|
JPEGHuffmanTable |
getACHuffmanTable(int var1)
Returns the AC Huffman coding table requested or null if
not defined
|
JPEGHuffmanTable |
getACHuffmanTableForComponent(int var1)
Returns the AC Huffman coding table for the requested component.
|
int |
getDCHuffmanComponentMapping(int var1)
Get the number of the DC Huffman table that will be used for
a particular component.
|
JPEGHuffmanTable |
getDCHuffmanTable(int var1)
Returns the DC Huffman coding table requested or null if
not defined
|
JPEGHuffmanTable |
getDCHuffmanTableForComponent(int var1)
Returns the DC Huffman coding table for the requested component.
|
static int |
getDefaultColorId(ColorModel var0) |
int |
getDensityUnit()
Get the code for pixel size units This value is copied from the
APP0 marker.
|
int |
getEncodedColorID()
Returns the JPEG Encoded color id.
|
int |
getHeight()
Get the image height
|
int |
getHorizontalSubsampling(int var1)
Return the Horizontal subsampling factor for requested
Component.
|
boolean |
getMarker(int var1)
Returns true if at least one instance of the marker is present
in the Parameter object.
|
byte[][] |
getMarkerData(int var1)
Returns a 'byte[][]' associated with the requested marker in
the parameter object.
|
int |
getNumComponents()
Returns the number of components for the current encoding
COLOR_ID.
|
static int |
getNumComponents(int var0) |
JPEGQTable |
getQTable(int var1)
Returns the coefficient quantization tables or NULL if not
defined. tableNum must range in value from 0 - 3.
|
int |
getQTableComponentMapping(int var1)
Get the number of the quantization table that will be used for
a particular component.
|
JPEGQTable |
getQTableForComponent(int var1)
Returns the Quantization table for the requested component.
|
int |
getRestartInterval()
Get the MCUs per restart marker.
|
int |
getVerticalSubsampling(int var1)
Return the Vertical subsampling factor for requested
Component.
|
int |
getWidth()
Get the image width
|
int |
getXDensity()
Get the horizontal pixel density This value is copied from the
APP0 marker.
|
int |
getYDensity()
Get the vertical pixel density This value is copied into the
APP0 marker.
|
boolean |
isImageInfoValid()
Returns true if the image information in the ParamBlock is
currently valid.
|
boolean |
isTableInfoValid()
Returns true if the tables in the ParamBlock are currently
valid.
|
void |
setACHuffmanComponentMapping(int var1,
int var2)
Sets the mapping between a component and it's AC Huffman Table.
|
void |
setACHuffmanTable(int var1,
JPEGHuffmanTable var2)
Sets the AC Huffman coding table at index to the table provided.
|
void |
setDCHuffmanComponentMapping(int var1,
int var2)
Sets the mapping between a component and it's DC Huffman Table.
|
void |
setDCHuffmanTable(int var1,
JPEGHuffmanTable var2)
Sets the DC Huffman coding table at index to the table provided.
|
protected void |
setDefaults(int var1) |
void |
setDensityUnit(int var1)
Set the pixel size units This value is copied into the APP0
marker (if that marker is written).
|
void |
setHeight(int var1) |
void |
setHorizontalSubsampling(int var1,
int var2)
Set the horizontal subsample factor for the given component.
|
void |
setImageInfoValid(boolean var1)
Set the flag indicating the validity of the table information
in the ParamBlock.
|
void |
setMarkerData(int var1,
byte[][] var2)
Sets the marker data to be written to the output data stream.
|
void |
setQTable(int var1,
JPEGQTable var2)
Sets the coefficient quantization tables at index
passed. tableNum must range in value from 0 - 3.
|
void |
setQTableComponentMapping(int var1,
int var2)
Sets the mapping between a component and it's Quantization Table.
|
void |
setQuality(float var1,
boolean var2)
This creates new Quantization tables that replace the currently
installed Quantization tables.
|
void |
setRestartInterval(int var1)
Set the MCUs per restart, or 0 for no restart markers.
|
void |
setTableInfoValid(boolean var1)
Set the flag indicating the validity of the image information
in the ParamBlock.
|
void |
setVerticalSubsampling(int var1,
int var2)
Set the vertical subsample factor for the given component.
|
void |
setWidth(int var1) |
void |
setXDensity(int var1)
Set the horizontal pixel density This value is written into the
APP0 marker.
|
void |
setYDensity(int var1)
Set the vertical pixel density.
|
public JPEGParam(int var1)
public JPEGParam(JPEGDecodeParam var1)
public JPEGParam(JPEGEncodeParam var1)
public JPEGParam(int var1,
int var2)
protected void setDefaults(int var1)
public Object clone()
clone 在接口中 JPEGDecodeParamclone 在接口中 JPEGEncodeParamclone 在类中 Objectpublic int getWidth()
JPEGDecodeParamgetWidth 在接口中 JPEGDecodeParampublic int getHeight()
JPEGDecodeParamgetHeight 在接口中 JPEGDecodeParampublic void setWidth(int var1)
public void setHeight(int var1)
public int getHorizontalSubsampling(int var1)
JPEGDecodeParamgetHorizontalSubsampling 在接口中 JPEGDecodeParamvar1 - The component of the encoded image to return
the subsampling factor for.public int getVerticalSubsampling(int var1)
JPEGDecodeParamgetVerticalSubsampling 在接口中 JPEGDecodeParamvar1 - The component of the encoded image to return
the subsampling factor for.public void setHorizontalSubsampling(int var1,
int var2)
JPEGEncodeParamsetHorizontalSubsampling 在接口中 JPEGEncodeParamvar1 - The component being specified.var2 - The subsampling factor being specified.public void setVerticalSubsampling(int var1,
int var2)
JPEGEncodeParamsetVerticalSubsampling 在接口中 JPEGEncodeParamvar1 - The component being specified.var2 - The subsampling factor being specified.public JPEGQTable getQTable(int var1)
JPEGDecodeParamgetQTable 在接口中 JPEGDecodeParamvar1 - the index of the table to be returned.public JPEGQTable getQTableForComponent(int var1)
JPEGDecodeParamgetQTableForComponent 在接口中 JPEGDecodeParamvar1 - the image component of interest.public JPEGHuffmanTable getDCHuffmanTable(int var1)
JPEGDecodeParamgetDCHuffmanTable 在接口中 JPEGDecodeParamvar1 - the index of the table to be returned.public JPEGHuffmanTable getDCHuffmanTableForComponent(int var1)
JPEGDecodeParamgetDCHuffmanTableForComponent 在接口中 JPEGDecodeParamvar1 - the image component of interest.public JPEGHuffmanTable getACHuffmanTable(int var1)
JPEGDecodeParamgetACHuffmanTable 在接口中 JPEGDecodeParamvar1 - the index of the table to be returned.public JPEGHuffmanTable getACHuffmanTableForComponent(int var1)
JPEGDecodeParamgetACHuffmanTableForComponent 在接口中 JPEGDecodeParamvar1 - the image component of interest.public void setQTable(int var1,
JPEGQTable var2)
JPEGEncodeParamsetQTable 在接口中 JPEGEncodeParamvar1 - the index of the table to be set.public void setDCHuffmanTable(int var1,
JPEGHuffmanTable var2)
JPEGEncodeParamsetDCHuffmanTable 在接口中 JPEGEncodeParamvar1 - - the index of the table to be set.var2 - JPEGHuffmanTable that will be assigned
to index tableNum.public void setACHuffmanTable(int var1,
JPEGHuffmanTable var2)
JPEGEncodeParamsetACHuffmanTable 在接口中 JPEGEncodeParamvar1 - - the index of the table to be set.var2 - JPEGHuffmanTable that will be assigned
to index tableNum.public int getDCHuffmanComponentMapping(int var1)
JPEGDecodeParamgetDCHuffmanComponentMapping 在接口中 JPEGDecodeParamvar1 - The Component of interest.public int getACHuffmanComponentMapping(int var1)
JPEGDecodeParamgetACHuffmanComponentMapping 在接口中 JPEGDecodeParamvar1 - The Component of interest.public int getQTableComponentMapping(int var1)
JPEGDecodeParamgetQTableComponentMapping 在接口中 JPEGDecodeParamvar1 - The Component of interest.public void setDCHuffmanComponentMapping(int var1,
int var2)
JPEGEncodeParamsetDCHuffmanComponentMapping 在接口中 JPEGEncodeParamvar1 - The component to set the mapping forvar2 - The DC Huffman table to use for componentpublic void setACHuffmanComponentMapping(int var1,
int var2)
JPEGEncodeParamsetACHuffmanComponentMapping 在接口中 JPEGEncodeParamvar1 - The component to set the mapping forvar2 - The AC Huffman table to use for componentpublic void setQTableComponentMapping(int var1,
int var2)
JPEGEncodeParamsetQTableComponentMapping 在接口中 JPEGEncodeParamvar1 - The component to set the mapping forvar2 - The Quantization Table to use for componentpublic boolean isImageInfoValid()
JPEGDecodeParamisImageInfoValid 在接口中 JPEGDecodeParampublic void setImageInfoValid(boolean var1)
JPEGEncodeParamsetImageInfoValid 在接口中 JPEGEncodeParampublic boolean isTableInfoValid()
JPEGDecodeParamisTableInfoValid 在接口中 JPEGDecodeParampublic void setTableInfoValid(boolean var1)
JPEGEncodeParamsetTableInfoValid 在接口中 JPEGEncodeParampublic boolean getMarker(int var1)
JPEGDecodeParamgetMarker 在接口中 JPEGDecodeParamvar1 - The marker of interest.public byte[][] getMarkerData(int var1)
JPEGDecodeParamgetMarkerData 在接口中 JPEGDecodeParamvar1 - The marker of interest.public void setMarkerData(int var1,
byte[][] var2)
JPEGEncodeParamsetMarkerData 在接口中 JPEGEncodeParamvar1 - The marker to set the data for.var2 - the new set of data to be written.public void addMarkerData(int var1,
byte[] var2)
JPEGEncodeParamaddMarkerData 在接口中 JPEGEncodeParamvar1 - The marker to add and instance of.var2 - the data to be written.public int getEncodedColorID()
JPEGDecodeParamgetEncodedColorID 在接口中 JPEGDecodeParampublic int getNumComponents()
JPEGDecodeParamgetNumComponents 在接口中 JPEGDecodeParampublic static int getNumComponents(int var0)
public int getRestartInterval()
JPEGDecodeParamgetRestartInterval 在接口中 JPEGDecodeParampublic void setRestartInterval(int var1)
JPEGEncodeParamsetRestartInterval 在接口中 JPEGEncodeParamvar1 - number MCUs per restart marker.public int getDensityUnit()
JPEGDecodeParamgetDensityUnit 在接口中 JPEGDecodeParampublic int getXDensity()
JPEGDecodeParamgetXDensity 在接口中 JPEGDecodeParamJPEGDecodeParam.getDensityUnit()public int getYDensity()
JPEGDecodeParamgetYDensity 在接口中 JPEGDecodeParamJPEGDecodeParam.getDensityUnit()public void setDensityUnit(int var1)
JPEGEncodeParamsetDensityUnit 在接口中 JPEGEncodeParamvar1 - One of the DENSITY_UNIT_* values.public void setXDensity(int var1)
JPEGEncodeParamsetXDensity 在接口中 JPEGEncodeParamvar1 - the horizontal pixel density, in units
described by @see JPEGParam.getDensityUnit.public void setYDensity(int var1)
JPEGEncodeParamsetYDensity 在接口中 JPEGEncodeParamvar1 - The verticle pixel density, in units
described by @see JPEGParam.getDensityUnit.public void setQuality(float var1,
boolean var2)
JPEGEncodeParamThe Created Quantization table varies from very high compression, very low quality, (0.0) to low compression, very high quality (1.0) based on the quality parameter.
At a quality level of 1.0 the table will be all 1's which will lead to no loss of data due to quantization (however chrominace subsampling, if used, and roundoff error in the DCT will still degrade the image some what).
This is a linear manipulation of the standard Chrominance Q-Table.
Some guidelines: 0.75 high quality
0.5 medium quality
0.25 low quality
setQuality 在接口中 JPEGEncodeParamvar1 - 0.0-1.0 setting of desired quality level.var2 - force baseline quantization tablepublic static int getDefaultColorId(ColorModel var0)
Copyright © 2022. All rights reserved.