com.bbn.openmap.image
Class AcmeJPEGHelper

java.lang.Object
  |
  +--com.bbn.openmap.image.AcmeJPEGHelper

public class AcmeJPEGHelper
extends java.lang.Object

This class provides some utility methods for creating jpeg encoded images. It relies on the Acme Encoders, available at http://www.acme.com. A copy has been included in the contrib directory.


Method Summary
static byte[] encodeJPEG(java.awt.image.BufferedImage image, int quality)
          Return a byte array that contains the JPEG encoded image.
static byte[] encodeJPEG(int w, int h, int[] pixels, int 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encodeJPEG

public static byte[] encodeJPEG(java.awt.image.BufferedImage image,
                                int quality)
                         throws java.io.IOException
Return a byte array that contains the JPEG encoded image.

Parameters:
image - the image to encode
quality - the JPEG quality factor to use in encoding 1-100
Throws:
java.io.IOException - an error occured in encoding the image

encodeJPEG

public static byte[] encodeJPEG(int w,
                                int h,
                                int[] pixels,
                                int quality)
                         throws java.io.IOException
Return a byte array that contains the JPEG encoded image.

Parameters:
w - the width of the image
h - the height of the image
pixels - the array of pixels in RGB directcolor
quality - the JPEG quality factor to use in encoding
Throws:
java.io.IOException - an error occured in encoding the image

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
A test main that encodes an image url at various jpeg quality factors.

Parameters:
args - url [width height]
java.lang.Exception


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details