#ifndef MAIN_CODE_H_INCLUDED #define MAIN_CODE_H_INCLUDED #ifdef TARGET_ANDROID #include "android_api.h" #endif #ifdef TARGET_WIN32 #define NOMINMAX 1 #include #undef NOMINMAX #endif #include #include #include #include "boost/shared_ptr.hpp" #include "boost/thread/thread.hpp" #include "boost/assign.hpp" #include "boost/bind.hpp" #include "include/Engine.h" #include "boost/signals2.hpp"//Signal must be included after asio #include "../windows/DoubleHitBalls-win/DoubleHitBalls-win/FaceLandmarkDetector.h" #include "../windows/DoubleHitBalls-win/DoubleHitBalls-win/ValueSmoother.h" struct FaceStruct { SE::Vector2f center; SE::Vector2f size; std::array preds; std::vector modelPoints; cv::Mat rotationVector; cv::Mat translationVector; cv::Mat rotationMatrix; cv::Mat poseMatrix; cv::Mat eulerAngles; std::vector boxModelSrc; std::vector boxModelDst; ValueSmoother landmarkSmoothers[2 * LANDMARK_POINT_COUNT]; ValueSmoother rotationVectorSmoothers[3]; ValueSmoother translationVectorSmoothers[3]; FaceStruct(); FaceStruct(const std::array& fromPreds, cv::Mat& cameraMatrix, cv::Mat& distortionCoefficients); void CalcFromPreds(bool noticeablyChanged, cv::Mat& cameraMatrix, cv::Mat& distortionCoefficients); void ApplyPreds(const std::array& fromPred, bool noticeablyChanged, cv::Mat& cameraMatrix, cv::Mat& distortionCoefficientss); void InnerApplyPreds(const std::array& fromPreds); }; using namespace SE; extern const std::string CONST_LOADING_BACKGROUND_BLACK; class TMyApplication : public TApplication { protected: bool Inited; std::array faceRenderPair; public: TMyApplication() : TApplication(), Inited(false) { } virtual void InnerInit(); virtual void InnerDeinit(); virtual void InnerDraw(); virtual void InnerUpdate(size_t dt); bool IsInited(); virtual void InnerOnTapDown(Vector2f p); virtual void InnerOnTapUp(Vector2f p); virtual void InnerOnTapUpAfterMove(Vector2f p); virtual void InnerOnMove(Vector2f p, Vector2f shift); virtual void OnFling(Vector2f v); }; extern TMyApplication* Application; #endif