org.jmage.encoder
Class JDKImageEncoder

java.lang.Object
  extended by org.jmage.encoder.JDKImageEncoder
All Implemented Interfaces:
Configurable, ImageEncoder

public class JDKImageEncoder
extends java.lang.Object
implements ImageEncoder

Use JDK native methods to encode images


Field Summary
protected  com.sun.media.jai.codec.ImageEncodeParam encodeParam
           
protected  java.lang.String encodingFormat
           
static java.util.Map encodingFormats
           
static java.lang.String JPEG
           
static java.lang.String JPG
           
static org.apache.log4j.Logger log
           
static java.lang.String PNG
           
 
Constructor Summary
JDKImageEncoder()
          Default Constructor
 
Method Summary
 boolean canHandle(ImageRequest request)
          Test whether the ImageEncoder can handle the request
 void configure(ApplicationContext context)
          Configure
 byte[] createFrom(ImageRequest request)
          Encode the image in the specified format
 void initialize(ImageRequest request)
          Initialize the ImageEncoder for a particular encodingformat using Properties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PNG

public static final java.lang.String PNG
See Also:
Constant Field Values

JPG

public static final java.lang.String JPG
See Also:
Constant Field Values

JPEG

public static final java.lang.String JPEG
See Also:
Constant Field Values

encodingFormats

public static java.util.Map encodingFormats

log

public static org.apache.log4j.Logger log

encodingFormat

protected java.lang.String encodingFormat

encodeParam

protected com.sun.media.jai.codec.ImageEncodeParam encodeParam
Constructor Detail

JDKImageEncoder

public JDKImageEncoder()
Default Constructor

Method Detail

configure

public void configure(ApplicationContext context)
Configure

Specified by:
configure in interface Configurable
Parameters:
context -

canHandle

public boolean canHandle(ImageRequest request)
Description copied from interface: ImageEncoder
Test whether the ImageEncoder can handle the request

Specified by:
canHandle in interface ImageEncoder
Parameters:
request - the ImageRequest
Returns:
[true | false]

initialize

public void initialize(ImageRequest request)
                throws CodecException
Description copied from interface: ImageEncoder
Initialize the ImageEncoder for a particular encodingformat using Properties

Specified by:
initialize in interface ImageEncoder
Throws:
CodecException

createFrom

public byte[] createFrom(ImageRequest request)
                  throws CodecException
Description copied from interface: ImageEncoder
Encode the image in the specified format

Specified by:
createFrom in interface ImageEncoder
Parameters:
request - the imageRequest
Returns:
the encoded image as a byte array.
Throws:
CodecException


Copyright © 2004-2008 Sourceforge. All Rights Reserved.