mirror of
https://github.com/wasabeef/glide-transformations.git
synced 2025-10-04 18:03:21 +08:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
68a9097962 | ||
|
6269999abc | ||
|
7e93ccd9af | ||
|
07b7d24e13 | ||
|
ca648cbc7d | ||
|
67ac3e31a4 |
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,6 +1,16 @@
|
||||
Change Log
|
||||
==========
|
||||
|
||||
Version 1.0.3 *(2015-02-05)*
|
||||
----------------------------
|
||||
|
||||
Bug fix
|
||||
|
||||
Version 1.0.2 *(2015-02-04)*
|
||||
----------------------------
|
||||
|
||||
Refactor: use BimapPool
|
||||
|
||||
Version 1.0.1 *(2015-01-21)*
|
||||
----------------------------
|
||||
|
||||
|
@@ -32,7 +32,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'jp.wasabeef:glide-transformations:1.0.1@aar'
|
||||
compile 'jp.wasabeef:glide-transformations:1.0.3@aar'
|
||||
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.2.3@aar'
|
||||
}
|
||||
```
|
||||
|
@@ -53,7 +53,7 @@ def getKeyAliasPasswordProperty() {
|
||||
|
||||
dependencies {
|
||||
compile project(':transformations')
|
||||
// compile 'jp.wasabeef:glide-transformations:1.0.2'
|
||||
// compile 'jp.wasabeef:glide-transformations:1.0.3'
|
||||
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.2.3'
|
||||
compile 'com.android.support:appcompat-v7:21.+'
|
||||
compile 'com.android.support:recyclerview-v7:21.+'
|
||||
|
@@ -1,4 +1,4 @@
|
||||
VERSION_NAME=1.0.2
|
||||
VERSION_NAME=1.0.3
|
||||
VERSION_CODE=3
|
||||
GROUP=jp.wasabeef
|
||||
ARTIFACT_ID=glide-transformations
|
||||
|
@@ -24,6 +24,8 @@ import com.bumptech.glide.load.resource.bitmap.BitmapResource;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Rect;
|
||||
import android.support.v8.renderscript.Allocation;
|
||||
import android.support.v8.renderscript.RenderScript;
|
||||
import android.support.v8.renderscript.ScriptIntrinsicBlur;
|
||||
@@ -54,9 +56,11 @@ public class BlurTransformation implements Transformation<Bitmap> {
|
||||
int width = source.getWidth();
|
||||
int height = source.getHeight();
|
||||
|
||||
Bitmap bitmap = mBitmapPool.get(width, height, source.getConfig());
|
||||
Bitmap.Config config =
|
||||
source.getConfig() != null ? source.getConfig() : Bitmap.Config.ARGB_8888;
|
||||
Bitmap bitmap = mBitmapPool.get(width, height, config);
|
||||
if (bitmap == null) {
|
||||
bitmap = Bitmap.createBitmap(width, height, source.getConfig());
|
||||
bitmap = Bitmap.createBitmap(width, height, config);
|
||||
}
|
||||
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
|
@@ -45,9 +45,11 @@ public class ColorFilterTransformation implements Transformation<Bitmap> {
|
||||
int width = source.getWidth();
|
||||
int height = source.getHeight();
|
||||
|
||||
Bitmap bitmap = mBitmapPool.get(width, height, source.getConfig());
|
||||
Bitmap.Config config =
|
||||
source.getConfig() != null ? source.getConfig() : Bitmap.Config.ARGB_8888;
|
||||
Bitmap bitmap = mBitmapPool.get(width, height, config);
|
||||
if (bitmap == null) {
|
||||
bitmap = Bitmap.createBitmap(width, height, source.getConfig());
|
||||
bitmap = Bitmap.createBitmap(width, height, config);
|
||||
}
|
||||
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
|
@@ -43,9 +43,11 @@ public class CropCircleTransformation implements Transformation<Bitmap> {
|
||||
int width = (source.getWidth() - size) / 2;
|
||||
int height = (source.getHeight() - size) / 2;
|
||||
|
||||
Bitmap bitmap = mBitmapPool.get(width, height, source.getConfig());
|
||||
Bitmap.Config config =
|
||||
source.getConfig() != null ? source.getConfig() : Bitmap.Config.ARGB_8888;
|
||||
Bitmap bitmap = mBitmapPool.get(size, size, config);
|
||||
if (bitmap == null) {
|
||||
bitmap = Bitmap.createBitmap(width, height, source.getConfig());
|
||||
bitmap = Bitmap.createBitmap(size, size, config);
|
||||
}
|
||||
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
|
@@ -41,7 +41,9 @@ public class CropSquareTransformation implements Transformation<Bitmap> {
|
||||
mWidth = (source.getWidth() - size) / 2;
|
||||
mHeight = (source.getHeight() - size) / 2;
|
||||
|
||||
Bitmap bitmap = mBitmapPool.get(mWidth, mHeight, source.getConfig());
|
||||
Bitmap.Config config =
|
||||
source.getConfig() != null ? source.getConfig() : Bitmap.Config.ARGB_8888;
|
||||
Bitmap bitmap = mBitmapPool.get(mWidth, mHeight, config);
|
||||
if (bitmap == null) {
|
||||
bitmap = Bitmap.createBitmap(source, mWidth, mHeight, size, size);
|
||||
}
|
||||
|
@@ -51,9 +51,11 @@ public class CropTransformation implements Transformation<Bitmap> {
|
||||
mHeight = source.getHeight();
|
||||
}
|
||||
|
||||
Bitmap bitmap = mBitmapPool.get(mWidth, mHeight, source.getConfig());
|
||||
Bitmap.Config config =
|
||||
source.getConfig() != null ? source.getConfig() : Bitmap.Config.ARGB_8888;
|
||||
Bitmap bitmap = mBitmapPool.get(mWidth, mHeight, config);
|
||||
if (bitmap == null) {
|
||||
bitmap = Bitmap.createBitmap(mWidth, mHeight, source.getConfig());
|
||||
bitmap = Bitmap.createBitmap(mWidth, mHeight, config);
|
||||
}
|
||||
|
||||
float scaleX = (float) mWidth / source.getWidth();
|
||||
|
@@ -42,9 +42,11 @@ public class GrayscaleTransformation implements Transformation<Bitmap> {
|
||||
int width = source.getWidth();
|
||||
int height = source.getHeight();
|
||||
|
||||
Bitmap bitmap = mBitmapPool.get(width, height, source.getConfig());
|
||||
Bitmap.Config config =
|
||||
source.getConfig() != null ? source.getConfig() : Bitmap.Config.ARGB_8888;
|
||||
Bitmap bitmap = mBitmapPool.get(width, height, config);
|
||||
if (bitmap == null) {
|
||||
bitmap = Bitmap.createBitmap(width, height, source.getConfig());
|
||||
bitmap = Bitmap.createBitmap(width, height, config);
|
||||
}
|
||||
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
|
@@ -48,9 +48,11 @@ public class RoundedCornersTransformation implements Transformation<Bitmap> {
|
||||
int width = source.getWidth();
|
||||
int height = source.getHeight();
|
||||
|
||||
Bitmap bitmap = mBitmapPool.get(width, height, source.getConfig());
|
||||
Bitmap.Config config =
|
||||
source.getConfig() != null ? source.getConfig() : Bitmap.Config.ARGB_8888;
|
||||
Bitmap bitmap = mBitmapPool.get(width, height, config);
|
||||
if (bitmap == null) {
|
||||
bitmap = Bitmap.createBitmap(width, height, source.getConfig());
|
||||
bitmap = Bitmap.createBitmap(width, height, config);
|
||||
}
|
||||
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
|
Reference in New Issue
Block a user