39 lines
881 B
Java
39 lines
881 B
Java
![]() |
package com.rubenvandeven.emotionhero;
|
||
|
|
||
|
import com.affectiva.android.affdex.sdk.detector.Face;
|
||
|
|
||
|
/**
|
||
|
* Created by ruben on 16/08/16.
|
||
|
*/
|
||
|
|
||
|
public enum Emotion {
|
||
|
ANGER,
|
||
|
CONTEMPT,
|
||
|
DISGUST,
|
||
|
FEAR,
|
||
|
JOY,
|
||
|
SADNESS,
|
||
|
SURPRISE;
|
||
|
|
||
|
public float getValueFromFace(Face face)
|
||
|
{
|
||
|
switch (this) {
|
||
|
case ANGER:
|
||
|
return face.emotions.getAnger();
|
||
|
case CONTEMPT:
|
||
|
return face.emotions.getContempt();
|
||
|
case DISGUST:
|
||
|
return face.emotions.getDisgust();
|
||
|
case FEAR:
|
||
|
return face.emotions.getFear();
|
||
|
case JOY:
|
||
|
return face.emotions.getJoy();
|
||
|
case SADNESS:
|
||
|
return face.emotions.getSadness();
|
||
|
case SURPRISE:
|
||
|
return face.emotions.getSurprise();
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
}
|