| java.lang.Object org.jfree.chart.encoders.SunJPEGEncoderAdapter
SunJPEGEncoderAdapter | public class SunJPEGEncoderAdapter implements ImageEncoder(Code) | | Adapter class for the Sun JPEG Encoder. The
ImageEncoderFactory
will only return a reference to this class by default if the library has
been compiled under a JDK 1.4+ and is being run using a JRE 1.4+.
|
Method Summary | |
public byte[] | encode(BufferedImage bufferedImage) Encodes an image in JPEG format.
Parameters: bufferedImage - the image to be encoded (null not permitted). | public void | encode(BufferedImage bufferedImage, OutputStream outputStream) Encodes an image in JPEG format and writes it to an output stream. | public float | getQuality() Returns the quality of the image encoding, which is a number in the
range 0.0f to 1.0f (higher values give better quality output, but larger
file sizes). | public boolean | isEncodingAlpha() Returns false always, indicating that this encoder does not
encode alpha transparency. | public void | setEncodingAlpha(boolean encodingAlpha) Set whether the encoder should encode alpha transparency (this is not
supported for JPEG, so this method does nothing). | public void | setQuality(float quality) Set the quality of the image encoding. |
SunJPEGEncoderAdapter | public SunJPEGEncoderAdapter()(Code) | | Creates a new SunJPEGEncoderAdapter instance.
|
encode | public byte[] encode(BufferedImage bufferedImage) throws IOException(Code) | | Encodes an image in JPEG format.
Parameters: bufferedImage - the image to be encoded (null not permitted). The byte[] that is the encoded image. throws: IOException - if there is an I/O problem. throws: NullPointerException - if bufferedImage is null . |
encode | public void encode(BufferedImage bufferedImage, OutputStream outputStream) throws IOException(Code) | | Encodes an image in JPEG format and writes it to an output stream.
Parameters: bufferedImage - the image to be encoded (null not permitted). Parameters: outputStream - the OutputStream to write the encoded image to (null not permitted). throws: IOException - if there is an I/O problem. throws: NullPointerException - if bufferedImage is null . |
getQuality | public float getQuality()(Code) | | Returns the quality of the image encoding, which is a number in the
range 0.0f to 1.0f (higher values give better quality output, but larger
file sizes). The default value is 0.95f.
A float representing the quality, in the range 0.0f to 1.0f. See Also: SunJPEGEncoderAdapter.setQuality(float) |
isEncodingAlpha | public boolean isEncodingAlpha()(Code) | | Returns false always, indicating that this encoder does not
encode alpha transparency.
false . |
setEncodingAlpha | public void setEncodingAlpha(boolean encodingAlpha)(Code) | | Set whether the encoder should encode alpha transparency (this is not
supported for JPEG, so this method does nothing).
Parameters: encodingAlpha - ignored. |
setQuality | public void setQuality(float quality)(Code) | | Set the quality of the image encoding.
Parameters: quality - A float representing the quality (in the range 0.0f to1.0f). See Also: SunJPEGEncoderAdapter.getQuality() |
|
|