├── .classpath ├── .gitignore ├── .project ├── AndroidManifest.xml ├── LICENSE ├── README.md ├── jni ├── Android.mk ├── Application.mk ├── NativeVision │ ├── .kdev4 │ │ └── NativeVision.kdev4 │ ├── CMakeLists.txt │ ├── NativeVision.kdev4 │ ├── imgTrainer.cpp │ ├── imgTrainer.h │ ├── include │ │ └── yaml-cpp │ │ │ ├── aliasmanager.h │ │ │ ├── anchor.h │ │ │ ├── contrib │ │ │ ├── anchordict.h │ │ │ └── graphbuilder.h │ │ │ ├── conversion.h │ │ │ ├── dll.h │ │ │ ├── emitfromevents.h │ │ │ ├── emitter.h │ │ │ ├── emittermanip.h │ │ │ ├── eventhandler.h │ │ │ ├── exceptions.h │ │ │ ├── iterator.h │ │ │ ├── ltnode.h │ │ │ ├── mark.h │ │ │ ├── node.h │ │ │ ├── nodeimpl.h │ │ │ ├── nodereadimpl.h │ │ │ ├── nodeutil.h │ │ │ ├── noncopyable.h │ │ │ ├── null.h │ │ │ ├── ostream.h │ │ │ ├── parser.h │ │ │ ├── stlemitter.h │ │ │ ├── stlnode.h │ │ │ ├── traits.h │ │ │ └── yaml.h │ ├── lsh.hpp │ ├── main.cpp │ ├── make_patches.py │ ├── speaker.cpp │ ├── speaker.h │ ├── test.cpp │ ├── us_old_patches.yaml │ ├── vision.cpp │ ├── vision.h │ ├── webcam_test.cpp │ └── yaml │ │ ├── aliasmanager.cpp │ │ ├── collectionstack.h │ │ ├── contrib │ │ ├── graphbuilder.cpp │ │ ├── graphbuilderadapter.cpp │ │ └── graphbuilderadapter.h │ │ ├── conversion.cpp │ │ ├── directives.cpp │ │ ├── directives.h │ │ ├── emitfromevents.cpp │ │ ├── emitter.cpp │ │ ├── emitterstate.cpp │ │ ├── emitterstate.h │ │ ├── emitterutils.cpp │ │ ├── emitterutils.h │ │ ├── exp.cpp │ │ ├── exp.h │ │ ├── indentation.h │ │ ├── iterator.cpp │ │ ├── iterpriv.h │ │ ├── node.cpp │ │ ├── nodebuilder.cpp │ │ ├── nodebuilder.h │ │ ├── nodeownership.cpp │ │ ├── nodeownership.h │ │ ├── null.cpp │ │ ├── ostream.cpp │ │ ├── parser.cpp │ │ ├── ptr_stack.h │ │ ├── ptr_vector.h │ │ ├── regex.cpp │ │ ├── regex.h │ │ ├── regeximpl.h │ │ ├── scanner.cpp │ │ ├── scanner.h │ │ ├── scanscalar.cpp │ │ ├── scanscalar.h │ │ ├── scantag.cpp │ │ ├── scantag.h │ │ ├── scantoken.cpp │ │ ├── setting.h │ │ ├── simplekey.cpp │ │ ├── singledocparser.cpp │ │ ├── singledocparser.h │ │ ├── stream.cpp │ │ ├── stream.h │ │ ├── streamcharsource.h │ │ ├── stringsource.h │ │ ├── tag.cpp │ │ ├── tag.h │ │ └── token.h ├── android-ndk-profiler.mk ├── build.sh ├── jni_recognizer.cpp └── prof.h ├── proguard.cfg ├── project.properties ├── res ├── drawable-hdpi │ ├── ic_launcher.png │ ├── mnu_focus.png │ ├── mnu_light.png │ ├── mnu_settings.png │ ├── mnu_tipstricks.png │ └── tips_tricks_icon.png ├── drawable-ldpi │ └── ic_launcher.png ├── drawable-mdpi │ └── ic_launcher.png ├── layout │ ├── main.xml │ ├── settings.xml │ ├── tip.xml │ └── tips_and_tricks.xml ├── menu │ └── main.xml ├── raw │ ├── au100bfull_pic.jpg │ ├── au100ffull_pic.jpg │ ├── au10bfull_pic.jpg │ ├── au10ffull_pic.jpg │ ├── au20bfull_pic.jpg │ ├── au20ffull_pic.jpg │ ├── au50bfull_pic.jpg │ ├── au50ffull_pic.jpg │ ├── au5bfull_pic.jpg │ ├── au5bfull_pic_alt1.jpg │ ├── au5bfull_pic_alt2.jpg │ ├── au5ffull_pic.jpg │ ├── au5ffull_pic_alt1.jpg │ ├── au5ffull_pic_alt2.jpg │ ├── by100000bfull_pic.jpg │ ├── by100000ffull_pic.jpg │ ├── by10000bfull_pic.jpg │ ├── by10000ffull_pic.jpg │ ├── by1000bfull_pic.jpg │ ├── by1000ffull_pic.jpg │ ├── by100bfull_pic.jpg │ ├── by100ffull_pic.jpg │ ├── by200000bfull_pic.jpg │ ├── by200000ffull_pic.jpg │ ├── by20000bfull_pic.jpg │ ├── by20000ffull_pic.jpg │ ├── by50000bfull_pic.jpg │ ├── by50000ffull_pic.jpg │ ├── by5000bfull_pic.jpg │ ├── by5000ffull_pic.jpg │ ├── by500bfull_pic.jpg │ ├── by500ffull_pic.jpg │ ├── by50bfull_pic.jpg │ ├── by50ffull_pic.jpg │ ├── ca100bfull_pic.jpg │ ├── ca100ffull_pic.jpg │ ├── ca10bfull_pic.jpg │ ├── ca10ffull_pic.jpg │ ├── ca10ffull_pic_alt1.jpg │ ├── ca20bfull_pic.jpg │ ├── ca20ffull_pic.jpg │ ├── ca50bfull_pic.jpg │ ├── ca50ffull_pic.jpg │ ├── ca5bfull_pic.jpg │ ├── ca5ffull_pic.jpg │ ├── ca5ffull_pic_alt1.jpg │ ├── eu100bfull_pic.jpg │ ├── eu100ffull_pic.jpg │ ├── eu10bfull_pic.jpg │ ├── eu10ffull_pic.jpg │ ├── eu200bfull_pic.jpg │ ├── eu200ffull_pic.jpg │ ├── eu20bfull_pic.jpg │ ├── eu20ffull_pic.jpg │ ├── eu500bfull_pic.jpg │ ├── eu500ffull_pic.jpg │ ├── eu50bfull_pic.jpg │ ├── eu50ffull_pic.jpg │ ├── eu5bfull_pic.jpg │ ├── eu5ffull_pic.jpg │ ├── ka100bfull_pic.jpg │ ├── ka100ffull_pic.jpg │ ├── ka10bfull_pic.jpg │ ├── ka10ffull_pic.jpg │ ├── ka1bfull_pic.jpg │ ├── ka1ffull_pic.jpg │ ├── ka200bfull_pic.jpg │ ├── ka200ffull_pic.jpg │ ├── ka20bfull_pic.jpg │ ├── ka20ffull_pic.jpg │ ├── ka2bfull_pic.jpg │ ├── ka2ffull_pic.jpg │ ├── ka50bfull_pic.jpg │ ├── ka50ffull_pic.jpg │ ├── ka5bfull_pic.jpg │ ├── ka5ffull_pic.jpg │ ├── ru1000bfull_pic.jpg │ ├── ru1000ffull_pic.jpg │ ├── ru100bfull_pic.jpg │ ├── ru100ffull_pic.jpg │ ├── ru10bfull_pic.jpg │ ├── ru10ffull_pic.jpg │ ├── ru5000bfull_pic.jpg │ ├── ru5000ffull_pic.jpg │ ├── ru500bfull_pic.jpg │ ├── ru500ffull_pic.jpg │ ├── ru50bfull_pic.jpg │ ├── ru50ffull_pic.jpg │ ├── sound_chaching.ogg │ ├── sound_focuscomplete.ogg │ ├── sound_recognitionevent.ogg │ ├── ua100bfull_pic.jpg │ ├── ua100bfull_pic_alt1.jpg │ ├── ua100ffull_pic.jpg │ ├── ua100ffull_pic_alt1.jpg │ ├── ua10bfull_pic.jpg │ ├── ua10bfull_pic_alt1.jpg │ ├── ua10bfull_pic_alt2.jpg │ ├── ua10ffull_pic.jpg │ ├── ua10ffull_pic_alt1.jpg │ ├── ua10ffull_pic_alt2.jpg │ ├── ua1bfull_pic.jpg │ ├── ua1bfull_pic_alt1.jpg │ ├── ua1bfull_pic_alt2.jpg │ ├── ua1ffull_pic.jpg │ ├── ua1ffull_pic_alt1.jpg │ ├── ua1ffull_pic_alt2.jpg │ ├── ua1ffull_pic_alt3.jpg │ ├── ua200bfull_pic.jpg │ ├── ua200bfull_pic_alt1.jpg │ ├── ua200ffull_pic.jpg │ ├── ua200ffull_pic_alt1.jpg │ ├── ua20bfull_pic.jpg │ ├── ua20bfull_pic_alt1.jpg │ ├── ua20bfull_pic_alt2.jpg │ ├── ua20ffull_pic.jpg │ ├── ua20ffull_pic_alt1.jpg │ ├── ua20ffull_pic_alt2.jpg │ ├── ua2bfull_pic.jpg │ ├── ua2bfull_pic_alt1.jpg │ ├── ua2bfull_pic_alt2.jpg │ ├── ua2ffull_pic.jpg │ ├── ua2ffull_pic_alt1.jpg │ ├── ua2ffull_pic_alt2.jpg │ ├── ua500bfull_pic.jpg │ ├── ua500ffull_pic.jpg │ ├── ua50bfull_pic.jpg │ ├── ua50bfull_pic_alt1.jpg │ ├── ua50ffull_pic.jpg │ ├── ua50ffull_pic_alt1.jpg │ ├── ua5bfull_pic.jpg │ ├── ua5bfull_pic_alt1.jpg │ ├── ua5bfull_pic_alt2.jpg │ ├── ua5ffull_pic.jpg │ ├── ua5ffull_pic_alt1.jpg │ ├── ua5ffull_pic_alt2.jpg │ ├── uk10bfull_pic.jpg │ ├── uk10ffull_pic.jpg │ ├── uk20bfull_pic.jpg │ ├── uk20bfull_pic_alt1.jpg │ ├── uk20ffull_pic.jpg │ ├── uk20ffull_pic_alt1.jpg │ ├── uk50bfull_pic.jpg │ ├── uk50bfull_pic_alt1.jpg │ ├── uk50ffull_pic.jpg │ ├── uk50ffull_pic_alt1.jpg │ ├── uk5bfull_pic.jpg │ ├── uk5ffull_pic.jpg │ ├── us100bfull_pic.jpg │ ├── us100ffull_pic.jpg │ ├── us10bfull_pic.jpg │ ├── us10ffull_pic.jpg │ ├── us1bfull_pic.jpg │ ├── us1ffull_pic.jpg │ ├── us20bfull_pic.jpg │ ├── us20ffull_pic.jpg │ ├── us2bfull_pic.jpg │ ├── us2ffull_pic.jpg │ ├── us50bfull_pic.jpg │ ├── us50ffull_pic.jpg │ ├── us5bfull_pic.jpg │ └── us5ffull_pic.jpg ├── values-ru │ ├── language_packs.xml │ ├── strings.xml │ └── tips_and_tricks.xml └── values │ ├── attrs.xml │ ├── language_packs.xml │ ├── strings.xml │ └── tips_and_tricks.xml └── src └── com └── ndu └── mobile └── darwinwallet ├── AutoFocusModes.java ├── AutoFocuser.java ├── BillRecognizerActivity.java ├── CurrencyInfo.java ├── IAutoFocusEvent.java ├── IRecognitionEvent.java ├── Preview.java ├── RecognitionResult.java ├── Recognizer.java ├── SettingsActivity.java ├── TipsArrayAdapter.java ├── TipsnTricksActivity.java └── Voice.java /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | obj/ 3 | gen/ 4 | libs/ 5 | *.a 6 | *.o 7 | *.so 8 | *~ 9 | *.ref 10 | jni/NativeVision/currency 11 | jni/NativeVision/build 12 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | DarwinWallet 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 42 | 43 | 44 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | darwinwallet 2 | ============ 3 | 4 | Darwin Wallet is an Android app that enables blind and visually impaired users to quickly recognize paper money. It uses the phone's camera to detect currency denominations for US, UK, Canadian, European Union, Belarusian rubles, and Australian bills. Simply hold the bill in front of the phone's camera and the app will speak its value 5 | 6 | Check it out on the Android App Store: 7 | https://play.google.com/store/apps/details?id=com.ndu.mobile.darwinwallet&hl=en 8 | 9 | Darwin Wallet is licensed under the GPLv2 10 | -------------------------------------------------------------------------------- /jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | 4 | 5 | include $(CLEAR_VARS) 6 | 7 | OPENCV_CAMERA_MODULES := off 8 | #OPENCV_MK_PATH:=/home/mhill/projects/darwin_wallet/opencv/OpenCV-2.3.1/share/OpenCV/OpenCV.mk 9 | OPENCV_MK_PATH:=/home/mhill/projects/darwin_wallet/opencv/sdk/native/jni/OpenCV.mk 10 | 11 | 12 | OPENCV_LIB_TYPE:=STATIC 13 | OPENCV_INSTALL_MODULES:=on 14 | 15 | include $(OPENCV_MK_PATH) 16 | 17 | #Profiler 18 | #-include android-ndk-profiler.mk 19 | 20 | #include ../includeOpenCV.mk 21 | #ifeq ("$(wildcard $(OPENCV_MK_PATH))","") 22 | # #try to load OpenCV.mk from default install location 23 | # include $(TOOLCHAIN_PREBUILT_ROOT)/user/share/OpenCV/OpenCV.mk 24 | #else 25 | # include $(OPENCV_MK_PATH) 26 | #endif 27 | 28 | LOCAL_C_INCLUDES := /home/mhill/projects/darwin_wallet/opencv/sdk/native/jni/include 29 | 30 | LOCAL_MODULE := native_wallet 31 | LOCAL_SRC_FILES := jni_recognizer.cpp NativeVision/vision.cpp 32 | LOCAL_CFLAGS=-ffast-math -O3 -funroll-loops 33 | #LOCAL_CFLAGS=-O3 -funroll-loops 34 | 35 | LOCAL_LDLIBS += -llog -ldl 36 | 37 | #Profiling 38 | #LOCAL_CFLAGS := -pg 39 | #LOCAL_STATIC_LIBRARIES := andprof 40 | 41 | 42 | 43 | include $(BUILD_SHARED_LIBRARY) 44 | -------------------------------------------------------------------------------- /jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_STL := gnustl_static 2 | APP_CPPFLAGS := -frtti -fexceptions -Wno-error=format-security 3 | APP_ABI := armeabi-v7a 4 | -------------------------------------------------------------------------------- /jni/NativeVision/.kdev4/NativeVision.kdev4: -------------------------------------------------------------------------------- 1 | [Buildset] 2 | BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x18\x00N\x00a\x00t\x00i\x00v\x00e\x00V\x00i\x00s\x00i\x00o\x00n) 3 | 4 | [CMake] 5 | BuildDirs=/home/mhill/projects/darwin_wallet/NativeVision/build 6 | CMakeDir=/usr/share/cmake-2.8/Modules 7 | Current CMake Binary=file:///usr/bin/cmake 8 | CurrentBuildDir=file:///home/mhill/projects/darwin_wallet/NativeVision/build 9 | CurrentBuildType=Debug 10 | CurrentInstallDir= 11 | Extra Arguments= 12 | ProjectRootRelative=./ 13 | 14 | [Launch] 15 | Launch Configurations=Launch Configuration 0,Launch Configuration 1,Launch Configuration 2,Launch Configuration 3 16 | 17 | [Launch][Launch Configuration 0] 18 | Configured Launch Modes=execute 19 | Configured Launchers=nativeAppLauncher 20 | Name=Main 21 | Type=Native Application 22 | 23 | [Launch][Launch Configuration 0][Data] 24 | Arguments= 25 | Dependencies=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x00) 26 | Dependency Action=Nothing 27 | EnvironmentGroup=default 28 | Executable= 29 | External Terminal=konsole --noclose --workdir %workdir -e %exe 30 | Project Target=NativeVision,nativevision 31 | Use External Terminal=false 32 | Working Directory= 33 | isExecutable=false 34 | 35 | [Launch][Launch Configuration 1] 36 | Configured Launch Modes=execute 37 | Configured Launchers=nativeAppLauncher 38 | Name=Webcam Test 39 | Type=Native Application 40 | 41 | [Launch][Launch Configuration 1][Data] 42 | Arguments= 43 | Dependencies=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x00) 44 | Dependency Action=Nothing 45 | EnvironmentGroup=default 46 | Executable= 47 | External Terminal=konsole --noclose --workdir %workdir -e %exe 48 | Project Target=NativeVision,webcam_test 49 | Use External Terminal=false 50 | Working Directory= 51 | isExecutable=false 52 | 53 | [Launch][Launch Configuration 2] 54 | Configured Launch Modes=execute 55 | Configured Launchers=nativeAppLauncher 56 | Name=Trainer 57 | Type=Native Application 58 | 59 | [Launch][Launch Configuration 2][Data] 60 | Arguments= 61 | Dependencies=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x00) 62 | Dependency Action=Nothing 63 | EnvironmentGroup=default 64 | Executable= 65 | External Terminal=konsole --noclose --workdir %workdir -e %exe 66 | Project Target=NativeVision,trainer 67 | Use External Terminal=false 68 | Working Directory= 69 | isExecutable=false 70 | 71 | [Launch][Launch Configuration 3] 72 | Configured Launch Modes=execute 73 | Configured Launchers=nativeAppLauncher 74 | Name=Test one off 75 | Type=Native Application 76 | 77 | [Launch][Launch Configuration 3][Data] 78 | Arguments= 79 | Dependencies=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x00) 80 | Dependency Action=Nothing 81 | EnvironmentGroup=default 82 | Executable= 83 | External Terminal=konsole --noclose --workdir %workdir -e %exe 84 | Project Target=NativeVision,test 85 | Use External Terminal=false 86 | Working Directory= 87 | isExecutable=false 88 | 89 | [Project] 90 | VersionControlSupport=kdevgit 91 | -------------------------------------------------------------------------------- /jni/NativeVision/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | project(nativevision) 4 | 5 | include_directories(include) 6 | 7 | add_executable(nativevision main.cpp vision.cpp imgTrainer.cpp speaker.cpp 8 | 9 | # YAML files 10 | ./yaml/aliasmanager.cpp ./yaml/conversion.cpp ./yaml/emitter.cpp ./yaml/scanscalar.cpp ./yaml/stream.cpp 11 | ./yaml/exp.cpp ./yaml/emitfromevents.cpp ./yaml/regex.cpp ./yaml/scantag.cpp ./yaml/singledocparser.cpp 12 | ./yaml/ostream.cpp ./yaml/simplekey.cpp ./yaml/null.cpp ./yaml/directives.cpp ./yaml/emitterstate.cpp ./yaml/scanner.cpp 13 | ./yaml/parser.cpp ./yaml/contrib/graphbuilderadapter.cpp ./yaml/contrib/graphbuilder.cpp ./yaml/emitterutils.cpp 14 | ./yaml/iterator.cpp ./yaml/nodeownership.cpp ./yaml/nodebuilder.cpp ./yaml/tag.cpp ./yaml/scantoken.cpp ./yaml/node.cpp 15 | ) 16 | 17 | add_executable(webcam_test webcam_test.cpp vision.cpp) 18 | 19 | add_executable(test test.cpp vision.cpp ) 20 | 21 | 22 | target_link_libraries (nativevision 23 | 24 | #OpenCV 25 | opencv_core opencv_imgproc opencv_calib3d opencv_video opencv_features2d opencv_ml opencv_highgui opencv_objdetect opencv_contrib opencv_legacy 26 | 27 | #E-speak 28 | espeak 29 | ) 30 | 31 | target_link_libraries (webcam_test opencv_core opencv_imgproc opencv_calib3d opencv_video opencv_features2d opencv_ml opencv_highgui opencv_objdetect opencv_contrib opencv_legacy) 32 | 33 | target_link_libraries (test opencv_core opencv_imgproc opencv_calib3d opencv_video opencv_features2d opencv_ml opencv_highgui opencv_objdetect opencv_contrib opencv_legacy) 34 | -------------------------------------------------------------------------------- /jni/NativeVision/NativeVision.kdev4: -------------------------------------------------------------------------------- 1 | [Project] 2 | Name=NativeVision 3 | Manager=KDevCMakeManager 4 | VersionControl=kdevgit 5 | -------------------------------------------------------------------------------- /jni/NativeVision/imgTrainer.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "imgTrainer.h" 4 | #include "vision.h" 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | //int main(int argc, char** argv) 14 | //{ 15 | // loadRecognitionSet("", getMatcher()); 16 | // 17 | // return 0; 18 | //} 19 | 20 | 21 | int loadRecognitionSet(string name, Ptr descriptorMatcher, vector& billMapping) 22 | { 23 | std::ostringstream out; 24 | out << "/home/mhill/projects/darwin_wallet/DarwinWallet/jni/NativeVision/currency/" << name << ".yaml"; 25 | 26 | cout << "loading: " << out.str() << endl; 27 | std::ifstream fin(out.str().c_str()); 28 | 29 | // Setup the detector, extractor, and matcher 30 | //ORB::CommonParams cp = ORB::CommonParams(1.2f,12U,5,1); 31 | 32 | Ptr detector = getTrainerDetector(); 33 | //Ptr detector2 = getQueryDetector(); 34 | 35 | 36 | 37 | // Parse the yaml input file 38 | YAML::Parser parser(fin); 39 | 40 | YAML::Node doc; 41 | std::string detection_points; 42 | std::string scale_factor; 43 | 44 | cout << "parsing yaml" << endl; 45 | 46 | vector trainImages; 47 | 48 | while(parser.GetNextDocument(doc)) { 49 | 50 | const YAML::Node& bills = doc["bills"]; 51 | 52 | //doc["detection_points_per_image"] >> detection_points; 53 | //doc["scale_factor"] >> scale_factor; 54 | 55 | //cout << "Detection Points: " << detection_points << endl; 56 | //cout << "Scale factor: " << scale_factor << endl; 57 | 58 | // for(YAML::Iterator it=bills.begin();it!=bills.end();++it) { 59 | 60 | // std::string key, value; 61 | std::string img_path; 62 | // it.first() >> key; 63 | // 64 | // const YAML::Node& bill = bills[key]; 65 | // std::cout << "Key: " << key << std::endl; 66 | 67 | for(int i = 0; i < bills.size(); i++) { 68 | 69 | std::string patch, type; 70 | bills[i]["type"] >> type; 71 | bills[i]["patch"] >> patch; 72 | std::cout << " -- Patch: " << type << " (" << patch << ")" << std::endl; 73 | 74 | 75 | out.str(""); 76 | out << "/home/mhill/projects/darwin_wallet/DarwinWallet/res/raw/" << name << type << "full_pic.jpg"; 77 | img_path = out.str(); 78 | 79 | std::cout << img_path << endl; 80 | 81 | // load and add patch to recognizer 82 | cout << "< Reading image: " << type << endl; 83 | Mat img1 = imread( img_path ); 84 | if( img1.empty() ) 85 | { 86 | cout << "Can not read images" << endl; 87 | return -1; 88 | } 89 | 90 | billMapping.push_back(type); 91 | Mat trainData = trainImage(img1, detector, descriptorMatcher); 92 | trainImages.push_back(trainData); 93 | } 94 | 95 | // } 96 | 97 | 98 | } 99 | 100 | descriptorMatcher->add(trainImages); 101 | descriptorMatcher->train(); 102 | 103 | //FileStorage fileobj = FileStorage("/tmp/outty", FileStorage::WRITE); 104 | //descriptorMatcher->write(fileobj); 105 | 106 | return 0; 107 | } 108 | 109 | 110 | -------------------------------------------------------------------------------- /jni/NativeVision/imgTrainer.h: -------------------------------------------------------------------------------- 1 | #include "opencv2/highgui/highgui.hpp" 2 | #include "opencv2/calib3d/calib3d.hpp" 3 | #include "opencv2/imgproc/imgproc.hpp" 4 | #include "opencv2/features2d/features2d.hpp" 5 | #include "opencv2/video/tracking.hpp" 6 | 7 | #include 8 | #include "yaml-cpp/yaml.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | using namespace cv; 15 | using namespace std; 16 | 17 | int loadRecognitionSet(string name, Ptr descriptorMatcher, vector& billMapping); -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/aliasmanager.h: -------------------------------------------------------------------------------- 1 | #ifndef ALIASMANAGER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define ALIASMANAGER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/anchor.h" 9 | #include 10 | 11 | namespace YAML 12 | { 13 | class Node; 14 | 15 | class AliasManager 16 | { 17 | public: 18 | AliasManager(); 19 | 20 | void RegisterReference(const Node& node); 21 | anchor_t LookupAnchor(const Node& node) const; 22 | 23 | private: 24 | anchor_t _CreateNewAnchor(); 25 | 26 | private: 27 | typedef std::map AnchorByIdentity; 28 | AnchorByIdentity m_anchorByIdentity; 29 | 30 | anchor_t m_curAnchor; 31 | }; 32 | } 33 | 34 | #endif // ALIASMANAGER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 35 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/anchor.h: -------------------------------------------------------------------------------- 1 | #ifndef ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include 9 | 10 | namespace YAML 11 | { 12 | typedef std::size_t anchor_t; 13 | const anchor_t NullAnchor = 0; 14 | } 15 | 16 | #endif // ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 17 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/contrib/anchordict.h: -------------------------------------------------------------------------------- 1 | #ifndef ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include 9 | 10 | #include "../anchor.h" 11 | 12 | namespace YAML 13 | { 14 | /// AnchorDict 15 | /// . An object that stores and retrieves values correlating to anchor_t 16 | /// values. 17 | /// . Efficient implementation that can make assumptions about how anchor_t 18 | /// values are assigned by the Parser class. 19 | template 20 | class AnchorDict 21 | { 22 | public: 23 | void Register(anchor_t anchor, T value) 24 | { 25 | if (anchor > m_data.size()) 26 | { 27 | m_data.resize(anchor); 28 | } 29 | m_data[anchor - 1] = value; 30 | } 31 | 32 | T Get(anchor_t anchor) const 33 | { 34 | return m_data[anchor - 1]; 35 | } 36 | 37 | private: 38 | std::vector m_data; 39 | }; 40 | } 41 | 42 | #endif // ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 43 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/conversion.h: -------------------------------------------------------------------------------- 1 | #ifndef CONVERSION_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define CONVERSION_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/null.h" 10 | #include "yaml-cpp/traits.h" 11 | #include 12 | #include 13 | #include 14 | 15 | namespace YAML 16 | { 17 | inline bool Convert(const std::string& input, std::string& output) { 18 | output = input; 19 | return true; 20 | } 21 | 22 | YAML_CPP_API bool Convert(const std::string& input, bool& output); 23 | YAML_CPP_API bool Convert(const std::string& input, _Null& output); 24 | 25 | inline bool IsInfinity(const std::string& input) { 26 | return input == ".inf" || input == ".Inf" || input == ".INF" || input == "+.inf" || input == "+.Inf" || input == "+.INF"; 27 | } 28 | 29 | inline bool IsNegativeInfinity(const std::string& input) { 30 | return input == "-.inf" || input == "-.Inf" || input == "-.INF"; 31 | } 32 | 33 | inline bool IsNaN(const std::string& input) { 34 | return input == ".nan" || input == ".NaN" || input == ".NAN"; 35 | } 36 | 37 | 38 | template 39 | inline bool Convert(const std::string& input, T& output, typename enable_if >::type * = 0) { 40 | std::stringstream stream(input); 41 | stream.unsetf(std::ios::dec); 42 | stream >> output; 43 | if(!!stream) 44 | return true; 45 | 46 | if(std::numeric_limits::has_infinity) { 47 | if(IsInfinity(input)) { 48 | output = std::numeric_limits::infinity(); 49 | return true; 50 | } else if(IsNegativeInfinity(input)) { 51 | output = -std::numeric_limits::infinity(); 52 | return true; 53 | } 54 | } 55 | 56 | if(std::numeric_limits::has_quiet_NaN && IsNaN(input)) { 57 | output = std::numeric_limits::quiet_NaN(); 58 | return true; 59 | } 60 | 61 | return false; 62 | } 63 | } 64 | 65 | #endif // CONVERSION_H_62B23520_7C8E_11DE_8A39_0800200C9A66 66 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/dll.h: -------------------------------------------------------------------------------- 1 | #ifndef DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | // The following ifdef block is the standard way of creating macros which make exporting 9 | // from a DLL simpler. All files within this DLL are compiled with the yaml_cpp_EXPORTS 10 | // symbol defined on the command line. this symbol should not be defined on any project 11 | // that uses this DLL. This way any other project whose source files include this file see 12 | // YAML_CPP_API functions as being imported from a DLL, whereas this DLL sees symbols 13 | // defined with this macro as being exported. 14 | #undef YAML_CPP_API 15 | 16 | #ifdef YAML_CPP_DLL // Using or Building YAML-CPP DLL (definition defined manually) 17 | #ifdef yaml_cpp_EXPORTS // Building YAML-CPP DLL (definition created by CMake or defined manually) 18 | // #pragma message( "Defining YAML_CPP_API for DLL export" ) 19 | #define YAML_CPP_API __declspec(dllexport) 20 | #else // yaml_cpp_EXPORTS 21 | // #pragma message( "Defining YAML_CPP_API for DLL import" ) 22 | #define YAML_CPP_API __declspec(dllimport) 23 | #endif // yaml_cpp_EXPORTS 24 | #else //YAML_CPP_DLL 25 | #define YAML_CPP_API 26 | #endif // YAML_CPP_DLL 27 | 28 | #endif // DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 29 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/emitfromevents.h: -------------------------------------------------------------------------------- 1 | #ifndef EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/eventhandler.h" 9 | #include 10 | 11 | namespace YAML 12 | { 13 | class Emitter; 14 | 15 | class EmitFromEvents: public EventHandler 16 | { 17 | public: 18 | EmitFromEvents(Emitter& emitter); 19 | 20 | virtual void OnDocumentStart(const Mark& mark); 21 | virtual void OnDocumentEnd(); 22 | 23 | virtual void OnNull(const Mark& mark, anchor_t anchor); 24 | virtual void OnAlias(const Mark& mark, anchor_t anchor); 25 | virtual void OnScalar(const Mark& mark, const std::string& tag, anchor_t anchor, const std::string& value); 26 | 27 | virtual void OnSequenceStart(const Mark& mark, const std::string& tag, anchor_t anchor); 28 | virtual void OnSequenceEnd(); 29 | 30 | virtual void OnMapStart(const Mark& mark, const std::string& tag, anchor_t anchor); 31 | virtual void OnMapEnd(); 32 | 33 | private: 34 | void BeginNode(); 35 | void EmitProps(const std::string& tag, anchor_t anchor); 36 | 37 | private: 38 | Emitter& m_emitter; 39 | 40 | struct State { enum value { WaitingForSequenceEntry, WaitingForKey, WaitingForValue }; }; 41 | std::stack m_stateStack; 42 | }; 43 | } 44 | 45 | #endif // EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 46 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/emittermanip.h: -------------------------------------------------------------------------------- 1 | #ifndef EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | 11 | namespace YAML 12 | { 13 | enum EMITTER_MANIP { 14 | // general manipulators 15 | Auto, 16 | TagByKind, 17 | Newline, 18 | 19 | // output character set 20 | EmitNonAscii, 21 | EscapeNonAscii, 22 | 23 | // string manipulators 24 | // Auto, // duplicate 25 | SingleQuoted, 26 | DoubleQuoted, 27 | Literal, 28 | 29 | // bool manipulators 30 | YesNoBool, // yes, no 31 | TrueFalseBool, // true, false 32 | OnOffBool, // on, off 33 | UpperCase, // TRUE, N 34 | LowerCase, // f, yes 35 | CamelCase, // No, Off 36 | LongBool, // yes, On 37 | ShortBool, // y, t 38 | 39 | // int manipulators 40 | Dec, 41 | Hex, 42 | Oct, 43 | 44 | // document manipulators 45 | BeginDoc, 46 | EndDoc, 47 | 48 | // sequence manipulators 49 | BeginSeq, 50 | EndSeq, 51 | Flow, 52 | Block, 53 | 54 | // map manipulators 55 | BeginMap, 56 | EndMap, 57 | Key, 58 | Value, 59 | // Flow, // duplicate 60 | // Block, // duplicate 61 | // Auto, // duplicate 62 | LongKey 63 | }; 64 | 65 | struct _Indent { 66 | _Indent(int value_): value(value_) {} 67 | int value; 68 | }; 69 | 70 | inline _Indent Indent(int value) { 71 | return _Indent(value); 72 | } 73 | 74 | struct _Alias { 75 | _Alias(const std::string& content_): content(content_) {} 76 | std::string content; 77 | }; 78 | 79 | inline _Alias Alias(const std::string content) { 80 | return _Alias(content); 81 | } 82 | 83 | struct _Anchor { 84 | _Anchor(const std::string& content_): content(content_) {} 85 | std::string content; 86 | }; 87 | 88 | inline _Anchor Anchor(const std::string content) { 89 | return _Anchor(content); 90 | } 91 | 92 | struct _Tag { 93 | struct Type { enum value { Verbatim, PrimaryHandle, NamedHandle }; }; 94 | 95 | explicit _Tag(const std::string& prefix_, const std::string& content_, Type::value type_) 96 | : prefix(prefix_), content(content_), type(type_) 97 | { 98 | } 99 | std::string prefix; 100 | std::string content; 101 | Type::value type; 102 | }; 103 | 104 | inline _Tag VerbatimTag(const std::string content) { 105 | return _Tag("", content, _Tag::Type::Verbatim); 106 | } 107 | 108 | inline _Tag LocalTag(const std::string content) { 109 | return _Tag("", content, _Tag::Type::PrimaryHandle); 110 | } 111 | 112 | inline _Tag LocalTag(const std::string& prefix, const std::string content) { 113 | return _Tag(prefix, content, _Tag::Type::NamedHandle); 114 | } 115 | 116 | inline _Tag SecondaryTag(const std::string content) { 117 | return _Tag("", content, _Tag::Type::NamedHandle); 118 | } 119 | 120 | struct _Comment { 121 | _Comment(const std::string& content_): content(content_) {} 122 | std::string content; 123 | }; 124 | 125 | inline _Comment Comment(const std::string content) { 126 | return _Comment(content); 127 | } 128 | 129 | struct _Binary { 130 | _Binary(const unsigned char *data_, std::size_t size_): data(data_), size(size_) {} 131 | const unsigned char *data; 132 | std::size_t size; 133 | }; 134 | 135 | inline _Binary Binary(const unsigned char *data, std::size_t size) { 136 | return _Binary(data, size); 137 | } 138 | } 139 | 140 | #endif // EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 141 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/eventhandler.h: -------------------------------------------------------------------------------- 1 | #ifndef EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/anchor.h" 9 | #include 10 | 11 | namespace YAML 12 | { 13 | struct Mark; 14 | 15 | class EventHandler 16 | { 17 | public: 18 | virtual ~EventHandler() {} 19 | 20 | virtual void OnDocumentStart(const Mark& mark) = 0; 21 | virtual void OnDocumentEnd() = 0; 22 | 23 | virtual void OnNull(const Mark& mark, anchor_t anchor) = 0; 24 | virtual void OnAlias(const Mark& mark, anchor_t anchor) = 0; 25 | virtual void OnScalar(const Mark& mark, const std::string& tag, anchor_t anchor, const std::string& value) = 0; 26 | 27 | virtual void OnSequenceStart(const Mark& mark, const std::string& tag, anchor_t anchor) = 0; 28 | virtual void OnSequenceEnd() = 0; 29 | 30 | virtual void OnMapStart(const Mark& mark, const std::string& tag, anchor_t anchor) = 0; 31 | virtual void OnMapEnd() = 0; 32 | }; 33 | } 34 | 35 | #endif // EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 36 | 37 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/iterator.h: -------------------------------------------------------------------------------- 1 | #ifndef ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/dll.h" 9 | #include 10 | 11 | namespace YAML 12 | { 13 | class Node; 14 | struct IterPriv; 15 | 16 | class YAML_CPP_API Iterator 17 | { 18 | public: 19 | Iterator(); 20 | Iterator(std::auto_ptr pData); 21 | Iterator(const Iterator& rhs); 22 | ~Iterator(); 23 | 24 | Iterator& operator = (const Iterator& rhs); 25 | Iterator& operator ++ (); 26 | Iterator operator ++ (int); 27 | const Node& operator * () const; 28 | const Node *operator -> () const; 29 | const Node& first() const; 30 | const Node& second() const; 31 | 32 | friend YAML_CPP_API bool operator == (const Iterator& it, const Iterator& jt); 33 | friend YAML_CPP_API bool operator != (const Iterator& it, const Iterator& jt); 34 | 35 | private: 36 | std::auto_ptr m_pData; 37 | }; 38 | } 39 | 40 | #endif // ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 41 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/ltnode.h: -------------------------------------------------------------------------------- 1 | #ifndef LTNODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define LTNODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | namespace YAML 10 | { 11 | class Node; 12 | 13 | struct ltnode { 14 | bool operator()(const Node *pNode1, const Node *pNode2) const; 15 | }; 16 | } 17 | 18 | #endif // LTNODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 19 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/mark.h: -------------------------------------------------------------------------------- 1 | #ifndef MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/dll.h" 10 | 11 | namespace YAML 12 | { 13 | struct YAML_CPP_API Mark { 14 | Mark(): pos(0), line(0), column(0) {} 15 | 16 | static const Mark null() { return Mark(-1, -1, -1); } 17 | 18 | int pos; 19 | int line, column; 20 | 21 | private: 22 | Mark(int pos_, int line_, int column_): pos(pos_), line(line_), column(column_) {} 23 | }; 24 | } 25 | 26 | #endif // MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 27 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/node.h: -------------------------------------------------------------------------------- 1 | #ifndef NODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/conversion.h" 10 | #include "yaml-cpp/dll.h" 11 | #include "yaml-cpp/exceptions.h" 12 | #include "yaml-cpp/iterator.h" 13 | #include "yaml-cpp/ltnode.h" 14 | #include "yaml-cpp/mark.h" 15 | #include "yaml-cpp/noncopyable.h" 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | namespace YAML 23 | { 24 | class AliasManager; 25 | class Content; 26 | class NodeOwnership; 27 | class Scanner; 28 | class Emitter; 29 | class EventHandler; 30 | 31 | struct NodeType { enum value { Null, Scalar, Sequence, Map }; }; 32 | 33 | class YAML_CPP_API Node: private noncopyable 34 | { 35 | public: 36 | friend class NodeOwnership; 37 | friend class NodeBuilder; 38 | 39 | Node(); 40 | ~Node(); 41 | 42 | void Clear(); 43 | std::auto_ptr Clone() const; 44 | void EmitEvents(EventHandler& eventHandler) const; 45 | void EmitEvents(AliasManager& am, EventHandler& eventHandler) const; 46 | 47 | NodeType::value Type() const { return m_type; } 48 | bool IsAliased() const; 49 | 50 | // file location of start of this node 51 | const Mark GetMark() const { return m_mark; } 52 | 53 | // accessors 54 | Iterator begin() const; 55 | Iterator end() const; 56 | std::size_t size() const; 57 | 58 | // extraction of scalars 59 | bool GetScalar(std::string& s) const; 60 | 61 | // we can specialize this for other values 62 | template 63 | bool Read(T& value) const; 64 | 65 | template 66 | const T to() const; 67 | 68 | template 69 | friend YAML_CPP_API void operator >> (const Node& node, T& value); 70 | 71 | // retrieval for maps and sequences 72 | template 73 | const Node *FindValue(const T& key) const; 74 | 75 | template 76 | const Node& operator [] (const T& key) const; 77 | 78 | // specific to maps 79 | const Node *FindValue(const char *key) const; 80 | const Node *FindValue(char *key) const; 81 | const Node& operator [] (const char *key) const; 82 | const Node& operator [] (char *key) const; 83 | 84 | // for tags 85 | const std::string& Tag() const { return m_tag; } 86 | 87 | // emitting 88 | friend YAML_CPP_API Emitter& operator << (Emitter& out, const Node& node); 89 | 90 | // ordering 91 | int Compare(const Node& rhs) const; 92 | friend bool operator < (const Node& n1, const Node& n2); 93 | 94 | private: 95 | explicit Node(NodeOwnership& owner); 96 | Node& CreateNode(); 97 | 98 | void Init(NodeType::value type, const Mark& mark, const std::string& tag); 99 | 100 | void MarkAsAliased(); 101 | void SetScalarData(const std::string& data); 102 | void Append(Node& node); 103 | void Insert(Node& key, Node& value); 104 | 105 | // helper for sequences 106 | template friend struct _FindFromNodeAtIndex; 107 | const Node *FindAtIndex(std::size_t i) const; 108 | 109 | // helper for maps 110 | template 111 | const Node& GetValue(const T& key) const; 112 | 113 | template 114 | const Node *FindValueForKey(const T& key) const; 115 | 116 | private: 117 | std::auto_ptr m_pOwnership; 118 | 119 | Mark m_mark; 120 | std::string m_tag; 121 | 122 | typedef std::vector node_seq; 123 | typedef std::map node_map; 124 | 125 | NodeType::value m_type; 126 | std::string m_scalarData; 127 | node_seq m_seqData; 128 | node_map m_mapData; 129 | }; 130 | } 131 | 132 | #include "yaml-cpp/nodeimpl.h" 133 | #include "yaml-cpp/nodereadimpl.h" 134 | 135 | #endif // NODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 136 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/nodeimpl.h: -------------------------------------------------------------------------------- 1 | #ifndef NODEIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NODEIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/nodeutil.h" 10 | #include 11 | 12 | namespace YAML 13 | { 14 | // implementation of templated things 15 | template 16 | inline const T Node::to() const { 17 | T value; 18 | *this >> value; 19 | return value; 20 | } 21 | 22 | template 23 | inline void operator >> (const Node& node, T& value) { 24 | if(!ConvertScalar(node, value)) 25 | throw InvalidScalar(node.m_mark); 26 | } 27 | 28 | template 29 | inline const Node *Node::FindValue(const T& key) const { 30 | switch(m_type) { 31 | case NodeType::Null: 32 | case NodeType::Scalar: 33 | throw BadDereference(); 34 | case NodeType::Sequence: 35 | return FindFromNodeAtIndex(*this, key); 36 | case NodeType::Map: 37 | return FindValueForKey(key); 38 | } 39 | assert(false); 40 | throw BadDereference(); 41 | } 42 | 43 | template 44 | inline const Node *Node::FindValueForKey(const T& key) const { 45 | for(Iterator it=begin();it!=end();++it) { 46 | T t; 47 | if(it.first().Read(t)) { 48 | if(key == t) 49 | return &it.second(); 50 | } 51 | } 52 | 53 | return 0; 54 | } 55 | 56 | template 57 | inline const Node& Node::GetValue(const T& key) const { 58 | if(const Node *pValue = FindValue(key)) 59 | return *pValue; 60 | throw MakeTypedKeyNotFound(m_mark, key); 61 | } 62 | 63 | template 64 | inline const Node& Node::operator [] (const T& key) const { 65 | return GetValue(key); 66 | } 67 | 68 | inline const Node *Node::FindValue(const char *key) const { 69 | return FindValue(std::string(key)); 70 | } 71 | 72 | inline const Node *Node::FindValue(char *key) const { 73 | return FindValue(std::string(key)); 74 | } 75 | 76 | inline const Node& Node::operator [] (const char *key) const { 77 | return GetValue(std::string(key)); 78 | } 79 | 80 | inline const Node& Node::operator [] (char *key) const { 81 | return GetValue(std::string(key)); 82 | } 83 | } 84 | 85 | #endif // NODEIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 86 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/nodereadimpl.h: -------------------------------------------------------------------------------- 1 | #ifndef NODEREADIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NODEREADIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | namespace YAML 10 | { 11 | // implementation for Node::Read 12 | // (the goal is to call ConvertScalar if we can, and fall back to operator >> if not) 13 | // thanks to litb from stackoverflow.com 14 | // http://stackoverflow.com/questions/1386183/how-to-call-a-templated-function-if-it-exists-and-something-else-otherwise/1386390#1386390 15 | 16 | // Note: this doesn't work on gcc 3.2, but does on gcc 3.4 and above. I'm not sure about 3.3. 17 | 18 | #if __GNUC__ && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ <= 3)) 19 | // trick doesn't work? Just fall back to ConvertScalar. 20 | // This means that we can't use any user-defined types as keys in a map 21 | template 22 | inline bool Node::Read(T& value) const { 23 | return ConvertScalar(*this, value); 24 | } 25 | #else 26 | // usual case: the trick! 27 | template 28 | struct read_impl; 29 | 30 | // ConvertScalar available 31 | template<> 32 | struct read_impl { 33 | template 34 | static bool read(const Node& node, T& value) { 35 | return ConvertScalar(node, value); 36 | } 37 | }; 38 | 39 | // ConvertScalar not available 40 | template<> 41 | struct read_impl { 42 | template 43 | static bool read(const Node& node, T& value) { 44 | try { 45 | node >> value; 46 | } catch(const Exception&) { 47 | return false; 48 | } 49 | return true; 50 | } 51 | }; 52 | 53 | namespace fallback { 54 | // sizeof > 1 55 | struct flag { char c[2]; }; 56 | flag Convert(...); 57 | 58 | int operator,(flag, flag); 59 | 60 | template 61 | char operator,(flag, T const&); 62 | 63 | char operator,(int, flag); 64 | int operator,(char, flag); 65 | } 66 | 67 | template 68 | inline bool Node::Read(T& value) const { 69 | using namespace fallback; 70 | 71 | return read_impl::read(*this, value); 72 | } 73 | #endif // done with trick 74 | 75 | // the main conversion function 76 | template 77 | inline bool ConvertScalar(const Node& node, T& value) { 78 | std::string scalar; 79 | if(!node.GetScalar(scalar)) 80 | return false; 81 | 82 | return Convert(scalar, value); 83 | } 84 | } 85 | 86 | #endif // NODEREADIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 87 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/nodeutil.h: -------------------------------------------------------------------------------- 1 | #ifndef NODEUTIL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NODEUTIL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | namespace YAML 10 | { 11 | template 12 | struct is_same_type { 13 | enum { value = false }; 14 | }; 15 | 16 | template 17 | struct is_same_type { 18 | enum { value = true }; 19 | }; 20 | 21 | template 22 | struct is_index_type_with_check { 23 | enum { value = false }; 24 | }; 25 | 26 | template <> struct is_index_type_with_check { enum { value = true }; }; 27 | 28 | #define MAKE_INDEX_TYPE(Type) \ 29 | template <> struct is_index_type_with_check::value> { enum { value = true }; } 30 | 31 | MAKE_INDEX_TYPE(int); 32 | MAKE_INDEX_TYPE(unsigned); 33 | MAKE_INDEX_TYPE(short); 34 | MAKE_INDEX_TYPE(unsigned short); 35 | MAKE_INDEX_TYPE(long); 36 | MAKE_INDEX_TYPE(unsigned long); 37 | 38 | #undef MAKE_INDEX_TYPE 39 | 40 | template 41 | struct is_index_type: public is_index_type_with_check {}; 42 | 43 | // messing around with template stuff to get the right overload for operator [] for a sequence 44 | template 45 | struct _FindFromNodeAtIndex { 46 | const Node *pRet; 47 | _FindFromNodeAtIndex(const Node&, const T&): pRet(0) {} 48 | }; 49 | 50 | template 51 | struct _FindFromNodeAtIndex { 52 | const Node *pRet; 53 | _FindFromNodeAtIndex(const Node& node, const T& key): pRet(node.FindAtIndex(static_cast(key))) {} 54 | }; 55 | 56 | template 57 | inline const Node *FindFromNodeAtIndex(const Node& node, const T& key) { 58 | return _FindFromNodeAtIndex::value>(node, key).pRet; 59 | } 60 | } 61 | 62 | #endif // NODEUTIL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 63 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/noncopyable.h: -------------------------------------------------------------------------------- 1 | #ifndef NONCOPYABLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NONCOPYABLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/dll.h" 9 | 10 | namespace YAML 11 | { 12 | // this is basically boost::noncopyable 13 | class YAML_CPP_API noncopyable 14 | { 15 | protected: 16 | noncopyable() {} 17 | ~noncopyable() {} 18 | 19 | private: 20 | noncopyable(const noncopyable&); 21 | const noncopyable& operator = (const noncopyable&); 22 | }; 23 | } 24 | 25 | #endif // NONCOPYABLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 26 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/null.h: -------------------------------------------------------------------------------- 1 | #ifndef NULL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NULL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/dll.h" 10 | 11 | namespace YAML 12 | { 13 | class Node; 14 | 15 | struct YAML_CPP_API _Null {}; 16 | inline bool operator == (const _Null&, const _Null&) { return true; } 17 | inline bool operator != (const _Null&, const _Null&) { return false; } 18 | 19 | YAML_CPP_API bool IsNull(const Node& node); 20 | 21 | extern YAML_CPP_API _Null Null; 22 | } 23 | 24 | #endif // NULL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 25 | 26 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/ostream.h: -------------------------------------------------------------------------------- 1 | #ifndef OSTREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define OSTREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | 11 | namespace YAML 12 | { 13 | class ostream 14 | { 15 | public: 16 | ostream(); 17 | ~ostream(); 18 | 19 | void reserve(unsigned size); 20 | void put(char ch); 21 | const char *str() const { return m_buffer; } 22 | 23 | unsigned row() const { return m_row; } 24 | unsigned col() const { return m_col; } 25 | unsigned pos() const { return m_pos; } 26 | 27 | private: 28 | char *m_buffer; 29 | unsigned m_pos; 30 | unsigned m_size; 31 | 32 | unsigned m_row, m_col; 33 | }; 34 | 35 | ostream& operator << (ostream& out, const char *str); 36 | ostream& operator << (ostream& out, const std::string& str); 37 | ostream& operator << (ostream& out, char ch); 38 | } 39 | 40 | #endif // OSTREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 41 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/parser.h: -------------------------------------------------------------------------------- 1 | #ifndef PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/dll.h" 10 | #include "yaml-cpp/noncopyable.h" 11 | #include 12 | #include 13 | 14 | namespace YAML 15 | { 16 | struct Directives; 17 | struct Mark; 18 | struct Token; 19 | class EventHandler; 20 | class Node; 21 | class Scanner; 22 | 23 | class YAML_CPP_API Parser: private noncopyable 24 | { 25 | public: 26 | Parser(); 27 | Parser(std::istream& in); 28 | ~Parser(); 29 | 30 | operator bool() const; 31 | 32 | void Load(std::istream& in); 33 | bool HandleNextDocument(EventHandler& eventHandler); 34 | 35 | bool GetNextDocument(Node& document); 36 | void PrintTokens(std::ostream& out); 37 | 38 | private: 39 | void ParseDirectives(); 40 | void HandleDirective(const Token& token); 41 | void HandleYamlDirective(const Token& token); 42 | void HandleTagDirective(const Token& token); 43 | 44 | private: 45 | std::auto_ptr m_pScanner; 46 | std::auto_ptr m_pDirectives; 47 | }; 48 | } 49 | 50 | #endif // PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 51 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/stlemitter.h: -------------------------------------------------------------------------------- 1 | #ifndef STLEMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define STLEMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | namespace YAML 15 | { 16 | template 17 | inline Emitter& EmitSeq(Emitter& emitter, const Seq& seq) { 18 | emitter << BeginSeq; 19 | for(typename Seq::const_iterator it=seq.begin();it!=seq.end();++it) 20 | emitter << *it; 21 | emitter << EndSeq; 22 | return emitter; 23 | } 24 | 25 | template 26 | inline Emitter& operator << (Emitter& emitter, const std::vector& v) { 27 | return EmitSeq(emitter, v); 28 | } 29 | 30 | template 31 | inline Emitter& operator << (Emitter& emitter, const std::list& v) { 32 | return EmitSeq(emitter, v); 33 | } 34 | 35 | template 36 | inline Emitter& operator << (Emitter& emitter, const std::set& v) { 37 | return EmitSeq(emitter, v); 38 | } 39 | 40 | template 41 | inline Emitter& operator << (Emitter& emitter, const std::map& m) { 42 | typedef typename std::map map; 43 | emitter << BeginMap; 44 | for(typename map::const_iterator it=m.begin();it!=m.end();++it) 45 | emitter << Key << it->first << Value << it->second; 46 | emitter << EndMap; 47 | return emitter; 48 | } 49 | } 50 | 51 | #endif // STLEMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 52 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/stlnode.h: -------------------------------------------------------------------------------- 1 | #ifndef STLNODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define STLNODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include 11 | 12 | namespace YAML 13 | { 14 | template 15 | void operator >> (const Node& node, std::vector& v) 16 | { 17 | v.clear(); 18 | v.resize(node.size()); 19 | for(unsigned i=0;i> v[i]; 21 | } 22 | 23 | 24 | template 25 | void operator >> (const Node& node, std::map& m) 26 | { 27 | m.clear(); 28 | for(Iterator it=node.begin();it!=node.end();++it) { 29 | K k; 30 | V v; 31 | it.first() >> k; 32 | it.second() >> v; 33 | m[k] = v; 34 | } 35 | } 36 | } 37 | 38 | #endif // STLNODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 39 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/traits.h: -------------------------------------------------------------------------------- 1 | #ifndef TRAITS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define TRAITS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | namespace YAML 10 | { 11 | template 12 | struct is_numeric { enum { value = false }; }; 13 | 14 | template <> struct is_numeric { enum { value = true }; }; 15 | template <> struct is_numeric { enum { value = true }; }; 16 | template <> struct is_numeric { enum { value = true }; }; 17 | template <> struct is_numeric { enum { value = true }; }; 18 | template <> struct is_numeric { enum { value = true }; }; 19 | template <> struct is_numeric { enum { value = true }; }; 20 | template <> struct is_numeric { enum { value = true }; }; 21 | template <> struct is_numeric { enum { value = true }; }; 22 | #if defined(_MSC_VER) && (_MSC_VER < 1310) 23 | template <> struct is_numeric <__int64> { enum { value = true }; }; 24 | template <> struct is_numeric { enum { value = true }; }; 25 | #else 26 | template <> struct is_numeric { enum { value = true }; }; 27 | template <> struct is_numeric { enum { value = true }; }; 28 | #endif 29 | template <> struct is_numeric { enum { value = true }; }; 30 | template <> struct is_numeric { enum { value = true }; }; 31 | template <> struct is_numeric { enum { value = true }; }; 32 | 33 | template 34 | struct enable_if_c { 35 | typedef T type; 36 | }; 37 | 38 | template 39 | struct enable_if_c {}; 40 | 41 | template 42 | struct enable_if : public enable_if_c {}; 43 | 44 | template 45 | struct disable_if_c { 46 | typedef T type; 47 | }; 48 | 49 | template 50 | struct disable_if_c {}; 51 | 52 | template 53 | struct disable_if : public disable_if_c {}; 54 | } 55 | 56 | #endif // TRAITS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 57 | 58 | -------------------------------------------------------------------------------- /jni/NativeVision/include/yaml-cpp/yaml.h: -------------------------------------------------------------------------------- 1 | #ifndef YAML_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define YAML_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/parser.h" 10 | #include "yaml-cpp/node.h" 11 | #include "yaml-cpp/stlnode.h" 12 | #include "yaml-cpp/iterator.h" 13 | #include "yaml-cpp/emitter.h" 14 | #include "yaml-cpp/stlemitter.h" 15 | #include "yaml-cpp/exceptions.h" 16 | 17 | #endif // YAML_H_62B23520_7C8E_11DE_8A39_0800200C9A66 18 | -------------------------------------------------------------------------------- /jni/NativeVision/main.cpp: -------------------------------------------------------------------------------- 1 | #include "opencv2/highgui/highgui.hpp" 2 | #include "opencv2/calib3d/calib3d.hpp" 3 | #include "opencv2/imgproc/imgproc.hpp" 4 | #include "opencv2/features2d/features2d.hpp" 5 | #include "opencv2/video/tracking.hpp" 6 | 7 | #include "imgTrainer.h" 8 | #include "speaker.h" 9 | #include "vision.h" 10 | 11 | #include 12 | #include 13 | 14 | using namespace cv; 15 | using namespace std; 16 | 17 | 18 | const string winName = "correspondences"; 19 | 20 | #define DRAW_RICH_KEYPOINTS_MODE 0 21 | #define DRAW_OUTLIERS_MODE 0 22 | 23 | static int prev_match_index = -1; 24 | 25 | double diffclock(clock_t clock1,clock_t clock2) 26 | { 27 | double diffticks=clock2-clock1; 28 | //double diffms=(diffticks*1000)/ CLOCKS_PER_SEC; 29 | double diffms = diffticks; 30 | return diffms; 31 | } 32 | 33 | 34 | 35 | 36 | int main(int argc, char** argv) 37 | { 38 | 39 | 40 | cout << "< Creating detector, descriptor extractor and descriptor matcher ..." << endl; 41 | //Ptr detector = FeatureDetector::create( argv[1] ); 42 | //http://opencv.itseez.com/modules/features2d/doc/feature_detection_and_description.html 43 | // CommonParams(float scale_factor = 1.2f, unsigned int n_levels = DEFAULT_N_LEVELS, 44 | // int edge_threshold = 31, unsigned int first_level = DEFAULT_FIRST_LEVEL); 45 | 46 | 47 | Ptr detector = getQueryDetector(); 48 | 49 | Ptr descriptorMatcher = getMatcher(); 50 | 51 | 52 | 53 | cout << ">" << endl; 54 | if( detector.empty() || descriptorMatcher.empty() ) 55 | { 56 | cout << "Can not create detector or descriptor exstractor or descriptor matcher of given types" << endl; 57 | return -1; 58 | } 59 | 60 | cout << "< Reading the images..." << endl; 61 | 62 | 63 | vector billMapping; 64 | 65 | int success = loadRecognitionSet("us", descriptorMatcher, billMapping); 66 | 67 | for (int i = 0; i < billMapping.size(); i++) 68 | { 69 | cout << billMapping[i] << endl; 70 | } 71 | 72 | if( success != 0 ) 73 | { 74 | cout << "Failed training images" << endl; 75 | } 76 | 77 | 78 | Mat img2; 79 | 80 | //initSpeaker(); 81 | //speak_synchronously("Initification"); 82 | 83 | namedWindow(winName, 1); 84 | 85 | const int BORDER_SIZE = 28; 86 | 87 | CvCapture* cap = cvCaptureFromCAM(0); 88 | //CvCapture* cap = cvCreateFileCapture("/tmp/shot2.jpg"); 89 | 90 | cvSetCaptureProperty( cap, CV_CAP_PROP_FRAME_WIDTH, 800 ); 91 | 92 | cvSetCaptureProperty( cap, CV_CAP_PROP_FRAME_HEIGHT, 400 ); 93 | 94 | 95 | int count = 0; 96 | for(;;) 97 | { 98 | 99 | IplImage* img2 = cvQueryFrame(cap); 100 | 101 | IplImage* mgray_small = cvCreateImage(cvSize(400,200), 102 | img2->depth,img2->nChannels); 103 | cvResize(img2, mgray_small); 104 | 105 | //IplImage* externsrc = mgray_small; 106 | Mat externsrc(mgray_small); 107 | //IplImage* externsrc = cvCreateImage( cvSize(320+BORDER_SIZE*2,240+BORDER_SIZE*2), 8, 3 ); 108 | //cvCopyMakeBorder( img2, externsrc, cvPoint(BORDER_SIZE, BORDER_SIZE), IPL_BORDER_CONSTANT, CV_RGB(185, 186, 72)); 109 | 110 | Mat drawImg; 111 | 112 | int debug_matches[billMapping.size()]; 113 | RecognitionResult result = recognize( externsrc, true, &drawImg, detector, descriptorMatcher, billMapping, 114 | true, debug_matches); 115 | 116 | if (result.haswinner == true) 117 | { 118 | //speak(result.winner); 119 | } 120 | 121 | count++; 122 | if (count % 10 == 0) 123 | { 124 | cout << "-----------------------------------" << endl; 125 | for (int i = 0; i < billMapping.size(); i++) 126 | cout << billMapping[i] << ": " << debug_matches[i] << endl; 127 | cout << "-----------------------------------" << endl; 128 | } 129 | //putText(drawImg, "boom", Point(15, 27), FONT_HERSHEY_DUPLEX, 1.1, CV_RGB(0, 0, 0), 2); 130 | imshow( winName, drawImg ); 131 | 132 | waitKey(1); 133 | 134 | } 135 | 136 | 137 | return 0; 138 | } -------------------------------------------------------------------------------- /jni/NativeVision/make_patches.py: -------------------------------------------------------------------------------- 1 | #!/bin/python 2 | 3 | import yaml 4 | import os 5 | import PythonMagick as Magick #PythonMagick 6 | 7 | 8 | PIXELS_PER_WIDTH_INCH = 54.234527687 9 | 10 | dirList=os.listdir('./currency/') 11 | for fname in dirList: 12 | if fname.endswith('.yaml'): 13 | 14 | f = open('./currency/' + fname) 15 | 16 | locality = fname[:2] 17 | 18 | OUTDIR_BASE = '/home/mhill/projects/darwin_wallet/DarwinWallet/res/raw/' 19 | 20 | patch_config = yaml.load(f) 21 | f.close() 22 | from commands import * 23 | 24 | #print patch_config 25 | 26 | for patch in patch_config['bills']: 27 | #input_file = './currency/' locality + '/' + bill + '.png' 28 | 29 | bill = patch['type'] 30 | print 'processing: ' + bill 31 | 32 | if 'input' not in patch: 33 | in_file = bill + '.png' 34 | else: 35 | in_file = patch['input'] 36 | 37 | input_file = './currency/' + locality + '/' + in_file 38 | image = Magick.Image(input_file) 39 | 40 | if 'width' not in patch: 41 | # Don't crop 42 | pass 43 | else: 44 | crop_string = str(patch['width']) + "x" + str(patch['height']) + "+" + str(patch['left']) + "+" + str(patch['top']) 45 | image.crop( crop_string ) 46 | 47 | 48 | 49 | print " - patch: " + patch['patch'] 50 | #print image.fileName() 51 | #print image.magick() 52 | #print image.size().width() 53 | #print image.size().height() 54 | 55 | # Width x Height + left + top 56 | desired_width = patch['inch_width'] * PIXELS_PER_WIDTH_INCH 57 | scale_factor = round( (desired_width / image.size().width()) * 100, 2 ) 58 | #print 'computed width;' + str( image.size().width() ) 59 | image.scale(str(scale_factor) + '%') 60 | 61 | image.borderColor("#ffffff") 62 | #image.border("34x34") 63 | 64 | out_dir = OUTDIR_BASE 65 | if not os.path.exists(out_dir): 66 | os.makedirs(out_dir) 67 | 68 | out_file = out_dir + '/' + locality + bill + patch['patch'] + '.jpg' 69 | image.write( out_file ) 70 | 71 | # Process with montage 72 | #getstatusoutput('montage -adjoin -geometry +0+0 ' + out_dir + '/*.png ./currency/outs/' + bill + '.png') 73 | -------------------------------------------------------------------------------- /jni/NativeVision/speaker.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #include "speaker.h" 5 | 6 | 7 | espeak_POSITION_TYPE position_type; 8 | 9 | char *path=NULL; 10 | int Buflength = 500, Options=0; 11 | void* user_data; 12 | t_espeak_callback *SynthCallback; 13 | espeak_PARAMETER Parm; 14 | 15 | char Voice[] = {"default"}; 16 | 17 | //char text[20] = {"Hello World!"}; 18 | 19 | unsigned int Size,position=0, end_position=0, flags=espeakCHARS_AUTO, *unique_identifier; 20 | 21 | 22 | void initSpeaker() 23 | { 24 | espeak_Initialize(AUDIO_OUTPUT_PLAYBACK, Buflength, path, Options ); 25 | espeak_SetVoiceByName(Voice); 26 | } 27 | 28 | int speak_synchronously(string text) 29 | { 30 | int retval = speak(text); 31 | espeak_Synchronize( ); 32 | 33 | return retval; 34 | } 35 | 36 | int speak(string text) 37 | { 38 | if (espeak_IsPlaying() == 1) 39 | { 40 | return -1; 41 | } 42 | 43 | int I, Run = 1, L; 44 | Size = text.length() + 1; 45 | //printf("Saying '%s'",text); 46 | 47 | 48 | char *ctext; 49 | ctext = &text[0]; 50 | espeak_Synth( ctext, Size, position, position_type, end_position, flags, 51 | unique_identifier, user_data ); 52 | //espeak_Synchronize( ); 53 | 54 | return 0; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /jni/NativeVision/speaker.h: -------------------------------------------------------------------------------- 1 | using namespace std; 2 | 3 | #include 4 | #include 5 | 6 | 7 | int speak(string text); 8 | 9 | int speak_synchronously(string text); 10 | 11 | void initSpeaker(); -------------------------------------------------------------------------------- /jni/NativeVision/test.cpp: -------------------------------------------------------------------------------- 1 | #include "opencv2/highgui/highgui.hpp" 2 | #include "opencv2/calib3d/calib3d.hpp" 3 | #include "opencv2/imgproc/imgproc.hpp" 4 | #include "opencv2/features2d/features2d.hpp" 5 | #include "opencv2/video/tracking.hpp" 6 | 7 | #include "imgTrainer.h" 8 | #include "speaker.h" 9 | #include "vision.h" 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | using namespace cv; 17 | using namespace std; 18 | 19 | 20 | char* readFileBytes(const char *name) 21 | { 22 | ifstream fl(name); 23 | fl.seekg( 0, ios::end ); 24 | size_t len = fl.tellg(); 25 | char *ret = new char[len]; 26 | fl.seekg(0, ios::beg); 27 | fl.read(ret, len); 28 | fl.close(); 29 | return ret; 30 | } 31 | 32 | 33 | int main(int argc, char** argv) 34 | { 35 | int bytelength = 110651; 36 | 37 | char* bytearray = readFileBytes("/home/mhill/projects/darwin_wallet/DarwinWallet/assets/eu/100b/full_pic.jpg"); 38 | 39 | //Mat mcolor(height + height/2, width, CV_8UC1, (unsigned char *)bytearray); 40 | Mat mgray(1, bytelength, CV_8U, (unsigned char *)bytearray); 41 | 42 | 43 | Mat img = imdecode(mgray, 0); 44 | 45 | 46 | vector v; 47 | 48 | 49 | 50 | // ORB::ORB detector = new ORB(500, 1.2f, 5U, 10, 1, 2); 51 | // detector.operator()(img, v); 52 | 53 | 54 | 55 | // drawKeypoints(img, v, img); 56 | 57 | // imshow( "test window", img ); 58 | 59 | 60 | waitKey(10000); 61 | return 0; 62 | } 63 | -------------------------------------------------------------------------------- /jni/NativeVision/vision.h: -------------------------------------------------------------------------------- 1 | #include "opencv2/highgui/highgui.hpp" 2 | #include "opencv2/calib3d/calib3d.hpp" 3 | #include "opencv2/imgproc/imgproc.hpp" 4 | #include "opencv2/features2d/features2d.hpp" 5 | #include "opencv2/video/tracking.hpp" 6 | 7 | using namespace cv; 8 | using namespace std; 9 | 10 | Ptr getQueryDetector(); 11 | Ptr getTrainerDetector(); 12 | Ptr getTrainerDetector(int detection_points); 13 | 14 | Ptr getMatcher(); 15 | 16 | struct RecognitionResult { 17 | bool haswinner; 18 | string winner; 19 | int confidence; 20 | } ; 21 | 22 | void surfStyleMatching( Ptr& descriptorMatcher, 23 | const Mat& queryDescriptors, const Mat& trainingDescriptors, 24 | vector& matches12 ); 25 | 26 | 27 | void surfStyleMatching( Ptr& descriptorMatcher, 28 | const Mat& queryDescriptors, 29 | vector& matches12 ); 30 | 31 | Mat trainImage( const Mat& img1, 32 | Ptr& detector, 33 | Ptr& descriptorMatcher ); 34 | 35 | RecognitionResult recognize( const Mat& queryImg, bool drawOnImage, Mat* outputImage, 36 | Ptr& detector, 37 | Ptr& descriptorMatcher, vector& billMapping, 38 | bool debug_on, int* debug_matches_array ); -------------------------------------------------------------------------------- /jni/NativeVision/yaml/aliasmanager.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/aliasmanager.h" 2 | #include "yaml-cpp/node.h" 3 | #include 4 | #include 5 | 6 | namespace YAML 7 | { 8 | AliasManager::AliasManager(): m_curAnchor(0) 9 | { 10 | } 11 | 12 | void AliasManager::RegisterReference(const Node& node) 13 | { 14 | m_anchorByIdentity.insert(std::make_pair(&node, _CreateNewAnchor())); 15 | } 16 | 17 | anchor_t AliasManager::LookupAnchor(const Node& node) const 18 | { 19 | AnchorByIdentity::const_iterator it = m_anchorByIdentity.find(&node); 20 | if(it == m_anchorByIdentity.end()) 21 | return 0; 22 | return it->second; 23 | } 24 | 25 | anchor_t AliasManager::_CreateNewAnchor() 26 | { 27 | return ++m_curAnchor; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/collectionstack.h: -------------------------------------------------------------------------------- 1 | #ifndef COLLECTIONSTACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define COLLECTIONSTACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include 11 | 12 | namespace YAML 13 | { 14 | struct CollectionType { 15 | enum value { None, BlockMap, BlockSeq, FlowMap, FlowSeq, CompactMap }; 16 | }; 17 | 18 | class CollectionStack 19 | { 20 | public: 21 | CollectionType::value GetCurCollectionType() const { 22 | if(collectionStack.empty()) 23 | return CollectionType::None; 24 | return collectionStack.top(); 25 | } 26 | 27 | void PushCollectionType(CollectionType::value type) { collectionStack.push(type); } 28 | void PopCollectionType(CollectionType::value type) { assert(type == GetCurCollectionType()); collectionStack.pop(); } 29 | 30 | private: 31 | std::stack collectionStack; 32 | }; 33 | } 34 | 35 | #endif // COLLECTIONSTACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 36 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/contrib/graphbuilder.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/parser.h" 2 | #include "yaml-cpp/contrib/graphbuilder.h" 3 | #include "graphbuilderadapter.h" 4 | 5 | namespace YAML 6 | { 7 | void *BuildGraphOfNextDocument(Parser& parser, GraphBuilderInterface& graphBuilder) 8 | { 9 | GraphBuilderAdapter eventHandler(graphBuilder); 10 | if (parser.HandleNextDocument(eventHandler)) { 11 | return eventHandler.RootNode(); 12 | } else { 13 | return NULL; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/contrib/graphbuilderadapter.cpp: -------------------------------------------------------------------------------- 1 | #include "graphbuilderadapter.h" 2 | 3 | namespace YAML 4 | { 5 | int GraphBuilderAdapter::ContainerFrame::sequenceMarker; 6 | 7 | void GraphBuilderAdapter::OnNull(const Mark& mark, anchor_t anchor) 8 | { 9 | void *pParent = GetCurrentParent(); 10 | void *pNode = m_builder.NewNull(mark, pParent); 11 | RegisterAnchor(anchor, pNode); 12 | 13 | DispositionNode(pNode); 14 | } 15 | 16 | void GraphBuilderAdapter::OnAlias(const Mark& mark, anchor_t anchor) 17 | { 18 | void *pReffedNode = m_anchors.Get(anchor); 19 | DispositionNode(m_builder.AnchorReference(mark, pReffedNode)); 20 | } 21 | 22 | void GraphBuilderAdapter::OnScalar(const Mark& mark, const std::string& tag, anchor_t anchor, const std::string& value) 23 | { 24 | void *pParent = GetCurrentParent(); 25 | void *pNode = m_builder.NewScalar(mark, tag, pParent, value); 26 | RegisterAnchor(anchor, pNode); 27 | 28 | DispositionNode(pNode); 29 | } 30 | 31 | void GraphBuilderAdapter::OnSequenceStart(const Mark& mark, const std::string& tag, anchor_t anchor) 32 | { 33 | void *pNode = m_builder.NewSequence(mark, tag, GetCurrentParent()); 34 | m_containers.push(ContainerFrame(pNode)); 35 | RegisterAnchor(anchor, pNode); 36 | } 37 | 38 | void GraphBuilderAdapter::OnSequenceEnd() 39 | { 40 | void *pSequence = m_containers.top().pContainer; 41 | m_containers.pop(); 42 | 43 | DispositionNode(pSequence); 44 | } 45 | 46 | void GraphBuilderAdapter::OnMapStart(const Mark& mark, const std::string& tag, anchor_t anchor) 47 | { 48 | void *pNode = m_builder.NewMap(mark, tag, GetCurrentParent()); 49 | m_containers.push(ContainerFrame(pNode, m_pKeyNode)); 50 | m_pKeyNode = NULL; 51 | RegisterAnchor(anchor, pNode); 52 | } 53 | 54 | void GraphBuilderAdapter::OnMapEnd() 55 | { 56 | void *pMap = m_containers.top().pContainer; 57 | m_pKeyNode = m_containers.top().pPrevKeyNode; 58 | m_containers.pop(); 59 | DispositionNode(pMap); 60 | } 61 | 62 | void *GraphBuilderAdapter::GetCurrentParent() const 63 | { 64 | if (m_containers.empty()) { 65 | return NULL; 66 | } 67 | return m_containers.top().pContainer; 68 | } 69 | 70 | void GraphBuilderAdapter::RegisterAnchor(anchor_t anchor, void *pNode) 71 | { 72 | if (anchor) { 73 | m_anchors.Register(anchor, pNode); 74 | } 75 | } 76 | 77 | void GraphBuilderAdapter::DispositionNode(void *pNode) 78 | { 79 | if (m_containers.empty()) { 80 | m_pRootNode = pNode; 81 | return; 82 | } 83 | 84 | void *pContainer = m_containers.top().pContainer; 85 | if (m_containers.top().isMap()) { 86 | if (m_pKeyNode) { 87 | m_builder.AssignInMap(pContainer, m_pKeyNode, pNode); 88 | m_pKeyNode = NULL; 89 | } else { 90 | m_pKeyNode = pNode; 91 | } 92 | } else { 93 | m_builder.AppendToSequence(pContainer, pNode); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/contrib/graphbuilderadapter.h: -------------------------------------------------------------------------------- 1 | #ifndef GRAPHBUILDERADAPTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define GRAPHBUILDERADAPTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include 9 | #include 10 | #include 11 | #include "yaml-cpp/eventhandler.h" 12 | #include "yaml-cpp/contrib/anchordict.h" 13 | #include "yaml-cpp/contrib/graphbuilder.h" 14 | 15 | namespace YAML 16 | { 17 | class GraphBuilderAdapter : public EventHandler 18 | { 19 | public: 20 | GraphBuilderAdapter(GraphBuilderInterface& builder) 21 | : m_builder(builder), m_pRootNode(NULL), m_pKeyNode(NULL) 22 | { 23 | } 24 | 25 | virtual void OnDocumentStart(const Mark& mark) {(void)mark;} 26 | virtual void OnDocumentEnd() {} 27 | 28 | virtual void OnNull(const Mark& mark, anchor_t anchor); 29 | virtual void OnAlias(const Mark& mark, anchor_t anchor); 30 | virtual void OnScalar(const Mark& mark, const std::string& tag, anchor_t anchor, const std::string& value); 31 | 32 | virtual void OnSequenceStart(const Mark& mark, const std::string& tag, anchor_t anchor); 33 | virtual void OnSequenceEnd(); 34 | 35 | virtual void OnMapStart(const Mark& mark, const std::string& tag, anchor_t anchor); 36 | virtual void OnMapEnd(); 37 | 38 | void *RootNode() const {return m_pRootNode;} 39 | 40 | private: 41 | struct ContainerFrame 42 | { 43 | ContainerFrame(void *pSequence) 44 | : pContainer(pSequence), pPrevKeyNode(&sequenceMarker) 45 | {} 46 | ContainerFrame(void *pMap, void* pPrevKeyNode) 47 | : pContainer(pMap), pPrevKeyNode(pPrevKeyNode) 48 | {} 49 | 50 | void *pContainer; 51 | void *pPrevKeyNode; 52 | 53 | bool isMap() const {return pPrevKeyNode != &sequenceMarker;} 54 | 55 | private: 56 | static int sequenceMarker; 57 | }; 58 | typedef std::stack ContainerStack; 59 | typedef AnchorDict AnchorMap; 60 | 61 | GraphBuilderInterface& m_builder; 62 | ContainerStack m_containers; 63 | AnchorMap m_anchors; 64 | void *m_pRootNode; 65 | void *m_pKeyNode; 66 | 67 | void *GetCurrentParent() const; 68 | void RegisterAnchor(anchor_t anchor, void *pNode); 69 | void DispositionNode(void *pNode); 70 | }; 71 | } 72 | 73 | #endif // GRAPHBUILDERADAPTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 74 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/conversion.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/conversion.h" 2 | #include 3 | 4 | //////////////////////////////////////////////////////////////// 5 | // Specializations for converting a string to specific types 6 | 7 | namespace 8 | { 9 | // we're not gonna mess with the mess that is all the isupper/etc. functions 10 | bool IsLower(char ch) { return 'a' <= ch && ch <= 'z'; } 11 | bool IsUpper(char ch) { return 'A' <= ch && ch <= 'Z'; } 12 | char ToLower(char ch) { return IsUpper(ch) ? ch + 'a' - 'A' : ch; } 13 | 14 | std::string tolower(const std::string& str) 15 | { 16 | std::string s(str); 17 | std::transform(s.begin(), s.end(), s.begin(), ToLower); 18 | return s; 19 | } 20 | 21 | template 22 | bool IsEntirely(const std::string& str, T func) 23 | { 24 | for(std::size_t i=0;i::const_iterator it = tags.find(handle); 16 | if(it == tags.end()) { 17 | if(handle == "!!") 18 | return "tag:yaml.org,2002:"; 19 | return handle; 20 | } 21 | 22 | return it->second; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/directives.h: -------------------------------------------------------------------------------- 1 | #ifndef DIRECTIVES_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define DIRECTIVES_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include 11 | 12 | namespace YAML 13 | { 14 | struct Version { 15 | bool isDefault; 16 | int major, minor; 17 | }; 18 | 19 | struct Directives { 20 | Directives(); 21 | 22 | const std::string TranslateTagHandle(const std::string& handle) const; 23 | 24 | Version version; 25 | std::map tags; 26 | }; 27 | } 28 | 29 | #endif // DIRECTIVES_H_62B23520_7C8E_11DE_8A39_0800200C9A66 30 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/emitfromevents.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/emitfromevents.h" 2 | #include "yaml-cpp/emitter.h" 3 | #include "yaml-cpp/null.h" 4 | #include 5 | #include 6 | 7 | namespace { 8 | std::string ToString(YAML::anchor_t anchor) { 9 | std::stringstream stream; 10 | stream << anchor; 11 | return stream.str(); 12 | } 13 | } 14 | 15 | namespace YAML 16 | { 17 | EmitFromEvents::EmitFromEvents(Emitter& emitter): m_emitter(emitter) 18 | { 19 | } 20 | 21 | void EmitFromEvents::OnDocumentStart(const Mark&) 22 | { 23 | } 24 | 25 | void EmitFromEvents::OnDocumentEnd() 26 | { 27 | } 28 | 29 | void EmitFromEvents::OnNull(const Mark&, anchor_t anchor) 30 | { 31 | BeginNode(); 32 | EmitProps("", anchor); 33 | m_emitter << Null; 34 | } 35 | 36 | void EmitFromEvents::OnAlias(const Mark&, anchor_t anchor) 37 | { 38 | BeginNode(); 39 | m_emitter << Alias(ToString(anchor)); 40 | } 41 | 42 | void EmitFromEvents::OnScalar(const Mark&, const std::string& tag, anchor_t anchor, const std::string& value) 43 | { 44 | BeginNode(); 45 | EmitProps(tag, anchor); 46 | m_emitter << value; 47 | } 48 | 49 | void EmitFromEvents::OnSequenceStart(const Mark&, const std::string& tag, anchor_t anchor) 50 | { 51 | BeginNode(); 52 | EmitProps(tag, anchor); 53 | m_emitter << BeginSeq; 54 | m_stateStack.push(State::WaitingForSequenceEntry); 55 | } 56 | 57 | void EmitFromEvents::OnSequenceEnd() 58 | { 59 | m_emitter << EndSeq; 60 | assert(m_stateStack.top() == State::WaitingForSequenceEntry); 61 | m_stateStack.pop(); 62 | } 63 | 64 | void EmitFromEvents::OnMapStart(const Mark&, const std::string& tag, anchor_t anchor) 65 | { 66 | BeginNode(); 67 | EmitProps(tag, anchor); 68 | m_emitter << BeginMap; 69 | m_stateStack.push(State::WaitingForKey); 70 | } 71 | 72 | void EmitFromEvents::OnMapEnd() 73 | { 74 | m_emitter << EndMap; 75 | assert(m_stateStack.top() == State::WaitingForKey); 76 | m_stateStack.pop(); 77 | } 78 | 79 | void EmitFromEvents::BeginNode() 80 | { 81 | if(m_stateStack.empty()) 82 | return; 83 | 84 | switch(m_stateStack.top()) { 85 | case State::WaitingForKey: 86 | m_emitter << Key; 87 | m_stateStack.top() = State::WaitingForValue; 88 | break; 89 | case State::WaitingForValue: 90 | m_emitter << Value; 91 | m_stateStack.top() = State::WaitingForKey; 92 | break; 93 | default: 94 | break; 95 | } 96 | } 97 | 98 | void EmitFromEvents::EmitProps(const std::string& tag, anchor_t anchor) 99 | { 100 | if(!tag.empty() && tag != "?") 101 | m_emitter << VerbatimTag(tag); 102 | if(anchor) 103 | m_emitter << Anchor(ToString(anchor)); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/emitterutils.h: -------------------------------------------------------------------------------- 1 | #ifndef EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/ostream.h" 10 | #include 11 | 12 | namespace YAML 13 | { 14 | namespace Utils 15 | { 16 | bool WriteString(ostream& out, const std::string& str, bool inFlow, bool escapeNonAscii); 17 | bool WriteSingleQuotedString(ostream& out, const std::string& str); 18 | bool WriteDoubleQuotedString(ostream& out, const std::string& str, bool escapeNonAscii); 19 | bool WriteLiteralString(ostream& out, const std::string& str, int indent); 20 | bool WriteComment(ostream& out, const std::string& str, int postCommentIndent); 21 | bool WriteAlias(ostream& out, const std::string& str); 22 | bool WriteAnchor(ostream& out, const std::string& str); 23 | bool WriteTag(ostream& out, const std::string& str, bool verbatim); 24 | bool WriteTagWithPrefix(ostream& out, const std::string& prefix, const std::string& tag); 25 | bool WriteBinary(ostream& out, const unsigned char *data, std::size_t size); 26 | } 27 | } 28 | 29 | #endif // EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 30 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/exp.cpp: -------------------------------------------------------------------------------- 1 | #include "exp.h" 2 | #include "yaml-cpp/exceptions.h" 3 | #include 4 | 5 | namespace YAML 6 | { 7 | namespace Exp 8 | { 9 | unsigned ParseHex(const std::string& str, const Mark& mark) 10 | { 11 | unsigned value = 0; 12 | for(std::size_t i=0;i(ch)); 33 | } 34 | 35 | // Escape 36 | // . Translates the next 'codeLength' characters into a hex number and returns the result. 37 | // . Throws if it's not actually hex. 38 | std::string Escape(Stream& in, int codeLength) 39 | { 40 | // grab string 41 | std::string str; 42 | for(int i=0;i= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF) { 50 | std::stringstream msg; 51 | msg << ErrorMsg::INVALID_UNICODE << value; 52 | throw ParserException(in.mark(), msg.str()); 53 | } 54 | 55 | // now break it up into chars 56 | if(value <= 0x7F) 57 | return Str(value); 58 | else if(value <= 0x7FF) 59 | return Str(0xC0 + (value >> 6)) + Str(0x80 + (value & 0x3F)); 60 | else if(value <= 0xFFFF) 61 | return Str(0xE0 + (value >> 12)) + Str(0x80 + ((value >> 6) & 0x3F)) + Str(0x80 + (value & 0x3F)); 62 | else 63 | return Str(0xF0 + (value >> 18)) + Str(0x80 + ((value >> 12) & 0x3F)) + 64 | Str(0x80 + ((value >> 6) & 0x3F)) + Str(0x80 + (value & 0x3F)); 65 | } 66 | 67 | // Escape 68 | // . Escapes the sequence starting 'in' (it must begin with a '\' or single quote) 69 | // and returns the result. 70 | // . Throws if it's an unknown escape character. 71 | std::string Escape(Stream& in) 72 | { 73 | // eat slash 74 | char escape = in.get(); 75 | 76 | // switch on escape character 77 | char ch = in.get(); 78 | 79 | // first do single quote, since it's easier 80 | if(escape == '\'' && ch == '\'') 81 | return "\'"; 82 | 83 | // now do the slash (we're not gonna check if it's a slash - you better pass one!) 84 | switch(ch) { 85 | case '0': return std::string(1, '\x00'); 86 | case 'a': return "\x07"; 87 | case 'b': return "\x08"; 88 | case 't': 89 | case '\t': return "\x09"; 90 | case 'n': return "\x0A"; 91 | case 'v': return "\x0B"; 92 | case 'f': return "\x0C"; 93 | case 'r': return "\x0D"; 94 | case 'e': return "\x1B"; 95 | case ' ': return "\x20"; 96 | case '\"': return "\""; 97 | case '\'': return "\'"; 98 | case '\\': return "\\"; 99 | case '/': return "/"; 100 | case 'N': return "\x85"; 101 | case '_': return "\xA0"; 102 | case 'L': return "\xE2\x80\xA8"; // LS (#x2028) 103 | case 'P': return "\xE2\x80\xA9"; // PS (#x2029) 104 | case 'x': return Escape(in, 2); 105 | case 'u': return Escape(in, 4); 106 | case 'U': return Escape(in, 8); 107 | } 108 | 109 | std::stringstream msg; 110 | throw ParserException(in.mark(), std::string(ErrorMsg::INVALID_ESCAPE) + ch); 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/indentation.h: -------------------------------------------------------------------------------- 1 | #ifndef INDENTATION_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define INDENTATION_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/ostream.h" 10 | #include 11 | 12 | namespace YAML 13 | { 14 | struct Indentation { 15 | Indentation(unsigned n_): n(n_) {} 16 | unsigned n; 17 | }; 18 | 19 | inline ostream& operator << (ostream& out, const Indentation& indent) { 20 | for(unsigned i=0;i pData): m_pData(pData) 12 | { 13 | } 14 | 15 | Iterator::Iterator(const Iterator& rhs): m_pData(new IterPriv(*rhs.m_pData)) 16 | { 17 | } 18 | 19 | Iterator& Iterator::operator = (const Iterator& rhs) 20 | { 21 | if(this == &rhs) 22 | return *this; 23 | 24 | m_pData.reset(new IterPriv(*rhs.m_pData)); 25 | return *this; 26 | } 27 | 28 | Iterator::~Iterator() 29 | { 30 | } 31 | 32 | Iterator& Iterator::operator ++ () 33 | { 34 | if(m_pData->type == IterPriv::IT_SEQ) 35 | ++m_pData->seqIter; 36 | else if(m_pData->type == IterPriv::IT_MAP) 37 | ++m_pData->mapIter; 38 | 39 | return *this; 40 | } 41 | 42 | Iterator Iterator::operator ++ (int) 43 | { 44 | Iterator temp = *this; 45 | 46 | if(m_pData->type == IterPriv::IT_SEQ) 47 | ++m_pData->seqIter; 48 | else if(m_pData->type == IterPriv::IT_MAP) 49 | ++m_pData->mapIter; 50 | 51 | return temp; 52 | } 53 | 54 | const Node& Iterator::operator * () const 55 | { 56 | if(m_pData->type == IterPriv::IT_SEQ) 57 | return **m_pData->seqIter; 58 | 59 | throw BadDereference(); 60 | } 61 | 62 | const Node *Iterator::operator -> () const 63 | { 64 | if(m_pData->type == IterPriv::IT_SEQ) 65 | return *m_pData->seqIter; 66 | 67 | throw BadDereference(); 68 | } 69 | 70 | const Node& Iterator::first() const 71 | { 72 | if(m_pData->type == IterPriv::IT_MAP) 73 | return *m_pData->mapIter->first; 74 | 75 | throw BadDereference(); 76 | } 77 | 78 | const Node& Iterator::second() const 79 | { 80 | if(m_pData->type == IterPriv::IT_MAP) 81 | return *m_pData->mapIter->second; 82 | 83 | throw BadDereference(); 84 | } 85 | 86 | bool operator == (const Iterator& it, const Iterator& jt) 87 | { 88 | if(it.m_pData->type != jt.m_pData->type) 89 | return false; 90 | 91 | if(it.m_pData->type == IterPriv::IT_SEQ) 92 | return it.m_pData->seqIter == jt.m_pData->seqIter; 93 | else if(it.m_pData->type == IterPriv::IT_MAP) 94 | return it.m_pData->mapIter == jt.m_pData->mapIter; 95 | 96 | return true; 97 | } 98 | 99 | bool operator != (const Iterator& it, const Iterator& jt) 100 | { 101 | return !(it == jt); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/iterpriv.h: -------------------------------------------------------------------------------- 1 | #ifndef ITERPRIV_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define ITERPRIV_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/ltnode.h" 10 | #include 11 | #include 12 | 13 | namespace YAML 14 | { 15 | class Node; 16 | 17 | // IterPriv 18 | // . The implementation for iterators - essentially a union of sequence and map iterators. 19 | struct IterPriv 20 | { 21 | IterPriv(): type(IT_NONE) {} 22 | IterPriv(std::vector ::const_iterator it): type(IT_SEQ), seqIter(it) {} 23 | IterPriv(std::map ::const_iterator it): type(IT_MAP), mapIter(it) {} 24 | 25 | enum ITER_TYPE { IT_NONE, IT_SEQ, IT_MAP }; 26 | ITER_TYPE type; 27 | 28 | std::vector ::const_iterator seqIter; 29 | std::map ::const_iterator mapIter; 30 | }; 31 | } 32 | 33 | #endif // ITERPRIV_H_62B23520_7C8E_11DE_8A39_0800200C9A66 34 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/nodebuilder.cpp: -------------------------------------------------------------------------------- 1 | #include "nodebuilder.h" 2 | #include "yaml-cpp/mark.h" 3 | #include "yaml-cpp/node.h" 4 | #include 5 | 6 | namespace YAML 7 | { 8 | NodeBuilder::NodeBuilder(Node& root): m_root(root), m_initializedRoot(false), m_finished(false) 9 | { 10 | m_root.Clear(); 11 | m_anchors.push_back(0); // since the anchors start at 1 12 | } 13 | 14 | NodeBuilder::~NodeBuilder() 15 | { 16 | } 17 | 18 | void NodeBuilder::OnDocumentStart(const Mark&) 19 | { 20 | } 21 | 22 | void NodeBuilder::OnDocumentEnd() 23 | { 24 | assert(m_finished); 25 | } 26 | 27 | void NodeBuilder::OnNull(const Mark& mark, anchor_t anchor) 28 | { 29 | Node& node = Push(anchor); 30 | node.Init(NodeType::Null, mark, ""); 31 | Pop(); 32 | } 33 | 34 | void NodeBuilder::OnAlias(const Mark& /*mark*/, anchor_t anchor) 35 | { 36 | Node& node = *m_anchors[anchor]; 37 | Insert(node); 38 | node.MarkAsAliased(); 39 | } 40 | 41 | void NodeBuilder::OnScalar(const Mark& mark, const std::string& tag, anchor_t anchor, const std::string& value) 42 | { 43 | Node& node = Push(anchor); 44 | node.Init(NodeType::Scalar, mark, tag); 45 | node.SetScalarData(value); 46 | Pop(); 47 | } 48 | 49 | void NodeBuilder::OnSequenceStart(const Mark& mark, const std::string& tag, anchor_t anchor) 50 | { 51 | Node& node = Push(anchor); 52 | node.Init(NodeType::Sequence, mark, tag); 53 | } 54 | 55 | void NodeBuilder::OnSequenceEnd() 56 | { 57 | Pop(); 58 | } 59 | 60 | void NodeBuilder::OnMapStart(const Mark& mark, const std::string& tag, anchor_t anchor) 61 | { 62 | Node& node = Push(anchor); 63 | node.Init(NodeType::Map, mark, tag); 64 | m_didPushKey.push(false); 65 | } 66 | 67 | void NodeBuilder::OnMapEnd() 68 | { 69 | m_didPushKey.pop(); 70 | Pop(); 71 | } 72 | 73 | Node& NodeBuilder::Push(anchor_t anchor) 74 | { 75 | Node& node = Push(); 76 | RegisterAnchor(anchor, node); 77 | return node; 78 | } 79 | 80 | Node& NodeBuilder::Push() 81 | { 82 | if(!m_initializedRoot) { 83 | m_initializedRoot = true; 84 | return m_root; 85 | } 86 | 87 | Node& node = m_root.CreateNode(); 88 | m_stack.push(&node); 89 | return node; 90 | } 91 | 92 | Node& NodeBuilder::Top() 93 | { 94 | return m_stack.empty() ? m_root : *m_stack.top(); 95 | } 96 | 97 | void NodeBuilder::Pop() 98 | { 99 | assert(!m_finished); 100 | if(m_stack.empty()) { 101 | m_finished = true; 102 | return; 103 | } 104 | 105 | Node& node = *m_stack.top(); 106 | m_stack.pop(); 107 | Insert(node); 108 | } 109 | 110 | void NodeBuilder::Insert(Node& node) 111 | { 112 | Node& curTop = Top(); 113 | switch(curTop.Type()) { 114 | case NodeType::Null: 115 | case NodeType::Scalar: 116 | assert(false); 117 | break; 118 | case NodeType::Sequence: 119 | curTop.Append(node); 120 | break; 121 | case NodeType::Map: 122 | assert(!m_didPushKey.empty()); 123 | if(m_didPushKey.top()) { 124 | assert(!m_pendingKeys.empty()); 125 | 126 | Node& key = *m_pendingKeys.top(); 127 | m_pendingKeys.pop(); 128 | curTop.Insert(key, node); 129 | m_didPushKey.top() = false; 130 | } else { 131 | m_pendingKeys.push(&node); 132 | m_didPushKey.top() = true; 133 | } 134 | break; 135 | } 136 | } 137 | 138 | void NodeBuilder::RegisterAnchor(anchor_t anchor, Node& node) 139 | { 140 | if(anchor) { 141 | assert(anchor == m_anchors.size()); 142 | m_anchors.push_back(&node); 143 | } 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/nodebuilder.h: -------------------------------------------------------------------------------- 1 | #ifndef NODEBUILDER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NODEBUILDER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/eventhandler.h" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | namespace YAML 15 | { 16 | class Node; 17 | 18 | class NodeBuilder: public EventHandler 19 | { 20 | public: 21 | explicit NodeBuilder(Node& root); 22 | virtual ~NodeBuilder(); 23 | 24 | virtual void OnDocumentStart(const Mark& mark); 25 | virtual void OnDocumentEnd(); 26 | 27 | virtual void OnNull(const Mark& mark, anchor_t anchor); 28 | virtual void OnAlias(const Mark& mark, anchor_t anchor); 29 | virtual void OnScalar(const Mark& mark, const std::string& tag, anchor_t anchor, const std::string& value); 30 | 31 | virtual void OnSequenceStart(const Mark& mark, const std::string& tag, anchor_t anchor); 32 | virtual void OnSequenceEnd(); 33 | 34 | virtual void OnMapStart(const Mark& mark, const std::string& tag, anchor_t anchor); 35 | virtual void OnMapEnd(); 36 | 37 | private: 38 | Node& Push(anchor_t anchor); 39 | Node& Push(); 40 | Node& Top(); 41 | void Pop(); 42 | 43 | void Insert(Node& node); 44 | void RegisterAnchor(anchor_t anchor, Node& node); 45 | 46 | private: 47 | Node& m_root; 48 | bool m_initializedRoot; 49 | bool m_finished; 50 | 51 | std::stack m_stack; 52 | std::stack m_pendingKeys; 53 | std::stack m_didPushKey; 54 | 55 | typedef std::vector Anchors; 56 | Anchors m_anchors; 57 | }; 58 | } 59 | 60 | #endif // NODEBUILDER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 61 | 62 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/nodeownership.cpp: -------------------------------------------------------------------------------- 1 | #include "nodeownership.h" 2 | #include "yaml-cpp/node.h" 3 | 4 | namespace YAML 5 | { 6 | NodeOwnership::NodeOwnership(NodeOwnership *pOwner): m_pOwner(pOwner) 7 | { 8 | if(!m_pOwner) 9 | m_pOwner = this; 10 | } 11 | 12 | NodeOwnership::~NodeOwnership() 13 | { 14 | } 15 | 16 | Node& NodeOwnership::_Create() 17 | { 18 | m_nodes.push_back(std::auto_ptr(new Node)); 19 | return m_nodes.back(); 20 | } 21 | 22 | void NodeOwnership::_MarkAsAliased(const Node& node) 23 | { 24 | m_aliasedNodes.insert(&node); 25 | } 26 | 27 | bool NodeOwnership::_IsAliased(const Node& node) const 28 | { 29 | return m_aliasedNodes.count(&node) > 0; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/nodeownership.h: -------------------------------------------------------------------------------- 1 | #ifndef NODE_OWNERSHIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NODE_OWNERSHIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/noncopyable.h" 10 | #include "ptr_vector.h" 11 | #include 12 | 13 | namespace YAML 14 | { 15 | class Node; 16 | 17 | class NodeOwnership: private noncopyable 18 | { 19 | public: 20 | explicit NodeOwnership(NodeOwnership *pOwner = 0); 21 | ~NodeOwnership(); 22 | 23 | Node& Create() { return m_pOwner->_Create(); } 24 | void MarkAsAliased(const Node& node) { m_pOwner->_MarkAsAliased(node); } 25 | bool IsAliased(const Node& node) const { return m_pOwner->_IsAliased(node); } 26 | 27 | private: 28 | Node& _Create(); 29 | void _MarkAsAliased(const Node& node); 30 | bool _IsAliased(const Node& node) const; 31 | 32 | private: 33 | ptr_vector m_nodes; 34 | std::set m_aliasedNodes; 35 | NodeOwnership *m_pOwner; 36 | }; 37 | } 38 | 39 | #endif // NODE_OWNERSHIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 40 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/null.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/null.h" 2 | #include "yaml-cpp/node.h" 3 | 4 | namespace YAML 5 | { 6 | _Null Null; 7 | 8 | bool IsNull(const Node& node) 9 | { 10 | return node.Read(Null); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/ostream.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/ostream.h" 2 | #include 3 | 4 | namespace YAML 5 | { 6 | ostream::ostream(): m_buffer(0), m_pos(0), m_size(0), m_row(0), m_col(0) 7 | { 8 | reserve(1024); 9 | } 10 | 11 | ostream::~ostream() 12 | { 13 | delete [] m_buffer; 14 | } 15 | 16 | void ostream::reserve(unsigned size) 17 | { 18 | if(size <= m_size) 19 | return; 20 | 21 | char *newBuffer = new char[size]; 22 | std::memset(newBuffer, 0, size * sizeof(char)); 23 | std::memcpy(newBuffer, m_buffer, m_size * sizeof(char)); 24 | delete [] m_buffer; 25 | m_buffer = newBuffer; 26 | m_size = size; 27 | } 28 | 29 | void ostream::put(char ch) 30 | { 31 | if(m_pos >= m_size - 1) // an extra space for the NULL terminator 32 | reserve(m_size * 2); 33 | 34 | m_buffer[m_pos] = ch; 35 | m_pos++; 36 | 37 | if(ch == '\n') { 38 | m_row++; 39 | m_col = 0; 40 | } else 41 | m_col++; 42 | } 43 | 44 | ostream& operator << (ostream& out, const char *str) 45 | { 46 | std::size_t length = std::strlen(str); 47 | for(std::size_t i=0;i 12 | #include 13 | 14 | namespace YAML 15 | { 16 | Parser::Parser() 17 | { 18 | } 19 | 20 | Parser::Parser(std::istream& in) 21 | { 22 | Load(in); 23 | } 24 | 25 | Parser::~Parser() 26 | { 27 | } 28 | 29 | Parser::operator bool() const 30 | { 31 | return m_pScanner.get() && !m_pScanner->empty(); 32 | } 33 | 34 | void Parser::Load(std::istream& in) 35 | { 36 | m_pScanner.reset(new Scanner(in)); 37 | m_pDirectives.reset(new Directives); 38 | } 39 | 40 | // HandleNextDocument 41 | // . Handles the next document 42 | // . Throws a ParserException on error. 43 | // . Returns false if there are no more documents 44 | bool Parser::HandleNextDocument(EventHandler& eventHandler) 45 | { 46 | if(!m_pScanner.get()) 47 | return false; 48 | 49 | ParseDirectives(); 50 | if(m_pScanner->empty()) 51 | return false; 52 | 53 | SingleDocParser sdp(*m_pScanner, *m_pDirectives); 54 | sdp.HandleDocument(eventHandler); 55 | return true; 56 | } 57 | 58 | // GetNextDocument 59 | // . Reads the next document in the queue (of tokens). 60 | // . Throws a ParserException on error. 61 | bool Parser::GetNextDocument(Node& document) 62 | { 63 | NodeBuilder builder(document); 64 | return HandleNextDocument(builder); 65 | } 66 | 67 | // ParseDirectives 68 | // . Reads any directives that are next in the queue. 69 | void Parser::ParseDirectives() 70 | { 71 | bool readDirective = false; 72 | 73 | while(1) { 74 | if(m_pScanner->empty()) 75 | break; 76 | 77 | Token& token = m_pScanner->peek(); 78 | if(token.type != Token::DIRECTIVE) 79 | break; 80 | 81 | // we keep the directives from the last document if none are specified; 82 | // but if any directives are specific, then we reset them 83 | if(!readDirective) 84 | m_pDirectives.reset(new Directives); 85 | 86 | readDirective = true; 87 | HandleDirective(token); 88 | m_pScanner->pop(); 89 | } 90 | } 91 | 92 | void Parser::HandleDirective(const Token& token) 93 | { 94 | if(token.value == "YAML") 95 | HandleYamlDirective(token); 96 | else if(token.value == "TAG") 97 | HandleTagDirective(token); 98 | } 99 | 100 | // HandleYamlDirective 101 | // . Should be of the form 'major.minor' (like a version number) 102 | void Parser::HandleYamlDirective(const Token& token) 103 | { 104 | if(token.params.size() != 1) 105 | throw ParserException(token.mark, ErrorMsg::YAML_DIRECTIVE_ARGS); 106 | 107 | if(!m_pDirectives->version.isDefault) 108 | throw ParserException(token.mark, ErrorMsg::REPEATED_YAML_DIRECTIVE); 109 | 110 | std::stringstream str(token.params[0]); 111 | str >> m_pDirectives->version.major; 112 | str.get(); 113 | str >> m_pDirectives->version.minor; 114 | if(!str || str.peek() != EOF) 115 | throw ParserException(token.mark, std::string(ErrorMsg::YAML_VERSION) + token.params[0]); 116 | 117 | if(m_pDirectives->version.major > 1) 118 | throw ParserException(token.mark, ErrorMsg::YAML_MAJOR_VERSION); 119 | 120 | m_pDirectives->version.isDefault = false; 121 | // TODO: warning on major == 1, minor > 2? 122 | } 123 | 124 | // HandleTagDirective 125 | // . Should be of the form 'handle prefix', where 'handle' is converted to 'prefix' in the file. 126 | void Parser::HandleTagDirective(const Token& token) 127 | { 128 | if(token.params.size() != 2) 129 | throw ParserException(token.mark, ErrorMsg::TAG_DIRECTIVE_ARGS); 130 | 131 | const std::string& handle = token.params[0]; 132 | const std::string& prefix = token.params[1]; 133 | if(m_pDirectives->tags.find(handle) != m_pDirectives->tags.end()) 134 | throw ParserException(token.mark, ErrorMsg::REPEATED_TAG_DIRECTIVE); 135 | 136 | m_pDirectives->tags[handle] = prefix; 137 | } 138 | 139 | void Parser::PrintTokens(std::ostream& out) 140 | { 141 | if(!m_pScanner.get()) 142 | return; 143 | 144 | while(1) { 145 | if(m_pScanner->empty()) 146 | break; 147 | 148 | out << m_pScanner->peek() << "\n"; 149 | m_pScanner->pop(); 150 | } 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/ptr_stack.h: -------------------------------------------------------------------------------- 1 | #ifndef PTR_STACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define PTR_STACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/noncopyable.h" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | template 15 | class ptr_stack: private YAML::noncopyable 16 | { 17 | public: 18 | ptr_stack() {} 19 | ~ptr_stack() { clear(); } 20 | 21 | void clear() { 22 | for(unsigned i=0;i t) { 31 | m_data.push_back(NULL); 32 | m_data.back() = t.release(); 33 | } 34 | std::auto_ptr pop() { 35 | std::auto_ptr t(m_data.back()); 36 | m_data.pop_back(); 37 | return t; 38 | } 39 | T& top() { return *m_data.back(); } 40 | const T& top() const { return *m_data.back(); } 41 | 42 | private: 43 | std::vector m_data; 44 | }; 45 | 46 | #endif // PTR_STACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 47 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/ptr_vector.h: -------------------------------------------------------------------------------- 1 | #ifndef PTR_VECTOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define PTR_VECTOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/noncopyable.h" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | namespace YAML { 15 | 16 | template 17 | class ptr_vector: private YAML::noncopyable 18 | { 19 | public: 20 | ptr_vector() {} 21 | ~ptr_vector() { clear(); } 22 | 23 | void clear() { 24 | for(unsigned i=0;i t) { 33 | m_data.push_back(NULL); 34 | m_data.back() = t.release(); 35 | } 36 | T& operator[](std::size_t i) { return *m_data[i]; } 37 | const T& operator[](std::size_t i) const { return *m_data[i]; } 38 | 39 | T& back() { return *m_data.back(); } 40 | const T& back() const { return *m_data.back(); } 41 | 42 | private: 43 | std::vector m_data; 44 | }; 45 | } 46 | 47 | #endif // PTR_VECTOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 48 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/regex.cpp: -------------------------------------------------------------------------------- 1 | #include "regex.h" 2 | 3 | namespace YAML 4 | { 5 | // constructors 6 | RegEx::RegEx(): m_op(REGEX_EMPTY) 7 | { 8 | } 9 | 10 | RegEx::RegEx(REGEX_OP op): m_op(op) 11 | { 12 | } 13 | 14 | RegEx::RegEx(char ch): m_op(REGEX_MATCH), m_a(ch) 15 | { 16 | } 17 | 18 | RegEx::RegEx(char a, char z): m_op(REGEX_RANGE), m_a(a), m_z(z) 19 | { 20 | } 21 | 22 | RegEx::RegEx(const std::string& str, REGEX_OP op): m_op(op) 23 | { 24 | for(std::size_t i=0;i= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include 11 | 12 | namespace YAML 13 | { 14 | class Stream; 15 | 16 | enum REGEX_OP { REGEX_EMPTY, REGEX_MATCH, REGEX_RANGE, REGEX_OR, REGEX_AND, REGEX_NOT, REGEX_SEQ }; 17 | 18 | // simplified regular expressions 19 | // . Only straightforward matches (no repeated characters) 20 | // . Only matches from start of string 21 | class RegEx 22 | { 23 | public: 24 | RegEx(); 25 | RegEx(char ch); 26 | RegEx(char a, char z); 27 | RegEx(const std::string& str, REGEX_OP op = REGEX_SEQ); 28 | ~RegEx() {} 29 | 30 | friend RegEx operator ! (const RegEx& ex); 31 | friend RegEx operator || (const RegEx& ex1, const RegEx& ex2); 32 | friend RegEx operator && (const RegEx& ex1, const RegEx& ex2); 33 | friend RegEx operator + (const RegEx& ex1, const RegEx& ex2); 34 | 35 | bool Matches(char ch) const; 36 | bool Matches(const std::string& str) const; 37 | bool Matches(const Stream& in) const; 38 | template bool Matches(const Source& source) const; 39 | 40 | int Match(const std::string& str) const; 41 | int Match(const Stream& in) const; 42 | template int Match(const Source& source) const; 43 | 44 | private: 45 | RegEx(REGEX_OP op); 46 | 47 | template bool IsValidSource(const Source& source) const; 48 | template int MatchUnchecked(const Source& source) const; 49 | 50 | template int MatchOpEmpty(const Source& source) const; 51 | template int MatchOpMatch(const Source& source) const; 52 | template int MatchOpRange(const Source& source) const; 53 | template int MatchOpOr(const Source& source) const; 54 | template int MatchOpAnd(const Source& source) const; 55 | template int MatchOpNot(const Source& source) const; 56 | template int MatchOpSeq(const Source& source) const; 57 | 58 | private: 59 | REGEX_OP m_op; 60 | char m_a, m_z; 61 | std::vector m_params; 62 | }; 63 | } 64 | 65 | #include "regeximpl.h" 66 | 67 | #endif // REGEX_H_62B23520_7C8E_11DE_8A39_0800200C9A66 68 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/scanner.h: -------------------------------------------------------------------------------- 1 | #ifndef SCANNER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define SCANNER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include "ptr_vector.h" 16 | #include "stream.h" 17 | #include "token.h" 18 | 19 | namespace YAML 20 | { 21 | class Node; 22 | class RegEx; 23 | 24 | class Scanner 25 | { 26 | public: 27 | Scanner(std::istream& in); 28 | ~Scanner(); 29 | 30 | // token queue management (hopefully this looks kinda stl-ish) 31 | bool empty(); 32 | void pop(); 33 | Token& peek(); 34 | 35 | private: 36 | struct IndentMarker { 37 | enum INDENT_TYPE { MAP, SEQ, NONE }; 38 | enum STATUS { VALID, INVALID, UNKNOWN }; 39 | IndentMarker(int column_, INDENT_TYPE type_): column(column_), type(type_), status(VALID), pStartToken(0) {} 40 | 41 | int column; 42 | INDENT_TYPE type; 43 | STATUS status; 44 | Token *pStartToken; 45 | }; 46 | 47 | enum FLOW_MARKER { FLOW_MAP, FLOW_SEQ }; 48 | 49 | private: 50 | // scanning 51 | void EnsureTokensInQueue(); 52 | void ScanNextToken(); 53 | void ScanToNextToken(); 54 | void StartStream(); 55 | void EndStream(); 56 | Token *PushToken(Token::TYPE type); 57 | 58 | bool InFlowContext() const { return !m_flows.empty(); } 59 | bool InBlockContext() const { return m_flows.empty(); } 60 | int GetFlowLevel() const { return m_flows.size(); } 61 | 62 | Token::TYPE GetStartTokenFor(IndentMarker::INDENT_TYPE type) const; 63 | IndentMarker *PushIndentTo(int column, IndentMarker::INDENT_TYPE type); 64 | void PopIndentToHere(); 65 | void PopAllIndents(); 66 | void PopIndent(); 67 | int GetTopIndent() const; 68 | 69 | // checking input 70 | bool CanInsertPotentialSimpleKey() const; 71 | bool ExistsActiveSimpleKey() const; 72 | void InsertPotentialSimpleKey(); 73 | void InvalidateSimpleKey(); 74 | bool VerifySimpleKey(); 75 | void PopAllSimpleKeys(); 76 | 77 | void ThrowParserException(const std::string& msg) const; 78 | 79 | bool IsWhitespaceToBeEaten(char ch); 80 | const RegEx& GetValueRegex() const; 81 | 82 | struct SimpleKey { 83 | SimpleKey(const Mark& mark_, int flowLevel_); 84 | 85 | void Validate(); 86 | void Invalidate(); 87 | 88 | Mark mark; 89 | int flowLevel; 90 | IndentMarker *pIndent; 91 | Token *pMapStart, *pKey; 92 | }; 93 | 94 | // and the tokens 95 | void ScanDirective(); 96 | void ScanDocStart(); 97 | void ScanDocEnd(); 98 | void ScanBlockSeqStart(); 99 | void ScanBlockMapSTart(); 100 | void ScanBlockEnd(); 101 | void ScanBlockEntry(); 102 | void ScanFlowStart(); 103 | void ScanFlowEnd(); 104 | void ScanFlowEntry(); 105 | void ScanKey(); 106 | void ScanValue(); 107 | void ScanAnchorOrAlias(); 108 | void ScanTag(); 109 | void ScanPlainScalar(); 110 | void ScanQuotedScalar(); 111 | void ScanBlockScalar(); 112 | 113 | private: 114 | // the stream 115 | Stream INPUT; 116 | 117 | // the output (tokens) 118 | std::queue m_tokens; 119 | 120 | // state info 121 | bool m_startedStream, m_endedStream; 122 | bool m_simpleKeyAllowed; 123 | bool m_canBeJSONFlow; 124 | std::stack m_simpleKeys; 125 | std::stack m_indents; 126 | ptr_vector m_indentRefs; // for "garbage collection" 127 | std::stack m_flows; 128 | }; 129 | } 130 | 131 | #endif // SCANNER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 132 | 133 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/scanscalar.h: -------------------------------------------------------------------------------- 1 | #ifndef SCANSCALAR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define SCANSCALAR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include "regex.h" 11 | #include "stream.h" 12 | 13 | namespace YAML 14 | { 15 | enum CHOMP { STRIP = -1, CLIP, KEEP }; 16 | enum ACTION { NONE, BREAK, THROW }; 17 | enum FOLD { DONT_FOLD, FOLD_BLOCK, FOLD_FLOW }; 18 | 19 | struct ScanScalarParams { 20 | ScanScalarParams(): eatEnd(false), indent(0), detectIndent(false), eatLeadingWhitespace(0), escape(0), fold(DONT_FOLD), 21 | trimTrailingSpaces(0), chomp(CLIP), onDocIndicator(NONE), onTabInIndentation(NONE), leadingSpaces(false) {} 22 | 23 | // input: 24 | RegEx end; // what condition ends this scalar? 25 | bool eatEnd; // should we eat that condition when we see it? 26 | int indent; // what level of indentation should be eaten and ignored? 27 | bool detectIndent; // should we try to autodetect the indent? 28 | bool eatLeadingWhitespace; // should we continue eating this delicious indentation after 'indent' spaces? 29 | char escape; // what character do we escape on (i.e., slash or single quote) (0 for none) 30 | FOLD fold; // how do we fold line ends? 31 | bool trimTrailingSpaces; // do we remove all trailing spaces (at the very end) 32 | CHOMP chomp; // do we strip, clip, or keep trailing newlines (at the very end) 33 | // Note: strip means kill all, clip means keep at most one, keep means keep all 34 | ACTION onDocIndicator; // what do we do if we see a document indicator? 35 | ACTION onTabInIndentation; // what do we do if we see a tab where we should be seeing indentation spaces 36 | 37 | // output: 38 | bool leadingSpaces; 39 | }; 40 | 41 | std::string ScanScalar(Stream& INPUT, ScanScalarParams& info); 42 | } 43 | 44 | #endif // SCANSCALAR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 45 | 46 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/scantag.cpp: -------------------------------------------------------------------------------- 1 | #include "scanner.h" 2 | #include "regex.h" 3 | #include "exp.h" 4 | #include "yaml-cpp/exceptions.h" 5 | 6 | namespace YAML 7 | { 8 | const std::string ScanVerbatimTag(Stream& INPUT) 9 | { 10 | std::string tag; 11 | 12 | // eat the start character 13 | INPUT.get(); 14 | 15 | while(INPUT) { 16 | if(INPUT.peek() == Keys::VerbatimTagEnd) { 17 | // eat the end character 18 | INPUT.get(); 19 | return tag; 20 | } 21 | 22 | int n = Exp::URI().Match(INPUT); 23 | if(n <= 0) 24 | break; 25 | 26 | tag += INPUT.get(n); 27 | } 28 | 29 | throw ParserException(INPUT.mark(), ErrorMsg::END_OF_VERBATIM_TAG); 30 | } 31 | 32 | const std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle) 33 | { 34 | std::string tag; 35 | canBeHandle = true; 36 | Mark firstNonWordChar; 37 | 38 | while(INPUT) { 39 | if(INPUT.peek() == Keys::Tag) { 40 | if(!canBeHandle) 41 | throw ParserException(firstNonWordChar, ErrorMsg::CHAR_IN_TAG_HANDLE); 42 | break; 43 | } 44 | 45 | int n = 0; 46 | if(canBeHandle) { 47 | n = Exp::Word().Match(INPUT); 48 | if(n <= 0) { 49 | canBeHandle = false; 50 | firstNonWordChar = INPUT.mark(); 51 | } 52 | } 53 | 54 | if(!canBeHandle) 55 | n = Exp::Tag().Match(INPUT); 56 | 57 | if(n <= 0) 58 | break; 59 | 60 | tag += INPUT.get(n); 61 | } 62 | 63 | return tag; 64 | } 65 | 66 | const std::string ScanTagSuffix(Stream& INPUT) 67 | { 68 | std::string tag; 69 | 70 | while(INPUT) { 71 | int n = Exp::Tag().Match(INPUT); 72 | if(n <= 0) 73 | break; 74 | 75 | tag += INPUT.get(n); 76 | } 77 | 78 | if(tag.empty()) 79 | throw ParserException(INPUT.mark(), ErrorMsg::TAG_WITH_NO_SUFFIX); 80 | 81 | return tag; 82 | } 83 | } 84 | 85 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/scantag.h: -------------------------------------------------------------------------------- 1 | #ifndef SCANTAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define SCANTAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include "stream.h" 11 | 12 | namespace YAML 13 | { 14 | const std::string ScanVerbatimTag(Stream& INPUT); 15 | const std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle); 16 | const std::string ScanTagSuffix(Stream& INPUT); 17 | } 18 | 19 | #endif // SCANTAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 20 | 21 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/setting.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTING_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define SETTING_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include 11 | #include "yaml-cpp/noncopyable.h" 12 | 13 | namespace YAML 14 | { 15 | class SettingChangeBase; 16 | 17 | template 18 | class Setting 19 | { 20 | public: 21 | Setting(): m_value() {} 22 | 23 | const T get() const { return m_value; } 24 | std::auto_ptr set(const T& value); 25 | void restore(const Setting& oldSetting) { 26 | m_value = oldSetting.get(); 27 | } 28 | 29 | private: 30 | T m_value; 31 | }; 32 | 33 | class SettingChangeBase 34 | { 35 | public: 36 | virtual ~SettingChangeBase() {} 37 | virtual void pop() = 0; 38 | }; 39 | 40 | template 41 | class SettingChange: public SettingChangeBase 42 | { 43 | public: 44 | SettingChange(Setting *pSetting): m_pCurSetting(pSetting) { 45 | // copy old setting to save its state 46 | m_oldSetting = *pSetting; 47 | } 48 | 49 | virtual void pop() { 50 | m_pCurSetting->restore(m_oldSetting); 51 | } 52 | 53 | private: 54 | Setting *m_pCurSetting; 55 | Setting m_oldSetting; 56 | }; 57 | 58 | template 59 | inline std::auto_ptr Setting::set(const T& value) { 60 | std::auto_ptr pChange(new SettingChange (this)); 61 | m_value = value; 62 | return pChange; 63 | } 64 | 65 | class SettingChanges: private noncopyable 66 | { 67 | public: 68 | SettingChanges() {} 69 | ~SettingChanges() { clear(); } 70 | 71 | void clear() { 72 | restore(); 73 | 74 | for(setting_changes::const_iterator it=m_settingChanges.begin();it!=m_settingChanges.end();++it) 75 | delete *it; 76 | m_settingChanges.clear(); 77 | } 78 | 79 | void restore() { 80 | for(setting_changes::const_iterator it=m_settingChanges.begin();it!=m_settingChanges.end();++it) 81 | (*it)->pop(); 82 | } 83 | 84 | void push(std::auto_ptr pSettingChange) { 85 | m_settingChanges.push_back(pSettingChange.release()); 86 | } 87 | 88 | // like std::auto_ptr - assignment is transfer of ownership 89 | SettingChanges& operator = (SettingChanges& rhs) { 90 | if(this == &rhs) 91 | return *this; 92 | 93 | clear(); 94 | m_settingChanges = rhs.m_settingChanges; 95 | rhs.m_settingChanges.clear(); 96 | return *this; 97 | } 98 | 99 | private: 100 | typedef std::vector setting_changes; 101 | setting_changes m_settingChanges; 102 | }; 103 | } 104 | 105 | #endif // SETTING_H_62B23520_7C8E_11DE_8A39_0800200C9A66 106 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/simplekey.cpp: -------------------------------------------------------------------------------- 1 | #include "scanner.h" 2 | #include "token.h" 3 | #include "yaml-cpp/exceptions.h" 4 | #include "exp.h" 5 | 6 | namespace YAML 7 | { 8 | Scanner::SimpleKey::SimpleKey(const Mark& mark_, int flowLevel_) 9 | : mark(mark_), flowLevel(flowLevel_), pIndent(0), pMapStart(0), pKey(0) 10 | { 11 | } 12 | 13 | void Scanner::SimpleKey::Validate() 14 | { 15 | // Note: pIndent will *not* be garbage here; 16 | // we "garbage collect" them so we can 17 | // always refer to them 18 | if(pIndent) 19 | pIndent->status = IndentMarker::VALID; 20 | if(pMapStart) 21 | pMapStart->status = Token::VALID; 22 | if(pKey) 23 | pKey->status = Token::VALID; 24 | } 25 | 26 | void Scanner::SimpleKey::Invalidate() 27 | { 28 | if(pIndent) 29 | pIndent->status = IndentMarker::INVALID; 30 | if(pMapStart) 31 | pMapStart->status = Token::INVALID; 32 | if(pKey) 33 | pKey->status = Token::INVALID; 34 | } 35 | 36 | // CanInsertPotentialSimpleKey 37 | bool Scanner::CanInsertPotentialSimpleKey() const 38 | { 39 | if(!m_simpleKeyAllowed) 40 | return false; 41 | 42 | return !ExistsActiveSimpleKey(); 43 | } 44 | 45 | // ExistsActiveSimpleKey 46 | // . Returns true if there's a potential simple key at our flow level 47 | // (there's allowed at most one per flow level, i.e., at the start of the flow start token) 48 | bool Scanner::ExistsActiveSimpleKey() const 49 | { 50 | if(m_simpleKeys.empty()) 51 | return false; 52 | 53 | const SimpleKey& key = m_simpleKeys.top(); 54 | return key.flowLevel == GetFlowLevel(); 55 | } 56 | 57 | // InsertPotentialSimpleKey 58 | // . If we can, add a potential simple key to the queue, 59 | // and save it on a stack. 60 | void Scanner::InsertPotentialSimpleKey() 61 | { 62 | if(!CanInsertPotentialSimpleKey()) 63 | return; 64 | 65 | SimpleKey key(INPUT.mark(), GetFlowLevel()); 66 | 67 | // first add a map start, if necessary 68 | if(InBlockContext()) { 69 | key.pIndent = PushIndentTo(INPUT.column(), IndentMarker::MAP); 70 | if(key.pIndent) { 71 | key.pIndent->status = IndentMarker::UNKNOWN; 72 | key.pMapStart = key.pIndent->pStartToken; 73 | key.pMapStart->status = Token::UNVERIFIED; 74 | } 75 | } 76 | 77 | // then add the (now unverified) key 78 | m_tokens.push(Token(Token::KEY, INPUT.mark())); 79 | key.pKey = &m_tokens.back(); 80 | key.pKey->status = Token::UNVERIFIED; 81 | 82 | m_simpleKeys.push(key); 83 | } 84 | 85 | // InvalidateSimpleKey 86 | // . Automatically invalidate the simple key in our flow level 87 | void Scanner::InvalidateSimpleKey() 88 | { 89 | if(m_simpleKeys.empty()) 90 | return; 91 | 92 | // grab top key 93 | SimpleKey& key = m_simpleKeys.top(); 94 | if(key.flowLevel != GetFlowLevel()) 95 | return; 96 | 97 | key.Invalidate(); 98 | m_simpleKeys.pop(); 99 | } 100 | 101 | // VerifySimpleKey 102 | // . Determines whether the latest simple key to be added is valid, 103 | // and if so, makes it valid. 104 | bool Scanner::VerifySimpleKey() 105 | { 106 | if(m_simpleKeys.empty()) 107 | return false; 108 | 109 | // grab top key 110 | SimpleKey key = m_simpleKeys.top(); 111 | 112 | // only validate if we're in the correct flow level 113 | if(key.flowLevel != GetFlowLevel()) 114 | return false; 115 | 116 | m_simpleKeys.pop(); 117 | 118 | bool isValid = true; 119 | 120 | // needs to be less than 1024 characters and inline 121 | if(INPUT.line() != key.mark.line || INPUT.pos() - key.mark.pos > 1024) 122 | isValid = false; 123 | 124 | // invalidate key 125 | if(isValid) 126 | key.Validate(); 127 | else 128 | key.Invalidate(); 129 | 130 | return isValid; 131 | } 132 | 133 | void Scanner::PopAllSimpleKeys() 134 | { 135 | while(!m_simpleKeys.empty()) 136 | m_simpleKeys.pop(); 137 | } 138 | } 139 | 140 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/singledocparser.h: -------------------------------------------------------------------------------- 1 | #ifndef SINGLEDOCPARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define SINGLEDOCPARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/anchor.h" 10 | #include "yaml-cpp/noncopyable.h" 11 | #include 12 | #include 13 | #include 14 | 15 | namespace YAML 16 | { 17 | struct Directives; 18 | struct Mark; 19 | struct Token; 20 | class CollectionStack; 21 | class EventHandler; 22 | class Node; 23 | class Scanner; 24 | 25 | class SingleDocParser: private noncopyable 26 | { 27 | public: 28 | SingleDocParser(Scanner& scanner, const Directives& directives); 29 | ~SingleDocParser(); 30 | 31 | void HandleDocument(EventHandler& eventHandler); 32 | 33 | private: 34 | void HandleNode(EventHandler& eventHandler); 35 | 36 | void HandleSequence(EventHandler& eventHandler); 37 | void HandleBlockSequence(EventHandler& eventHandler); 38 | void HandleFlowSequence(EventHandler& eventHandler); 39 | 40 | void HandleMap(EventHandler& eventHandler); 41 | void HandleBlockMap(EventHandler& eventHandler); 42 | void HandleFlowMap(EventHandler& eventHandler); 43 | void HandleCompactMap(EventHandler& eventHandler); 44 | void HandleCompactMapWithNoKey(EventHandler& eventHandler); 45 | 46 | void ParseProperties(std::string& tag, anchor_t& anchor); 47 | void ParseTag(std::string& tag); 48 | void ParseAnchor(anchor_t& anchor); 49 | 50 | anchor_t RegisterAnchor(const std::string& name); 51 | anchor_t LookupAnchor(const Mark& mark, const std::string& name) const; 52 | 53 | private: 54 | Scanner& m_scanner; 55 | const Directives& m_directives; 56 | std::auto_ptr m_pCollectionStack; 57 | 58 | typedef std::map Anchors; 59 | Anchors m_anchors; 60 | 61 | anchor_t m_curAnchor; 62 | }; 63 | } 64 | 65 | #endif // SINGLEDOCPARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 66 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/stream.h: -------------------------------------------------------------------------------- 1 | #ifndef STREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define STREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/noncopyable.h" 10 | #include "yaml-cpp/mark.h" 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | namespace YAML 19 | { 20 | static const size_t MAX_PARSER_PUSHBACK = 8; 21 | 22 | class Stream: private noncopyable 23 | { 24 | public: 25 | friend class StreamCharSource; 26 | 27 | Stream(std::istream& input); 28 | ~Stream(); 29 | 30 | operator bool() const; 31 | bool operator !() const { return !static_cast (*this); } 32 | 33 | char peek() const; 34 | char get(); 35 | std::string get(int n); 36 | void eat(int n = 1); 37 | 38 | static char eof() { return 0x04; } 39 | 40 | const Mark mark() const { return m_mark; } 41 | int pos() const { return m_mark.pos; } 42 | int line() const { return m_mark.line; } 43 | int column() const { return m_mark.column; } 44 | void ResetColumn() { m_mark.column = 0; } 45 | 46 | private: 47 | enum CharacterSet {utf8, utf16le, utf16be, utf32le, utf32be}; 48 | 49 | std::istream& m_input; 50 | Mark m_mark; 51 | 52 | CharacterSet m_charSet; 53 | unsigned char m_bufPushback[MAX_PARSER_PUSHBACK]; 54 | mutable size_t m_nPushedBack; 55 | mutable std::deque m_readahead; 56 | unsigned char* const m_pPrefetched; 57 | mutable size_t m_nPrefetchedAvailable; 58 | mutable size_t m_nPrefetchedUsed; 59 | 60 | void AdvanceCurrent(); 61 | char CharAt(size_t i) const; 62 | bool ReadAheadTo(size_t i) const; 63 | bool _ReadAheadTo(size_t i) const; 64 | void StreamInUtf8() const; 65 | void StreamInUtf16() const; 66 | void StreamInUtf32() const; 67 | unsigned char GetNextByte() const; 68 | }; 69 | 70 | // CharAt 71 | // . Unchecked access 72 | inline char Stream::CharAt(size_t i) const { 73 | return m_readahead[i]; 74 | } 75 | 76 | inline bool Stream::ReadAheadTo(size_t i) const { 77 | if(m_readahead.size() > i) 78 | return true; 79 | return _ReadAheadTo(i); 80 | } 81 | } 82 | 83 | #endif // STREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 84 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/streamcharsource.h: -------------------------------------------------------------------------------- 1 | #ifndef STREAMCHARSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define STREAMCHARSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/noncopyable.h" 10 | #include 11 | 12 | namespace YAML 13 | { 14 | class StreamCharSource 15 | { 16 | public: 17 | StreamCharSource(const Stream& stream): m_offset(0), m_stream(stream) {} 18 | StreamCharSource(const StreamCharSource& source): m_offset(source.m_offset), m_stream(source.m_stream) {} 19 | ~StreamCharSource() {} 20 | 21 | operator bool() const; 22 | char operator [] (std::size_t i) const { return m_stream.CharAt(m_offset + i); } 23 | bool operator !() const { return !static_cast(*this); } 24 | 25 | const StreamCharSource operator + (int i) const; 26 | 27 | private: 28 | std::size_t m_offset; 29 | const Stream& m_stream; 30 | 31 | StreamCharSource& operator = (const StreamCharSource&); // non-assignable 32 | }; 33 | 34 | inline StreamCharSource::operator bool() const { 35 | return m_stream.ReadAheadTo(m_offset); 36 | } 37 | 38 | inline const StreamCharSource StreamCharSource::operator + (int i) const { 39 | StreamCharSource source(*this); 40 | if(static_cast (source.m_offset) + i >= 0) 41 | source.m_offset += i; 42 | else 43 | source.m_offset = 0; 44 | return source; 45 | } 46 | } 47 | 48 | #endif // STREAMCHARSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 49 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/stringsource.h: -------------------------------------------------------------------------------- 1 | #ifndef STRINGSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define STRINGSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | 11 | namespace YAML 12 | { 13 | class StringCharSource 14 | { 15 | public: 16 | StringCharSource(const char *str, std::size_t size): m_str(str), m_size(size), m_offset(0) {} 17 | 18 | operator bool() const { return m_offset < m_size; } 19 | char operator [] (std::size_t i) const { return m_str[m_offset + i]; } 20 | bool operator !() const { return !static_cast(*this); } 21 | 22 | const StringCharSource operator + (int i) const { 23 | StringCharSource source(*this); 24 | if(static_cast (source.m_offset) + i >= 0) 25 | source.m_offset += i; 26 | else 27 | source.m_offset = 0; 28 | return source; 29 | } 30 | 31 | StringCharSource& operator ++ () { 32 | ++m_offset; 33 | return *this; 34 | } 35 | 36 | StringCharSource& operator += (std::size_t offset) { 37 | m_offset += offset; 38 | return *this; 39 | } 40 | private: 41 | const char *m_str; 42 | std::size_t m_size; 43 | std::size_t m_offset; 44 | }; 45 | } 46 | 47 | #endif // STRINGSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 48 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/tag.cpp: -------------------------------------------------------------------------------- 1 | #include "tag.h" 2 | #include "directives.h" 3 | #include "token.h" 4 | #include 5 | #include 6 | 7 | namespace YAML 8 | { 9 | Tag::Tag(const Token& token): type(static_cast(token.data)) 10 | { 11 | switch(type) { 12 | case VERBATIM: 13 | value = token.value; 14 | break; 15 | case PRIMARY_HANDLE: 16 | value = token.value; 17 | break; 18 | case SECONDARY_HANDLE: 19 | value = token.value; 20 | break; 21 | case NAMED_HANDLE: 22 | handle = token.value; 23 | value = token.params[0]; 24 | break; 25 | case NON_SPECIFIC: 26 | break; 27 | default: 28 | assert(false); 29 | } 30 | } 31 | 32 | const std::string Tag::Translate(const Directives& directives) 33 | { 34 | switch(type) { 35 | case VERBATIM: 36 | return value; 37 | case PRIMARY_HANDLE: 38 | return directives.TranslateTagHandle("!") + value; 39 | case SECONDARY_HANDLE: 40 | return directives.TranslateTagHandle("!!") + value; 41 | case NAMED_HANDLE: 42 | return directives.TranslateTagHandle("!" + handle + "!") + value; 43 | case NON_SPECIFIC: 44 | // TODO: 45 | return "!"; 46 | default: 47 | assert(false); 48 | } 49 | throw std::runtime_error("yaml-cpp: internal error, bad tag type"); 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/tag.h: -------------------------------------------------------------------------------- 1 | #ifndef TAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define TAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include 9 | 10 | namespace YAML 11 | { 12 | struct Token; 13 | struct Directives; 14 | 15 | struct Tag { 16 | enum TYPE { 17 | VERBATIM, PRIMARY_HANDLE, SECONDARY_HANDLE, NAMED_HANDLE, NON_SPECIFIC 18 | }; 19 | 20 | Tag(const Token& token); 21 | const std::string Translate(const Directives& directives); 22 | 23 | TYPE type; 24 | std::string handle, value; 25 | }; 26 | } 27 | 28 | #endif // TAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 29 | -------------------------------------------------------------------------------- /jni/NativeVision/yaml/token.h: -------------------------------------------------------------------------------- 1 | #ifndef TOKEN_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define TOKEN_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/mark.h" 10 | #include 11 | #include 12 | #include 13 | 14 | namespace YAML 15 | { 16 | const std::string TokenNames[] = { 17 | "DIRECTIVE", 18 | "DOC_START", 19 | "DOC_END", 20 | "BLOCK_SEQ_START", 21 | "BLOCK_MAP_START", 22 | "BLOCK_SEQ_END", 23 | "BLOCK_MAP_END", 24 | "BLOCK_ENTRY", 25 | "FLOW_SEQ_START", 26 | "FLOW_MAP_START", 27 | "FLOW_SEQ_END", 28 | "FLOW_MAP_END", 29 | "FLOW_MAP_COMPACT", 30 | "FLOW_ENTRY", 31 | "KEY", 32 | "VALUE", 33 | "ANCHOR", 34 | "ALIAS", 35 | "TAG", 36 | "SCALAR" 37 | }; 38 | 39 | struct Token { 40 | // enums 41 | enum STATUS { VALID, INVALID, UNVERIFIED }; 42 | enum TYPE { 43 | DIRECTIVE, 44 | DOC_START, 45 | DOC_END, 46 | BLOCK_SEQ_START, 47 | BLOCK_MAP_START, 48 | BLOCK_SEQ_END, 49 | BLOCK_MAP_END, 50 | BLOCK_ENTRY, 51 | FLOW_SEQ_START, 52 | FLOW_MAP_START, 53 | FLOW_SEQ_END, 54 | FLOW_MAP_END, 55 | FLOW_MAP_COMPACT, 56 | FLOW_ENTRY, 57 | KEY, 58 | VALUE, 59 | ANCHOR, 60 | ALIAS, 61 | TAG, 62 | PLAIN_SCALAR, 63 | NON_PLAIN_SCALAR 64 | }; 65 | 66 | // data 67 | Token(TYPE type_, const Mark& mark_): status(VALID), type(type_), mark(mark_), data(0) {} 68 | 69 | friend std::ostream& operator << (std::ostream& out, const Token& token) { 70 | out << TokenNames[token.type] << std::string(": ") << token.value; 71 | for(std::size_t i=0;i params; 81 | int data; 82 | }; 83 | } 84 | 85 | #endif // TOKEN_H_62B23520_7C8E_11DE_8A39_0800200C9A66 86 | -------------------------------------------------------------------------------- /jni/android-ndk-profiler.mk: -------------------------------------------------------------------------------- 1 | TARGET_thumb_release_CFLAGS := $(filter-out -ffunction-sections,$(TARGET_thumb_release_CFLAGS)) 2 | TARGET_thumb_release_CFLAGS := $(filter-out -fomit-frame-pointer,$(TARGET_thumb_release_CFLAGS)) 3 | TARGET_arm_release_CFLAGS := $(filter-out -ffunction-sections,$(TARGET_arm_release_CFLAGS)) 4 | TARGET_arm_release_CFLAGS := $(filter-out -fomit-frame-pointer,$(TARGET_arm_release_CFLAGS)) 5 | TARGET_CFLAGS := $(filter-out -ffunction-sections,$(TARGET_CFLAGS)) 6 | 7 | # include libandprof.a in the build 8 | include $(CLEAR_VARS) 9 | LOCAL_MODULE := andprof 10 | LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libandprof.a 11 | include $(PREBUILT_STATIC_LIBRARY) 12 | -------------------------------------------------------------------------------- /jni/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | /home/mhill/apps/android-ndk/ndk-build 4 | -------------------------------------------------------------------------------- /jni/prof.h: -------------------------------------------------------------------------------- 1 | #ifndef prof_h_seen 2 | #define prof_h_seen 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void monstartup(const char *libname); 8 | void moncleanup(void); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | #endif 14 | -------------------------------------------------------------------------------- /proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class * extends android.app.backup.BackupAgentHelper 14 | -keep public class * extends android.preference.Preference 15 | -keep public class com.android.vending.licensing.ILicensingService 16 | 17 | -keep class com.ndu.mobile.darwinwallet.Recognizer 18 | -keepclassmembers class com.ndu.mobile.darwinwallet.Recognizer { 19 | public *; 20 | } 21 | 22 | 23 | -keepclasseswithmembernames class * { 24 | native ; 25 | } 26 | 27 | -keepclasseswithmembers class * { 28 | public (android.content.Context, android.util.AttributeSet); 29 | } 30 | 31 | -keepclasseswithmembers class * { 32 | public (android.content.Context, android.util.AttributeSet, int); 33 | } 34 | 35 | -keepclassmembers class * extends android.app.Activity { 36 | public void *(android.view.View); 37 | } 38 | 39 | -keepclassmembers enum * { 40 | public static **[] values(); 41 | public static ** valueOf(java.lang.String); 42 | } 43 | 44 | -keep class * implements android.os.Parcelable { 45 | public static final android.os.Parcelable$Creator *; 46 | } 47 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-19 12 | android.library.reference.1=../OpenCV-2.4.9-android-sdk/sdk/java 13 | -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-hdpi/mnu_focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/drawable-hdpi/mnu_focus.png -------------------------------------------------------------------------------- /res/drawable-hdpi/mnu_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/drawable-hdpi/mnu_light.png -------------------------------------------------------------------------------- /res/drawable-hdpi/mnu_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/drawable-hdpi/mnu_settings.png -------------------------------------------------------------------------------- /res/drawable-hdpi/mnu_tipstricks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/drawable-hdpi/mnu_tipstricks.png -------------------------------------------------------------------------------- /res/drawable-hdpi/tips_tricks_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/drawable-hdpi/tips_tricks_icon.png -------------------------------------------------------------------------------- /res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 13 | 24 | 25 | -------------------------------------------------------------------------------- /res/layout/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /res/layout/tip.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 | 23 | 24 | -------------------------------------------------------------------------------- /res/layout/tips_and_tricks.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 11 | 15 | 16 | 17 | 21 | 22 | 23 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /res/raw/au100bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/au100bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/au100ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/au100ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/au10bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/au10bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/au10ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/au10ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/au20bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/au20bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/au20ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/au20ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/au50bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/au50bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/au50ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/au50ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/au5bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/au5bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/au5bfull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/au5bfull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/au5bfull_pic_alt2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/au5bfull_pic_alt2.jpg -------------------------------------------------------------------------------- /res/raw/au5ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/au5ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/au5ffull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/au5ffull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/au5ffull_pic_alt2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/au5ffull_pic_alt2.jpg -------------------------------------------------------------------------------- /res/raw/by100000bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by100000bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by100000ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by100000ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by10000bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by10000bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by10000ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by10000ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by1000bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by1000bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by1000ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by1000ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by100bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by100bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by100ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by100ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by200000bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by200000bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by200000ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by200000ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by20000bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by20000bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by20000ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by20000ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by50000bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by50000bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by50000ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by50000ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by5000bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by5000bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by5000ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by5000ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by500bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by500bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by500ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by500ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by50bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by50bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/by50ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/by50ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ca100bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ca100bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ca100ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ca100ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ca10bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ca10bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ca10ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ca10ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ca10ffull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ca10ffull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ca20bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ca20bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ca20ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ca20ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ca50bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ca50bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ca50ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ca50ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ca5bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ca5bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ca5ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ca5ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ca5ffull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ca5ffull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/eu100bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/eu100bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/eu100ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/eu100ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/eu10bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/eu10bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/eu10ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/eu10ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/eu200bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/eu200bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/eu200ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/eu200ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/eu20bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/eu20bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/eu20ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/eu20ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/eu500bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/eu500bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/eu500ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/eu500ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/eu50bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/eu50bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/eu50ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/eu50ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/eu5bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/eu5bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/eu5ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/eu5ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ka100bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ka100bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ka100ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ka100ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ka10bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ka10bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ka10ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ka10ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ka1bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ka1bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ka1ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ka1ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ka200bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ka200bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ka200ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ka200ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ka20bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ka20bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ka20ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ka20ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ka2bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ka2bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ka2ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ka2ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ka50bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ka50bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ka50ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ka50ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ka5bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ka5bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ka5ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ka5ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ru1000bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ru1000bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ru1000ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ru1000ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ru100bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ru100bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ru100ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ru100ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ru10bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ru10bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ru10ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ru10ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ru5000bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ru5000bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ru5000ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ru5000ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ru500bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ru500bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ru500ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ru500ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ru50bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ru50bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ru50ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ru50ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/sound_chaching.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/sound_chaching.ogg -------------------------------------------------------------------------------- /res/raw/sound_focuscomplete.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/sound_focuscomplete.ogg -------------------------------------------------------------------------------- /res/raw/sound_recognitionevent.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/sound_recognitionevent.ogg -------------------------------------------------------------------------------- /res/raw/ua100bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua100bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua100bfull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua100bfull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ua100ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua100ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua100ffull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua100ffull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ua10bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua10bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua10bfull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua10bfull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ua10bfull_pic_alt2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua10bfull_pic_alt2.jpg -------------------------------------------------------------------------------- /res/raw/ua10ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua10ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua10ffull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua10ffull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ua10ffull_pic_alt2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua10ffull_pic_alt2.jpg -------------------------------------------------------------------------------- /res/raw/ua1bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua1bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua1bfull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua1bfull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ua1bfull_pic_alt2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua1bfull_pic_alt2.jpg -------------------------------------------------------------------------------- /res/raw/ua1ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua1ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua1ffull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua1ffull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ua1ffull_pic_alt2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua1ffull_pic_alt2.jpg -------------------------------------------------------------------------------- /res/raw/ua1ffull_pic_alt3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua1ffull_pic_alt3.jpg -------------------------------------------------------------------------------- /res/raw/ua200bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua200bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua200bfull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua200bfull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ua200ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua200ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua200ffull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua200ffull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ua20bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua20bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua20bfull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua20bfull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ua20bfull_pic_alt2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua20bfull_pic_alt2.jpg -------------------------------------------------------------------------------- /res/raw/ua20ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua20ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua20ffull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua20ffull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ua20ffull_pic_alt2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua20ffull_pic_alt2.jpg -------------------------------------------------------------------------------- /res/raw/ua2bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua2bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua2bfull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua2bfull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ua2bfull_pic_alt2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua2bfull_pic_alt2.jpg -------------------------------------------------------------------------------- /res/raw/ua2ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua2ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua2ffull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua2ffull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ua2ffull_pic_alt2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua2ffull_pic_alt2.jpg -------------------------------------------------------------------------------- /res/raw/ua500bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua500bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua500ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua500ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua50bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua50bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua50bfull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua50bfull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ua50ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua50ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua50ffull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua50ffull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ua5bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua5bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua5bfull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua5bfull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ua5bfull_pic_alt2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua5bfull_pic_alt2.jpg -------------------------------------------------------------------------------- /res/raw/ua5ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua5ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/ua5ffull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua5ffull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/ua5ffull_pic_alt2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/ua5ffull_pic_alt2.jpg -------------------------------------------------------------------------------- /res/raw/uk10bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/uk10bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/uk10ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/uk10ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/uk20bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/uk20bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/uk20bfull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/uk20bfull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/uk20ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/uk20ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/uk20ffull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/uk20ffull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/uk50bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/uk50bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/uk50bfull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/uk50bfull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/uk50ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/uk50ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/uk50ffull_pic_alt1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/uk50ffull_pic_alt1.jpg -------------------------------------------------------------------------------- /res/raw/uk5bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/uk5bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/uk5ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/uk5ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/us100bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/us100bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/us100ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/us100ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/us10bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/us10bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/us10ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/us10ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/us1bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/us1bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/us1ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/us1ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/us20bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/us20bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/us20ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/us20ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/us2bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/us2bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/us2ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/us2ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/us50bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/us50bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/us50ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/us50ffull_pic.jpg -------------------------------------------------------------------------------- /res/raw/us5bfull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/us5bfull_pic.jpg -------------------------------------------------------------------------------- /res/raw/us5ffull_pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matthill/darwinwallet/11b774e17ca969e19f7c647514423a4591909ec8/res/raw/us5ffull_pic.jpg -------------------------------------------------------------------------------- /res/values-ru/language_packs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Доллары США 6 | Английские фунты стерлингов 7 | Евро 8 | Канадские доллары 9 | Австралийские доллары 10 | Грузинские лари 11 | Украинские гривны 12 | Русские рубли 13 | Белорусские рубли 14 | 15 | 16 | 17 | $ 18 | £ 19 | 20 | $ 21 | $ 22 |  грузинских лари  23 |  украинских гривен  24 |  русских рублей  25 |  белорусских рублей  26 | 27 | 28 | false 29 | 30 | -------------------------------------------------------------------------------- /res/values-ru/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | фронт 5 | назад 6 | Загружаюсь... 7 | Загружаю %s... 8 | Загрузка завершена 9 | Неудалось загрузиться. 10 | Высматриваю деньги 11 | Фокусировка... 12 | Неудалось открыть Камеру 13 | Вспышка отключена 14 | Вспышка включена 15 | На вашем Android устройстве не включен Text-to-Speech. Чтобы текст произносился речевым синтезатором, вам необходимо включить TTS в Настройках. Вы хотите перейти в эти настройки? 16 | Настройки Android 17 | 18 | Darwin Wallet - Настройки 19 | Пользовательские настройки 20 | Ваша валюта 21 | Пожалуйста, выберите Вашу валюту 22 | Настройка фокусировки камеры 23 | 24 | Автофокус выключен 25 | Фокусировка включается касанием дисплея 26 | Автофокус включен 27 | 28 | Пожалуйста, выберите режим фокусировки камеры 29 | Повышенная точность распознавания 30 | Уменьшите число возможных ошибок ценой более медленного распознавания купюр. 31 | 32 | Darwin Wallet - Полезные советы 33 | Совет №1 34 | Совет идет сюда... 35 | Совет №%d 36 | 37 | Настройки 38 | Включить/выключить вспышку 39 | Фокусировка камеры 40 | Полезные советы 41 | 42 | -------------------------------------------------------------------------------- /res/values-ru/tips_and_tricks.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Darwin Wallet распознает купюры при помощи основной камеры, расположенной на задней стороне устройства. Для получения наилучшего результата распознавания, расположите купюру на плоской поверхности и держите устройство в горизонтальном положении над банкнотой. 6 | Расстояние между устройством и распознаваемой купюрой имеет большое значение. Путем эксперимента Вы можете самостоятельно определить оптимальное расстояние для Вашего устройства. Для каждого конкретного устройства оптимальное расстояние может немного отличаться, но обычно наилучшим является расстояние от 15 до 30 сантиметров. 7 | Попробуйте располагать купюру для распознавания так, чтобы ее ориентация совпадала с ориентацией устройства. Располагайте банкноту боком к себе, если предпочитаете держать устройство в вертикальной (портретной) ориентации, или держите устройство над банкнотой, расположенной стандартно, в горизонтальной (ландшафтной) ориентации. Это позволит камере устройства захватить большую площадь распознаваемой купюры. 8 | Поэкспериментируйте с настройками автофокуса и вспышки. Различные устройства по-разному работают с автофокусом и вспышкой. Включение автофокуса и вспышки значительно увеличивает точность распознавания на одних устройствах, при этом может ухудшить результат на других. При необходимости поэкспериментируйте с разными вариантами настроек, чтобы подобрать оптимальное для своего устройства решение. 9 | Если Ваша валюта - не доллар США, убедитесь, что для распознавания выбрана валюта Вашей страны. Вы можете изменить денежные единицы в настройках приложения. 10 | Вы обратили внимание на глухой звук барабана, который раздается в тот момент, когда купюры распознаются? Этот звук сигнализирует о том, что банкнота распознана. Иногда, возможно, стоит подождать до тех пор, пока Вы не услышите звук барабана два или три раза, чтобы быть полностью уверенным в том, что купюра распознана правильно. Вслед за серией звуков, результат распознавания будет озвучен синтезатором речи. 11 | Физические кнопки (эти советы работают только при наличии у Вашего устройства соответствующих аппаратных кнопок). Вы можете включить или выключить вспышку при помощи аппаратной кнопки "поиск". Чтобы сфокусировать камеру, нажмите аппаратную кнопку "камера". Вы также можете сфокусировать камеру, коснувшись дисплея. Если Вы работаете с программой чтения с экрана, касание нужно выполнять с учетом работы специальных возможностей на Вашем устройстве. 12 | Остерегайтесь фальшивых денежных знаков. Darwin Wallet не является средством проверки подлинности купюр. Проверяйте размеры банкнот, фактуру бумаги, наличие специальных защитных элементов, остерегайтесь принимать деньги в небезопасных местах. Тот, кто предъявит программе изображение банкноты, идентичное оригиналу, полностью ее одурачит. 13 | Распознавайте Ваши банкноты по одной. Если программа Darwin Wallet видит множество банкнот, лежащих одна на другой, она оказывается сбитой с толку и крайне озадаченной. В этом случае весьма маловероятно, что она сообщит Вам хоть что-нибудь. Рекомендуется убирать каждую распознанную банкноту из поля зрения приложения, а лишь затем распознавать следующую. 14 | Будьте терпеливы при первом запуске программы. После того, как Darwin Wallet загрузит базу денежных знаков Вашей страны, требуется еще около 20 секунд, прежде чем программа войдет в колею и привыкнет распознавать Ваши банкноты. 15 | Если у Вас достаточно мощное устройство, попробуйте включить в настройках программы высокую точность распознавания. Высокая точность потребует больше времени на распознавание, но уменшится количество возможных ошибок. 16 | 17 | 18 | -------------------------------------------------------------------------------- /res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /res/values/language_packs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | us 6 | uk 7 | eu 8 | ca 9 | au 10 | ka 11 | ua 12 | ru 13 | by 14 | 15 | 16 | 17 | US Dollars 18 | British Pound Sterling 19 | European Union Euros 20 | Canadian Dollars 21 | Australian Dollars 22 | Georgian Laris 23 | Ukrainian hryvnias 24 | Russian Rubles 25 | Byelorussian Rubles 26 | 27 | 28 | 29 | $ 30 | £ 31 | 32 | $ 33 | $ 34 |  georgian laris  35 |  ukrainian hryvnias  36 |  russian rubles  37 |  byelorussian rubles  38 | 39 | 40 | true 41 | 42 | 43 | -------------------------------------------------------------------------------- /res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Darwin Wallet 5 | 6 | front 7 | back 8 | Loading... 9 | Loading %s... 10 | Loading complete. 11 | Loading failed. 12 | Scanning 13 | Focusing... 14 | Failed to open Camera 15 | Flash off 16 | Flash on 17 | Your Android device does not have Text-to-Speech enabled. You must enable Text-to-Speech in your Android settings in order to play text books. Do you wish to go to your Android settings now? 18 | Android Settings 19 | 20 | Darwin Wallet Settings 21 | User Preferences 22 | Preferred Currency 23 | Please select a currency 24 | Auto Focus Mode 25 | 26 | Auto-Focus Off 27 | Touch Screen to Focus 28 | Auto-focus On 29 | 30 | Please select a focus mode 31 | Higher Accuracy Scanning 32 | Reduce the number of false positives at the expense of slower bill recognition. 33 | 34 | Darwin Wallet Tips and Tricks 35 | Tip #1 36 | Tip goes here 37 | Tip #%d 38 | 39 | Settings 40 | Toggle Light 41 | Focus Camera 42 | Tips and Tricks 43 | 44 | -------------------------------------------------------------------------------- /res/values/tips_and_tricks.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Darwin Wallet works by using the camera on the back of your phone to recognize bills. For best results, lay your money on a flat surface and hold your phone steady above the bill. 5 | Distance is important. You should try to find the right distance to hold your phone away from the money. Every phone is a little different, but it is usually between 6 and 12 inches. 6 | Try to orient your money in the same direction as your phone. This helps ensure that the camera can see most of the bill. 7 | Experiment with flash and focus. Different phones handle flash mode and focus mode differently. Turning on auto-focus and flash mode on some phones greatly increases the accuracy, but could decrease the accuracy on others. Try to experiment with different settings to find the best match for your phone. 8 | If you do not deal regularly in US Dollar Bills, make sure to change your currency. You can change your currency to pounds, Euros, Canadian dollars, or Australian dollars in the settings. 9 | Did you notice the drum beats as the bills are being recognized? That tells you that a bill has been recognized. You should probably wait to hear two or three drum beats before you are sure that the bill is recognized correctly. 10 | Special keys. You can press the search button to toggle the flash on and off. You can press the camera button or tap the screen to focus the camera. 11 | 12 | Beware of counterfeit currency. Darwin Wallet is not a counterfeit detector. Be sure to check the weight and feel of the paper before trusting the bill. If someone printed an image of a dollar bill, that would absolutely fool Darwin Wallet. 13 | Separate your money. If Darwin Wallet sees many bills laid on top of each other, it tends to get confused and is less likely to report anything. It is best to remove each bill from the field of view before trying another one. 14 | Be patient when the app first loads. After Darwin Wallet finishes loading your currency, it still takes about 20 seconds before it gets in the groove of recognizing your bills. 15 | If you have a fast phone, try toggling the high accuracy option in the settings. This will take longer to recognize your money, but it will reduce the occurance of "false positives" 16 | 17 | -------------------------------------------------------------------------------- /src/com/ndu/mobile/darwinwallet/AutoFocusModes.java: -------------------------------------------------------------------------------- 1 | package com.ndu.mobile.darwinwallet; 2 | 3 | public enum AutoFocusModes 4 | { 5 | OFF 6 | { 7 | @Override 8 | public int getVal() 9 | { 10 | return 1; 11 | } 12 | }, 13 | FocusOnTouch 14 | { 15 | @Override 16 | public int getVal() 17 | { 18 | return 2; 19 | } 20 | }, 21 | ON 22 | { 23 | @Override 24 | public int getVal() 25 | { 26 | return 3; 27 | } 28 | }; 29 | 30 | public abstract int getVal(); 31 | 32 | public static AutoFocusModes getMode(String value) 33 | { 34 | return getMode(Integer.parseInt(value)); 35 | } 36 | 37 | public static AutoFocusModes getMode(int value) 38 | { 39 | for (AutoFocusModes mode : AutoFocusModes.values()) 40 | { 41 | if (mode.getVal() == value) return mode; 42 | } 43 | 44 | return AutoFocusModes.FocusOnTouch; 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /src/com/ndu/mobile/darwinwallet/AutoFocuser.java: -------------------------------------------------------------------------------- 1 | package com.ndu.mobile.darwinwallet; 2 | 3 | import java.util.Calendar; 4 | 5 | public class AutoFocuser 6 | { 7 | private static final long AUTO_FOCUS_INTERVAL_MS = 9000; 8 | private boolean mAutoFocusing; 9 | private long lastAutoFocus; 10 | 11 | private boolean enabled = false; 12 | private IAutoFocusEvent afcallback; 13 | 14 | public AutoFocuser(IAutoFocusEvent afcallback) 15 | { 16 | this.afcallback = afcallback; 17 | lastAutoFocus = getCurTime(); 18 | } 19 | 20 | public boolean needsAutoFocus() 21 | { 22 | if (enabled == false) return false; 23 | 24 | if ((getCurTime() - lastAutoFocus) > AUTO_FOCUS_INTERVAL_MS) 25 | { 26 | if (mAutoFocusing == false) return true; 27 | } 28 | 29 | return false; 30 | } 31 | 32 | public boolean isAutoFocusing() 33 | { 34 | return mAutoFocusing; 35 | } 36 | 37 | public void autoFocusStart() 38 | { 39 | mAutoFocusing = true; 40 | if (afcallback != null) afcallback.autoFocusUpdate(false); 41 | } 42 | 43 | public void disable() 44 | { 45 | enabled = false; 46 | } 47 | 48 | public void enable() 49 | { 50 | enabled = true; 51 | } 52 | 53 | public boolean isEnabled() 54 | { 55 | return enabled; 56 | } 57 | 58 | public void autoFocusComplete() 59 | { 60 | lastAutoFocus = getCurTime(); 61 | mAutoFocusing = false; 62 | 63 | if (afcallback != null) afcallback.autoFocusUpdate(true); 64 | } 65 | 66 | private long getCurTime() 67 | { 68 | Calendar rightNow = Calendar.getInstance(); 69 | return rightNow.getTimeInMillis(); 70 | } 71 | 72 | } -------------------------------------------------------------------------------- /src/com/ndu/mobile/darwinwallet/CurrencyInfo.java: -------------------------------------------------------------------------------- 1 | package com.ndu.mobile.darwinwallet; 2 | 3 | import android.content.Context; 4 | import android.os.Parcel; 5 | import android.os.Parcelable; 6 | 7 | public class CurrencyInfo implements Parcelable 8 | { 9 | private String description; // e.g. US Dollar 10 | private String code; // e.g. us 11 | private String symbol; // e.g. $ 12 | 13 | public CurrencyInfo(Context context, String currency_code) 14 | { 15 | String[] codes = context.getResources().getStringArray(R.array.language_codes); 16 | String[] descriptions = context.getResources().getStringArray(R.array.language_names); 17 | String[] symbols = context.getResources().getStringArray(R.array.language_signs); 18 | 19 | //int matchingIndex = 0; 20 | for (int i = 0; i < codes.length; i++) 21 | { 22 | String c = codes[i]; 23 | if (c.equals(currency_code)) 24 | { 25 | this.code = currency_code; 26 | this.description = descriptions[i]; 27 | this.symbol = symbols[i]; 28 | } 29 | } 30 | } 31 | 32 | public String getDescription() 33 | { 34 | return description; 35 | } 36 | 37 | public String getCode() 38 | { 39 | return code; 40 | } 41 | 42 | public String getSymbol() 43 | { 44 | return symbol; 45 | } 46 | 47 | @Override 48 | public boolean equals(Object o) 49 | { 50 | if (((CurrencyInfo) o).getCode() == this.getCode()) return true; 51 | 52 | return false; 53 | }; 54 | 55 | @Override 56 | public int describeContents() 57 | { 58 | return 0; 59 | } 60 | 61 | @Override 62 | public void writeToParcel(Parcel dest, int flags) 63 | { 64 | dest.writeString(description); 65 | dest.writeString(code); 66 | dest.writeString(symbol); 67 | } 68 | 69 | public static final Parcelable.Creator CREATOR = new Parcelable.Creator() 70 | { 71 | @Override 72 | public CurrencyInfo createFromParcel(Parcel in) 73 | { 74 | return new CurrencyInfo(in); 75 | } 76 | 77 | @Override 78 | public CurrencyInfo[] newArray(int size) 79 | { 80 | return new CurrencyInfo[size]; 81 | } 82 | }; 83 | 84 | private CurrencyInfo(Parcel in) 85 | { 86 | description = in.readString(); 87 | code = in.readString(); 88 | symbol = in.readString(); 89 | } 90 | 91 | } -------------------------------------------------------------------------------- /src/com/ndu/mobile/darwinwallet/IAutoFocusEvent.java: -------------------------------------------------------------------------------- 1 | package com.ndu.mobile.darwinwallet; 2 | 3 | public interface IAutoFocusEvent 4 | { 5 | public void autoFocusUpdate(boolean finished); 6 | } -------------------------------------------------------------------------------- /src/com/ndu/mobile/darwinwallet/IRecognitionEvent.java: -------------------------------------------------------------------------------- 1 | package com.ndu.mobile.darwinwallet; 2 | 3 | public interface IRecognitionEvent 4 | { 5 | public void recognitionEvent(RecognitionResult result); 6 | } -------------------------------------------------------------------------------- /src/com/ndu/mobile/darwinwallet/RecognitionResult.java: -------------------------------------------------------------------------------- 1 | package com.ndu.mobile.darwinwallet; 2 | 3 | public class RecognitionResult 4 | { 5 | boolean match_found = false; 6 | int bill_value; 7 | boolean front; 8 | int confidence; 9 | 10 | public RecognitionResult(String rawData) 11 | { 12 | if ((rawData == null) || (rawData.equals(""))) 13 | { 14 | match_found = false; 15 | bill_value = 0; 16 | front = false; 17 | confidence = 0; 18 | } 19 | else 20 | { 21 | match_found = true; 22 | String[] splits = rawData.split(","); 23 | String bill_val_str; 24 | if (splits[0].contains("f")) 25 | { 26 | bill_val_str = splits[0].substring(0, splits[0].indexOf('f')); 27 | front = true; 28 | } 29 | else 30 | { 31 | bill_val_str = splits[0].substring(0, splits[0].indexOf('b')); 32 | front = false; 33 | } 34 | bill_value = Integer.parseInt(bill_val_str); 35 | confidence = Integer.parseInt(splits[1]); 36 | } 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /src/com/ndu/mobile/darwinwallet/SettingsActivity.java: -------------------------------------------------------------------------------- 1 | package com.ndu.mobile.darwinwallet; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | import android.content.SharedPreferences.Editor; 6 | import android.os.Bundle; 7 | import android.preference.CheckBoxPreference; 8 | import android.preference.ListPreference; 9 | import android.preference.PreferenceActivity; 10 | import android.preference.PreferenceCategory; 11 | import android.preference.PreferenceManager; 12 | import android.preference.PreferenceScreen; 13 | 14 | public class SettingsActivity extends PreferenceActivity 15 | { 16 | public static String CURRENCY_PREF_KEY = "user_currency"; 17 | public final static String CURRENCY_DEFAULT = "us"; 18 | 19 | public final static String FLASH_PREF_KEY = "flash_on"; 20 | public final static boolean FLASH_DEFAULT = true; 21 | 22 | public final static String DOUBLE_CHECK_PREF_KEY = "double_check"; 23 | public final static boolean DOUBLE_CHECK_DEFAULT = false; 24 | 25 | public final static String AUTO_FOCUS_PREF_KEY = "user_autofocus_mode"; 26 | public final static String AUTO_FOCUS_DEFAULT = String.valueOf(AutoFocusModes.ON.getVal()); 27 | 28 | @Override 29 | public void onCreate(Bundle savedInstanceState) 30 | { 31 | super.onCreate(savedInstanceState); 32 | 33 | setContentView(R.layout.settings); 34 | 35 | setPreferenceScreen(createPreferenceHierarchy()); 36 | } 37 | 38 | private PreferenceScreen createPreferenceHierarchy() 39 | { 40 | // Root 41 | PreferenceScreen root = getPreferenceManager().createPreferenceScreen(this); 42 | 43 | // Inline preferences 44 | PreferenceCategory userPrefCat = new PreferenceCategory(this); 45 | userPrefCat.setTitle(getString(R.string.pref_title)); 46 | root.addPreference(userPrefCat); 47 | 48 | // Currency Preference 49 | ListPreference prefCurrency = new ListPreference(this); 50 | prefCurrency.setKey(CURRENCY_PREF_KEY); 51 | prefCurrency.setTitle(getString(R.string.pref_currency)); 52 | prefCurrency.setEntries(R.array.language_names); 53 | prefCurrency.setEntryValues(R.array.language_codes); 54 | prefCurrency.setDialogTitle(getString(R.string.pref_currency_dialog)); 55 | userPrefCat.addPreference(prefCurrency); 56 | 57 | // Focus mode 58 | String[] focusNames = getResources().getStringArray(R.array.pref_focus_names); 59 | String[] focusValues = { 60 | String.valueOf(AutoFocusModes.OFF.getVal()), 61 | String.valueOf(AutoFocusModes.FocusOnTouch.getVal()), 62 | String.valueOf(AutoFocusModes.ON.getVal()) 63 | }; 64 | ListPreference prefAutoFocus = new ListPreference(this); 65 | prefAutoFocus.setKey(AUTO_FOCUS_PREF_KEY); 66 | prefAutoFocus.setTitle(getString(R.string.pref_focus_title)); 67 | prefAutoFocus.setEntries(focusNames); 68 | prefAutoFocus.setEntryValues(focusValues); 69 | prefAutoFocus.setDialogTitle(getString(R.string.pref_focus_dialog)); 70 | userPrefCat.addPreference(prefAutoFocus); 71 | 72 | // Double check preference 73 | CheckBoxPreference prefDoubleCheck = new CheckBoxPreference(this); 74 | prefDoubleCheck.setKey(DOUBLE_CHECK_PREF_KEY); 75 | prefDoubleCheck.setDefaultValue(DOUBLE_CHECK_DEFAULT); 76 | prefDoubleCheck.setTitle(getString(R.string.pref_double_check_title)); 77 | prefDoubleCheck.setSummary(getString(R.string.pref_double_check_summary)); 78 | userPrefCat.addPreference(prefDoubleCheck); 79 | 80 | return root; 81 | } 82 | 83 | public static String getCurrency(Context context) 84 | { 85 | SharedPreferences appSharedPrefs = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext()); 86 | 87 | return appSharedPrefs.getString(CURRENCY_PREF_KEY, CURRENCY_DEFAULT); 88 | } 89 | 90 | public static AutoFocusModes getAutoFocusMode(Context context) 91 | { 92 | SharedPreferences appSharedPrefs = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext()); 93 | 94 | String value = appSharedPrefs.getString(AUTO_FOCUS_PREF_KEY, AUTO_FOCUS_DEFAULT); 95 | 96 | return AutoFocusModes.getMode(value); 97 | } 98 | 99 | public static boolean getFlash(Context context) 100 | { 101 | SharedPreferences appSharedPrefs = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext()); 102 | 103 | return appSharedPrefs.getBoolean(FLASH_PREF_KEY, FLASH_DEFAULT); 104 | } 105 | 106 | public static void setFlash(Context context, boolean enabled) 107 | { 108 | SharedPreferences appSharedPrefs = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext()); 109 | Editor prefsEditor = appSharedPrefs.edit(); 110 | prefsEditor.putBoolean(FLASH_PREF_KEY, enabled); 111 | prefsEditor.commit(); 112 | } 113 | 114 | public static boolean getDoubleCheck(Context context) 115 | { 116 | SharedPreferences appSharedPrefs = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext()); 117 | 118 | return appSharedPrefs.getBoolean(DOUBLE_CHECK_PREF_KEY, DOUBLE_CHECK_DEFAULT); 119 | } 120 | 121 | } -------------------------------------------------------------------------------- /src/com/ndu/mobile/darwinwallet/TipsArrayAdapter.java: -------------------------------------------------------------------------------- 1 | package com.ndu.mobile.darwinwallet; 2 | 3 | import java.util.List; 4 | 5 | import android.content.Context; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.ArrayAdapter; 10 | import android.widget.TextView; 11 | 12 | public class TipsArrayAdapter extends ArrayAdapter 13 | { 14 | private LayoutInflater mInflater; 15 | private Context mContext; 16 | 17 | public TipsArrayAdapter(Context context, int resource, int textViewResourceId, List objects) 18 | { 19 | super(context, resource, textViewResourceId, objects); 20 | 21 | mContext = context; 22 | mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 23 | } 24 | 25 | @Override 26 | public View getView(int position, View convertView, ViewGroup parent) 27 | { 28 | ViewHolder holder = null; 29 | TextView tipId = null; 30 | TextView tipText = null; 31 | 32 | String rowData = getItem(position); 33 | if (null == convertView) 34 | { 35 | convertView = mInflater.inflate(R.layout.tip, null); 36 | holder = new ViewHolder(convertView); 37 | convertView.setTag(holder); 38 | } 39 | 40 | holder = (ViewHolder) convertView.getTag(); 41 | tipId = holder.getTipId(); 42 | tipId.setText(mContext.getString(R.string.tip_n, position + 1)); 43 | tipText = holder.getTipText(); 44 | tipText.setText(rowData); 45 | 46 | return convertView; 47 | } 48 | 49 | private class ViewHolder 50 | { 51 | private View mRow; 52 | private TextView tipId = null; 53 | private TextView tipText = null; 54 | 55 | public ViewHolder(View row) 56 | { 57 | mRow = row; 58 | } 59 | 60 | public TextView getTipId() 61 | { 62 | if (null == tipId) 63 | { 64 | tipId = (TextView) mRow.findViewById(R.id.lblTipId); 65 | } 66 | 67 | return tipId; 68 | } 69 | 70 | public TextView getTipText() 71 | { 72 | if (null == tipText) 73 | { 74 | tipText = (TextView) mRow.findViewById(R.id.lblTipText); 75 | } 76 | 77 | return tipText; 78 | } 79 | 80 | } 81 | 82 | } -------------------------------------------------------------------------------- /src/com/ndu/mobile/darwinwallet/TipsnTricksActivity.java: -------------------------------------------------------------------------------- 1 | package com.ndu.mobile.darwinwallet; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import android.app.ListActivity; 6 | import android.os.Bundle; 7 | 8 | public class TipsnTricksActivity extends ListActivity 9 | { 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) 12 | { 13 | super.onCreate(savedInstanceState); 14 | setContentView(R.layout.tips_and_tricks); 15 | 16 | String[] tips_text = getResources().getStringArray(R.array.tips_text); 17 | List tipsList = new ArrayList(tips_text.length); 18 | for (String tip : tips_text) tipsList.add(tip); 19 | TipsArrayAdapter adapter = new TipsArrayAdapter(this, R.layout.tip, R.id.tipstricks, tipsList); 20 | // Bind to our new adapter. 21 | setListAdapter(adapter); 22 | } 23 | } -------------------------------------------------------------------------------- /src/com/ndu/mobile/darwinwallet/Voice.java: -------------------------------------------------------------------------------- 1 | package com.ndu.mobile.darwinwallet; 2 | 3 | import java.util.Locale; 4 | 5 | import android.app.Activity; 6 | import android.app.AlertDialog; 7 | import android.content.Context; 8 | import android.content.DialogInterface; 9 | import android.content.Intent; 10 | import android.speech.tts.TextToSpeech; 11 | import android.speech.tts.TextToSpeech.OnInitListener; 12 | import android.speech.tts.TextToSpeech.OnUtteranceCompletedListener; 13 | 14 | public class Voice implements OnUtteranceCompletedListener, OnInitListener 15 | { 16 | private TextToSpeech tts; 17 | private String activeText = ""; 18 | private boolean shutdown = false; 19 | 20 | private Context context; 21 | 22 | public Voice(Activity context) 23 | { 24 | this.context = context; 25 | 26 | tts = new TextToSpeech(context, this); 27 | } 28 | 29 | @Override 30 | public void onInit(int status) 31 | { 32 | if (status == TextToSpeech.SUCCESS) 33 | { 34 | // good... 35 | } 36 | else 37 | { 38 | // Initialization failed. 39 | AlertDialog.Builder builder = new AlertDialog.Builder(context); 40 | builder.setMessage(context.getString(R.string.tts_not_enabled)) 41 | .setCancelable(false) 42 | .setPositiveButton(context.getString(R.string.android_settings), new DialogInterface.OnClickListener() 43 | { 44 | @Override 45 | public void onClick(DialogInterface dialog, int id) 46 | { 47 | Intent dialogIntent = new Intent(android.provider.Settings.ACTION_SETTINGS); 48 | dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 49 | context.startActivity(dialogIntent); 50 | 51 | ((Activity)context).finish(); 52 | } 53 | }) 54 | .setNegativeButton(context.getString(android.R.string.cancel), new DialogInterface.OnClickListener() 55 | { 56 | @Override 57 | public void onClick(DialogInterface dialog, int id) 58 | { 59 | ((Activity)context).finish(); 60 | } 61 | }); 62 | builder.create(); 63 | } 64 | } 65 | 66 | public void shutdown() 67 | { 68 | if (tts != null) tts.shutdown(); 69 | shutdown = true; 70 | } 71 | 72 | public void setSpeed(float newSpeed) 73 | { 74 | if ((tts != null) && (!shutdown)) tts.setSpeechRate(newSpeed); 75 | } 76 | 77 | public void setPitch(float newPitch) 78 | { 79 | if ((tts != null) && (!shutdown)) tts.setPitch(newPitch); 80 | } 81 | 82 | public void speakWithoutCallback(String text) 83 | { 84 | // Don't speak anything if we've shut down the TTS 85 | if (shutdown) return; 86 | 87 | if (tts == null) return; 88 | 89 | tts.setOnUtteranceCompletedListener(this); 90 | activeText = "ignore"; 91 | if (tts.isSpeaking() == false) tts.speak(text, TextToSpeech.QUEUE_FLUSH, null); 92 | } 93 | 94 | public boolean isTTSAvailable() 95 | { 96 | int val = tts.isLanguageAvailable(Locale.getDefault()); 97 | 98 | if (val == TextToSpeech.LANG_MISSING_DATA) return false; 99 | 100 | return true; 101 | } 102 | 103 | @Override 104 | public void onUtteranceCompleted(String utteranceId) 105 | { 106 | System.out.println("TTS Utterance Complete"); 107 | if (utteranceId.equals(activeText) ) 108 | { 109 | } 110 | } 111 | 112 | } --------------------------------------------------------------------------------