Statistics
| Branch: | Revision:

root / rgbdslam / external / siftgpu / src / TestWin / BasicTestWin.h @ 9240aaa3

History | View | Annotate | Download (2.51 KB)

1
////////////////////////////////////////////////////////////////////////////
2
//        File:                BasicTestWin.h
3
//        Author:                Changchang Wu
4
//        Description :
5
//                BasicTestWin:        basic viewer of SiftGPU
6
//                                                both TestWinGlut and GLTestWndare derived from this
7
//                SiftDriver:                A simple driver of SiftGPU
8
//
9
//        Copyright (c) 2007 University of North Carolina at Chapel Hill
10
//        All Rights Reserved
11
//
12
//        Permission to use, copy, modify and distribute this software and its
13
//        documentation for educational, research and non-profit purposes, without
14
//        fee, and without a written agreement is hereby granted, provided that the
15
//        above copyright notice and the following paragraph appear in all copies.
16
//        
17
//        The University of North Carolina at Chapel Hill make no representations
18
//        about the suitability of this software for any purpose. It is provided
19
//        'as is' without express or implied warranty. 
20
//
21
//        Please send BUG REPORTS to ccwu@cs.unc.edu
22
//
23
////////////////////////////////////////////////////////////////////////////
24

    
25

    
26
#if !defined(BASIC_TEST_WIN_H)
27
#define BASIC_TEST_WIN_H
28

    
29
#if _WIN32 && _MSC_VER > 1000
30
#pragma once
31
#endif // _MSC_VER > 1000
32

    
33

    
34
#include "GLTransform.h"
35

    
36
class SiftParam;
37
class SiftGPUEX;
38

    
39
//////////////////////////////////////////////////////////////////////////
40
//class TestDriver
41
//description:        simple SiftGPU driver
42
/////////////////////////////////////////////////////////////////////////
43

    
44

    
45
//////////////////////////////////////////////////////////////////////////
46
//class BasicTestWin
47
//description:        basic SiftGPU viewer
48
//                                two implementations are GLTestWnd and TestWinGlut
49
///////////////////////////////////////////////////////////////////////////
50

    
51

    
52
class BasicTestWin
53
{
54
        GlTransform _transform;
55
        int  _looping;
56
        int  _motion;
57
        int  _motion_x, _motion_y;
58
        char  _title[512];
59
        int   _view;
60
        int          _sub_view;
61
        int   _win_w, _win_h;
62

    
63
protected:
64
        float        _displayScale;
65
        int        _imgWidth, _imgHeight;
66
        int _win_x, _win_y;
67
        int        _current;
68
private:
69
        //
70
        float _stat_tstart;
71
        int  _stat_frames;
72
protected:
73
        SiftGPUEX*                        _sift;
74
public:
75
        void SetVerbose();
76
        void FitWindow();
77
        void OnIdle();
78
        void EndMotion();
79
        void StartMotion(int x, int y);
80
        void SetView();
81
        void ReShape(int w, int h);
82
        void MoveMouse(int x, int y);
83
        void KeyInput(int key);
84
        void Display();
85
        virtual void UpdateDisplay()=0;
86
        BasicTestWin();
87
        virtual ~BasicTestWin();
88
        void ParseSiftParam(int argc, char** argv);
89
        void RunSiftGPU();
90
protected:
91
        virtual void SetWindowTitle(char * title)=0;
92
        virtual void SetDisplaySize(int w, int h)=0;
93
};
94

    
95
#endif // !defined(BASIC_TEST_WIN_H)
96