|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bumptech.glide.load.resource.bitmap.BitmapEncoder
public class BitmapEncoder
An ResourceEncoder
that writes Bitmap
s to
OutputStream
s.
Bitmap
s that return true from Bitmap.hasAlpha()
} are written
using Bitmap.CompressFormat.PNG
to preserve alpha and all other bitmaps are written
using Bitmap.CompressFormat.JPEG
.
Bitmap.compress(android.graphics.Bitmap.CompressFormat, int, java.io.OutputStream)
Constructor Summary | |
---|---|
BitmapEncoder()
|
|
BitmapEncoder(Bitmap.CompressFormat compressFormat,
int quality)
|
Method Summary | |
---|---|
boolean |
encode(Resource<Bitmap> resource,
OutputStream os)
Writes the given data to the given output stream and returns True if the write completed successfully and should be committed. |
String |
getId()
Returns an ID identifying any transformation this encoder may apply to the given data that will be mixed in to the cache key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BitmapEncoder()
public BitmapEncoder(Bitmap.CompressFormat compressFormat, int quality)
Method Detail |
---|
public boolean encode(Resource<Bitmap> resource, OutputStream os)
Encoder
encode
in interface Encoder<Resource<Bitmap>>
resource
- The data to write.os
- The OutputStream to write the data to.public String getId()
Encoder
If the encoder does not transform the data in a way that significantly affects the cached result (ie performs no unusual compression or downsampling) an empty string is an appropriate id.
getId
in interface Encoder<Resource<Bitmap>>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |