Package io.anyline2.image
Class AnylineImage
- java.lang.Object
-
- io.anyline2.image.AnylineImage
-
public class AnylineImage extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description AnylineImage(byte[] data, int width, int height)Instantiates a newAnylineImagefrom a byte array with a given width and height.AnylineImage(byte[] data, AnylineImage.ColorFormat colorFormat, int width, int height, int bytesPerRow)Instantiates a newAnylineImagefrom a byte array with a given width and height.AnylineImage(android.graphics.Bitmap bitmap)Instantiates anAnylineImagefrom aBitmap.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnylineImagecopy()AnylineImagecrop(CropRect cropRect)android.graphics.BitmapgetBitmap()Retrieves theBitmapof theAnylineImage.AnylineImage.ColorFormatgetColorFormat()AnylineImagegetCoreImage()byte[]getData()intgetHeight()intgetWidth()voidrelease()voidrotate(int degrees)java.lang.Stringsave()Saves anAnylineImageto storage.
-
-
-
Constructor Detail
-
AnylineImage
public AnylineImage(byte[] data, AnylineImage.ColorFormat colorFormat, int width, int height, int bytesPerRow) throws AnylineExceptionInstantiates a newAnylineImagefrom a byte array with a given width and height.- Parameters:
data- byte representation of the imagecolorFormat- colorFormat of imagewidth- image widthheight- image height- Throws:
AnylineException
-
AnylineImage
public AnylineImage(byte[] data, int width, int height) throws AnylineExceptionInstantiates a newAnylineImagefrom a byte array with a given width and height.- Parameters:
data- byte representation of the imagewidth- image widthheight- image height- Throws:
AnylineException
-
AnylineImage
public AnylineImage(android.graphics.Bitmap bitmap) throws java.lang.IllegalStateException, AnylineExceptionInstantiates anAnylineImagefrom aBitmap.- Parameters:
bitmap- the image source in Bitmap format- Throws:
java.lang.IllegalStateExceptionAnylineException
-
-
Method Detail
-
rotate
public void rotate(int degrees)
-
getData
public byte[] getData()
-
getWidth
public int getWidth()
-
getHeight
public int getHeight()
-
getBitmap
public android.graphics.Bitmap getBitmap()
Retrieves theBitmapof theAnylineImage.- Returns:
-
copy
@NonNull public AnylineImage copy() throws AnylineException
- Throws:
AnylineException
-
save
public java.lang.String save() throws java.io.IOExceptionSaves anAnylineImageto storage.- Returns:
- path to the
AnylineImage - Throws:
java.io.IOException
-
crop
public AnylineImage crop(CropRect cropRect) throws AnylineException
- Throws:
AnylineException
-
getCoreImage
public AnylineImage getCoreImage()
-
getColorFormat
public AnylineImage.ColorFormat getColorFormat()
-
release
public void release()
-
-