Transformation.java revision ee914288218f2fa29a96ed746c9bd9995857c8cd
1ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownpackage com.bumptech.glide.load; 2ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown 3ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownimport com.bumptech.glide.load.engine.Resource; 4 5/** 6 * A class for performing an arbitrary transformation on a bitmap 7 * @param <T> The type of the resource being transformed. 8 */ 9public interface Transformation<T> { 10 11 /** 12 * Transform the given bitmap. It is also acceptable to simply return the given bitmap if no transformation is 13 * required. 14 * 15 * @param resource The resource to transform 16 * @param outWidth The width of the view or target the bitmap will be displayed in 17 * @param outHeight The height of the view or target the bitmap will be displayed in 18 * @return The transformed bitmap 19 */ 20 public abstract Resource<T> transform(Resource<T> resource, int outWidth, int outHeight); 21 22 /** 23 * A method to get a unique identifier for this particular transformation that can be used as part of a cache key. 24 * The fully qualified class name for this class is appropriate if written out, but getClass().getName() is not 25 * because the name may be changed by proguard. 26 * 27 * @return A string that uniquely identifies this transformation from other transformations 28 */ 29 public String getId(); 30} 31