Loading jni/filters/fx.c +4 −4 Original line number Diff line number Diff line Loading @@ -29,7 +29,9 @@ __inline__ int interp(unsigned char *src, int p , int *off ,float dr,float dg, return (int)frbg ; } void JNIFUNCF(ImageFilterFx, nativeApplyFilter, jobject bitmap, jint width, jint height, jobject lutbitmap,jint lutwidth, jint lutheight ) void JNIFUNCF(ImageFilterFx, nativeApplyFilter, jobject bitmap, jint width, jint height, jobject lutbitmap, jint lutwidth, jint lutheight, jint start, jint end) { char* destination = 0; char* lut = 0; Loading Loading @@ -58,9 +60,7 @@ void JNIFUNCF(ImageFilterFx, nativeApplyFilter, jobject bitmap, jint width, jint float scale_B = (lutdim_b-1.f)/256.f; int i; int len = width * height * STEP; for (i = 0; i < len; i+=STEP) for (i = start; i < end; i+= STEP) { int r = rgb[RED]; int g = rgb[GREEN]; Loading src/com/android/gallery3d/filtershow/filters/IconUtilities.java +3 −2 Original line number Diff line number Diff line Loading @@ -64,8 +64,9 @@ public class IconUtilities { int h = bitmap.getHeight(); int fxw = fxBitmap.getWidth(); int fxh = fxBitmap.getHeight(); nativeApplyFilter(bitmap, w, h, fxBitmap, fxw, fxh); int start = 0; int end = w * h * 4; nativeApplyFilter(bitmap, w, h, fxBitmap, fxw, fxh, start, end); return bitmap; } }; Loading src/com/android/gallery3d/filtershow/filters/ImageFilterFx.java +17 −2 Original line number Diff line number Diff line Loading @@ -51,7 +51,9 @@ public class ImageFilterFx extends ImageFilter { return mParameters; } native protected void nativeApplyFilter(Bitmap bitmap, int w, int h,Bitmap fxBitmap, int fxw, int fxh); native protected void nativeApplyFilter(Bitmap bitmap, int w, int h, Bitmap fxBitmap, int fxw, int fxh, int start, int end); @Override public Bitmap apply(Bitmap bitmap, float scaleFactor, int quality) { Loading Loading @@ -85,7 +87,20 @@ public class ImageFilterFx extends ImageFilter { int fxw = mFxBitmap.getWidth(); int fxh = mFxBitmap.getHeight(); nativeApplyFilter(bitmap, w, h, mFxBitmap, fxw, fxh); int stride = w * 4; int max = stride * h; int increment = stride * 256; // 256 lines for (int i = 0; i < max; i += increment) { int start = i; int end = i + increment; if (end > max) { end = max; } if (!getEnvironment().needsStop()) { nativeApplyFilter(bitmap, w, h, mFxBitmap, fxw, fxh, start, end); } } return bitmap; } Loading Loading
jni/filters/fx.c +4 −4 Original line number Diff line number Diff line Loading @@ -29,7 +29,9 @@ __inline__ int interp(unsigned char *src, int p , int *off ,float dr,float dg, return (int)frbg ; } void JNIFUNCF(ImageFilterFx, nativeApplyFilter, jobject bitmap, jint width, jint height, jobject lutbitmap,jint lutwidth, jint lutheight ) void JNIFUNCF(ImageFilterFx, nativeApplyFilter, jobject bitmap, jint width, jint height, jobject lutbitmap, jint lutwidth, jint lutheight, jint start, jint end) { char* destination = 0; char* lut = 0; Loading Loading @@ -58,9 +60,7 @@ void JNIFUNCF(ImageFilterFx, nativeApplyFilter, jobject bitmap, jint width, jint float scale_B = (lutdim_b-1.f)/256.f; int i; int len = width * height * STEP; for (i = 0; i < len; i+=STEP) for (i = start; i < end; i+= STEP) { int r = rgb[RED]; int g = rgb[GREEN]; Loading
src/com/android/gallery3d/filtershow/filters/IconUtilities.java +3 −2 Original line number Diff line number Diff line Loading @@ -64,8 +64,9 @@ public class IconUtilities { int h = bitmap.getHeight(); int fxw = fxBitmap.getWidth(); int fxh = fxBitmap.getHeight(); nativeApplyFilter(bitmap, w, h, fxBitmap, fxw, fxh); int start = 0; int end = w * h * 4; nativeApplyFilter(bitmap, w, h, fxBitmap, fxw, fxh, start, end); return bitmap; } }; Loading
src/com/android/gallery3d/filtershow/filters/ImageFilterFx.java +17 −2 Original line number Diff line number Diff line Loading @@ -51,7 +51,9 @@ public class ImageFilterFx extends ImageFilter { return mParameters; } native protected void nativeApplyFilter(Bitmap bitmap, int w, int h,Bitmap fxBitmap, int fxw, int fxh); native protected void nativeApplyFilter(Bitmap bitmap, int w, int h, Bitmap fxBitmap, int fxw, int fxh, int start, int end); @Override public Bitmap apply(Bitmap bitmap, float scaleFactor, int quality) { Loading Loading @@ -85,7 +87,20 @@ public class ImageFilterFx extends ImageFilter { int fxw = mFxBitmap.getWidth(); int fxh = mFxBitmap.getHeight(); nativeApplyFilter(bitmap, w, h, mFxBitmap, fxw, fxh); int stride = w * 4; int max = stride * h; int increment = stride * 256; // 256 lines for (int i = 0; i < max; i += increment) { int start = i; int end = i + increment; if (end > max) { end = max; } if (!getEnvironment().needsStop()) { nativeApplyFilter(bitmap, w, h, mFxBitmap, fxw, fxh, start, end); } } return bitmap; } Loading