org.jmage.encoder
Class DefaultImageEncoder

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

public class DefaultImageEncoder
extends java.lang.Object
implements ImageEncoder

Encodes the most popular images types "bmp", "png", "jpg", and "tif"


Field Summary
static java.lang.String BMP
           
protected  com.sun.media.jai.codec.ImageEncodeParam encodeParam
           
protected  java.lang.String encodingFormat
           
static java.util.Map encodingFormats
           
static org.apache.log4j.Logger log
           
static java.lang.String TIF
           
static java.lang.String TIFF
           
 
Constructor Summary
DefaultImageEncoder()
          Default Constructor
 
Method Summary
 boolean canHandle(ImageRequest request)
          Test whether the ImageEncoder can handle the format
 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
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BMP

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

TIF

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

TIFF

public static final java.lang.String TIFF
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

DefaultImageEncoder

public DefaultImageEncoder()
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)
Test whether the ImageEncoder can handle the format

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

initialize

public void initialize(ImageRequest request)
                throws CodecException
Initialize the ImageEncoder for a particular encodingformat using Properties

Specified by:
initialize in interface ImageEncoder
Parameters:
request -
Throws:
CodecException

createFrom

public byte[] createFrom(ImageRequest request)
                  throws CodecException
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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2004-2008 Sourceforge. All Rights Reserved.