|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.imageio.IIOParam | +--javax.imageio.ImageWriteParam | +--com.sun.media.imageio.plugins.jpeg2000.J2KImageWriteParam
A subclass of ImageWriteParam
for writing images in
the JPEG 2000 format.
JPEG 2000 plugin supports to losslessly or lossy compress gray-scale, RGB, and RGBA images with byte, unsigned short or short data type. It also supports losslessly compress bilevel, and 8-bit color indexed images. The result data is in the of JP2 format -- JPEG 2000 Part 1 or baseline format.
The parameters for encoding JPEG 2000 are listed in the following table:
Parameter Name | Description |
---|---|
encodingRate | The bitrate in bits-per-pixel for encoding. Should be set when
lossy compression scheme is used. With the default value
Double.MAX_VALUE , a lossless compression will be done.
|
lossless | Indicates using the lossless scheme or not. It is equivalent to
use reversible quantization and 5x3 integer wavelet filters. The
default is true .
|
componentTransformation | Specifies to utilize the component transformation on some tiles. If the wavelet transform is reversible (w5x3 filter), the Reversible Component Transformation (RCT) is applied. If not reversible (w9x7 filter), the Irreversible Component Transformation (ICT) is used. |
filters | Specifies which wavelet filters to use for the specified tile-components. JPEG 2000 part I only supports w5x3 and w9x7 filters. |
codeBlockSize | Specifies the maximum code-block size to use for tile-component. The maximum width and height is 1024, however the block size (i.e. width x height) must not exceed 4096. The minimum width and height is 4. The default values are (64, 64). |
progressionType | Specifies which type of progression should be used when generating
the codestream.
The format is ont of the progression types defined below: res : Resolution-Layer-Component-Position layer: Layer-Resolution-Component-Position res-pos: Resolution-Position-Component-Layer pos-comp: Position-Component-Resolution-Layer comp-pos: Component-Position-Resolution-Layer |
SOP | Specifies whether start of packet (SOP) markers should be used. true enables, false disables it. The default value is false. |
EPH | Specifies whether end of packet header (EPH) markers should be used. true enables, false disables it. The default value is false. |
writeCodeStreamOnly | Specifies whether write only the jpeg2000 code stream, i.e, no any box is written. The default value is false. |
Field Summary | |
static String |
FILTER_53
The filter for lossless compression. |
static String |
FILTER_97
The filter for lossy compression. |
Fields inherited from class javax.imageio.ImageWriteParam |
canOffsetTiles, canWriteCompressed, canWriteProgressive, canWriteTiles, compressionMode, compressionQuality, compressionType, compressionTypes, locale, MODE_COPY_FROM_METADATA, MODE_DEFAULT, MODE_DISABLED, MODE_EXPLICIT, preferredTileSizes, progressiveMode, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, tilingMode, tilingSet |
Fields inherited from class javax.imageio.IIOParam |
controller, defaultController, destinationOffset, destinationType, sourceBands, sourceRegion, sourceXSubsampling, sourceYSubsampling, subsamplingXOffset, subsamplingYOffset |
Constructor Summary | |
J2KImageWriteParam()
Constructs a J2KImageWriteParam object with default
values for all parameters. |
|
J2KImageWriteParam(Locale locale)
Constructor which sets the Locale . |
Method Summary | |
int[] |
getCodeBlockSize()
Gets codeBlockSize . |
boolean |
getComponentTransformation()
Gets componentTransformation . |
double |
getEncodingRate()
Gets encodingRate . |
boolean |
getEPH()
Gets EPH . |
String |
getFilter()
Gets filters . |
boolean |
getLossless()
Gets encodingRate . |
String |
getProgressionType()
Gets progressionType . |
boolean |
getSOP()
Gets SOP . |
boolean |
getWriteCodeStreamOnly()
Gets writeCodeStreamOnly . |
void |
setCodeBlockSize(int[] value)
Sets codeBlockSize . |
void |
setComponentTransformation(boolean value)
Sets componentTransformation . |
void |
setEncodingRate(double rate)
Sets encodingRate . |
void |
setEPH(boolean value)
Sets EPH . |
void |
setFilter(String value)
Sets filter . |
void |
setLossless(boolean lossless)
Sets lossless . |
void |
setProgressionType(String value)
Sets progressionType . |
void |
setSOP(boolean value)
Sets SOP . |
void |
setWriteCodeStreamOnly(boolean value)
Sets writeCodeStreamOnly . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String FILTER_97
public static final String FILTER_53
Constructor Detail |
public J2KImageWriteParam(Locale locale)
Locale
.
locale
- a Locale
to be used to localize
compression type names and quality descriptions, or
null
.public J2KImageWriteParam()
J2KImageWriteParam
object with default
values for all parameters.
Method Detail |
public void setEncodingRate(double rate)
encodingRate
.
rate
- the encoding rate in bits-per-pixel.getEncodingRate()
public double getEncodingRate()
encodingRate
.
setEncodingRate(double)
public void setLossless(boolean lossless)
lossless
.
lossless
- whether the compression scheme is lossless.getLossless()
public boolean getLossless()
encodingRate
.
setLossless(boolean)
public void setFilter(String value)
filter
.
value
- which wavelet filters to use for the specified
tile-components.getFilter()
public String getFilter()
filters
.
setFilter(String)
public void setComponentTransformation(boolean value)
componentTransformation
.
value
- whether to utilize the component transformation.getComponentTransformation()
public boolean getComponentTransformation()
componentTransformation
.
setComponentTransformation(boolean)
public void setCodeBlockSize(int[] value)
codeBlockSize
.
value
- the maximum code-block size to use per tile-component.getCodeBlockSize()
public int[] getCodeBlockSize()
codeBlockSize
.
setCodeBlockSize(int[])
public void setSOP(boolean value)
SOP
.
value
- whether start of packet (SOP) markers should be used.getSOP()
public boolean getSOP()
SOP
.
setSOP(boolean)
public void setEPH(boolean value)
EPH
.
value
- whether end of packet header (EPH) markers should be used.getEPH()
public boolean getEPH()
EPH
.
setEPH(boolean)
public void setProgressionType(String value)
progressionType
.
value
- which type of progression should be used when generating
the codestream.getProgressionType()
public String getProgressionType()
progressionType
.
setProgressionType(String)
public void setWriteCodeStreamOnly(boolean value)
writeCodeStreamOnly
.
value
- Whether the jpeg2000 code stream only or the jp2 format
will be written into the output.getWriteCodeStreamOnly()
public boolean getWriteCodeStreamOnly()
writeCodeStreamOnly
.
setWriteCodeStreamOnly(boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |