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 class
ImageUtils.ReadableImageFilter
static class
ImageUtils.WritableImageFilter
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BufferedImage
convertToGray(BufferedImage image)
static BufferedImage
convertToGray(BufferedImage image, Color background)
static BufferedImage
convertToGray(BufferedImage image, Color background, boolean flushSrcImage)
static BufferedImage
convertToRgb(BufferedImage image)
static BufferedImage
convertToRgb(BufferedImage image, boolean flushSrcImage)
static BufferedImage
convertToRgb(BufferedImage image, Color background)
static BufferedImage
convertToRgb(BufferedImage image, Color background, boolean flushSrcImage)
static BufferedImage
crop(BufferedImage image, int x, int y, int width, int height)
static BufferedImage
cropToRatio(BufferedImage image, int ratioWidth, int ratioHeight)
static BufferedImage
flipHorizontal(BufferedImage image)
static BufferedImage
flipVertical(BufferedImage image)
static void
flush(Image image)
static int
getPixelsForResolution(int pixels, int resolution)
static File
getPreviewImage(ImmoToolProject project, File imageLocation, int width, int height)
static File
getPreviewImage(File tempDir, File imageLocation, int width, int height)
static boolean
hasAlpha(BufferedImage image)
static boolean
isReadableFormat(String format)
static boolean
isReadableMimeType(String mimeType)
static boolean
isReadableSuffix(String suffix)
static boolean
isWritableFormat(String format)
static boolean
isWritableMimeType(String mimeType)
static boolean
isWritableSuffix(String suffix)
static BufferedImage
read(File imageLocation)
static BufferedImage
read(InputStream imageLocation)
static BufferedImage
read(URL imageLocation)
static BufferedImage
readAsRgb(File imageLocation)
static BufferedImage
readAsRgb(InputStream imageLocation)
static BufferedImage
readAsRgb(URL imageLocation)
static BufferedImage
readPreviewFromCache(ImmoToolProject project, File imageLocation, int width, int height)
static BufferedImage
readPreviewFromCache(File tempDir, File imageLocation, int width, int height)
static BufferedImage
rotate(BufferedImage image, Scalr.Rotation rotation)
static BufferedImage
rotateToLeft(BufferedImage image)
static BufferedImage
rotateToRight(BufferedImage image)
static BufferedImage
scale(BufferedImage image, int width, int height)
static BufferedImage
scale(BufferedImage image, int width, int height, Scalr.Method method, Scalr.Mode mode)
static BufferedImage
scaleToFit(BufferedImage image, int width, int height)
static BufferedImage
scaleToFit(BufferedImage image, int width, int height, int resolution)
static BufferedImage
scaleToFitExactly(BufferedImage image, int width, int height)
static BufferedImage
scaleToFitExactly(BufferedImage image, int width, int height, int resolution)
static BufferedImage
scaleToFitHeight(BufferedImage image, int width, int height)
static BufferedImage
scaleToFitHeight(BufferedImage image, int width, int height, int resolution)
static BufferedImage
scaleToFitWidth(BufferedImage image, int width, int height)
static BufferedImage
scaleToFitWidth(BufferedImage image, int width, int height, int resolution)
static BufferedImage
toBufferedImage(Image image)
static BufferedImage
toBufferedImage(Image image, int type)
static void
write(BufferedImage image, File target, String format)
static void
write(BufferedImage image, OutputStream target, String format)
static void
writeJpg(BufferedImage image, File target)
static void
writeJpg(BufferedImage image, File target, boolean forceRgb)
static void
writeJpg(BufferedImage image, OutputStream target)
static void
writeJpg(BufferedImage image, OutputStream target, boolean forceRgb)
static void
writePng(BufferedImage image, File target)
static void
writePng(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
-
-