Java Code Examples for sun.awt.image.codec.JPEGParam#setWidth()

The following examples show how to use sun.awt.image.codec.JPEGParam#setWidth() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JPEGCodec.java    From jdk1.8-source-analysis with Apache License 2.0 3 votes vote down vote up
/**
  * This is a factory method for creating JPEGEncodeParam objects.
  * It is the users responsiblity to match the colorID with the
  * data contained in the Raster.  Failure to do so may lead to
  * either poor compression or poor image quality.  If you don't
  * understand much about JPEG it is strongly recommended that you
  * stick to the BufferedImage interface.
  * @param ras Raster that is similar to those to be encoded later.
  * @param colorID the COLOR_ID for the encoded data.  This should
  *        match the data in the raster.
  */
public static JPEGEncodeParam getDefaultJPEGEncodeParam(Raster ras,
                                                        int colorID)
{
JPEGParam ret = new JPEGParam(colorID, ras.getNumBands());
ret.setWidth(ras.getWidth());
ret.setHeight(ras.getHeight());

return ret;
}
 
Example 2
Source File: JPEGCodec.java    From oim-fx with MIT License 3 votes vote down vote up
/**
  * This is a factory method for creating JPEGEncodeParam objects.
  * It is the users responsiblity to match the colorID with the
  * data contained in the Raster.  Failure to do so may lead to
  * either poor compression or poor image quality.  If you don't
  * understand much about JPEG it is strongly recommended that you
  * stick to the BufferedImage interface.
  * @param ras Raster that is similar to those to be encoded later.
  * @param colorID the COLOR_ID for the encoded data.  This should
  *        match the data in the raster.
  */
public static JPEGEncodeParam getDefaultJPEGEncodeParam(Raster ras,
                                                       	int colorID)
{
 	JPEGParam ret = new JPEGParam(colorID, ras.getNumBands());
 	ret.setWidth(ras.getWidth());
 	ret.setHeight(ras.getHeight());

 	return ret;
}
 
Example 3
Source File: JPEGCodec.java    From JDKSourceCode1.8 with MIT License 3 votes vote down vote up
/**
  * This is a factory method for creating JPEGEncodeParam objects.
  * It is the users responsiblity to match the colorID with the
  * data contained in the Raster.  Failure to do so may lead to
  * either poor compression or poor image quality.  If you don't
  * understand much about JPEG it is strongly recommended that you
  * stick to the BufferedImage interface.
  * @param ras Raster that is similar to those to be encoded later.
  * @param colorID the COLOR_ID for the encoded data.  This should
  *        match the data in the raster.
  */
public static JPEGEncodeParam getDefaultJPEGEncodeParam(Raster ras,
                                                        int colorID)
{
JPEGParam ret = new JPEGParam(colorID, ras.getNumBands());
ret.setWidth(ras.getWidth());
ret.setHeight(ras.getHeight());

return ret;
}