it.geosolutions.imageio.plugins.jp2k
Class JP2KKakaduImageWriteParam

java.lang.Object
  extended by javax.imageio.IIOParam
      extended by javax.imageio.ImageWriteParam
          extended by it.geosolutions.imageio.plugins.jp2k.JP2KKakaduImageWriteParam

public class JP2KKakaduImageWriteParam
extends ImageWriteParam

Class holding Write parameters to customize the write operations, and set several fields, tags, markers through the kakadu machinery.

Author:
Daniele Romagnoli, GeoSolutions, Simone Giannecchini, GeoSolutions

Nested Class Summary
static class JP2KKakaduImageWriteParam.Compression
          Type of compression to better customize the quality specification.
static class JP2KKakaduImageWriteParam.ProgressionOrder
           
 
Field Summary
static int UNSPECIFIED_ORG_GEN_TLM
           
 
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
JP2KKakaduImageWriteParam()
          Default Constructor.
 
Method Summary
 boolean canWriteTiles()
           
 int getCLevels()
          Gets cLevels.
 JP2KKakaduImageWriteParam.Compression getCompression()
           
 JP2KKakaduImageWriteParam.ProgressionOrder getcOrder()
           
 String getcPrecincts()
           
 byte[] getGeoJp2()
           
 int getOrgGen_tlm()
           
 String getOrgT_parts()
           
 int getqGuard()
           
 double getQuality()
          Gets quality.
 int getQualityLayers()
          Gets qualityLayers.
 double[] getQualityLayersBitRates()
           
 int getsProfile()
           
 boolean isAddCommentMarker()
           
 boolean isOrgGen_plt()
           
 boolean isWriteCodeStreamOnly()
          Gets writeCodeStreamOnly.
 void setAddCommentMarker(boolean addCommentMarker)
           
 void setCLevels(int cLevels)
          Sets cLevels.
 void setCompression(JP2KKakaduImageWriteParam.Compression compression)
          Set the compression type.
 void setcOrder(JP2KKakaduImageWriteParam.ProgressionOrder cOrder)
           
 void setcPrecincts(String cPrecincts)
           
 void setGeoJp2(byte[] geoJp2)
           
 void setOrgGen_plt(boolean orgGen_plt)
           
 void setOrgGen_tlm(int orgGen_tlm)
           
 void setOrgT_parts(String orgT_parts)
           
 void setqGuard(int qGuard)
           
 void setQuality(double quality)
          Sets quality.
 void setQualityLayers(int qualityLayers)
          Sets qualityLayers.
 void setQualityLayersBitRates(double[] qualityLayersBitRates)
          Set the qualityLayer bitRates.
 void setsProfile(int sProfile)
           
 void setWriteCodeStreamOnly(boolean writeCodeStreamOnly)
          Sets writeCodeStreamOnly.
 String toString()
           
 
Methods inherited from class javax.imageio.ImageWriteParam
canOffsetTiles, canWriteCompressed, canWriteProgressive, 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
 
Methods inherited from class javax.imageio.IIOParam
activateController, getController, getDefaultController, getDestinationOffset, getDestinationType, getSourceBands, getSourceRegion, getSourceXSubsampling, getSourceYSubsampling, getSubsamplingXOffset, getSubsamplingYOffset, hasController, setController, setDestinationOffset, setDestinationType, setSourceBands, setSourceRegion, setSourceSubsampling
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNSPECIFIED_ORG_GEN_TLM

public static final int UNSPECIFIED_ORG_GEN_TLM
See Also:
Constant Field Values
Constructor Detail

JP2KKakaduImageWriteParam

public JP2KKakaduImageWriteParam()
Default Constructor.

Method Detail

canWriteTiles

public boolean canWriteTiles()
Overrides:
canWriteTiles in class ImageWriteParam

setWriteCodeStreamOnly

public void setWriteCodeStreamOnly(boolean writeCodeStreamOnly)
Sets writeCodeStreamOnly.

Parameters:
value - Whether the jpeg2000 code stream only or the jp2 format will be written into the output.
See Also:
isWriteCodeStreamOnly()

isWriteCodeStreamOnly

public boolean isWriteCodeStreamOnly()
Gets writeCodeStreamOnly.

Returns:
whether the jpeg2000 code stream only or the jp2 format will be written into the output.
See Also:
setWriteCodeStreamOnly(boolean)

getQuality

public double getQuality()
Gets quality.

Returns:
the quality parameter.
See Also:
setQuality(double)

setQuality

public void setQuality(double quality)
Sets quality.

Parameters:
quality - a quality parameter representing a compression ratio. As an instance, a 0.2 quality represents a 5:1 compression ratio. This parameter will be ignored in case the qualityLayersBitRates parameter have been specified or in case the Compression parameter has been specified through the setCompression(Compression) method using a JP2KKakaduImageWriteParam.Compression.NUMERICALLY_LOSSLESS
See Also:
getQuality(), setQualityLayersBitRates(double[]), setCompression(Compression)

getCLevels

public int getCLevels()
Gets cLevels.

Returns:
the number of decomposition levels.
See Also:
setCLevels(int)

setCLevels

public void setCLevels(int cLevels)
Sets cLevels.

Parameters:
cLevels - the number of decomposition levels.
See Also:
getCLevels()()

getQualityLayers

public int getQualityLayers()
Gets qualityLayers.

Returns:
the number of quality layers.
See Also:
setQualityLayers(int)

setQualityLayers

public void setQualityLayers(int qualityLayers)
Sets qualityLayers.

Parameters:
qualityLayers - the number of quality layers.
See Also:
getQualityLayers(), setQualityLayersBitRates(double[]), setCompression(Compression)

getGeoJp2

public byte[] getGeoJp2()

setGeoJp2

public void setGeoJp2(byte[] geoJp2)

setOrgGen_plt

public void setOrgGen_plt(boolean orgGen_plt)

isOrgGen_plt

public boolean isOrgGen_plt()

setOrgGen_tlm

public void setOrgGen_tlm(int orgGen_tlm)

getOrgGen_tlm

public int getOrgGen_tlm()

setOrgT_parts

public void setOrgT_parts(String orgT_parts)

getOrgT_parts

public String getOrgT_parts()

getcOrder

public JP2KKakaduImageWriteParam.ProgressionOrder getcOrder()

setcOrder

public void setcOrder(JP2KKakaduImageWriteParam.ProgressionOrder cOrder)

getqGuard

public int getqGuard()

setqGuard

public void setqGuard(int qGuard)

getcPrecincts

public String getcPrecincts()

setcPrecincts

public void setcPrecincts(String cPrecincts)

setQualityLayersBitRates

public void setQualityLayersBitRates(double[] qualityLayersBitRates)
Set the qualityLayer bitRates. This parameter will override any quality value specified with setQuality(double)

Parameters:
qualityLayersBitRates - an array representing the cumulative bitRate for each qualityLayer. The length of the array should be equals to the specified qualityLayers value.
See Also:
setQualityLayers(int), setCompression(Compression)

getQualityLayersBitRates

public double[] getQualityLayersBitRates()

isAddCommentMarker

public boolean isAddCommentMarker()

setAddCommentMarker

public void setAddCommentMarker(boolean addCommentMarker)

getsProfile

public int getsProfile()

setsProfile

public void setsProfile(int sProfile)

setCompression

public void setCompression(JP2KKakaduImageWriteParam.Compression compression)
Set the compression type. One of JP2KKakaduImageWriteParam.Compression.NUMERICALLY_LOSSLESS, JP2KKakaduImageWriteParam.Compression.LOSSY.

Parameters:
compression - the type of compression to apply which could be numerically lossless, visually lossless (leveraging on quality bitrates) or lossy (leveraging on quality factor).
  • Use NUMERICALLY_LOSSLESS if you want to specify a LossLess (reversible) compression (which is equivalent to specifying a quality = 1 parameter). The quality parameter will be ignored. Optionally specify a qualityLayersBitRate parameter (make sure to set 0 as the last value of the array) if you want to specify the quality layers structure. Otherwise the quality layers structure will be built using a dicothomic scale.
  • Use LOSSY if you want to specify a Visually LossLess compression (which is still lossy). You need to specify a qualityLayersBitRate parameter when using this value. The quality parameter will be ignored.
  • Use LOSSY if you want to specify a Lossy compression leveraging on the quality parameter which should be < 1. In order to leverage on the quality parameter, the qualityLayersBitRates parameter shouldn't be specified.
See Also:
setQualityLayers(int), setQuality(double), setQualityLayersBitRates(double[])

getCompression

public JP2KKakaduImageWriteParam.Compression getCompression()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006–2013 GeoSolutions. All rights reserved.