public class Jpeg2000Options extends ImageOptionsBase
The Jpeg2000 file format options.
Constructor and Description |
---|
Jpeg2000Options()
Initializes a new instance of the
Jpeg2000Options class. |
Jpeg2000Options(Jpeg2000Options jpeg2000Options)
Initializes a new instance of the
Jpeg2000Options class. |
Modifier and Type | Method and Description |
---|---|
int |
getCodec()
Gets or sets the JPEG2000 codec
|
String[] |
getComments()
Gets or sets the Jpeg comment markers.
|
int[] |
getCompressionRatios()
Gets or sets the Array of compression ratio.
|
boolean |
getIrreversible()
Gets a value indicating whether use the irreversible DWT 9-7 (true) or use lossless DWT 5-3 compression (default).
|
XmpPacketWrapper |
getXmpData()
Gets or sets the XMP metadata container.
|
void |
setCodec(int value)
Gets or sets the JPEG2000 codec
|
void |
setComments(String[] value)
Gets or sets the Jpeg comment markers.
|
void |
setCompressionRatios(int[] value)
Gets or sets the Array of compression ratio.
|
void |
setIrreversible(boolean value)
Sets a value indicating whether use the irreversible DWT 9-7 (true) or use lossless DWT 5-3 compression (default).
|
void |
setXmpData(XmpPacketWrapper value)
Gets or sets the XMP metadata container.
|
deepClone, getBufferSizeHint, getMultiPageOptions, getPalette, getProgressEventHandler, getResolutionSettings, getSource, getVectorRasterizationOptions, setBufferSizeHint, setMultiPageOptions, setPalette, setProgressEventHandler, setResolutionSettings, setSource, setVectorRasterizationOptions
close, dispose, getDisposed
public Jpeg2000Options()
Initializes a new instance of the Jpeg2000Options
class.
public Jpeg2000Options(Jpeg2000Options jpeg2000Options)
Initializes a new instance of the Jpeg2000Options
class.
jpeg2000Options
- The Jpeg2000 file format options to copy settings from.public XmpPacketWrapper getXmpData()
Gets or sets the XMP metadata container.
getXmpData
in class ImageOptionsBase
public void setXmpData(XmpPacketWrapper value)
Gets or sets the XMP metadata container.
setXmpData
in class ImageOptionsBase
value
- The XMP data container.public String[] getComments()
Gets or sets the Jpeg comment markers.
public void setComments(String[] value)
Gets or sets the Jpeg comment markers.
value
- The Jpeg comment markers.public int getCodec()
Gets or sets the JPEG2000 codec
Jpeg2000Codec
public void setCodec(int value)
Gets or sets the JPEG2000 codec
value
- The JPEG2000 codecJpeg2000Codec
This example shows how to create a PNG image and save it to JPEG2000 with the desired options.
String dir = "c:\\temp\\"; // Create a PNG image of 100x100 px. com.aspose.imaging.fileformats.png.PngImage pngImage = new com.aspose.imaging.fileformats.png.PngImage(100, 100); try { com.aspose.imaging.Graphics graphics = new com.aspose.imaging.Graphics(pngImage); // Fill the entire image in red. com.aspose.imaging.brushes.SolidBrush brush = new com.aspose.imaging.brushes.SolidBrush(com.aspose.imaging.Color.getRed()); graphics.fillRectangle(brush, pngImage.getBounds()); com.aspose.imaging.imageoptions.Jpeg2000Options saveOptions = new com.aspose.imaging.imageoptions.Jpeg2000Options(); // Use the irreversible Discrete Wavelet Transform 9-7 saveOptions.setIrreversible(true); // JP2 is the "container" format for JPEG 2000 codestreams. // J2K is raw compressed data, without a wrapper. saveOptions.setCodec(com.aspose.imaging.fileformats.jpeg2000.Jpeg2000Codec.J2K); // Save to a file pngImage.save(dir + "output.j2k", saveOptions); } finally { pngImage.dispose(); }
public int[] getCompressionRatios()
Gets or sets the Array of compression ratio. Different compression ratios for successive layers. The rate specified for each quality level is the desired compression factor. Decreasing ratios required.
public void setCompressionRatios(int[] value)
Gets or sets the Array of compression ratio. Different compression ratios for successive layers. The rate specified for each quality level is the desired compression factor. Decreasing ratios required.
value
- The compression ratios.public boolean getIrreversible()
Gets a value indicating whether use the irreversible DWT 9-7 (true) or use lossless DWT 5-3 compression (default).
public void setIrreversible(boolean value)
Sets a value indicating whether use the irreversible DWT 9-7 (true) or use lossless DWT 5-3 compression (default).
value
- a value indicating whether use the irreversible DWT 9-7 (true) or use lossless DWT 5-3 compressionThis example shows how to create a PNG image and save it to JPEG2000 with the desired options.
String dir = "c:\\temp\\"; // Create a PNG image of 100x100 px. com.aspose.imaging.fileformats.png.PngImage pngImage = new com.aspose.imaging.fileformats.png.PngImage(100, 100); try { com.aspose.imaging.Graphics graphics = new com.aspose.imaging.Graphics(pngImage); // Fill the entire image in red. com.aspose.imaging.brushes.SolidBrush brush = new com.aspose.imaging.brushes.SolidBrush(com.aspose.imaging.Color.getRed()); graphics.fillRectangle(brush, pngImage.getBounds()); com.aspose.imaging.imageoptions.Jpeg2000Options saveOptions = new com.aspose.imaging.imageoptions.Jpeg2000Options(); // Use the irreversible Discrete Wavelet Transform 9-7 saveOptions.setIrreversible(true); // JP2 is the "container" format for JPEG 2000 codestreams. // J2K is raw compressed data, without a wrapper. saveOptions.setCodec(com.aspose.imaging.fileformats.jpeg2000.Jpeg2000Codec.J2K); // Save to a file pngImage.save(dir + "output.j2k", saveOptions); } finally { pngImage.dispose(); }