Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-129
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-129
2021-129
Commits
2b75323b
Commit
2b75323b
authored
Oct 17, 2021
by
samesh97
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
performance improvements
parent
104409df
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
770 additions
and
186 deletions
+770
-186
app/src/main/assets/eye_gaze.tflite
app/src/main/assets/eye_gaze.tflite
+0
-0
app/src/main/assets/model_gesture_detection.tflite
app/src/main/assets/model_gesture_detection.tflite
+0
-0
app/src/main/java/com/app/smartphotoeditor/activities/AddEffects.java
.../java/com/app/smartphotoeditor/activities/AddEffects.java
+3
-59
app/src/main/java/com/app/smartphotoeditor/activities/AdjustBrightness.java
...com/app/smartphotoeditor/activities/AdjustBrightness.java
+301
-18
app/src/main/java/com/app/smartphotoeditor/activities/AdjustSaturation.java
...com/app/smartphotoeditor/activities/AdjustSaturation.java
+302
-21
app/src/main/java/com/app/smartphotoeditor/sdk/Methods.java
app/src/main/java/com/app/smartphotoeditor/sdk/Methods.java
+7
-0
app/src/main/java/com/app/smartphotoeditor/services/ComputerVision.java
...ava/com/app/smartphotoeditor/services/ComputerVision.java
+21
-0
app/src/main/java/com/app/smartphotoeditor/vision/EyeBlinkDetection.java
...va/com/app/smartphotoeditor/vision/EyeBlinkDetection.java
+21
-24
app/src/main/java/com/app/smartphotoeditor/vision/EyeGazeDetection.java
...ava/com/app/smartphotoeditor/vision/EyeGazeDetection.java
+5
-2
app/src/main/java/com/app/smartphotoeditor/vision/GestureDetection.java
...ava/com/app/smartphotoeditor/vision/GestureDetection.java
+1
-1
app/src/main/res/layout/activity_adjust_brightness.xml
app/src/main/res/layout/activity_adjust_brightness.xml
+54
-30
app/src/main/res/layout/activity_adjust_saturation.xml
app/src/main/res/layout/activity_adjust_saturation.xml
+55
-31
No files found.
app/src/main/assets/eye_gaze.tflite
View file @
2b75323b
No preview for this file type
app/src/main/assets/model_gesture_detection.tflite
View file @
2b75323b
No preview for this file type
app/src/main/java/com/app/smartphotoeditor/activities/AddEffects.java
View file @
2b75323b
...
@@ -80,7 +80,7 @@ public class AddEffects extends AppCompatActivity
...
@@ -80,7 +80,7 @@ public class AddEffects extends AppCompatActivity
private
ComputerVision
computerVision
;
private
ComputerVision
computerVision
;
private
EyeGazeDetection
eyeGazeDetection
;
@Override
@Override
...
@@ -130,12 +130,7 @@ public class AddEffects extends AppCompatActivity
...
@@ -130,12 +130,7 @@ public class AddEffects extends AppCompatActivity
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
back
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
back
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
save
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
save
));
try
{
eyeGazeDetection
=
new
EyeGazeDetection
(
getAssets
(),
getApplicationContext
(),
"eye_gaze.tflite"
,
224
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
init
();
init
();
...
@@ -326,16 +321,12 @@ public class AddEffects extends AppCompatActivity
...
@@ -326,16 +321,12 @@ public class AddEffects extends AppCompatActivity
void
findViewPoint
(
int
x
,
int
y
)
void
findViewPoint
(
int
x
,
int
y
)
{
{
//if(!isPossible) return;
ImageView
b
=
findViewById
(
R
.
id
.
cursor
);
ImageView
b
=
findViewById
(
R
.
id
.
cursor
);
int
viewMaxX
=
0
;
int
viewMaxX
=
0
;
int
viewMinX
=
0
;
int
viewMaxY
=
0
;
int
viewMaxY
=
0
;
int
viewMinY
=
0
;
...
@@ -368,17 +359,6 @@ public class AddEffects extends AppCompatActivity
...
@@ -368,17 +359,6 @@ public class AddEffects extends AppCompatActivity
}
}
//
// b.animate().x(x);
// b.animate().y(y);
...
@@ -393,16 +373,6 @@ public class AddEffects extends AppCompatActivity
...
@@ -393,16 +373,6 @@ public class AddEffects extends AppCompatActivity
int
viewX
=
location
[
0
];
int
viewX
=
location
[
0
];
int
viewY
=
location
[
1
];
int
viewY
=
location
[
1
];
// if(viewX >= viewMaxX)
// {
// viewMaxX = viewX;
// }
// if(viewY >= viewMaxY)
// {
// viewMaxY = viewY;
// }
Log
.
d
(
"aaaaaaaaaaaa"
,
"View="
+
view
.
getId
()
+
"X="
+
viewX
+
", Y="
+
viewY
);
int
viewMaxWidth
=
viewX
+
view
.
getWidth
();
int
viewMaxWidth
=
viewX
+
view
.
getWidth
();
int
viewMinWidth
=
viewX
-
view
.
getWidth
();
int
viewMinWidth
=
viewX
-
view
.
getWidth
();
...
@@ -410,24 +380,14 @@ public class AddEffects extends AppCompatActivity
...
@@ -410,24 +380,14 @@ public class AddEffects extends AppCompatActivity
int
viewMaxHeight
=
viewY
+
view
.
getHeight
();
int
viewMaxHeight
=
viewY
+
view
.
getHeight
();
int
viewMinHeight
=
viewY
-
view
.
getHeight
();
int
viewMinHeight
=
viewY
-
view
.
getHeight
();
//b.animate().y((viewMinHeight + viewMaxHeight) / 2);
if
((
x
>=
viewMinWidth
&&
x
<=
viewMaxWidth
))
if
((
x
>=
viewMinWidth
&&
x
<=
viewMaxWidth
))
{
{
if
(
lastLookedView
!=
null
&&
lastLookedView
.
getId
()
==
view
.
getId
())
if
(
lastLookedView
!=
null
&&
lastLookedView
.
getId
()
==
view
.
getId
())
{
{
count
++;
}
else
{
count
=
0
;
}
if
(
count
>=
3
)
{
isPossible
=
false
;
checkCount
();
}
}
...
@@ -456,21 +416,6 @@ public class AddEffects extends AppCompatActivity
...
@@ -456,21 +416,6 @@ public class AddEffects extends AppCompatActivity
b
.
animate
().
y
(
y
);
b
.
animate
().
y
(
y
);
}
}
private
void
checkCount
()
{
count
++;
if
(
count
>=
5
)
{
isPossible
=
true
;
count
=
0
;
}
else
{
isPossible
=
false
;
}
}
@Override
@Override
public
void
opened
()
{
public
void
opened
()
{
...
@@ -489,7 +434,6 @@ public class AddEffects extends AppCompatActivity
...
@@ -489,7 +434,6 @@ public class AddEffects extends AppCompatActivity
@Override
@Override
public
void
onPupilChanged
(
Mat
binary
,
int
x
,
int
y
,
int
range
,
int
pupilX
)
public
void
onPupilChanged
(
Mat
binary
,
int
x
,
int
y
,
int
range
,
int
pupilX
)
{
{
if
(
eyeGazeDetection
!=
null
)
eyeGazeDetection
.
detect
(
Methods
.
matToBit
(
binary
));
// try
// try
// {
// {
...
...
app/src/main/java/com/app/smartphotoeditor/activities/AdjustBrightness.java
View file @
2b75323b
package
com.app.smartphotoeditor.activities
;
package
com.app.smartphotoeditor.activities
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.graphics.Color
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
com.app.smartphotoeditor.R
;
import
com.app.smartphotoeditor.R
;
import
com.app.smartphotoeditor.config.ImageList
;
import
com.app.smartphotoeditor.config.ImageList
;
import
com.app.smartphotoeditor.listeners.OnCameraPreviewChanged
;
import
com.app.smartphotoeditor.listeners.OnVoiceCommandResultChanged
;
import
com.app.smartphotoeditor.listeners.ml.OnEyeStatusChanged
;
import
com.app.smartphotoeditor.listeners.ml.OnGestureDetected
;
import
com.app.smartphotoeditor.sdk.Methods
;
import
com.app.smartphotoeditor.sdk.Methods
;
import
com.app.smartphotoeditor.sdk.RealTimeCamera
;
import
com.app.smartphotoeditor.services.ComputerVision
;
import
com.app.smartphotoeditor.services.SpeechService
;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.Glide
;
import
com.warkiz.tickseekbar.OnSeekChangeListener
;
import
com.warkiz.tickseekbar.OnSeekChangeListener
;
import
com.warkiz.tickseekbar.SeekParams
;
import
com.warkiz.tickseekbar.SeekParams
;
import
com.warkiz.tickseekbar.TickSeekBar
;
import
com.warkiz.tickseekbar.TickSeekBar
;
import
org.opencv.core.Mat
;
public
class
AdjustBrightness
extends
AppCompatActivity
{
import
java.util.ArrayList
;
public
class
AdjustBrightness
extends
AppCompatActivity
implements
OnGestureDetected
,
OnEyeStatusChanged
,
OnVoiceCommandResultChanged
{
private
ImageView
adjustImage
;
private
ImageView
adjustImage
;
...
@@ -24,7 +39,14 @@ public class AdjustBrightness extends AppCompatActivity {
...
@@ -24,7 +39,14 @@ public class AdjustBrightness extends AppCompatActivity {
private
Methods
methods
;
private
Methods
methods
;
float
brightnessValue
=
0.0f
;
float
brightnessValue
=
0.0f
;
private
ComputerVision
computerVision
;
private
int
count
=
0
;
private
View
lastLookedView
=
null
;
private
ArrayList
<
View
>
viewsInDisplay
=
new
ArrayList
<>();
private
TickSeekBar
seekBar
;
private
boolean
isPossible
=
true
;
private
SpeechService
speechService
;
@Override
@Override
...
@@ -32,10 +54,25 @@ public class AdjustBrightness extends AppCompatActivity {
...
@@ -32,10 +54,25 @@ public class AdjustBrightness extends AppCompatActivity {
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_adjust_brightness
);
setContentView
(
R
.
layout
.
activity_adjust_brightness
);
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
back
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
save
));
computerVision
=
new
ComputerVision
(
this
,
this
,
this
);
ConstraintLayout
constraintLayout
=
findViewById
(
R
.
id
.
constraint_main
);
new
RealTimeCamera
(
AdjustBrightness
.
this
,
constraintLayout
,
new
OnCameraPreviewChanged
()
{
@Override
public
void
updated
(
Mat
rgba
,
Mat
previewMat
)
{
computerVision
.
setMat
(
rgba
);
setPreviewFrame
(
previewMat
);
}
}).
initialize
();
methods
=
new
Methods
(
getApplicationContext
());
methods
=
new
Methods
(
getApplicationContext
());
adjustImage
=
findViewById
(
R
.
id
.
adjustImage
);
adjustImage
=
findViewById
(
R
.
id
.
adjustImage
);
TickSeekBar
seekBar
=
findViewById
(
R
.
id
.
seekbar
);
seekBar
=
findViewById
(
R
.
id
.
seekbar
);
createImage
();
createImage
();
...
@@ -43,20 +80,39 @@ public class AdjustBrightness extends AppCompatActivity {
...
@@ -43,20 +80,39 @@ public class AdjustBrightness extends AppCompatActivity {
{
{
@Override
@Override
public
void
onSeeking
(
SeekParams
seekParams
)
public
void
onSeeking
(
SeekParams
seekParams
)
{
}
{
brightnessValue
=
seekBar
.
getProgress
();
createImage
();
}
@Override
@Override
public
void
onStartTrackingTouch
(
TickSeekBar
seekBar
)
{
}
public
void
onStartTrackingTouch
(
TickSeekBar
seekBar
)
{
}
@Override
@Override
public
void
onStopTrackingTouch
(
TickSeekBar
seekBar
)
public
void
onStopTrackingTouch
(
TickSeekBar
seekBar
)
{
{
brightnessValue
=
seekBar
.
getProgress
();
createImage
();
}
}
});
});
speechService
=
new
SpeechService
(
getApplicationContext
(),
findViewById
(
R
.
id
.
progress
),
this
);
}
private
void
setPreviewFrame
(
Mat
previewMat
)
{
ImageView
preview
=
findViewById
(
R
.
id
.
preview
);
Bitmap
previewBitmap
=
Methods
.
matToBit
(
previewMat
);
previewBitmap
=
Methods
.
rotateBitmap
(
previewBitmap
,-
90
f
);
Bitmap
finalPreviewBitmap
=
previewBitmap
;
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
preview
!=
null
)
preview
.
setImageBitmap
(
finalPreviewBitmap
);
}
});
}
}
private
void
createImage
()
private
void
createImage
()
...
@@ -68,19 +124,6 @@ public class AdjustBrightness extends AppCompatActivity {
...
@@ -68,19 +124,6 @@ public class AdjustBrightness extends AppCompatActivity {
currentEditingImage
=
methods
.
changeBitmapContrastBrightness
(
currentEditingImage
,
1
f
,
brightnessValue
);
currentEditingImage
=
methods
.
changeBitmapContrastBrightness
(
currentEditingImage
,
1
f
,
brightnessValue
);
}
}
// if(blurValue > 0)
// {
// currentEditingImage = new BlurUtils().blur(AdjustImage.this,currentEditingImage, blurValue);
// }
// if(saturationValue > 0)
// {
// currentEditingImage = methods.addSaturation(currentEditingImage,saturationValue);
// }
// if(brightnessValue > 0)
// {
// currentEditingImage = methods.changeBitmapContrastBrightness(currentEditingImage,1f,brightnessValue);
// }
Glide
.
with
(
getApplicationContext
()).
load
(
currentEditingImage
).
into
(
adjustImage
);
Glide
.
with
(
getApplicationContext
()).
load
(
currentEditingImage
).
into
(
adjustImage
);
}
}
...
@@ -99,4 +142,244 @@ public class AdjustBrightness extends AppCompatActivity {
...
@@ -99,4 +142,244 @@ public class AdjustBrightness extends AppCompatActivity {
}
}
Back
(
null
);
Back
(
null
);
}
}
void
findViewPoint
(
int
x
,
int
y
)
{
//if(!isPossible) return;
ImageView
b
=
findViewById
(
R
.
id
.
cursor
);
int
viewMaxX
=
0
;
int
viewMinX
=
0
;
int
viewMaxY
=
0
;
int
viewMinY
=
0
;
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
int
viewX
=
location
[
0
]
+
(
view
.
getWidth
()
/
2
);
int
viewY
=
location
[
1
]
/
2
;
if
(
viewX
>=
viewMaxX
)
{
viewMaxX
=
viewX
;
}
if
(
viewY
>=
viewMaxY
)
{
viewMaxY
=
viewY
;
}
}
if
(
x
>
viewMaxX
)
{
x
=
viewMaxX
;
}
if
(
y
>
viewMaxY
)
{
y
=
viewMaxY
;
}
//
// b.animate().x(x);
// b.animate().y(y);
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
int
viewX
=
location
[
0
];
int
viewY
=
location
[
1
];
// if(viewX >= viewMaxX)
// {
// viewMaxX = viewX;
// }
// if(viewY >= viewMaxY)
// {
// viewMaxY = viewY;
// }
Log
.
d
(
"aaaaaaaaaaaa"
,
"View="
+
view
.
getId
()
+
"X="
+
viewX
+
", Y="
+
viewY
);
int
viewMaxWidth
=
viewX
+
view
.
getWidth
();
int
viewMinWidth
=
viewX
-
view
.
getWidth
();
int
viewMaxHeight
=
viewY
+
view
.
getHeight
();
int
viewMinHeight
=
viewY
-
view
.
getHeight
();
//b.animate().y((viewMinHeight + viewMaxHeight) / 2);
if
((
x
>=
viewMinWidth
&&
x
<=
viewMaxWidth
))
{
if
(
lastLookedView
!=
null
&&
lastLookedView
.
getId
()
==
view
.
getId
())
{
count
++;
}
else
{
count
=
0
;
}
if
(
count
>=
3
)
{
isPossible
=
false
;
checkCount
();
}
view
.
setBackgroundColor
(
Color
.
RED
);
b
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
b
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
Log
.
d
(
"bbbbb"
,
"Came here"
);
lastLookedView
=
view
;
}
else
{
view
.
setBackgroundColor
(
Color
.
BLACK
);
}
}
b
.
animate
().
x
(
x
);
b
.
animate
().
y
(
y
);
}
private
void
checkCount
()
{
count
++;
if
(
count
>=
5
)
{
isPossible
=
true
;
count
=
0
;
}
else
{
isPossible
=
false
;
}
}
@Override
public
void
opened
()
{
}
@Override
public
void
closed
()
{
}
@Override
public
void
longClosed
()
{
}
@Override
public
void
onPupilChanged
(
Mat
binary
,
int
x
,
int
y
,
int
range
,
int
pupilX
)
{
findViewPoint
(
x
,
y
);
}
@Override
public
void
onIdle
()
{
}
@Override
public
void
onLeft
()
{
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
seekBar
.
setProgress
(
seekBar
.
getProgress
()
-
10
);
}
});
}
@Override
public
void
onRight
()
{
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
seekBar
.
setProgress
(
seekBar
.
getProgress
()
+
10
);
}
});
}
@Override
public
void
onTop
()
{
}
@Override
public
void
onBottom
()
{
}
@Override
public
void
back
()
{
Back
(
null
);
}
@Override
public
void
exit
()
{
}
@Override
public
void
undo
()
{
}
@Override
public
void
redo
()
{
}
@Override
public
void
save
()
{
Save
(
null
);
}
@Override
public
void
select
()
{
}
}
}
app/src/main/java/com/app/smartphotoeditor/activities/AdjustSaturation.java
View file @
2b75323b
package
com.app.smartphotoeditor.activities
;
package
com.app.smartphotoeditor.activities
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.graphics.Color
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
com.app.smartphotoeditor.R
;
import
com.app.smartphotoeditor.R
;
import
com.app.smartphotoeditor.config.ImageList
;
import
com.app.smartphotoeditor.config.ImageList
;
import
com.app.smartphotoeditor.listeners.OnCameraPreviewChanged
;
import
com.app.smartphotoeditor.listeners.OnVoiceCommandResultChanged
;
import
com.app.smartphotoeditor.listeners.ml.OnEyeStatusChanged
;
import
com.app.smartphotoeditor.listeners.ml.OnGestureDetected
;
import
com.app.smartphotoeditor.sdk.Methods
;
import
com.app.smartphotoeditor.sdk.Methods
;
import
com.app.smartphotoeditor.sdk.RealTimeCamera
;
import
com.app.smartphotoeditor.services.ComputerVision
;
import
com.app.smartphotoeditor.services.SpeechService
;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.Glide
;
import
com.warkiz.tickseekbar.OnSeekChangeListener
;
import
com.warkiz.tickseekbar.OnSeekChangeListener
;
import
com.warkiz.tickseekbar.SeekParams
;
import
com.warkiz.tickseekbar.SeekParams
;
import
com.warkiz.tickseekbar.TickSeekBar
;
import
com.warkiz.tickseekbar.TickSeekBar
;
import
org.opencv.core.Mat
;
public
class
AdjustSaturation
extends
AppCompatActivity
{
import
java.util.ArrayList
;
public
class
AdjustSaturation
extends
AppCompatActivity
implements
OnGestureDetected
,
OnEyeStatusChanged
,
OnVoiceCommandResultChanged
{
private
ImageView
adjustImage
;
private
ImageView
adjustImage
;
...
@@ -24,6 +39,15 @@ public class AdjustSaturation extends AppCompatActivity {
...
@@ -24,6 +39,15 @@ public class AdjustSaturation extends AppCompatActivity {
private
Methods
methods
;
private
Methods
methods
;
float
saturationLevel
=
0.0f
;
float
saturationLevel
=
0.0f
;
private
ComputerVision
computerVision
;
private
int
count
=
0
;
private
View
lastLookedView
=
null
;
private
ArrayList
<
View
>
viewsInDisplay
=
new
ArrayList
<>();
private
TickSeekBar
seekBar
;
private
boolean
isPossible
=
true
;
private
SpeechService
speechService
;
@Override
@Override
...
@@ -32,9 +56,24 @@ public class AdjustSaturation extends AppCompatActivity {
...
@@ -32,9 +56,24 @@ public class AdjustSaturation extends AppCompatActivity {
setContentView
(
R
.
layout
.
activity_adjust_saturation
);
setContentView
(
R
.
layout
.
activity_adjust_saturation
);
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
back
));
viewsInDisplay
.
add
(
findViewById
(
R
.
id
.
save
));
computerVision
=
new
ComputerVision
(
this
,
this
,
this
);
ConstraintLayout
constraintLayout
=
findViewById
(
R
.
id
.
constraint_main
);
new
RealTimeCamera
(
AdjustSaturation
.
this
,
constraintLayout
,
new
OnCameraPreviewChanged
()
{
@Override
public
void
updated
(
Mat
rgba
,
Mat
previewMat
)
{
computerVision
.
setMat
(
rgba
);
setPreviewFrame
(
previewMat
);
}
}).
initialize
();
methods
=
new
Methods
(
getApplicationContext
());
methods
=
new
Methods
(
getApplicationContext
());
adjustImage
=
findViewById
(
R
.
id
.
adjustImage
);
adjustImage
=
findViewById
(
R
.
id
.
adjustImage
);
TickSeekBar
seekBar
=
findViewById
(
R
.
id
.
seekbar
);
seekBar
=
findViewById
(
R
.
id
.
seekbar
);
createImage
();
createImage
();
...
@@ -42,21 +81,38 @@ public class AdjustSaturation extends AppCompatActivity {
...
@@ -42,21 +81,38 @@ public class AdjustSaturation extends AppCompatActivity {
{
{
@Override
@Override
public
void
onSeeking
(
SeekParams
seekParams
)
public
void
onSeeking
(
SeekParams
seekParams
)
{
}
{
saturationLevel
=
seekBar
.
getProgress
()
/
10
;
createImage
();
}
@Override
@Override
public
void
onStartTrackingTouch
(
TickSeekBar
seekBar
)
{
}
public
void
onStartTrackingTouch
(
TickSeekBar
seekBar
)
{
}
@Override
@Override
public
void
onStopTrackingTouch
(
TickSeekBar
seekBar
)
public
void
onStopTrackingTouch
(
TickSeekBar
seekBar
)
{
{
}
saturationLevel
=
seekBar
.
getProgress
();
createImage
();
}
});
});
speechService
=
new
SpeechService
(
getApplicationContext
(),
findViewById
(
R
.
id
.
progress
),
this
);
}
}
private
void
setPreviewFrame
(
Mat
previewMat
)
{
ImageView
preview
=
findViewById
(
R
.
id
.
preview
);
Bitmap
previewBitmap
=
Methods
.
matToBit
(
previewMat
);
previewBitmap
=
Methods
.
rotateBitmap
(
previewBitmap
,-
90
f
);
Bitmap
finalPreviewBitmap
=
previewBitmap
;
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
preview
!=
null
)
preview
.
setImageBitmap
(
finalPreviewBitmap
);
}
});
}
private
void
createImage
()
private
void
createImage
()
{
{
...
@@ -67,20 +123,6 @@ public class AdjustSaturation extends AppCompatActivity {
...
@@ -67,20 +123,6 @@ public class AdjustSaturation extends AppCompatActivity {
currentEditingImage
=
methods
.
addSaturation
(
currentEditingImage
,
saturationLevel
);
currentEditingImage
=
methods
.
addSaturation
(
currentEditingImage
,
saturationLevel
);
}
}
// if(blurValue > 0)
// {
// currentEditingImage = new BlurUtils().blur(AdjustImage.this,currentEditingImage, blurValue);
// }
// if(saturationValue > 0)
// {
// currentEditingImage = methods.addSaturation(currentEditingImage,saturationValue);
// }
// if(brightnessValue > 0)
// {
// currentEditingImage = methods.changeBitmapContrastBrightness(currentEditingImage,1f,brightnessValue);
// }
Glide
.
with
(
getApplicationContext
()).
load
(
currentEditingImage
).
into
(
adjustImage
);
Glide
.
with
(
getApplicationContext
()).
load
(
currentEditingImage
).
into
(
adjustImage
);
}
}
...
@@ -98,4 +140,243 @@ public class AdjustSaturation extends AppCompatActivity {
...
@@ -98,4 +140,243 @@ public class AdjustSaturation extends AppCompatActivity {
}
}
Back
(
null
);
Back
(
null
);
}
}
void
findViewPoint
(
int
x
,
int
y
)
{
//if(!isPossible) return;
ImageView
b
=
findViewById
(
R
.
id
.
cursor
);
int
viewMaxX
=
0
;
int
viewMinX
=
0
;
int
viewMaxY
=
0
;
int
viewMinY
=
0
;
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
int
viewX
=
location
[
0
]
+
(
view
.
getWidth
()
/
2
);
int
viewY
=
location
[
1
]
/
2
;
if
(
viewX
>=
viewMaxX
)
{
viewMaxX
=
viewX
;
}
if
(
viewY
>=
viewMaxY
)
{
viewMaxY
=
viewY
;
}
}
if
(
x
>
viewMaxX
)
{
x
=
viewMaxX
;
}
if
(
y
>
viewMaxY
)
{
y
=
viewMaxY
;
}
//
// b.animate().x(x);
// b.animate().y(y);
for
(
View
view
:
viewsInDisplay
)
{
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
int
viewX
=
location
[
0
];
int
viewY
=
location
[
1
];
// if(viewX >= viewMaxX)
// {
// viewMaxX = viewX;
// }
// if(viewY >= viewMaxY)
// {
// viewMaxY = viewY;
// }
Log
.
d
(
"aaaaaaaaaaaa"
,
"View="
+
view
.
getId
()
+
"X="
+
viewX
+
", Y="
+
viewY
);
int
viewMaxWidth
=
viewX
+
view
.
getWidth
();
int
viewMinWidth
=
viewX
-
view
.
getWidth
();
int
viewMaxHeight
=
viewY
+
view
.
getHeight
();
int
viewMinHeight
=
viewY
-
view
.
getHeight
();
//b.animate().y((viewMinHeight + viewMaxHeight) / 2);
if
((
x
>=
viewMinWidth
&&
x
<=
viewMaxWidth
))
{
if
(
lastLookedView
!=
null
&&
lastLookedView
.
getId
()
==
view
.
getId
())
{
count
++;
}
else
{
count
=
0
;
}
if
(
count
>=
3
)
{
isPossible
=
false
;
checkCount
();
}
view
.
setBackgroundColor
(
Color
.
RED
);
b
.
animate
().
x
((
viewMinWidth
+
viewMaxWidth
)
/
2
);
b
.
animate
().
y
((
viewMinHeight
+
viewMaxHeight
)
/
2
);
Log
.
d
(
"bbbbb"
,
"Came here"
);
lastLookedView
=
view
;
}
else
{
view
.
setBackgroundColor
(
Color
.
BLACK
);
}
}
b
.
animate
().
x
(
x
);
b
.
animate
().
y
(
y
);
}
private
void
checkCount
()
{
count
++;
if
(
count
>=
5
)
{
isPossible
=
true
;
count
=
0
;
}
else
{
isPossible
=
false
;
}
}
@Override
public
void
opened
()
{
}
@Override
public
void
closed
()
{
}
@Override
public
void
longClosed
()
{
}
@Override
public
void
onPupilChanged
(
Mat
binary
,
int
x
,
int
y
,
int
range
,
int
pupilX
)
{
findViewPoint
(
x
,
y
);
}
@Override
public
void
onIdle
()
{
}
@Override
public
void
onLeft
()
{
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
seekBar
.
setProgress
(
seekBar
.
getProgress
()
-
10
);
}
});
}
@Override
public
void
onRight
()
{
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
seekBar
.
setProgress
(
seekBar
.
getProgress
()
+
10
);
}
});
}
@Override
public
void
onTop
()
{
}
@Override
public
void
onBottom
()
{
}
@Override
public
void
back
()
{
Back
(
null
);
}
@Override
public
void
exit
()
{
}
@Override
public
void
undo
()
{
}
@Override
public
void
redo
()
{
}
@Override
public
void
save
()
{
Save
(
null
);
}
@Override
public
void
select
()
{
}
}
}
app/src/main/java/com/app/smartphotoeditor/sdk/Methods.java
View file @
2b75323b
...
@@ -56,6 +56,7 @@ import java.io.FileOutputStream;
...
@@ -56,6 +56,7 @@ import java.io.FileOutputStream;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.io.OutputStream
;
import
java.math.BigDecimal
;
import
java.nio.ByteBuffer
;
import
java.nio.ByteBuffer
;
import
java.nio.ByteOrder
;
import
java.nio.ByteOrder
;
import
java.nio.MappedByteBuffer
;
import
java.nio.MappedByteBuffer
;
...
@@ -371,6 +372,12 @@ public class Methods
...
@@ -371,6 +372,12 @@ public class Methods
return
ret
;
return
ret
;
}
}
public
static
float
round
(
float
d
,
int
decimalPlace
)
{
BigDecimal
bd
=
new
BigDecimal
(
Float
.
toString
(
d
));
bd
=
bd
.
setScale
(
decimalPlace
,
BigDecimal
.
ROUND_HALF_UP
);
return
bd
.
floatValue
();
}
public
Uri
getImageUri
(
Bitmap
inImage
,
Boolean
isNeededToDelete
)
public
Uri
getImageUri
(
Bitmap
inImage
,
Boolean
isNeededToDelete
)
{
{
ByteArrayOutputStream
bytes
=
new
ByteArrayOutputStream
();
ByteArrayOutputStream
bytes
=
new
ByteArrayOutputStream
();
...
...
app/src/main/java/com/app/smartphotoeditor/services/ComputerVision.java
View file @
2b75323b
...
@@ -25,6 +25,7 @@ public class ComputerVision
...
@@ -25,6 +25,7 @@ public class ComputerVision
private
FacialLandmarkDetection
landmarkDetection
;
private
FacialLandmarkDetection
landmarkDetection
;
private
GestureDetection
gestureDetection
;
private
GestureDetection
gestureDetection
;
private
EyeBlinkDetection
eyeBlinkDetection
;
private
EyeBlinkDetection
eyeBlinkDetection
;
private
EyeGazeDetection
eyeGazeDetection
;
//listeners
//listeners
private
final
OnGestureDetected
gestureListener
;
private
final
OnGestureDetected
gestureListener
;
...
@@ -44,6 +45,17 @@ public class ComputerVision
...
@@ -44,6 +45,17 @@ public class ComputerVision
setupLandmarkDetection
();
setupLandmarkDetection
();
setupGestureDetection
();
setupGestureDetection
();
setupEyeBlinkDetection
();
setupEyeBlinkDetection
();
setupEyeGazeDetection
();
}
private
void
setupEyeGazeDetection
()
{
try
{
eyeGazeDetection
=
new
EyeGazeDetection
(
activity
.
getAssets
(),
activity
.
getApplicationContext
(),
"eye_gaze.tflite"
,
224
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
...
@@ -104,9 +116,18 @@ public class ComputerVision
...
@@ -104,9 +116,18 @@ public class ComputerVision
{
{
Bitmap
bitmap
=
Methods
.
matToBit
(
mat
);
Bitmap
bitmap
=
Methods
.
matToBit
(
mat
);
// try {
// Methods.saveImage(activity.getApplicationContext(),bitmap,"NewEyeClose");
// } catch (IOException e) {
// e.printStackTrace();
// }
if
(
eyeBlinkDetection
!=
null
)
if
(
eyeBlinkDetection
!=
null
)
eyeBlinkDetection
.
detectEyeBlinkState
(
bitmap
);
eyeBlinkDetection
.
detectEyeBlinkState
(
bitmap
);
if
(
eyeGazeDetection
!=
null
)
eyeGazeDetection
.
detect
(
bitmap
);
}
}
...
...
app/src/main/java/com/app/smartphotoeditor/vision/EyeBlinkDetection.java
View file @
2b75323b
...
@@ -7,6 +7,7 @@ import android.speech.tts.TextToSpeech;
...
@@ -7,6 +7,7 @@ import android.speech.tts.TextToSpeech;
import
android.util.Log
;
import
android.util.Log
;
import
com.app.smartphotoeditor.listeners.ml.OnEyeStatusChanged
;
import
com.app.smartphotoeditor.listeners.ml.OnEyeStatusChanged
;
import
com.app.smartphotoeditor.sdk.Methods
;
import
org.tensorflow.lite.Interpreter
;
import
org.tensorflow.lite.Interpreter
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -22,8 +23,9 @@ public class EyeBlinkDetection
...
@@ -22,8 +23,9 @@ public class EyeBlinkDetection
private
final
Interpreter
interpreter
;
private
final
Interpreter
interpreter
;
private
final
int
imageSize
;
private
final
int
imageSize
;
private
static
final
int
MIN_EYE_CLOSE_COUNT
=
2
;
private
static
final
int
MIN_EYE_CLOSE_COUNT
=
0
;
private
static
final
int
MAX_EYE_CLOSE_TIME
=
-
1
;
private
static
final
int
LONG_EYE_CLOSE_COUNT
=
2
;
private
static
final
int
MAX_EYE_CLOSE_TIME
=
3
;
private
int
eyeCloseCount
=
MIN_EYE_CLOSE_COUNT
;
private
int
eyeCloseCount
=
MIN_EYE_CLOSE_COUNT
;
private
final
OnEyeStatusChanged
listener
;
private
final
OnEyeStatusChanged
listener
;
...
@@ -68,45 +70,40 @@ public class EyeBlinkDetection
...
@@ -68,45 +70,40 @@ public class EyeBlinkDetection
float
opened
=
(
float
)
Array
.
get
(
Array
.
get
(
result
,
0
),
i
+
0
);
float
opened
=
(
float
)
Array
.
get
(
Array
.
get
(
result
,
0
),
i
+
0
);
//get eye closed probability
//get eye closed probability
float
closed
=
(
float
)
Array
.
get
(
Array
.
get
(
result
,
0
),
i
+
1
);
float
closed
=
(
float
)
Array
.
get
(
Array
.
get
(
result
,
0
),
i
+
1
);
//closed = Methods.round(closed,5);
Log
.
d
(
"CheckBlink"
,
""
+
closed
);
//if open or close probability is good
//if open or close probability is good
if
((
opened
>=
0.95
&&
opened
<=
1
)
||
(
closed
>=
0.90
&&
closed
<=
1
))
if
((
opened
>=
0.95
&&
opened
<=
1
)
||
(
closed
<=
1
&&
closed
>=
0.90
))
{
{
//if opened probability is high
if
(
closed
>
0.90
)
if
(
opened
>
closed
)
{
{
//close
listener
.
closed
();
if
(
eyeCloseCount
<=
0
)
eyeCloseCount
+=
1
;
if
(
eyeCloseCount
>=
LONG_EYE_CLOSE_COUNT
&&
eyeCloseCount
<=
MAX_EYE_CLOSE_TIME
)
{
{
Log
.
d
(
"EyeBlink"
,
"Long Closed"
);
//long
speak
(
"Button Clicked"
);
listener
.
longClosed
();
listener
.
longClosed
();
speak
(
"Button Clicked"
);
eyeCloseCount
=
MIN_EYE_CLOSE_COUNT
;
}
}
else
else
if
(
eyeCloseCount
>
MAX_EYE_CLOSE_TIME
)
{
{
//opened
eyeCloseCount
=
MIN_EYE_CLOSE_COUNT
;
Log
.
d
(
"EyeBlink"
,
"Opened"
);
listener
.
opened
();
}
}
eyeCloseCount
=
MIN_EYE_CLOSE_COUNT
;
}
}
else
else
{
{
//closed
//open
Log
.
d
(
"EyeBlink"
,
"Closed"
);
eyeCloseCount
=
MIN_EYE_CLOSE_COUNT
;
eyeCloseCount
--;
listener
.
opened
();
listener
.
closed
();
if
(
eyeCloseCount
<=
MAX_EYE_CLOSE_TIME
)
{
eyeCloseCount
=
MIN_EYE_CLOSE_COUNT
;
}
}
}
}
}
...
...
app/src/main/java/com/app/smartphotoeditor/vision/EyeGazeDetection.java
View file @
2b75323b
...
@@ -37,7 +37,7 @@ public class EyeGazeDetection
...
@@ -37,7 +37,7 @@ public class EyeGazeDetection
ByteBuffer
byteBuffer
=
convertBitmapToByteBuffer
(
scaledBitmap
,
imageSize
);
ByteBuffer
byteBuffer
=
convertBitmapToByteBuffer
(
scaledBitmap
,
imageSize
);
//create 2d array to store results
//create 2d array to store results
float
[][]
result
=
new
float
[
1
][
2
];
float
[][]
result
=
new
float
[
1
][
3
];
//run the model
//run the model
interpreter
.
run
(
byteBuffer
,
result
);
interpreter
.
run
(
byteBuffer
,
result
);
...
@@ -47,10 +47,13 @@ public class EyeGazeDetection
...
@@ -47,10 +47,13 @@ public class EyeGazeDetection
//float center = (float) Array.get(Array.get(result, 0), i + 0);
//float center = (float) Array.get(Array.get(result, 0), i + 0);
float
left
=
(
float
)
Array
.
get
(
Array
.
get
(
result
,
0
),
i
+
0
);
float
left
=
(
float
)
Array
.
get
(
Array
.
get
(
result
,
0
),
i
+
0
);
float
right
=
(
float
)
Array
.
get
(
Array
.
get
(
result
,
0
),
i
+
1
);
float
right
=
(
float
)
Array
.
get
(
Array
.
get
(
result
,
0
),
i
+
1
);
float
center
=
(
float
)
Array
.
get
(
Array
.
get
(
result
,
0
),
i
+
2
);
Log
.
d
(
"GazePointer"
,
""
+
right
);
if
(
left
>
right
&&
left
>=
0.2
)
if
(
left
>
right
&&
left
>=
0.2
)
{
{
Log
.
d
(
"Hello22"
,
"Left - "
+
righ
t
);
Log
.
d
(
"Hello22"
,
"Left - "
+
lef
t
);
}
}
else
if
(
right
>=
0.2
)
else
if
(
right
>=
0.2
)
{
{
...
...
app/src/main/java/com/app/smartphotoeditor/vision/GestureDetection.java
View file @
2b75323b
...
@@ -104,7 +104,7 @@ public class GestureDetection
...
@@ -104,7 +104,7 @@ public class GestureDetection
float
top
=
(
float
)
Array
.
get
(
Array
.
get
(
result
,
0
),
i
+
3
);
float
top
=
(
float
)
Array
.
get
(
Array
.
get
(
result
,
0
),
i
+
3
);
float
bottom
=
(
float
)
Array
.
get
(
Array
.
get
(
result
,
0
),
i
+
4
);
float
bottom
=
(
float
)
Array
.
get
(
Array
.
get
(
result
,
0
),
i
+
4
);
Log
.
d
(
"Left
"
,
""
+
bottom
);
Log
.
d
(
"Left
ccc"
,
""
+
idle
);
float
max
=
0
;
float
max
=
0
;
...
...
app/src/main/res/layout/activity_adjust_brightness.xml
View file @
2b75323b
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:id=
"@+id/constraint_main"
android:background=
"@android:color/white"
android:background=
"@android:color/white"
tools:context=
".activities.AdjustBrightness"
>
tools:context=
".activities.AdjustBrightness"
>
...
@@ -55,46 +56,44 @@
...
@@ -55,46 +56,44 @@
android:id=
"@+id/adjustImage"
android:id=
"@+id/adjustImage"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
android:layout_marginTop=
"80dp"
android:adjustViewBounds=
"true"
android:adjustViewBounds=
"true"
android:background=
"@color/white"
android:scaleType=
"centerCrop"
android:scaleType=
"centerCrop"
app:layout_constraintBottom_to
TopOf=
"@+id/guideline6
"
app:layout_constraintBottom_to
BottomOf=
"@+id/displayImageDenoise
"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.0"
app:layout_constraintHorizontal_bias=
"0.0"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/toolbar"
/>
app:layout_constraintTop_toBottomOf=
"@+id/progress"
app:layout_constraintVertical_bias=
"0.0"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/constraintLayout"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:background=
"@color/colorPrimary"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/displayImageDenoise"
/>
<TextView
android:id=
"@+id/textView22"
<com.warkiz.tickseekbar.TickSeekBar
android:layout_width=
"wrap_content"
android:id=
"@+id/seekbar"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"32dp"
android:layout_marginStart=
"32dp"
android:text=
"Brightness"
android:layout_marginEnd=
"32dp"
android:textColor=
"@color/darkAsh"
app:layout_constraintBottom_toBottomOf=
"parent"
android:textSize=
"17sp"
app:layout_constraintEnd_toEndOf=
"parent"
android:textStyle=
"bold"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/displayImageDenoise"
/>
app:layout_constraintTop_toBottomOf=
"@+id/displayImageDenoise"
app:tsb_max=
"250"
<com.warkiz.tickseekbar.TickSeekBar
app:tsb_show_tick_marks_type=
"none"
android:id=
"@+id/seekbar"
app:tsb_thumb_color=
"@color/darkAsh"
android:layout_width=
"0dp"
app:tsb_thumb_size=
"20dp"
android:layout_height=
"wrap_content"
app:tsb_ticks_count=
"1"
android:layout_marginTop=
"8dp"
app:tsb_track_background_color=
"@color/darkAsh"
android:layout_marginEnd=
"32dp"
app:tsb_track_background_size=
"9dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:tsb_track_progress_color=
"#FFFFFF"
app:layout_constraintStart_toStartOf=
"@+id/textView22"
app:tsb_track_progress_size=
"3dp"
/>
app:layout_constraintTop_toBottomOf=
"@+id/textView22"
app:tsb_max=
"250"
app:tsb_show_tick_marks_type=
"none"
app:tsb_thumb_color=
"@color/darkAsh"
app:tsb_thumb_size=
"20dp"
app:tsb_ticks_count=
"1"
app:tsb_track_background_color=
"@color/darkAsh"
app:tsb_track_background_size=
"9dp"
app:tsb_track_progress_color=
"#FFFFFF"
app:tsb_track_progress_size=
"3dp"
/>
<androidx.constraintlayout.widget.Guideline
<androidx.constraintlayout.widget.Guideline
...
@@ -104,6 +103,15 @@
...
@@ -104,6 +103,15 @@
android:orientation=
"horizontal"
android:orientation=
"horizontal"
app:layout_constraintGuide_percent=
"0.82"
/>
app:layout_constraintGuide_percent=
"0.82"
/>
<ImageView
android:id=
"@+id/preview"
android:layout_width=
"120dp"
android:layout_height=
"120dp"
android:scaleType=
"centerCrop"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/toolbar"
/>
<Button
<Button
android:id=
"@+id/back"
android:id=
"@+id/back"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -127,4 +135,20 @@
...
@@ -127,4 +135,20 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/toolbar"
/>
app:layout_constraintTop_toBottomOf=
"@+id/toolbar"
/>
<ProgressBar
android:id=
"@+id/progress"
style=
"?android:attr/progressBarStyleHorizontal"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_centerVertical=
"true"
android:layout_marginStart=
"32dp"
android:layout_marginEnd=
"32dp"
android:max=
"100"
android:progress=
"50"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"1.0"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/preview"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_adjust_saturation.xml
View file @
2b75323b
...
@@ -4,8 +4,9 @@
...
@@ -4,8 +4,9 @@
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:id=
"@+id/constraint_main"
android:background=
"@android:color/white"
android:background=
"@android:color/white"
tools:context=
".activities.Adjust
Saturation
"
>
tools:context=
".activities.Adjust
Brightness
"
>
<androidx.appcompat.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id=
"@+id/toolbar"
android:id=
"@+id/toolbar"
...
@@ -55,46 +56,44 @@
...
@@ -55,46 +56,44 @@
android:id=
"@+id/adjustImage"
android:id=
"@+id/adjustImage"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
android:layout_marginTop=
"80dp"
android:adjustViewBounds=
"true"
android:adjustViewBounds=
"true"
android:background=
"@color/white"
android:scaleType=
"centerCrop"
android:scaleType=
"centerCrop"
app:layout_constraintBottom_to
TopOf=
"@+id/guideline6
"
app:layout_constraintBottom_to
BottomOf=
"@+id/displayImageDenoise
"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.0"
app:layout_constraintHorizontal_bias=
"0.0"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/toolbar"
/>
app:layout_constraintTop_toBottomOf=
"@+id/progress"
app:layout_constraintVertical_bias=
"0.0"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/constraintLayout"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:background=
"@color/colorPrimary"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/displayImageDenoise"
/>
<TextView
android:id=
"@+id/textView22"
<com.warkiz.tickseekbar.TickSeekBar
android:layout_width=
"wrap_content"
android:id=
"@+id/seekbar"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"32dp"
android:layout_marginStart=
"32dp"
android:text=
"Saturation"
android:layout_marginEnd=
"32dp"
android:textColor=
"@color/darkAsh"
app:layout_constraintBottom_toBottomOf=
"parent"
android:textSize=
"17sp"
app:layout_constraintEnd_toEndOf=
"parent"
android:textStyle=
"bold"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/displayImageDenoise"
/>
app:layout_constraintTop_toBottomOf=
"@+id/displayImageDenoise"
app:tsb_max=
"250"
<com.warkiz.tickseekbar.TickSeekBar
app:tsb_show_tick_marks_type=
"none"
android:id=
"@+id/seekbar"
app:tsb_thumb_color=
"@color/darkAsh"
android:layout_width=
"0dp"
app:tsb_thumb_size=
"20dp"
android:layout_height=
"wrap_content"
app:tsb_ticks_count=
"1"
android:layout_marginTop=
"8dp"
app:tsb_track_background_color=
"@color/darkAsh"
android:layout_marginEnd=
"32dp"
app:tsb_track_background_size=
"9dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:tsb_track_progress_color=
"#FFFFFF"
app:layout_constraintStart_toStartOf=
"@+id/textView22"
app:tsb_track_progress_size=
"3dp"
/>
app:layout_constraintTop_toBottomOf=
"@+id/textView22"
app:tsb_max=
"250"
app:tsb_show_tick_marks_type=
"none"
app:tsb_thumb_color=
"@color/darkAsh"
app:tsb_thumb_size=
"20dp"
app:tsb_ticks_count=
"1"
app:tsb_track_background_color=
"@color/darkAsh"
app:tsb_track_background_size=
"9dp"
app:tsb_track_progress_color=
"#FFFFFF"
app:tsb_track_progress_size=
"3dp"
/>
<androidx.constraintlayout.widget.Guideline
<androidx.constraintlayout.widget.Guideline
...
@@ -104,6 +103,15 @@
...
@@ -104,6 +103,15 @@
android:orientation=
"horizontal"
android:orientation=
"horizontal"
app:layout_constraintGuide_percent=
"0.82"
/>
app:layout_constraintGuide_percent=
"0.82"
/>
<ImageView
android:id=
"@+id/preview"
android:layout_width=
"120dp"
android:layout_height=
"120dp"
android:scaleType=
"centerCrop"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/toolbar"
/>
<Button
<Button
android:id=
"@+id/back"
android:id=
"@+id/back"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -127,4 +135,20 @@
...
@@ -127,4 +135,20 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/toolbar"
/>
app:layout_constraintTop_toBottomOf=
"@+id/toolbar"
/>
<ProgressBar
android:id=
"@+id/progress"
style=
"?android:attr/progressBarStyleHorizontal"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_centerVertical=
"true"
android:layout_marginStart=
"32dp"
android:layout_marginEnd=
"32dp"
android:max=
"100"
android:progress=
"50"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"1.0"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/preview"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment