|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bumptech.glide.load.resource.UnitTransformation<T>
T
- The type of the resource that will always be returned unmodified.public class UnitTransformation<T>
A noop Transformation that simply returns the given resource.
Constructor Summary | |
---|---|
UnitTransformation()
|
Method Summary | ||
---|---|---|
static
|
get()
Returns a UnitTransformation for the given type. |
|
String |
getId()
A method to get a unique identifier for this particular transformation that can be used as part of a cache key. |
|
Resource<T> |
transform(Resource<T> resource,
int outWidth,
int outHeight)
Transforms the given resource and returns the transformed resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UnitTransformation()
Method Detail |
---|
public static <T> UnitTransformation<T> get()
T
- The type of the resource to be transformed.public Resource<T> transform(Resource<T> resource, int outWidth, int outHeight)
Transformation
Note - If the original resource object is not returned, the original resource will be recycled and it's internal resources may be reused. This means it is not safe to rely on the original resource or any internal state of the original resource in any new resource that is created. Usually this shouldn't occur, but if absolutely necessary either the original resource object can be returned with modified internal state, or the data in the original resource can be copied into the transformed resource.
transform
in interface Transformation<T>
resource
- The resource to transform.outWidth
- The width of the view or target the resource will be displayed in, or
Target.SIZE_ORIGINAL
to indicate the original
resource width.outHeight
- The height of the view or target the resource will be displayed in, or
Target.SIZE_ORIGINAL
to indicate the original
resource height.
public String getId()
Transformation
If this transformation does not affect the data that will be stored in cache, returning an empty string here is acceptable.
getId
in interface Transformation<T>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |