Class ImageUtils
- java.lang.Object
-
- com.openindex.openestate.tool.utils.ImageUtils
-
public class ImageUtils extends Object
ImageUtils.- Author:
- Andreas Rudolph
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImageUtils.ReadableImageFilterstatic classImageUtils.WritableImageFilter
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BufferedImageconvertToGray(BufferedImage image)static BufferedImageconvertToGray(BufferedImage image, Color background)static BufferedImageconvertToGray(BufferedImage image, Color background, boolean flushSrcImage)static BufferedImageconvertToRgb(BufferedImage image)static BufferedImageconvertToRgb(BufferedImage image, boolean flushSrcImage)static BufferedImageconvertToRgb(BufferedImage image, Color background)static BufferedImageconvertToRgb(BufferedImage image, Color background, boolean flushSrcImage)static BufferedImagecrop(BufferedImage image, int x, int y, int width, int height)static BufferedImagecropToRatio(BufferedImage image, int ratioWidth, int ratioHeight)static BufferedImageflipHorizontal(BufferedImage image)static BufferedImageflipVertical(BufferedImage image)static voidflush(Image image)static intgetPixelsForResolution(int pixels, int resolution)static FilegetPreviewImage(ImmoToolProject project, File imageLocation, int width, int height)static FilegetPreviewImage(File tempDir, File imageLocation, int width, int height)static booleanhasAlpha(BufferedImage image)static booleanisReadableFormat(String format)static booleanisReadableMimeType(String mimeType)static booleanisReadableSuffix(String suffix)static booleanisWritableFormat(String format)static booleanisWritableMimeType(String mimeType)static booleanisWritableSuffix(String suffix)static BufferedImageread(File imageLocation)static BufferedImageread(InputStream imageLocation)static BufferedImageread(URL imageLocation)static BufferedImagereadAsRgb(File imageLocation)static BufferedImagereadAsRgb(InputStream imageLocation)static BufferedImagereadAsRgb(URL imageLocation)static BufferedImagereadPreviewFromCache(ImmoToolProject project, File imageLocation, int width, int height)static BufferedImagereadPreviewFromCache(File tempDir, File imageLocation, int width, int height)static BufferedImagerotate(BufferedImage image, Scalr.Rotation rotation)static BufferedImagerotateToLeft(BufferedImage image)static BufferedImagerotateToRight(BufferedImage image)static BufferedImagescale(BufferedImage image, int width, int height)static BufferedImagescale(BufferedImage image, int width, int height, Scalr.Method method, Scalr.Mode mode)static BufferedImagescaleToFit(BufferedImage image, int width, int height)static BufferedImagescaleToFit(BufferedImage image, int width, int height, int resolution)static BufferedImagescaleToFitExactly(BufferedImage image, int width, int height)static BufferedImagescaleToFitExactly(BufferedImage image, int width, int height, int resolution)static BufferedImagescaleToFitHeight(BufferedImage image, int width, int height)static BufferedImagescaleToFitHeight(BufferedImage image, int width, int height, int resolution)static BufferedImagescaleToFitWidth(BufferedImage image, int width, int height)static BufferedImagescaleToFitWidth(BufferedImage image, int width, int height, int resolution)static BufferedImagetoBufferedImage(Image image)static BufferedImagetoBufferedImage(Image image, int type)static voidwrite(BufferedImage image, File target, String format)static voidwrite(BufferedImage image, OutputStream target, String format)static voidwriteJpg(BufferedImage image, File target)static voidwriteJpg(BufferedImage image, File target, boolean forceRgb)static voidwriteJpg(BufferedImage image, OutputStream target)static voidwriteJpg(BufferedImage image, OutputStream target, boolean forceRgb)static voidwritePng(BufferedImage image, File target)static voidwritePng(BufferedImage image, OutputStream target)
-
-
-
Method Detail
-
convertToGray
public static BufferedImage convertToGray(BufferedImage image)
-
convertToGray
public static BufferedImage convertToGray(BufferedImage image, Color background)
-
convertToGray
public static BufferedImage convertToGray(BufferedImage image, Color background, boolean flushSrcImage)
-
convertToRgb
public static BufferedImage convertToRgb(BufferedImage image)
-
convertToRgb
public static BufferedImage convertToRgb(BufferedImage image, Color background)
-
convertToRgb
public static BufferedImage convertToRgb(BufferedImage image, boolean flushSrcImage)
-
convertToRgb
public static BufferedImage convertToRgb(BufferedImage image, Color background, boolean flushSrcImage)
-
crop
public static BufferedImage crop(BufferedImage image, int x, int y, int width, int height)
-
cropToRatio
public static BufferedImage cropToRatio(BufferedImage image, int ratioWidth, int ratioHeight)
-
flipHorizontal
public static BufferedImage flipHorizontal(BufferedImage image)
-
flipVertical
public static BufferedImage flipVertical(BufferedImage image)
-
flush
public static void flush(Image image)
-
getPixelsForResolution
public static int getPixelsForResolution(int pixels, int resolution)
-
getPreviewImage
public static File getPreviewImage(ImmoToolProject project, File imageLocation, int width, int height)
-
getPreviewImage
public static File getPreviewImage(File tempDir, File imageLocation, int width, int height)
-
hasAlpha
public static boolean hasAlpha(BufferedImage image)
-
isReadableFormat
public static boolean isReadableFormat(String format)
-
isReadableMimeType
public static boolean isReadableMimeType(String mimeType)
-
isReadableSuffix
public static boolean isReadableSuffix(String suffix)
-
isWritableFormat
public static boolean isWritableFormat(String format)
-
isWritableMimeType
public static boolean isWritableMimeType(String mimeType)
-
isWritableSuffix
public static boolean isWritableSuffix(String suffix)
-
read
public static BufferedImage read(File imageLocation) throws IOException
- Throws:
IOException
-
read
public static BufferedImage read(InputStream imageLocation) throws IOException
- Throws:
IOException
-
read
public static BufferedImage read(URL imageLocation) throws IOException
- Throws:
IOException
-
readAsRgb
public static BufferedImage readAsRgb(File imageLocation) throws IOException
- Throws:
IOException
-
readAsRgb
public static BufferedImage readAsRgb(InputStream imageLocation) throws IOException
- Throws:
IOException
-
readAsRgb
public static BufferedImage readAsRgb(URL imageLocation) throws IOException
- Throws:
IOException
-
readPreviewFromCache
public static BufferedImage readPreviewFromCache(ImmoToolProject project, File imageLocation, int width, int height) throws IOException
- Throws:
IOException
-
readPreviewFromCache
public static BufferedImage readPreviewFromCache(File tempDir, File imageLocation, int width, int height) throws IOException
- Throws:
IOException
-
rotate
public static BufferedImage rotate(BufferedImage image, Scalr.Rotation rotation)
-
rotateToLeft
public static BufferedImage rotateToLeft(BufferedImage image)
-
rotateToRight
public static BufferedImage rotateToRight(BufferedImage image)
-
scale
public static BufferedImage scale(BufferedImage image, int width, int height)
-
scale
public static BufferedImage scale(BufferedImage image, int width, int height, Scalr.Method method, Scalr.Mode mode)
-
scaleToFit
public static BufferedImage scaleToFit(BufferedImage image, int width, int height)
-
scaleToFit
public static BufferedImage scaleToFit(BufferedImage image, int width, int height, int resolution)
-
scaleToFitExactly
public static BufferedImage scaleToFitExactly(BufferedImage image, int width, int height)
-
scaleToFitExactly
public static BufferedImage scaleToFitExactly(BufferedImage image, int width, int height, int resolution)
-
scaleToFitHeight
public static BufferedImage scaleToFitHeight(BufferedImage image, int width, int height)
-
scaleToFitHeight
public static BufferedImage scaleToFitHeight(BufferedImage image, int width, int height, int resolution)
-
scaleToFitWidth
public static BufferedImage scaleToFitWidth(BufferedImage image, int width, int height)
-
scaleToFitWidth
public static BufferedImage scaleToFitWidth(BufferedImage image, int width, int height, int resolution)
-
toBufferedImage
public static BufferedImage toBufferedImage(Image image)
-
toBufferedImage
public static BufferedImage toBufferedImage(Image image, int type)
-
write
public static void write(BufferedImage image, File target, String format) throws IOException
- Throws:
IOException
-
write
public static void write(BufferedImage image, OutputStream target, String format) throws IOException
- Throws:
IOException
-
writeJpg
public static void writeJpg(BufferedImage image, File target) throws IOException
- Throws:
IOException
-
writeJpg
public static void writeJpg(BufferedImage image, File target, boolean forceRgb) throws IOException
- Throws:
IOException
-
writeJpg
public static void writeJpg(BufferedImage image, OutputStream target) throws IOException
- Throws:
IOException
-
writeJpg
public static void writeJpg(BufferedImage image, OutputStream target, boolean forceRgb) throws IOException
- Throws:
IOException
-
writePng
public static void writePng(BufferedImage image, File target) throws IOException
- Throws:
IOException
-
writePng
public static void writePng(BufferedImage image, OutputStream target) throws IOException
- Throws:
IOException
-
-