| 24 | import android.widget.Toast; |
| 25 | |
| 26 | public class MakeupActivity2 extends Activity implements View.OnClickListener, View.OnTouchListener |
| 27 | { |
| 28 | private static final String TAG = MakeupActivity2.class.getSimpleName(); |
| 29 | |
| 30 | |
| 31 | private ImageView iv_image; |
| 32 | // private ImageView iv_model; |
| 33 | |
| 34 | private Bitmap bmp_raw; |
| 35 | private Bitmap bmp_modified; |
| 36 | private Canvas canvas; |
| 37 | |
| 38 | private Bitmap bmp_example_before; |
| 39 | private Bitmap bmp_example_after; |
| 40 | private Bitmap bmp_example_stretched; |
| 41 | private Bitmap bmp_temp; |
| 42 | private Bitmap bmp_makeup; |
| 43 | |
| 44 | private Button btn_makeup; |
| 45 | private String name; |
| 46 | |
| 47 | private FaceDetector detector; |
| 48 | private SeekBar sb_weight; |
| 49 | |
| 50 | private int makeup_region_image; |
| 51 | |
| 52 | private static final BitmapFactory.Options options = new BitmapFactory.Options(); |
| 53 | static |
| 54 | { |
| 55 | options.inPreferredConfig = Bitmap.Config.ARGB_8888; |
| 56 | options.inSampleSize = 1; |
| 57 | options.inDither = false; |
| 58 | |
| 59 | // DON'T scale drawable/ images, OpenCV need the real size to process images. |
| 60 | options.inScaled = false; |
| 61 | } |
| 62 | |
| 63 | enum MakeupRegion |
| 64 | { |
| 65 | CHEEK, |
| 66 | EYE_BROW, |
| 67 | EYE_LASH, |
| 68 | EYE_SHADOW, |
| 69 | LIPS, |
| 70 | NOSE, |
| 71 | } |
| 72 | |
| 73 | private final Pair<MakeupRegion, Integer> params[] = new Pair[MakeupRegion.values().length]; |
| 74 | |
| 75 | |
| 76 | |
| 77 | private final SeekBar.OnSeekBarChangeListener lsn_weight = new SeekBar.OnSeekBarChangeListener() |
| 78 | { |
| 79 | @Override |
| 80 | public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) |
| 81 | { |
| 82 | if(makeup_region_image == 0) |
| 83 | return; |
nothing calls this directly
no outgoing calls
no test coverage detected