|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Objectsrc.groovy.pl.burningice.plugins.image.file.ImageFile
class ImageFile
Base class for all image sources (File, MultipartFile)
Property Summary | |
---|---|
static java.lang.String |
BMP_EXTENSION
|
static java.lang.String |
GIF_EXTENSION
|
private static def |
GIF_OUTPUT_FORMAT
Gif image output format |
static java.lang.String |
JPG_EXTENSION
|
static java.lang.String |
PNG_EXTENSION
|
def |
extensionEncoderMapping
Mapping file extension >> JAI encoder |
byte[] |
source
|
java.lang.String |
sourceFileName
Name of the source file |
Constructor Summary | |
ImageFile(java.lang.String sourceFileName, byte[] source)
Default constructor |
Method Summary | |
---|---|
BufferedImage
|
getAsBufferedImage()
Returns uploaded image as BufferedImage |
byte[]
|
getAsByteArray()
Returns uploaded image as byte array |
javax.media.jai.RenderedOp
|
getAsJaiStream()
Returns file as JAI RenderedOp object |
def
|
getEncoder()
Method returns encoder for file Encoder is mapped by file extension |
def
|
getExtension()
Method returns file extension If there is GIF file, it will be transformed into format specified by GIF_OUTPUT_FORMAT const |
SeekableStream
|
getInputStream()
Returns InputStream object representing current file |
def
|
getName()
Method returns name of file If file is gif, it will replace gif extension by format specified by GIF_OUTPUT_FORMAT |
Dimension
|
getSize()
Allows to get size of current image |
private byte[]
|
toByteArray(BufferedImage image)
Converts BufferedImage object pass as a parameter to byte array |
void
|
update(BufferedImage image)
Allows to update current image data |
Methods inherited from class java.lang.Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Property Detail |
---|
public static final java.lang.String BMP_EXTENSION
public static final java.lang.String GIF_EXTENSION
private static final def GIF_OUTPUT_FORMAT
public static final java.lang.String JPG_EXTENSION
public static final java.lang.String PNG_EXTENSION
@Lazy def extensionEncoderMapping
byte[] source
java.lang.String sourceFileName
Constructor Detail |
---|
public ImageFile(java.lang.String sourceFileName, byte[] source)
Method Detail |
---|
public BufferedImage getAsBufferedImage()
public byte[] getAsByteArray()
public javax.media.jai.RenderedOp getAsJaiStream()
public def getEncoder()
public def getExtension()
public SeekableStream getInputStream()
public def getName()
public Dimension getSize()
private byte[] toByteArray(BufferedImage image)
void update(BufferedImage image)
Groovy Documentation