Package mil.nga.geopackage.io
Class BitmapConverter
java.lang.Object
mil.nga.geopackage.io.BitmapConverter
Conversions between Bitmaps and image bytes
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Bitmap
toBitmap
(byte[] bytes) Decode the bytes to a bitmapstatic Bitmap
toBitmap
(byte[] bytes, BitmapFactory.Options options) Decode the bytes to a bitmap, with optionsstatic byte[]
toBytes
(Bitmap bitmap, Bitmap.CompressFormat format) Compress the bitmap to a byte array at full qualitystatic byte[]
toBytes
(Bitmap bitmap, Bitmap.CompressFormat format, int quality) Compress the bitmap to a byte array
-
Constructor Details
-
BitmapConverter
public BitmapConverter()
-
-
Method Details
-
toBitmap
Decode the bytes to a bitmap- Parameters:
bytes
- image bytes- Returns:
- image bitmap
-
toBitmap
Decode the bytes to a bitmap, with options- Parameters:
bytes
- image bytesoptions
- decode options- Returns:
- image bitmap
-
toBytes
Compress the bitmap to a byte array at full quality- Parameters:
bitmap
- image bitmapformat
- compress format- Returns:
- image bytes
- Throws:
IOException
- upon failure
-
toBytes
public static byte[] toBytes(Bitmap bitmap, Bitmap.CompressFormat format, int quality) throws IOException Compress the bitmap to a byte array- Parameters:
bitmap
- bitmap imageformat
- compress formatquality
- quality- Returns:
- image bytes
- Throws:
IOException
- upon failure
-