-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy pathGPUImage.java
More file actions
764 lines (684 loc) · 25.9 KB
/
Copy pathGPUImage.java
File metadata and controls
764 lines (684 loc) · 25.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
/*
* Copyright (C) 2018 CyberAgent, Inc.
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package jp.co.cyberagent.android.gpuimage;
import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.ConfigurationInfo;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.PixelFormat;
import android.hardware.Camera;
import android.media.ExifInterface;
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.opengl.GLSurfaceView;
import android.os.AsyncTask;
import android.os.Environment;
import android.os.Handler;
import android.provider.MediaStore;
import android.view.Display;
import android.view.SurfaceView;
import android.view.TextureView;
import android.view.WindowManager;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.List;
import jp.co.cyberagent.android.gpuimage.filter.GPUImageFilter;
import jp.co.cyberagent.android.gpuimage.util.Rotation;
import jp.co.cyberagent.android.gpuimage.view.GLRenderView;
/**
* The main accessor for GPUImage functionality. This class helps to do common
* tasks through a simple interface.
*/
public class GPUImage {
public enum ScaleType {CENTER_INSIDE, CENTER_CROP}
static final int SURFACE_TYPE_SURFACE_VIEW = 0;
static final int SURFACE_TYPE_TEXTURE_VIEW = 1;
private final Context context;
private final GPUImageRenderer renderer;
private GLRenderView glRenderView;
private GPUImageFilter filter;
private Bitmap currentBitmap;
private ScaleType scaleType = ScaleType.CENTER_CROP;
private int scaleWidth, scaleHeight;
/**
* Instantiates a new GPUImage object.
*
* @param context the context
*/
public GPUImage(final Context context) {
if (!supportsOpenGLES2(context)) {
throw new IllegalStateException("OpenGL ES 2.0 is not supported on this phone.");
}
this.context = context;
filter = new GPUImageFilter();
renderer = new GPUImageRenderer(filter);
}
/**
* Checks if OpenGL ES 2.0 is supported on the current device.
*
* @param context the context
* @return true, if successful
*/
private boolean supportsOpenGLES2(final Context context) {
final ActivityManager activityManager = (ActivityManager)
context.getSystemService(Context.ACTIVITY_SERVICE);
final ConfigurationInfo configurationInfo =
activityManager.getDeviceConfigurationInfo();
return configurationInfo.reqGlEsVersion >= 0x20000;
}
/**
* Sets the GLRenderView which will display the preview.
*
* @param view the GLRenderView instance
*/
public void setGLRenderView(final GLRenderView view) {
glRenderView = view;
glRenderView.setEGLContextClientVersion(2);
glRenderView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
if (glRenderView instanceof TextureView) {
((TextureView) glRenderView).setOpaque(false);
} else if (glRenderView instanceof SurfaceView) {
((SurfaceView) glRenderView).getHolder().setFormat(PixelFormat.RGBA_8888);
}
glRenderView.setRender(renderer);
glRenderView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
glRenderView.requestRender();
}
/**
* Sets the background color
*
* @param red red color value
* @param green green color value
* @param blue red color value
*/
public void setBackgroundColor(float red, float green, float blue) {
renderer.setBackgroundColor(red, green, blue);
}
/**
* Request the preview to be rendered again.
*/
public void requestRender() {
if (glRenderView != null) {
glRenderView.requestRender();
}
}
/**
* Deprecated: Please call
* {@link GPUImage#updatePreviewFrame(byte[], int, int)} frame by frame
* <p>
* Sets the up camera to be connected to GPUImage to get a filtered preview.
*
* @param camera the camera
*/
@Deprecated
public void setUpCamera(final Camera camera) {
setUpCamera(camera, 0, false, false);
}
/**
* Deprecated: Please call
* {@link GPUImage#updatePreviewFrame(byte[], int, int)} frame by frame
* <p>
* Sets the up camera to be connected to GPUImage to get a filtered preview.
*
* @param camera the camera
* @param degrees by how many degrees the image should be rotated
* @param flipHorizontal if the image should be flipped horizontally
* @param flipVertical if the image should be flipped vertically
*/
@Deprecated
public void setUpCamera(final Camera camera, final int degrees, final boolean flipHorizontal,
final boolean flipVertical) {
glRenderView.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
renderer.setUpSurfaceTexture(camera);
Rotation rotation = Rotation.NORMAL;
switch (degrees) {
case 90:
rotation = Rotation.ROTATION_90;
break;
case 180:
rotation = Rotation.ROTATION_180;
break;
case 270:
rotation = Rotation.ROTATION_270;
break;
}
renderer.setRotationCamera(rotation, flipHorizontal, flipVertical);
}
/**
* Sets the filter which should be applied to the image which was (or will
* be) set by setImage(...).
*
* @param filter the new filter
*/
public void setFilter(final GPUImageFilter filter) {
this.filter = filter;
renderer.setFilter(this.filter);
requestRender();
}
/**
* Sets the image on which the filter should be applied.
*
* @param bitmap the new image
*/
public void setImage(final Bitmap bitmap) {
currentBitmap = bitmap;
renderer.setImageBitmap(bitmap, false);
requestRender();
}
/**
* Update camera preview frame with YUV format data.
*
* @param data Camera preview YUV data for frame.
* @param width width of camera preview
* @param height height of camera preview
*/
public void updatePreviewFrame(final byte[] data, final int width, final int height) {
renderer.onPreviewFrame(data, width, height);
}
/**
* This sets the scale type of GPUImage. This has to be run before setting the image.
* If image is set and scale type changed, image needs to be reset.
*
* @param scaleType The new ScaleType
*/
public void setScaleType(ScaleType scaleType) {
this.scaleType = scaleType;
renderer.setScaleType(scaleType);
renderer.deleteImage();
currentBitmap = null;
requestRender();
}
/**
* This gets the size of the image. This makes it easier to adjust
* the size of your imagePreview to the the size of the scaled image.
*
* @return array with width and height of bitmap image
*/
public int[] getScaleSize() {
return new int[]{scaleWidth, scaleHeight};
}
/**
* Sets the rotation of the displayed image.
*
* @param rotation new rotation
*/
public void setRotation(Rotation rotation) {
renderer.setRotation(rotation);
}
/**
* Sets the rotation of the displayed image with flip options.
*
* @param rotation new rotation
*/
public void setRotation(Rotation rotation, boolean flipHorizontal, boolean flipVertical) {
renderer.setRotation(rotation, flipHorizontal, flipVertical);
}
/**
* Deletes the current image.
*/
public void deleteImage() {
renderer.deleteImage();
currentBitmap = null;
requestRender();
}
/**
* Sets the image on which the filter should be applied from a Uri.
*
* @param uri the uri of the new image
*/
public void setImage(final Uri uri) {
new LoadImageUriTask(this, uri).execute();
}
/**
* Sets the image on which the filter should be applied from a File.
*
* @param file the file of the new image
*/
public void setImage(final File file) {
new LoadImageFileTask(this, file).execute();
}
private String getPath(final Uri uri) {
String[] projection = {
MediaStore.Images.Media.DATA,
};
Cursor cursor = context.getContentResolver()
.query(uri, projection, null, null, null);
String path = null;
if (cursor == null) {
return null;
}
if (cursor.moveToFirst()) {
int pathIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
path = cursor.getString(pathIndex);
}
cursor.close();
return path;
}
/**
* Gets the current displayed image with applied filter as a Bitmap.
*
* @return the current image with filter applied
*/
public Bitmap getBitmapWithFilterApplied() {
return getBitmapWithFilterApplied(currentBitmap);
}
/**
* Gets the given bitmap with current filter applied as a Bitmap.
*
* @param bitmap the bitmap on which the current filter should be applied
* @return the bitmap with filter applied
*/
public Bitmap getBitmapWithFilterApplied(final Bitmap bitmap) {
return getBitmapWithFilterApplied(bitmap, false);
}
/**
* Gets the given bitmap with current filter applied as a Bitmap.
*
* @param bitmap the bitmap on which the current filter should be applied
* @param recycle recycle the bitmap or not.
* @return the bitmap with filter applied
*/
public Bitmap getBitmapWithFilterApplied(final Bitmap bitmap, boolean recycle) {
if (glRenderView != null) {
renderer.deleteImage();
renderer.runOnDraw(new Runnable() {
@Override
public void run() {
synchronized (filter) {
filter.destroy();
filter.notify();
}
}
});
synchronized (filter) {
requestRender();
try {
filter.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
GPUImageRenderer renderer = new GPUImageRenderer(filter);
renderer.setRotation(Rotation.NORMAL,
this.renderer.isFlippedHorizontally(), this.renderer.isFlippedVertically());
renderer.setScaleType(scaleType);
PixelBuffer buffer = new PixelBuffer(bitmap.getWidth(), bitmap.getHeight());
buffer.setRenderer(renderer);
renderer.setImageBitmap(bitmap, recycle);
Bitmap result = buffer.getBitmap();
filter.destroy();
renderer.deleteImage();
buffer.destroy();
this.renderer.setFilter(filter);
if (currentBitmap != null) {
this.renderer.setImageBitmap(currentBitmap, false);
}
requestRender();
return result;
}
/**
* Gets the images for multiple filters on a image. This can be used to
* quickly get thumbnail images for filters. <br>
* Whenever a new Bitmap is ready, the listener will be called with the
* bitmap. The order of the calls to the listener will be the same as the
* filter order.
*
* @param bitmap the bitmap on which the filters will be applied
* @param filters the filters which will be applied on the bitmap
* @param listener the listener on which the results will be notified
*/
public static void getBitmapForMultipleFilters(final Bitmap bitmap,
final List<GPUImageFilter> filters, final ResponseListener<Bitmap> listener) {
if (filters.isEmpty()) {
return;
}
GPUImageRenderer renderer = new GPUImageRenderer(filters.get(0));
renderer.setImageBitmap(bitmap, false);
PixelBuffer buffer = new PixelBuffer(bitmap.getWidth(), bitmap.getHeight());
buffer.setRenderer(renderer);
for (GPUImageFilter filter : filters) {
renderer.setFilter(filter);
listener.response(buffer.getBitmap());
filter.destroy();
}
renderer.deleteImage();
buffer.destroy();
}
/**
* Save current image with applied filter to Pictures. It will be stored on
* the default Picture folder on the phone below the given folderName and
* fileName. <br>
* This method is async and will notify when the image was saved through the
* listener.
*
* @param folderName the folder name
* @param fileName the file name
* @param listener the listener
*/
public void saveToPictures(final String folderName, final String fileName,
final OnPictureSavedListener listener) {
saveToPictures(currentBitmap, folderName, fileName, listener);
}
/**
* Apply and save the given bitmap with applied filter to Pictures. It will
* be stored on the default Picture folder on the phone below the given
* folerName and fileName. <br>
* This method is async and will notify when the image was saved through the
* listener.
*
* @param bitmap the bitmap
* @param folderName the folder name
* @param fileName the file name
* @param listener the listener
*/
public void saveToPictures(final Bitmap bitmap, final String folderName, final String fileName,
final OnPictureSavedListener listener) {
new SaveTask(bitmap, folderName, fileName, listener).execute();
}
/**
* Runs the given Runnable on the OpenGL thread.
*
* @param runnable The runnable to be run on the OpenGL thread.
*/
void runOnGLThread(Runnable runnable) {
renderer.runOnDrawEnd(runnable);
}
private int getOutputWidth() {
if (renderer != null && renderer.getFrameWidth() != 0) {
return renderer.getFrameWidth();
} else if (currentBitmap != null) {
return currentBitmap.getWidth();
} else {
WindowManager windowManager =
(WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Display display = windowManager.getDefaultDisplay();
return display.getWidth();
}
}
private int getOutputHeight() {
if (renderer != null && renderer.getFrameHeight() != 0) {
return renderer.getFrameHeight();
} else if (currentBitmap != null) {
return currentBitmap.getHeight();
} else {
WindowManager windowManager =
(WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Display display = windowManager.getDefaultDisplay();
return display.getHeight();
}
}
@Deprecated
private class SaveTask extends AsyncTask<Void, Void, Void> {
private final Bitmap bitmap;
private final String folderName;
private final String fileName;
private final OnPictureSavedListener listener;
private final Handler handler;
public SaveTask(final Bitmap bitmap, final String folderName, final String fileName,
final OnPictureSavedListener listener) {
this.bitmap = bitmap;
this.folderName = folderName;
this.fileName = fileName;
this.listener = listener;
handler = new Handler();
}
@Override
protected Void doInBackground(final Void... params) {
Bitmap result = getBitmapWithFilterApplied(bitmap);
saveImage(folderName, fileName, result);
return null;
}
private void saveImage(final String folderName, final String fileName, final Bitmap image) {
File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
File file = new File(path, folderName + "/" + fileName);
try {
file.getParentFile().mkdirs();
image.compress(CompressFormat.JPEG, 80, new FileOutputStream(file));
MediaScannerConnection.scanFile(context,
new String[]{
file.toString()
}, null,
new MediaScannerConnection.OnScanCompletedListener() {
@Override
public void onScanCompleted(final String path, final Uri uri) {
if (listener != null) {
handler.post(new Runnable() {
@Override
public void run() {
listener.onPictureSaved(uri);
}
});
}
}
});
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}
public interface OnPictureSavedListener {
void onPictureSaved(Uri uri);
}
private class LoadImageUriTask extends LoadImageTask {
private final Uri uri;
public LoadImageUriTask(GPUImage gpuImage, Uri uri) {
super(gpuImage);
this.uri = uri;
}
@Override
protected Bitmap decode(BitmapFactory.Options options) {
try {
InputStream inputStream;
if (uri.getScheme().startsWith("http") || uri.getScheme().startsWith("https")) {
inputStream = new URL(uri.toString()).openStream();
} else if (uri.getPath().startsWith("/android_asset/")) {
inputStream = context.getAssets().open(uri.getPath().substring(("/android_asset/").length()));
} else {
inputStream = context.getContentResolver().openInputStream(uri);
}
return BitmapFactory.decodeStream(inputStream, null, options);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
@Override
protected int getImageOrientation() throws IOException {
Cursor cursor = context.getContentResolver().query(uri,
new String[]{MediaStore.Images.ImageColumns.ORIENTATION}, null, null, null);
if (cursor == null || cursor.getCount() != 1) {
return 0;
}
cursor.moveToFirst();
int orientation = cursor.getInt(0);
cursor.close();
return orientation;
}
}
private class LoadImageFileTask extends LoadImageTask {
private final File imageFile;
public LoadImageFileTask(GPUImage gpuImage, File file) {
super(gpuImage);
imageFile = file;
}
@Override
protected Bitmap decode(BitmapFactory.Options options) {
return BitmapFactory.decodeFile(imageFile.getAbsolutePath(), options);
}
@Override
protected int getImageOrientation() throws IOException {
ExifInterface exif = new ExifInterface(imageFile.getAbsolutePath());
int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 1);
switch (orientation) {
case ExifInterface.ORIENTATION_NORMAL:
return 0;
case ExifInterface.ORIENTATION_ROTATE_90:
return 90;
case ExifInterface.ORIENTATION_ROTATE_180:
return 180;
case ExifInterface.ORIENTATION_ROTATE_270:
return 270;
default:
return 0;
}
}
}
private abstract class LoadImageTask extends AsyncTask<Void, Void, Bitmap> {
private final GPUImage gpuImage;
private int outputWidth;
private int outputHeight;
public LoadImageTask(final GPUImage gpuImage) {
this.gpuImage = gpuImage;
}
@Override
protected Bitmap doInBackground(Void... params) {
if (renderer != null && renderer.getFrameWidth() == 0) {
try {
synchronized (renderer.surfaceChangedWaiter) {
renderer.surfaceChangedWaiter.wait(3000);
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
outputWidth = getOutputWidth();
outputHeight = getOutputHeight();
return loadResizedImage();
}
@Override
protected void onPostExecute(Bitmap bitmap) {
super.onPostExecute(bitmap);
gpuImage.deleteImage();
gpuImage.setImage(bitmap);
}
protected abstract Bitmap decode(BitmapFactory.Options options);
private Bitmap loadResizedImage() {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
decode(options);
int scale = 1;
while (checkSize(options.outWidth / scale > outputWidth, options.outHeight / scale > outputHeight)) {
scale++;
}
scale--;
if (scale < 1) {
scale = 1;
}
options = new BitmapFactory.Options();
options.inSampleSize = scale;
options.inPreferredConfig = Bitmap.Config.RGB_565;
options.inPurgeable = true;
options.inTempStorage = new byte[32 * 1024];
Bitmap bitmap = decode(options);
if (bitmap == null) {
return null;
}
bitmap = rotateImage(bitmap);
bitmap = scaleBitmap(bitmap);
return bitmap;
}
private Bitmap scaleBitmap(Bitmap bitmap) {
// resize to desired dimensions
int width = bitmap.getWidth();
int height = bitmap.getHeight();
int[] newSize = getScaleSize(width, height);
Bitmap workBitmap = Bitmap.createScaledBitmap(bitmap, newSize[0], newSize[1], true);
if (workBitmap != bitmap) {
bitmap.recycle();
bitmap = workBitmap;
System.gc();
}
if (scaleType == ScaleType.CENTER_CROP) {
// Crop it
int diffWidth = newSize[0] - outputWidth;
int diffHeight = newSize[1] - outputHeight;
workBitmap = Bitmap.createBitmap(bitmap, diffWidth / 2, diffHeight / 2,
newSize[0] - diffWidth, newSize[1] - diffHeight);
if (workBitmap != bitmap) {
bitmap.recycle();
bitmap = workBitmap;
}
}
return bitmap;
}
/**
* Retrieve the scaling size for the image dependent on the ScaleType.<br>
* <br>
* If CROP: sides are same size or bigger than output's sides<br>
* Else : sides are same size or smaller than output's sides
*/
private int[] getScaleSize(int width, int height) {
float newWidth;
float newHeight;
float withRatio = (float) width / outputWidth;
float heightRatio = (float) height / outputHeight;
boolean adjustWidth = scaleType == ScaleType.CENTER_CROP
? withRatio > heightRatio : withRatio < heightRatio;
if (adjustWidth) {
newHeight = outputHeight;
newWidth = (newHeight / height) * width;
} else {
newWidth = outputWidth;
newHeight = (newWidth / width) * height;
}
scaleWidth = Math.round(newWidth);
scaleHeight = Math.round(newHeight);
return new int[]{Math.round(newWidth), Math.round(newHeight)};
}
private boolean checkSize(boolean widthBigger, boolean heightBigger) {
if (scaleType == ScaleType.CENTER_CROP) {
return widthBigger && heightBigger;
} else {
return widthBigger || heightBigger;
}
}
private Bitmap rotateImage(final Bitmap bitmap) {
if (bitmap == null) {
return null;
}
Bitmap rotatedBitmap = bitmap;
try {
int orientation = getImageOrientation();
if (orientation != 0) {
Matrix matrix = new Matrix();
matrix.postRotate(orientation);
rotatedBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(),
bitmap.getHeight(), matrix, true);
bitmap.recycle();
}
} catch (IOException e) {
e.printStackTrace();
}
return rotatedBitmap;
}
protected abstract int getImageOrientation() throws IOException;
}
public interface ResponseListener<T> {
void response(T item);
}
public GPUImageRenderer getRenderer() {
return renderer;
}
}