public class J2KImageWriteParam extends ImageWriteParam
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 |
---|---|
numDecompositionLevels | The number of decomposition levels to generate. This value must
be in the range
0 ≤ numDecompositionLevels ≤ 32
. The default value is 5 . Note that the number
of resolution levels is
numDecompositionLevels + 1 .
The number of decomposition levels is constant across
all components and all tiles.
|
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. |
Modifier and Type | Field and Description |
---|---|
private int[] |
codeBlockSize
Specifies the maximum code-block size to use for tile-component.
|
private boolean |
componentTransformation
Specifies to utilize the component transformation with some tiles.
|
private double |
encodingRate
The bitrate in bits-per-pixel for encoding.
|
private boolean |
EPH
Specifies whether end of packet header (EPH) markers should be used.
|
private String |
filter
Specifies which filters to use for the specified tile-components.
|
static String |
FILTER_53
The filter for lossless compression.
|
static String |
FILTER_97
The filter for lossy compression.
|
private boolean |
lossless
Indicates using the lossless scheme or not.
|
private int |
numDecompositionLevels
The number of decomposition levels.
|
private String |
progressionType
See above.
|
private boolean |
SOP
Specifies whether start of packet (SOP) markers should be used.
|
private boolean |
writeCodeStreamOnly
Specifies whether write only the jpeg2000 code stream, i.e, no any
box is written.
|
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
controller, defaultController, destinationOffset, destinationType, sourceBands, sourceRegion, sourceXSubsampling, sourceYSubsampling, subsamplingXOffset, subsamplingYOffset
Constructor and Description |
---|
J2KImageWriteParam()
Constructs a
J2KImageWriteParam object with default
values for all parameters. |
J2KImageWriteParam(Locale locale)
Constructor which sets the
Locale . |
Modifier and Type | Method and Description |
---|---|
int[] |
getCodeBlockSize()
Gets
codeBlockSize . |
boolean |
getComponentTransformation()
Gets
componentTransformation . |
double |
getEncodingRate()
Gets
encodingRate . |
boolean |
getEPH()
Gets
EPH . |
String |
getFilter()
Gets
filters . |
boolean |
getLossless()
Gets
lossless . |
int |
getNumDecompositionLevels()
Gets
numDecompositionLevels . |
String |
getProgressionType()
Gets
progressionType . |
boolean |
getSOP()
Gets
SOP . |
boolean |
getWriteCodeStreamOnly()
Gets
writeCodeStreamOnly . |
void |
setCodeBlockSize(int[] value)
Sets
codeBlockSize . |
void |
setComponentTransformation(boolean value)
Sets
componentTransformation . |
private void |
setDefaults()
Set source
|
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 |
setNumDecompositionLevels(int numDecompositionLevels)
Sets
numDecompositionLevels . |
void |
setProgressionType(String value)
Sets
progressionType . |
void |
setSOP(boolean value)
Sets
SOP . |
void |
setWriteCodeStreamOnly(boolean value)
Sets
writeCodeStreamOnly . |
canOffsetTiles, canWriteCompressed, canWriteProgressive, canWriteTiles, getBitRate, getCompressionMode, getCompressionQuality, getCompressionQualityDescriptions, getCompressionQualityValues, getCompressionType, getCompressionTypes, getLocale, getLocalizedCompressionTypeName, getPreferredTileSizes, getProgressiveMode, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getTilingMode, isCompressionLossless, setCompressionMode, setCompressionQuality, setCompressionType, setProgressiveMode, setTiling, setTilingMode, unsetCompression, unsetTiling
activateController, getController, getDefaultController, getDestinationOffset, getDestinationType, getSourceBands, getSourceRegion, getSourceXSubsampling, getSourceYSubsampling, getSubsamplingXOffset, getSubsamplingYOffset, hasController, setController, setDestinationOffset, setDestinationType, setSourceBands, setSourceRegion, setSourceSubsampling
public static final String FILTER_97
public static final String FILTER_53
private int numDecompositionLevels
private double encodingRate
Double.MAX_VALUE
.private boolean lossless
private boolean componentTransformation
private String filter
private int[] codeBlockSize
private String progressionType
private boolean EPH
private boolean SOP
private boolean writeCodeStreamOnly
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.private void setDefaults()
public void setNumDecompositionLevels(int numDecompositionLevels)
numDecompositionLevels
.numDecompositionLevels
- the number of decomposition levels.IllegalArgumentException
- if numDecompositionLevels
is negative or greater than 32.getNumDecompositionLevels()
public int getNumDecompositionLevels()
numDecompositionLevels
.setNumDecompositionLevels(int)
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()
lossless
.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)
Copyright © 2015 Open Microscopy Environment