public class ImageSource
extends java.lang.Object
Bitmap
ImageSource.BitmapFactory
Modifier and Type | Class and Description |
---|---|
static interface |
ImageSource.BitmapFactory
Factory for delegating construction of bitmap images.
|
Modifier and Type | Method and Description |
---|---|
android.graphics.Bitmap |
asBitmap()
Returns the source bitmap.
|
ImageSource.BitmapFactory |
asBitmapFactory()
Returns the source bitmap factory.
|
java.lang.String |
asFilePath()
Returns the source file path name.
|
java.lang.Object |
asObject()
Returns the image source associated with an unrecognized type.
|
int |
asResource()
Returns the source Android resource identifier.
|
java.lang.String |
asUrl()
Returns the source URL string.
|
boolean |
equals(java.lang.Object o) |
static ImageSource |
fromBitmap(android.graphics.Bitmap bitmap)
Constructs an image source with a bitmap.
|
static ImageSource |
fromBitmapFactory(ImageSource.BitmapFactory factory)
Constructs an image source with a bitmap factory.
|
static ImageSource |
fromFilePath(java.lang.String pathName)
Constructs an image source with a file path.
|
static ImageSource |
fromObject(java.lang.Object source)
Constructs an image source with a generic Object instance.
|
static ImageSource |
fromResource(int id)
Constructs an image source with an Android resource identifier.
|
static ImageSource |
fromUrl(java.lang.String urlString)
Constructs an image source with a URL string.
|
int |
hashCode() |
boolean |
isBitmap()
Indicates whether this image source is a Bitmap.
|
boolean |
isBitmapFactory()
Indicates whether this image source is a bitmap factory.
|
boolean |
isFilePath()
Indicates whether this image source is a file path.
|
boolean |
isResource()
Indicates whether this image source is an Android resource.
|
boolean |
isUrl()
Indicates whether this image source is a URL string.
|
java.lang.String |
toString() |
public static ImageSource fromBitmap(android.graphics.Bitmap bitmap)
bitmap
- the bitmap to use as an image sourcejava.lang.IllegalArgumentException
- If the bitmap is null or recycledpublic static ImageSource fromBitmapFactory(ImageSource.BitmapFactory factory)
factory
- the bitmap factory to use as an image sourcejava.lang.IllegalArgumentException
- If the factory is nullpublic static ImageSource fromResource(int id)
id
- the resource identifier, as generated by the aapt toolpublic static ImageSource fromFilePath(java.lang.String pathName)
pathName
- complete path name to the filejava.lang.IllegalArgumentException
- If the path name is nullpublic static ImageSource fromUrl(java.lang.String urlString)
urlString
- complete URL stringjava.lang.IllegalArgumentException
- If the URL string is nullpublic static ImageSource fromObject(java.lang.Object source)
source
- the generic sourcejava.lang.IllegalArgumentException
- If the source is nullpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isBitmap()
public boolean isBitmapFactory()
public boolean isResource()
public boolean isFilePath()
public boolean isUrl()
public android.graphics.Bitmap asBitmap()
public ImageSource.BitmapFactory asBitmapFactory()
public int asResource()
public java.lang.String asFilePath()
public java.lang.String asUrl()
public java.lang.Object asObject()