* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + *
* http://www.apache.org/licenses/LICENSE-2.0 - * + *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,6 +20,8 @@ package jp.wasabeef.glide.transformations;
import android.content.Context;
import android.graphics.Bitmap;
+import androidx.annotation.NonNull;
+
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.Transformation;
import com.bumptech.glide.load.engine.Resource;
@@ -30,8 +32,6 @@ import com.bumptech.glide.util.Util;
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
-
public abstract class BitmapTransformation implements Transformation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,11 +21,12 @@ import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
+import androidx.annotation.NonNull;
+
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
import jp.wasabeef.glide.transformations.internal.FastBlur;
public class BlurTransformation extends BitmapTransformation {
@@ -64,7 +65,7 @@ public class BlurTransformation extends BitmapTransformation {
Bitmap bitmap = pool.get(scaledWidth, scaledHeight, Bitmap.Config.ARGB_8888);
- setCanvasBitmapDensity(toTransform,bitmap);
+ setCanvasBitmapDensity(toTransform, bitmap);
Canvas canvas = new Canvas(bitmap);
canvas.scale(1 / (float) sampling, 1 / (float) sampling);
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/ColorFilterTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/ColorFilterTransformation.java
index a71d0cf..e98b341 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/ColorFilterTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/ColorFilterTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,12 +23,12 @@ import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
+import androidx.annotation.NonNull;
+
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
-
public class ColorFilterTransformation extends BitmapTransformation {
private static final int VERSION = 1;
@@ -51,13 +51,13 @@ public class ColorFilterTransformation extends BitmapTransformation {
toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;
Bitmap bitmap = pool.get(width, height, config);
- setCanvasBitmapDensity(toTransform, bitmap);
+ setCanvasBitmapDensity(toTransform, bitmap);
- Canvas canvas = new Canvas(bitmap);
- Paint paint = new Paint();
- paint.setAntiAlias(true);
- paint.setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.SRC_ATOP));
- canvas.drawBitmap(toTransform, 0, 0, paint);
+ Canvas canvas = new Canvas(bitmap);
+ Paint paint = new Paint();
+ paint.setAntiAlias(true);
+ paint.setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.SRC_ATOP));
+ canvas.drawBitmap(toTransform, 0, 0, paint);
return bitmap;
}
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/CropCircleTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/CropCircleTransformation.java
index fb4a8b6..b3a2277 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/CropCircleTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/CropCircleTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,14 +19,14 @@ package jp.wasabeef.glide.transformations;
import android.content.Context;
import android.graphics.Bitmap;
+import androidx.annotation.NonNull;
+
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.TransformationUtils;
import com.bumptech.glide.request.RequestOptions;
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
-
/**
* @deprecated Use {@link RequestOptions#circleCrop()}.
*/
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/CropCircleWithBorderTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/CropCircleWithBorderTransformation.java
index df4c0f9..6825107 100644
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/CropCircleWithBorderTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/CropCircleWithBorderTransformation.java
@@ -1,14 +1,30 @@
package jp.wasabeef.glide.transformations;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+
+import androidx.annotation.ColorInt;
+import androidx.annotation.NonNull;
+
+import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
+import com.bumptech.glide.load.resource.bitmap.TransformationUtils;
+
+import java.security.MessageDigest;
+
+import jp.wasabeef.glide.transformations.internal.Utils;
+
/**
- * Copyright (C) 2017 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,79 +32,65 @@ package jp.wasabeef.glide.transformations;
* limitations under the License.
*/
-public class CropCircleWithBorderTransformation implements Transformation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,13 +19,13 @@ package jp.wasabeef.glide.transformations;
import android.content.Context;
import android.graphics.Bitmap;
+import androidx.annotation.NonNull;
+
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.TransformationUtils;
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
-
public class CropSquareTransformation extends BitmapTransformation {
private static final int VERSION = 1;
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/CropTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/CropTransformation.java
index 41a87be..c70ca4c 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/CropTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/CropTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,12 +21,12 @@ import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.RectF;
+import androidx.annotation.NonNull;
+
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
-
public class CropTransformation extends BitmapTransformation {
private static final int VERSION = 1;
@@ -76,7 +76,7 @@ public class CropTransformation extends BitmapTransformation {
float top = getTop(scaledHeight);
RectF targetRect = new RectF(left, top, left + scaledWidth, top + scaledHeight);
- setCanvasBitmapDensity(toTransform,bitmap);
+ setCanvasBitmapDensity(toTransform, bitmap);
Canvas canvas = new Canvas(bitmap);
canvas.drawBitmap(toTransform, null, targetRect, null);
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/GrayscaleTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/GrayscaleTransformation.java
index 4e99251..66b8930 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/GrayscaleTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/GrayscaleTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,12 +23,12 @@ import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Paint;
+import androidx.annotation.NonNull;
+
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
-
public class GrayscaleTransformation extends BitmapTransformation {
private static final int VERSION = 1;
@@ -45,7 +45,7 @@ public class GrayscaleTransformation extends BitmapTransformation {
toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;
Bitmap bitmap = pool.get(width, height, config);
- setCanvasBitmapDensity(toTransform,bitmap);
+ setCanvasBitmapDensity(toTransform, bitmap);
Canvas canvas = new Canvas(bitmap);
ColorMatrix saturation = new ColorMatrix();
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/MaskTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/MaskTransformation.java
index 083a75d..e57a7ea 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/MaskTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/MaskTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,11 +24,12 @@ import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.drawable.Drawable;
+import androidx.annotation.NonNull;
+
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
import jp.wasabeef.glide.transformations.internal.Utils;
public class MaskTransformation extends BitmapTransformation {
@@ -64,7 +65,7 @@ public class MaskTransformation extends BitmapTransformation {
Drawable mask = Utils.getMaskDrawable(context.getApplicationContext(), maskId);
- setCanvasBitmapDensity(toTransform,bitmap);
+ setCanvasBitmapDensity(toTransform, bitmap);
Canvas canvas = new Canvas(bitmap);
mask.setBounds(0, 0, width, height);
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/RoundedCornersTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/RoundedCornersTransformation.java
index 4a0a4d9..30c7323 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/RoundedCornersTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/RoundedCornersTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,12 +24,12 @@ import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;
+import androidx.annotation.NonNull;
+
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
-
public class RoundedCornersTransformation extends BitmapTransformation {
private static final int VERSION = 1;
@@ -68,15 +68,15 @@ public class RoundedCornersTransformation extends BitmapTransformation {
Bitmap bitmap = pool.get(width, height, Bitmap.Config.ARGB_8888);
bitmap.setHasAlpha(true);
- setCanvasBitmapDensity(toTransform, bitmap);
+ setCanvasBitmapDensity(toTransform, bitmap);
- Canvas canvas = new Canvas(bitmap);
- Paint paint = new Paint();
- paint.setAntiAlias(true);
- paint.setShader(new BitmapShader(toTransform, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));
- drawRoundRect(canvas, paint, width, height);
- return bitmap;
- }
+ Canvas canvas = new Canvas(bitmap);
+ Paint paint = new Paint();
+ paint.setAntiAlias(true);
+ paint.setShader(new BitmapShader(toTransform, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));
+ drawRoundRect(canvas, paint, width, height);
+ return bitmap;
+ }
private void drawRoundRect(Canvas canvas, Paint paint, float width, float height) {
float right = width - margin;
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/SupportRSBlurTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/SupportRSBlurTransformation.java
index 3ed6b02..8554f27 100644
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/SupportRSBlurTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/SupportRSBlurTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,11 +22,12 @@ import android.graphics.Canvas;
import android.graphics.Paint;
import android.os.Build;
+import androidx.annotation.NonNull;
+
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
import jp.wasabeef.glide.transformations.internal.FastBlur;
import jp.wasabeef.glide.transformations.internal.RSBlur;
import jp.wasabeef.glide.transformations.internal.SupportRSBlur;
@@ -67,13 +68,13 @@ public class SupportRSBlurTransformation extends BitmapTransformation {
Bitmap bitmap = pool.get(scaledWidth, scaledHeight, Bitmap.Config.ARGB_8888);
- setCanvasBitmapDensity(toTransform, bitmap);
+ setCanvasBitmapDensity(toTransform, bitmap);
- Canvas canvas = new Canvas(bitmap);
- canvas.scale(1 / (float) sampling, 1 / (float) sampling);
- Paint paint = new Paint();
- paint.setFlags(Paint.FILTER_BITMAP_FLAG);
- canvas.drawBitmap(toTransform, 0, 0, paint);
+ Canvas canvas = new Canvas(bitmap);
+ canvas.scale(1 / (float) sampling, 1 / (float) sampling);
+ Paint paint = new Paint();
+ paint.setFlags(Paint.FILTER_BITMAP_FLAG);
+ canvas.drawBitmap(toTransform, 0, 0, paint);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
try {
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/BrightnessFilterTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/BrightnessFilterTransformation.java
index 182f75a..fe0a83f 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/BrightnessFilterTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/BrightnessFilterTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations.gpu;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,9 +16,10 @@ package jp.wasabeef.glide.transformations.gpu;
* limitations under the License.
*/
+import androidx.annotation.NonNull;
+
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
import jp.co.cyberagent.android.gpuimage.filter.GPUImageBrightnessFilter;
/**
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/ContrastFilterTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/ContrastFilterTransformation.java
index 09c306a..d2ef994 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/ContrastFilterTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/ContrastFilterTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations.gpu;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,9 +16,10 @@ package jp.wasabeef.glide.transformations.gpu;
* limitations under the License.
*/
+import androidx.annotation.NonNull;
+
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
import jp.co.cyberagent.android.gpuimage.filter.GPUImageContrastFilter;
/**
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/GPUFilterTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/GPUFilterTransformation.java
index d674838..0dfcf97 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/GPUFilterTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/GPUFilterTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations.gpu;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,11 +19,12 @@ package jp.wasabeef.glide.transformations.gpu;
import android.content.Context;
import android.graphics.Bitmap;
+import androidx.annotation.NonNull;
+
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
import jp.co.cyberagent.android.gpuimage.GPUImage;
import jp.co.cyberagent.android.gpuimage.filter.GPUImageFilter;
import jp.wasabeef.glide.transformations.BitmapTransformation;
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/InvertFilterTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/InvertFilterTransformation.java
index f41a04f..50f098a 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/InvertFilterTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/InvertFilterTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations.gpu;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,9 +16,10 @@ package jp.wasabeef.glide.transformations.gpu;
* limitations under the License.
*/
+import androidx.annotation.NonNull;
+
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
import jp.co.cyberagent.android.gpuimage.filter.GPUImageColorInvertFilter;
/**
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/KuwaharaFilterTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/KuwaharaFilterTransformation.java
index 247b195..72e2d63 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/KuwaharaFilterTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/KuwaharaFilterTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations.gpu;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,9 +16,10 @@ package jp.wasabeef.glide.transformations.gpu;
* limitations under the License.
*/
+import androidx.annotation.NonNull;
+
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
import jp.co.cyberagent.android.gpuimage.filter.GPUImageKuwaharaFilter;
/**
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/PixelationFilterTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/PixelationFilterTransformation.java
index af71935..3d29f32 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/PixelationFilterTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/PixelationFilterTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations.gpu;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,9 +16,10 @@ package jp.wasabeef.glide.transformations.gpu;
* limitations under the License.
*/
+import androidx.annotation.NonNull;
+
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
import jp.co.cyberagent.android.gpuimage.filter.GPUImagePixelationFilter;
/**
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/SepiaFilterTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/SepiaFilterTransformation.java
index 1a09f56..aae6655 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/SepiaFilterTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/SepiaFilterTransformation.java
@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
- * Copyright (C) 2018 Wasabeef
+ * Copyright (C) 2019 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,14 +16,15 @@ package jp.wasabeef.glide.transformations.gpu;
* limitations under the License.
*/
+import androidx.annotation.NonNull;
+
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
import jp.co.cyberagent.android.gpuimage.filter.GPUImageSepiaToneFilter;
/**
* Applies a simple sepia effect.
- *
+ *
* The intensity with a default of 1.0.
*/
public class SepiaFilterTransformation extends GPUFilterTransformation {
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/SketchFilterTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/SketchFilterTransformation.java
index 3c27329..800e284 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/SketchFilterTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/SketchFilterTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations.gpu;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,9 +16,10 @@ package jp.wasabeef.glide.transformations.gpu;
* limitations under the License.
*/
+import androidx.annotation.NonNull;
+
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
import jp.co.cyberagent.android.gpuimage.filter.GPUImageSketchFilter;
public class SketchFilterTransformation extends GPUFilterTransformation {
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/SwirlFilterTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/SwirlFilterTransformation.java
index 98e0179..42358e4 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/SwirlFilterTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/SwirlFilterTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations.gpu;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,9 +18,10 @@ package jp.wasabeef.glide.transformations.gpu;
import android.graphics.PointF;
+import androidx.annotation.NonNull;
+
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
import jp.co.cyberagent.android.gpuimage.filter.GPUImageSwirlFilter;
/**
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/ToonFilterTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/ToonFilterTransformation.java
index 6ae7d2c..cece2bc 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/ToonFilterTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/ToonFilterTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations.gpu;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,9 +16,10 @@ package jp.wasabeef.glide.transformations.gpu;
* limitations under the License.
*/
+import androidx.annotation.NonNull;
+
import java.security.MessageDigest;
-import androidx.annotation.NonNull;
import jp.co.cyberagent.android.gpuimage.filter.GPUImageToonFilter;
/**
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/VignetteFilterTransformation.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/VignetteFilterTransformation.java
index 21fc9a8..f76d3a0 100755
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/VignetteFilterTransformation.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/gpu/VignetteFilterTransformation.java
@@ -1,14 +1,14 @@
package jp.wasabeef.glide.transformations.gpu;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,10 +18,11 @@ package jp.wasabeef.glide.transformations.gpu;
import android.graphics.PointF;
+import androidx.annotation.NonNull;
+
import java.security.MessageDigest;
import java.util.Arrays;
-import androidx.annotation.NonNull;
import jp.co.cyberagent.android.gpuimage.filter.GPUImageVignetteFilter;
/**
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/internal/FastBlur.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/internal/FastBlur.java
index b203926..822ca2a 100644
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/internal/FastBlur.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/internal/FastBlur.java
@@ -3,14 +3,14 @@ package jp.wasabeef.glide.transformations.internal;
import android.graphics.Bitmap;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -72,15 +72,15 @@ public class FastBlur {
int wh = w * h;
int div = radius + radius + 1;
- int r[] = new int[wh];
- int g[] = new int[wh];
- int b[] = new int[wh];
+ int[] r = new int[wh];
+ int[] g = new int[wh];
+ int[] b = new int[wh];
int rsum, gsum, bsum, x, y, i, p, yp, yi, yw;
- int vmin[] = new int[Math.max(w, h)];
+ int[] vmin = new int[Math.max(w, h)];
int divsum = (div + 1) >> 1;
divsum *= divsum;
- int dv[] = new int[256 * divsum];
+ int[] dv = new int[256 * divsum];
for (i = 0; i < 256 * divsum; i++) {
dv[i] = (i / divsum);
}
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/internal/RSBlur.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/internal/RSBlur.java
index d9693d8..137ddda 100644
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/internal/RSBlur.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/internal/RSBlur.java
@@ -11,14 +11,14 @@ import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicBlur;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/internal/SupportRSBlur.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/internal/SupportRSBlur.java
index 7bb654a..9775b44 100644
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/internal/SupportRSBlur.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/internal/SupportRSBlur.java
@@ -12,14 +12,14 @@ import androidx.renderscript.RenderScript;
import androidx.renderscript.ScriptIntrinsicBlur;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/transformations/src/main/java/jp/wasabeef/glide/transformations/internal/Utils.java b/transformations/src/main/java/jp/wasabeef/glide/transformations/internal/Utils.java
index 091125c..36ad066 100644
--- a/transformations/src/main/java/jp/wasabeef/glide/transformations/internal/Utils.java
+++ b/transformations/src/main/java/jp/wasabeef/glide/transformations/internal/Utils.java
@@ -1,18 +1,19 @@
package jp.wasabeef.glide.transformations.internal;
import android.content.Context;
+import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Build;
/**
- * Copyright (C) 2018 Wasabeef
- *
+ * Copyright (C) 2019 Wasabeef
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -40,4 +41,8 @@ public final class Utils {
return drawable;
}
+
+ public static int toDp(int px) {
+ return px * (int) Resources.getSystem().getDisplayMetrics().density;
+ }
}