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 newAnylineImage
from a byte array with a given width and height.AnylineImage(byte[] data, AnylineImage.ColorFormat colorFormat, int width, int height, int bytesPerRow)
Instantiates a newAnylineImage
from a byte array with a given width and height.AnylineImage(android.graphics.Bitmap bitmap)
Instantiates anAnylineImage
from aBitmap
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnylineImage
copy()
AnylineImage
crop(CropRect cropRect)
android.graphics.Bitmap
getBitmap()
Retrieves theBitmap
of theAnylineImage
.AnylineImage.ColorFormat
getColorFormat()
AnylineImage
getCoreImage()
byte[]
getData()
int
getHeight()
int
getWidth()
void
release()
void
rotate(int degrees)
java.lang.String
save()
Saves anAnylineImage
to storage.
-
-
-
Constructor Detail
-
AnylineImage
public AnylineImage(byte[] data, AnylineImage.ColorFormat colorFormat, int width, int height, int bytesPerRow) throws AnylineException
Instantiates a newAnylineImage
from 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 AnylineException
Instantiates a newAnylineImage
from 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, AnylineException
Instantiates anAnylineImage
from aBitmap
.- Parameters:
bitmap
- the image source in Bitmap format- Throws:
java.lang.IllegalStateException
AnylineException
-
-
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 theBitmap
of theAnylineImage
.- Returns:
-
copy
@NonNull public AnylineImage copy() throws AnylineException
- Throws:
AnylineException
-
save
public java.lang.String save() throws java.io.IOException
Saves anAnylineImage
to 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()
-
-