java.lang.Object | |
↳ | com.facebook.imageutils.BitmapUtil |
This class contains utility method for Bitmap
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | ALPHA_8_BYTES_PER_PIXEL | Bytes per pixel definitions | |||||||||
int | ARGB_4444_BYTES_PER_PIXEL | ||||||||||
int | ARGB_8888_BYTES_PER_PIXEL | ||||||||||
float | MAX_BITMAP_SIZE | ||||||||||
int | RGBA_F16_BYTES_PER_PIXEL | ||||||||||
int | RGB_565_BYTES_PER_PIXEL |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BitmapUtil() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static Pair<Integer, Integer> |
decodeDimensions(Uri uri)
Decodes the bounds of an image from its Uri and returns a pair of the dimensions
| ||||||||||
static Pair<Integer, Integer> |
decodeDimensions(byte[] bytes)
Decodes only the bounds of an image and returns its width and height or null if the size can't
be determined
| ||||||||||
static Pair<Integer, Integer> |
decodeDimensions(InputStream is)
Decodes the bounds of an image and returns its width and height or null if the size can't be
determined
| ||||||||||
static ImageMetaData |
decodeDimensionsAndColorSpace(InputStream is)
Decodes the bounds of an image and returns its width and height or null if the size can't be
determined.
| ||||||||||
static int |
getPixelSizeForBitmapConfig(Bitmap.Config bitmapConfig)
Returns the amount of bytes used by a pixel in a specific android.graphics.Bitmap.Config
| ||||||||||
static int |
getSizeInByteForBitmap(int width, int height, Bitmap.Config bitmapConfig)
Returns the size in byte of an image with specific size and android.graphics.Bitmap.Config
| ||||||||||
static int | getSizeInBytes(Bitmap bitmap) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Bytes per pixel definitions
Decodes the bounds of an image from its Uri and returns a pair of the dimensions
uri | the Uri of the image |
---|
Decodes only the bounds of an image and returns its width and height or null if the size can't be determined
bytes | the input byte array of the image |
---|
Decodes the bounds of an image and returns its width and height or null if the size can't be determined
is | the InputStream containing the image data |
---|
Decodes the bounds of an image and returns its width and height or null if the size can't be determined. It also recovers the color space of the image, or null if it can't be determined.
is | the InputStream containing the image data |
---|
Returns the amount of bytes used by a pixel in a specific android.graphics.Bitmap.Config
bitmapConfig | the android.graphics.Bitmap.Config for which the size in byte will be returned |
---|
Returns the size in byte of an image with specific size and android.graphics.Bitmap.Config
width | the width of the image |
---|---|
height | the height of the image |
bitmapConfig | the android.graphics.Bitmap.Config for which the size in byte will be returned |