public class JPEGHelper
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
encodeJPEG(java.awt.image.BufferedImage image,
float quality)
Return a byte array that contains the JPEG encoded image.
|
static byte[] |
encodeJPEG(int w,
int h,
int[] pixels,
float quality)
Return a byte array that contains the JPEG encoded image.
|
static void |
main(java.lang.String[] args)
A test main that encodes an image url at various jpeg quality factors.
|
public static byte[] encodeJPEG(java.awt.image.BufferedImage image, float quality) throws java.io.IOException
image
- the image to encodequality
- the JPEG quality factor to use in encodingjava.io.IOException
- an error occurred in encoding the imagepublic static byte[] encodeJPEG(int w, int h, int[] pixels, float quality) throws java.io.IOException
w
- the width of the imageh
- the height of the imagepixels
- the array of pixels in RGB directcolorquality
- the JPEG quality factor to use in encodingjava.io.IOException
- an error occurred in encoding the imagepublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- url [width height]java.lang.Exception
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details