Package com.norconex.commons.lang.img
Class MutableImage
- java.lang.Object
-
- com.norconex.commons.lang.img.MutableImage
-
public class MutableImage extends Object
Holds an image in memory and offers simple ways to do common operations.- Since:
- 2.0.0
- Author:
- Pascal Essiembre
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMutableImage.Quality
-
Constructor Summary
Constructors Constructor Description MutableImage(Image image)MutableImage(InputStream imageStream)MutableImage(Path imageFile)
-
Method Summary
-
-
-
Constructor Detail
-
MutableImage
public MutableImage(Path imageFile) throws IOException
- Throws:
IOException
-
MutableImage
public MutableImage(InputStream imageStream) throws IOException
- Throws:
IOException
-
MutableImage
public MutableImage(Image image)
-
-
Method Detail
-
getResizeQuality
public MutableImage.Quality getResizeQuality()
-
setResizeQuality
public MutableImage setResizeQuality(MutableImage.Quality resizeQuality)
-
toImage
public BufferedImage toImage()
-
toBase64String
public String toBase64String(String format) throws IOException
- Throws:
IOException
-
toInputStream
public InputStream toInputStream(String format) throws IOException
- Throws:
IOException
-
write
public void write(Path file) throws IOException
- Throws:
IOException
-
write
public void write(Path file, String format) throws IOException
- Throws:
IOException
-
write
public void write(OutputStream out, String format) throws IOException
- Throws:
IOException
-
getDimension
public Dimension getDimension()
-
getHeight
public int getHeight()
-
getWidth
public int getWidth()
-
rotateLeft
public MutableImage rotateLeft()
-
rotateRight
public MutableImage rotateRight()
-
rotate
public MutableImage rotate(double degrees)
-
flipHorizontal
public MutableImage flipHorizontal()
-
flipVertical
public MutableImage flipVertical()
-
crop
public MutableImage crop(Rectangle rectangle)
-
stretchWidth
public MutableImage stretchWidth(int width)
-
stretchHeight
public MutableImage stretchHeight(int height)
-
stretchWidthFactor
public MutableImage stretchWidthFactor(double factor)
-
stretchHeightFactor
public MutableImage stretchHeightFactor(double factor)
-
stretch
public MutableImage stretch(Dimension dimension)
-
stretchFactor
public MutableImage stretchFactor(double factorWidth, double factorHeight)
-
stretch
public MutableImage stretch(int size)
-
stretch
public MutableImage stretch(int width, int height)
-
scaleWidth
public MutableImage scaleWidth(int width)
-
scaleHeight
public MutableImage scaleHeight(int height)
-
scaleWidthFactor
public MutableImage scaleWidthFactor(double factor)
-
scaleHeightFactor
public MutableImage scaleHeightFactor(double factor)
-
scaleFactor
public MutableImage scaleFactor(double factor)
-
scale
public MutableImage scale(int size)
-
scale
public MutableImage scale(Dimension maxDimension)
-
scale
public MutableImage scale(int maxWidth, int maxHeight)
-
largerThan
public boolean largerThan(MutableImage img)
-
largerThan
public boolean largerThan(Dimension dim)
-
largerThan
public boolean largerThan(int width, int height)
-
largest
public MutableImage largest(MutableImage img)
-
smallerThan
public boolean smallerThan(MutableImage img)
-
smallerThan
public boolean smallerThan(Dimension dim)
-
smallerThan
public boolean smallerThan(int width, int height)
-
smallest
public MutableImage smallest(MutableImage img)
-
tallest
public MutableImage tallest(MutableImage img)
-
widest
public MutableImage widest(MutableImage img)
-
getArea
public long getArea()
-
-