Package rife.cmf.format
Class ImageFormatter
java.lang.Object
rife.cmf.format.ImageFormatter
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. |
longest-edge-length |
Changes the longest edge of the image. Aspect ratio is preserved. The "width" or "height" attributes take precedence if set, and this attribute will be ignored. |
- Since:
- 1.0
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static final class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
format
(Content content, ContentTransformer<Image> transformer) Formats raw data and returns it in aDataType
that's supported by the back-end stores.
-
Constructor Details
-
ImageFormatter
public ImageFormatter()
-
-
Method Details
-
format
Description copied from interface:Formatter
Formats raw data and returns it in aDataType
that's supported by the back-end stores.- Specified by:
format
in interfaceFormatter<byte[],
Image> - Parameters:
content
- aContent
instance that contains the raw data with additional information that describes the storage and formatting of the processed datatransformer
- a transformer that will be used to modify raw data after it has been loaded; ornull
if the data shouldn't be transformed- Returns:
- the result of the formatting of the raw data
- Throws:
FormatException
-