1
0
mirror of https://github.com/wasabeef/glide-transformations.git synced 2025-10-04 18:03:21 +08:00

Release 4.2.0 (#183)

* format

* update copyright

* remove -android.namespacedRClass

* update compile&target sdk version to 30

* update dependencies

* update gitignore

* update samples dependencies

* update signinconfig

* bump up to 4.2.0

* bump up to 4.2.0
This commit is contained in:
Daichi Furiya
2020-09-15 03:51:31 +09:00
committed by GitHub
parent fa04c1b3c9
commit 074b6eef45
45 changed files with 294 additions and 311 deletions

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* Copyright 2014 Google, Inc. All rights reserved.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -40,8 +40,8 @@ public abstract class BitmapTransformation implements Transformation<Bitmap> {
int outWidth, int outHeight) {
if (!Util.isValidDimensions(outWidth, outHeight)) {
throw new IllegalArgumentException(
"Cannot apply transformation on width: " + outWidth + " or height: " + outHeight
+ " less than or equal to zero and not Target.SIZE_ORIGINAL");
"Cannot apply transformation on width: " + outWidth + " or height: " + outHeight
+ " less than or equal to zero and not Target.SIZE_ORIGINAL");
}
BitmapPool bitmapPool = Glide.get(context).getBitmapPool();
Bitmap toTransform = resource.get();

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ public class BlurTransformation extends BitmapTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.BlurTransformation." + VERSION;
"jp.wasabeef.glide.transformations.BlurTransformation." + VERSION;
private static int MAX_RADIUS = 25;
private static int DEFAULT_DOWN_SAMPLING = 1;
@@ -86,8 +86,8 @@ public class BlurTransformation extends BitmapTransformation {
@Override
public boolean equals(Object o) {
return o instanceof BlurTransformation &&
((BlurTransformation) o).radius == radius &&
((BlurTransformation) o).sampling == sampling;
((BlurTransformation) o).radius == radius &&
((BlurTransformation) o).sampling == sampling;
}
@Override

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ public class ColorFilterTransformation extends BitmapTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.ColorFilterTransformation." + VERSION;
"jp.wasabeef.glide.transformations.ColorFilterTransformation." + VERSION;
private int color;
@@ -48,7 +48,7 @@ public class ColorFilterTransformation extends BitmapTransformation {
int height = toTransform.getHeight();
Bitmap.Config config =
toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;
toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;
Bitmap bitmap = pool.get(width, height, config);
setCanvasBitmapDensity(toTransform, bitmap);
@@ -70,7 +70,7 @@ public class ColorFilterTransformation extends BitmapTransformation {
@Override
public boolean equals(Object o) {
return o instanceof ColorFilterTransformation &&
((ColorFilterTransformation) o).color == color;
((ColorFilterTransformation) o).color == color;
}
@Override

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@ public class CropCircleTransformation extends BitmapTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.CropCircleTransformation." + VERSION;
"jp.wasabeef.glide.transformations.CropCircleTransformation." + VERSION;
@Override
protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,

View File

@@ -17,7 +17,7 @@ import java.security.MessageDigest;
import jp.wasabeef.glide.transformations.internal.Utils;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,10 +68,10 @@ public class CropCircleWithBorderTransformation extends BitmapTransformation {
Canvas canvas = new Canvas(bitmap);
canvas.drawCircle(
outWidth / 2f,
outHeight / 2f,
Math.max(outWidth, outHeight) / 2f - borderSize / 2f,
paint
outWidth / 2f,
outHeight / 2f,
Math.max(outWidth, outHeight) / 2f - borderSize / 2f,
paint
);
return bitmap;
@@ -85,12 +85,12 @@ public class CropCircleWithBorderTransformation extends BitmapTransformation {
@Override
public boolean equals(Object o) {
return o instanceof CropCircleWithBorderTransformation &&
((CropCircleWithBorderTransformation) o).borderSize == borderSize &&
((CropCircleWithBorderTransformation) o).borderColor == borderColor;
((CropCircleWithBorderTransformation) o).borderSize == borderSize &&
((CropCircleWithBorderTransformation) o).borderColor == borderColor;
}
@Override
public int hashCode() {
return ID.hashCode() + borderSize * 100 + borderColor + 10;
}
}
}

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@ public class CropSquareTransformation extends BitmapTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.CropSquareTransformation." + VERSION;
"jp.wasabeef.glide.transformations.CropSquareTransformation." + VERSION;
private int size;

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -61,7 +61,7 @@ public class CropTransformation extends BitmapTransformation {
height = height == 0 ? toTransform.getHeight() : height;
Bitmap.Config config =
toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;
toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;
Bitmap bitmap = pool.get(width, height, config);
bitmap.setHasAlpha(true);
@@ -105,9 +105,9 @@ public class CropTransformation extends BitmapTransformation {
@Override
public boolean equals(Object o) {
return o instanceof CropTransformation &&
((CropTransformation) o).width == width &&
((CropTransformation) o).height == height &&
((CropTransformation) o).cropType == cropType;
((CropTransformation) o).width == width &&
((CropTransformation) o).height == height &&
((CropTransformation) o).cropType == cropType;
}
@Override

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ public class GrayscaleTransformation extends BitmapTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.GrayscaleTransformation." + VERSION;
"jp.wasabeef.glide.transformations.GrayscaleTransformation." + VERSION;
@Override
protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,
@@ -42,7 +42,7 @@ public class GrayscaleTransformation extends BitmapTransformation {
int height = toTransform.getHeight();
Bitmap.Config config =
toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;
toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;
Bitmap bitmap = pool.get(width, height, config);
setCanvasBitmapDensity(toTransform, bitmap);

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@ public class MaskTransformation extends BitmapTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.MaskTransformation." + VERSION;
"jp.wasabeef.glide.transformations.MaskTransformation." + VERSION;
private static Paint paint = new Paint();
private int maskId;
@@ -83,7 +83,7 @@ public class MaskTransformation extends BitmapTransformation {
@Override
public boolean equals(Object o) {
return o instanceof MaskTransformation &&
((MaskTransformation) o).maskId == maskId;
((MaskTransformation) o).maskId == maskId;
}
@Override

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -136,47 +136,47 @@ public class RoundedCornersTransformation extends BitmapTransformation {
private void drawTopLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, margin + diameter), radius,
radius, paint);
radius, paint);
canvas.drawRect(new RectF(margin, margin + radius, margin + radius, bottom), paint);
canvas.drawRect(new RectF(margin + radius, margin, right, bottom), paint);
}
private void drawTopRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
canvas.drawRoundRect(new RectF(right - diameter, margin, right, margin + diameter), radius,
radius, paint);
radius, paint);
canvas.drawRect(new RectF(margin, margin, right - radius, bottom), paint);
canvas.drawRect(new RectF(right - radius, margin + radius, right, bottom), paint);
}
private void drawBottomLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
canvas.drawRoundRect(new RectF(margin, bottom - diameter, margin + diameter, bottom), radius,
radius, paint);
radius, paint);
canvas.drawRect(new RectF(margin, margin, margin + diameter, bottom - radius), paint);
canvas.drawRect(new RectF(margin + radius, margin, right, bottom), paint);
}
private void drawBottomRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
canvas.drawRoundRect(new RectF(right - diameter, bottom - diameter, right, bottom), radius,
radius, paint);
radius, paint);
canvas.drawRect(new RectF(margin, margin, right - radius, bottom), paint);
canvas.drawRect(new RectF(right - radius, margin, right, bottom - radius), paint);
}
private void drawTopRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
canvas.drawRoundRect(new RectF(margin, margin, right, margin + diameter), radius, radius,
paint);
paint);
canvas.drawRect(new RectF(margin, margin + radius, right, bottom), paint);
}
private void drawBottomRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
canvas.drawRoundRect(new RectF(margin, bottom - diameter, right, bottom), radius, radius,
paint);
paint);
canvas.drawRect(new RectF(margin, margin, right, bottom - radius), paint);
}
private void drawLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, bottom), radius, radius,
paint);
paint);
canvas.drawRect(new RectF(margin + radius, margin, right, bottom), paint);
}
@@ -187,22 +187,22 @@ public class RoundedCornersTransformation extends BitmapTransformation {
private void drawOtherTopLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
canvas.drawRoundRect(new RectF(margin, bottom - diameter, right, bottom), radius, radius,
paint);
paint);
canvas.drawRoundRect(new RectF(right - diameter, margin, right, bottom), radius, radius, paint);
canvas.drawRect(new RectF(margin, margin, right - radius, bottom - radius), paint);
}
private void drawOtherTopRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, bottom), radius, radius,
paint);
paint);
canvas.drawRoundRect(new RectF(margin, bottom - diameter, right, bottom), radius, radius,
paint);
paint);
canvas.drawRect(new RectF(margin + radius, margin, right, bottom - radius), paint);
}
private void drawOtherBottomLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
canvas.drawRoundRect(new RectF(margin, margin, right, margin + diameter), radius, radius,
paint);
paint);
canvas.drawRoundRect(new RectF(right - diameter, margin, right, bottom), radius, radius, paint);
canvas.drawRect(new RectF(margin, margin + radius, right - radius, bottom), paint);
}
@@ -210,18 +210,18 @@ public class RoundedCornersTransformation extends BitmapTransformation {
private void drawOtherBottomRightRoundRect(Canvas canvas, Paint paint, float right,
float bottom) {
canvas.drawRoundRect(new RectF(margin, margin, right, margin + diameter), radius, radius,
paint);
paint);
canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, bottom), radius, radius,
paint);
paint);
canvas.drawRect(new RectF(margin + radius, margin + radius, right, bottom), paint);
}
private void drawDiagonalFromTopLeftRoundRect(Canvas canvas, Paint paint, float right,
float bottom) {
canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, margin + diameter), radius,
radius, paint);
radius, paint);
canvas.drawRoundRect(new RectF(right - diameter, bottom - diameter, right, bottom), radius,
radius, paint);
radius, paint);
canvas.drawRect(new RectF(margin, margin + radius, right - radius, bottom), paint);
canvas.drawRect(new RectF(margin + radius, margin, right, bottom - radius), paint);
}
@@ -229,9 +229,9 @@ public class RoundedCornersTransformation extends BitmapTransformation {
private void drawDiagonalFromTopRightRoundRect(Canvas canvas, Paint paint, float right,
float bottom) {
canvas.drawRoundRect(new RectF(right - diameter, margin, right, margin + diameter), radius,
radius, paint);
radius, paint);
canvas.drawRoundRect(new RectF(margin, bottom - diameter, margin + diameter, bottom), radius,
radius, paint);
radius, paint);
canvas.drawRect(new RectF(margin, margin, right - radius, bottom - radius), paint);
canvas.drawRect(new RectF(margin + radius, margin + radius, right, bottom), paint);
}
@@ -239,16 +239,16 @@ public class RoundedCornersTransformation extends BitmapTransformation {
@Override
public String toString() {
return "RoundedTransformation(radius=" + radius + ", margin=" + margin + ", diameter="
+ diameter + ", cornerType=" + cornerType.name() + ")";
+ diameter + ", cornerType=" + cornerType.name() + ")";
}
@Override
public boolean equals(Object o) {
return o instanceof RoundedCornersTransformation &&
((RoundedCornersTransformation) o).radius == radius &&
((RoundedCornersTransformation) o).diameter == diameter &&
((RoundedCornersTransformation) o).margin == margin &&
((RoundedCornersTransformation) o).cornerType == cornerType;
((RoundedCornersTransformation) o).radius == radius &&
((RoundedCornersTransformation) o).diameter == diameter &&
((RoundedCornersTransformation) o).margin == margin &&
((RoundedCornersTransformation) o).cornerType == cornerType;
}
@Override

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@ public class SupportRSBlurTransformation extends BitmapTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.SupportRSBlurTransformation." + VERSION;
"jp.wasabeef.glide.transformations.SupportRSBlurTransformation." + VERSION;
private static int MAX_RADIUS = 25;
private static int DEFAULT_DOWN_SAMPLING = 1;
@@ -99,8 +99,8 @@ public class SupportRSBlurTransformation extends BitmapTransformation {
@Override
public boolean equals(Object o) {
return o instanceof SupportRSBlurTransformation &&
((SupportRSBlurTransformation) o).radius == radius &&
((SupportRSBlurTransformation) o).sampling == sampling;
((SupportRSBlurTransformation) o).radius == radius &&
((SupportRSBlurTransformation) o).sampling == sampling;
}
@Override

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ public class BrightnessFilterTransformation extends GPUFilterTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.gpu.BrightnessFilterTransformation." + VERSION;
"jp.wasabeef.glide.transformations.gpu.BrightnessFilterTransformation." + VERSION;
private float brightness;
@@ -52,7 +52,7 @@ public class BrightnessFilterTransformation extends GPUFilterTransformation {
@Override
public boolean equals(Object o) {
return o instanceof BrightnessFilterTransformation &&
((BrightnessFilterTransformation) o).brightness == brightness;
((BrightnessFilterTransformation) o).brightness == brightness;
}
@Override

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ public class ContrastFilterTransformation extends GPUFilterTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.gpu.ContrastFilterTransformation." + VERSION;
"jp.wasabeef.glide.transformations.gpu.ContrastFilterTransformation." + VERSION;
private float contrast;

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ public class GPUFilterTransformation extends BitmapTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.gpu.GPUFilterTransformation." + VERSION;
"jp.wasabeef.glide.transformations.gpu.GPUFilterTransformation." + VERSION;
private static final byte[] ID_BYTES = ID.getBytes(CHARSET);
private GPUImageFilter gpuImageFilter;

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ public class InvertFilterTransformation extends GPUFilterTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.gpu.InvertFilterTransformation." + VERSION;
"jp.wasabeef.glide.transformations.gpu.InvertFilterTransformation." + VERSION;
public InvertFilterTransformation() {
super(new GPUImageColorInvertFilter());

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import jp.co.cyberagent.android.gpuimage.filter.GPUImageKuwaharaFilter;
/**
* Kuwahara all the colors in the image.
*
* <p>
* The radius to sample from when creating the brush-stroke effect, with a default of 25.
* The larger the radius, the slower the filter.
*/
@@ -32,7 +32,7 @@ public class KuwaharaFilterTransformation extends GPUFilterTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.gpu.KuwaharaFilterTransformation." + VERSION;
"jp.wasabeef.glide.transformations.gpu.KuwaharaFilterTransformation." + VERSION;
private int radius;

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,14 +24,14 @@ import jp.co.cyberagent.android.gpuimage.filter.GPUImagePixelationFilter;
/**
* Applies a Pixelation effect to the image.
*
* <p>
* The pixel with a default of 10.0.
*/
public class PixelationFilterTransformation extends GPUFilterTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.gpu.PixelationFilterTransformation." + VERSION;
"jp.wasabeef.glide.transformations.gpu.PixelationFilterTransformation." + VERSION;
private float pixel;

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@ public class SepiaFilterTransformation extends GPUFilterTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.gpu.SepiaFilterTransformation." + VERSION;
"jp.wasabeef.glide.transformations.gpu.SepiaFilterTransformation." + VERSION;
private float intensity;

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ public class SketchFilterTransformation extends GPUFilterTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.gpu.SketchFilterTransformation." + VERSION;
"jp.wasabeef.glide.transformations.gpu.SketchFilterTransformation." + VERSION;
public SketchFilterTransformation() {
super(new GPUImageSketchFilter());

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@ public class SwirlFilterTransformation extends GPUFilterTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.gpu.SwirlFilterTransformation." + VERSION;
"jp.wasabeef.glide.transformations.gpu.SwirlFilterTransformation." + VERSION;
private float radius;
private float angle;
@@ -60,15 +60,15 @@ public class SwirlFilterTransformation extends GPUFilterTransformation {
@Override
public String toString() {
return "SwirlFilterTransformation(radius=" + radius + ",angle=" + angle + ",center="
+ center.toString() + ")";
+ center.toString() + ")";
}
@Override
public boolean equals(Object o) {
return o instanceof SwirlFilterTransformation &&
((SwirlFilterTransformation) o).radius == radius &&
((SwirlFilterTransformation) o).angle == radius &&
((SwirlFilterTransformation) o).center.equals(center.x, center.y);
((SwirlFilterTransformation) o).radius == radius &&
((SwirlFilterTransformation) o).angle == radius &&
((SwirlFilterTransformation) o).center.equals(center.x, center.y);
}
@Override

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@ public class ToonFilterTransformation extends GPUFilterTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.gpu.ToonFilterTransformation." + VERSION;
"jp.wasabeef.glide.transformations.gpu.ToonFilterTransformation." + VERSION;
private float threshold;
private float quantizationLevels;
@@ -52,14 +52,14 @@ public class ToonFilterTransformation extends GPUFilterTransformation {
@Override
public String toString() {
return "ToonFilterTransformation(threshold=" + threshold + ",quantizationLevels="
+ quantizationLevels + ")";
+ quantizationLevels + ")";
}
@Override
public boolean equals(Object o) {
return o instanceof ToonFilterTransformation &&
((ToonFilterTransformation) o).threshold == threshold &&
((ToonFilterTransformation) o).quantizationLevels == quantizationLevels;
((ToonFilterTransformation) o).threshold == threshold &&
((ToonFilterTransformation) o).quantizationLevels == quantizationLevels;
}
@Override

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@ public class VignetteFilterTransformation extends GPUFilterTransformation {
private static final int VERSION = 1;
private static final String ID =
"jp.wasabeef.glide.transformations.gpu.VignetteFilterTransformation." + VERSION;
"jp.wasabeef.glide.transformations.gpu.VignetteFilterTransformation." + VERSION;
private PointF center;
private float[] vignetteColor;
@@ -61,22 +61,22 @@ public class VignetteFilterTransformation extends GPUFilterTransformation {
@Override
public String toString() {
return "VignetteFilterTransformation(center=" + center.toString() + ",color=" + Arrays.toString(
vignetteColor) + ",start=" + vignetteStart + ",end=" + vignetteEnd + ")";
vignetteColor) + ",start=" + vignetteStart + ",end=" + vignetteEnd + ")";
}
@Override
public boolean equals(Object o) {
return o instanceof VignetteFilterTransformation &&
((VignetteFilterTransformation) o).center.equals(center.x, center.y) &&
Arrays.equals(((VignetteFilterTransformation) o).vignetteColor, vignetteColor) &&
((VignetteFilterTransformation) o).vignetteStart == vignetteStart &&
((VignetteFilterTransformation) o).vignetteEnd == vignetteEnd;
((VignetteFilterTransformation) o).center.equals(center.x, center.y) &&
Arrays.equals(((VignetteFilterTransformation) o).vignetteColor, vignetteColor) &&
((VignetteFilterTransformation) o).vignetteStart == vignetteStart &&
((VignetteFilterTransformation) o).vignetteEnd == vignetteEnd;
}
@Override
public int hashCode() {
return ID.hashCode() + center.hashCode() + Arrays.hashCode(vignetteColor) +
(int) (vignetteStart * 100) + (int) (vignetteEnd * 10);
(int) (vignetteStart * 100) + (int) (vignetteEnd * 10);
}
@Override

View File

@@ -3,7 +3,7 @@ package jp.wasabeef.glide.transformations.internal;
import android.graphics.Bitmap;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -254,4 +254,4 @@ public class FastBlur {
return (bitmap);
}
}
}

View File

@@ -11,7 +11,7 @@ import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicBlur;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ public class RSBlur {
rs = RenderScript.create(context);
rs.setMessageHandler(new RenderScript.RSMessageHandler());
input = Allocation.createFromBitmap(rs, bitmap, Allocation.MipmapControl.MIPMAP_NONE,
Allocation.USAGE_SCRIPT);
Allocation.USAGE_SCRIPT);
output = Allocation.createTyped(rs, input.getType());
blur = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));

View File

@@ -12,7 +12,7 @@ import androidx.renderscript.RenderScript;
import androidx.renderscript.ScriptIntrinsicBlur;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ public class SupportRSBlur {
rs = RenderScript.create(context);
rs.setMessageHandler(new RenderScript.RSMessageHandler());
input = Allocation.createFromBitmap(rs, bitmap, Allocation.MipmapControl.MIPMAP_NONE,
Allocation.USAGE_SCRIPT);
Allocation.USAGE_SCRIPT);
output = Allocation.createTyped(rs, input.getType());
blur = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));

View File

@@ -6,7 +6,7 @@ import android.graphics.drawable.Drawable;
import android.os.Build;
/**
* Copyright (C) 2019 Wasabeef
* Copyright (C) 2020 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.