com.uwyn.rife.cmf.format
Class ImageFormatter

java.lang.Object
  extended by com.uwyn.rife.cmf.format.ImageFormatter
All Implemented Interfaces:
Formatter<byte[],Image>

public class ImageFormatter
extends Object
implements Formatter<byte[],Image>

Formats raw Content data as an image.

The following content attributes are supported:

width Changes the width of the image. If no height is provided, the image will be proportionally scaled.
height Changes the height of the image. If no width is provided, the image will be proportionally scaled.

Since:
1.0
Version:
$Revision: 3634 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com)
See Also:
Formatter

Constructor Summary
ImageFormatter()
           
 
Method Summary
 byte[] format(Content content, ContentTransformer<Image> transformer)
          Formats raw data and returns it in a DataType that's supported by the back-end stores.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageFormatter

public ImageFormatter()
Method Detail

format

public byte[] format(Content content,
                     ContentTransformer<Image> transformer)
              throws FormatException
Description copied from interface: Formatter
Formats raw data and returns it in a DataType that's supported by the back-end stores.

Specified by:
format in interface Formatter<byte[],Image>
Parameters:
content - a Content instance that contains the raw data with additional information that describes the storage and formatting of the processed data
transformer - a transformer that will be used to modify raw data after it has been loaded; or

null if the data shouldn't be transformed

Returns:
the result of the formatting of the raw data
Throws:
FormatException


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.