de.innovationgate.utils
public interface MimeTypeSpecificImageScaler
Modifier and Type | Method and Description |
---|---|
void |
crop(int x,
int y,
int width,
int height)
This method crops out the selected area from an image
The parameters x and y defines the start coordinate.
|
long |
determineRenderedSize()
Determines the bytes size of the image if it would be written to an output stream.
|
int |
getHeight()
Returns the current image height
|
java.lang.Object |
getImageEncodeParam()
Returns the image encoding params.
|
int |
getWidth()
Returns the current image width
|
void |
growToSize(int width,
int height)
Scales the images up to fit given minimum sizes.
|
boolean |
isTransparencySupportedForOutput()
Returns if transparency is supported by the used mime type
|
void |
load(java.io.InputStream is,
java.lang.String mimeType)
Loads image data.
|
void |
scaleByFactor(int hfactor,
int vfactor)
Scales the image based on the given scaling factors.
|
void |
scaleToSize(int width,
int height,
boolean keepRatio)
Scales the image to the determined target size
if keepRation==true
image orientation is determined (landscape or portrait)
on landscape the image is scaled with the same ratio to the given width
on portrait the image is scaled with the same ratio to the given height
|
void |
setImageEncodeParam(java.lang.Object imageEncodeParam)
Sets the image encoding params
|
void |
shrinkToSize(int width,
int height)
Scales the images down to fit into given maximum sizes.
|
void |
writeImage(java.io.OutputStream out)
Writes the rendered and scaled image to an outputstream
|
void load(java.io.InputStream is, java.lang.String mimeType) throws java.lang.IllegalArgumentException, java.io.IOException
is
- image data input stream.mimeType
- of the loaded imagejava.lang.IllegalArgumentException
- if the mimetype is not supportedjava.io.IOException
- if something goes wrong on loadingvoid scaleToSize(int width, int height, boolean keepRatio) throws java.lang.UnsupportedOperationException, java.io.IOException
width
- The target widthheight
- The target heightkeepRatio
- true/ falsejava.lang.UnsupportedOperationException
java.io.IOException
void scaleByFactor(int hfactor, int vfactor) throws java.lang.UnsupportedOperationException, java.io.IOException
hfactor
- The horizontal scaling factorvfactor
- The vertical scaling factorjava.lang.UnsupportedOperationException
java.io.IOException
void shrinkToSize(int width, int height) throws java.lang.UnsupportedOperationException, java.io.IOException
width
- The maximum widthheight
- The maximum heightjava.lang.UnsupportedOperationException
java.io.IOException
void growToSize(int width, int height) throws java.lang.UnsupportedOperationException, java.io.IOException
width
- The maximum widthheight
- The maximum heightjava.lang.UnsupportedOperationException
java.io.IOException
void writeImage(java.io.OutputStream out) throws java.io.IOException
out
- java.io.IOException
java.lang.Object getImageEncodeParam()
void setImageEncodeParam(java.lang.Object imageEncodeParam)
imageEncodeParam
- The imageEncodeParam to set.int getWidth()
int getHeight()
long determineRenderedSize() throws java.lang.UnsupportedOperationException, java.io.IOException
java.lang.UnsupportedOperationException
java.io.IOException
boolean isTransparencySupportedForOutput()
void crop(int x, int y, int width, int height) throws java.lang.UnsupportedOperationException, java.io.IOException
x
- y
- width
- height
- java.lang.UnsupportedOperationException
- If this scaler does not support croppingjava.io.IOException