Skip to content

Commit

Permalink
Code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
phishman3579 committed Nov 20, 2013
1 parent 8ba6b6d commit 0bbdc3e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
2 changes: 1 addition & 1 deletion AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
android:versionCode="1"
android:versionName="1.0">

<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="5"/>
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="7"/>

<uses-feature android:name="android.hardware.camera"/>
<uses-permission android:name="android.permission.CAMERA"/>
Expand Down
2 changes: 1 addition & 1 deletion project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
# project structure.

# Project target.
target=android-5
target=android-7
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public void run() {
}

Bitmap bitmap = null;
if (Preferences.SAVE_CHANGES && img != null) {
if (Preferences.SAVE_CHANGES) {
if (Preferences.USE_RGB) bitmap = ImageProcessing.rgbToBitmap(img, width, height);
else bitmap = ImageProcessing.lumaToGreyscale(img, width, height);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ protected static boolean isDifferent(int[] first, int width, int height) {
int totDifferentPixels = 0;
for (int i = 0, ij = 0; i < height; i++) {
for (int j = 0; j < width; j++, ij++) {
int pix = (0xff & ((int) first[ij]));
int otherPix = (0xff & ((int) mPrevious[ij]));
int pix = (0xff & (first[ij]));
int otherPix = (0xff & (mPrevious[ij]));

// Catch any pixels that are out of range
if (pix < 0) pix = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ protected static boolean isDifferent(int[] first, int width, int height) {
int totDifferentPixels = 0;
for (int i = 0, ij = 0; i < height; i++) {
for (int j = 0; j < width; j++, ij++) {
int pix = (0xff & ((int) first[ij]));
int otherPix = (0xff & ((int) mPrevious[ij]));
int pix = (0xff & (first[ij]));
int otherPix = (0xff & (mPrevious[ij]));

// Catch any pixels that are out of range
if (pix < 0) pix = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public static int[] decodeYUV420SPtoLuma(byte[] yuv420sp, int width, int height)

for (int j = 0, yp = 0; j < height; j++) {
for (int i = 0; i < width; i++, yp++) {
int y = (0xff & ((int) yuv420sp[yp])) - 16;
int y = (0xff & (yuv420sp[yp])) - 16;
if (y < 0) y = 0;
hsl[yp] = y;
}
Expand Down Expand Up @@ -142,7 +142,7 @@ public static int[] decodeYUV420SPtoRGB(byte[] yuv420sp, int width, int height)
for (int j = 0, yp = 0; j < height; j++) {
int uvp = frameSize + (j >> 1) * width, u = 0, v = 0;
for (int i = 0; i < width; i++, yp++) {
int y = (0xff & ((int) yuv420sp[yp])) - 16;
int y = (0xff & (yuv420sp[yp])) - 16;
if (y < 0) y = 0;
if ((i & 1) == 0) {
v = (0xff & yuv420sp[uvp++]) - 128;
Expand Down

0 comments on commit 0bbdc3e

Please sign in to comment.