1 /*M///////////////////////////////////////////////////////////////////////////////////////
3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
5 // By downloading, copying, installing or using the software you agree to this license.
6 // If you do not agree to this license, do not download, install,
7 // copy or use the software.
10 // Intel License Agreement
11 // For Open Source Computer Vision Library
13 // Copyright (C) 2000, Intel Corporation, all rights reserved.
14 // Third party copyrights are property of their respective owners.
16 // Redistribution and use in source and binary forms, with or without modification,
17 // are permitted provided that the following conditions are met:
19 // * Redistribution's of source code must retain the above copyright notice,
20 // this list of conditions and the following disclaimer.
22 // * Redistribution's in binary form must reproduce the above copyright notice,
23 // this list of conditions and the following disclaimer in the documentation
24 // and/or other materials provided with the distribution.
26 // * The name of Intel Corporation may not be used to endorse or promote products
27 // derived from this software without specific prior written permission.
29 // This software is provided by the copyright holders and contributors "as is" and
30 // any express or implied warranties, including, but not limited to, the implied
31 // warranties of merchantability and fitness for a particular purpose are disclaimed.
32 // In no event shall the Intel Corporation or contributors be liable for any direct,
33 // indirect, incidental, special, exemplary, or consequential damages
34 // (including, but not limited to, procurement of substitute goods or services;
35 // loss of use, data, or profits; or business interruption) however caused
36 // and on any theory of liability, whether in contract, strict liability,
37 // or tort (including negligence or otherwise) arising in any way out of
38 // the use of this software, even if advised of the possibility of such damage.
41 // CamShiftDemo.cpp : Defines the class behaviors for the application.
46 #include "CamShiftDemo.h"
49 #include "CamShiftDemoDoc.h"
50 #include "CamShiftDemoView.h"
55 static char THIS_FILE[] = __FILE__;
58 /////////////////////////////////////////////////////////////////////////////
61 BEGIN_MESSAGE_MAP(CCamShiftDemoApp, CWinApp)
62 //{{AFX_MSG_MAP(CCamShiftDemoApp)
63 ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
64 // NOTE - the ClassWizard will add and remove mapping macros here.
65 // DO NOT EDIT what you see in these blocks of generated code!
67 // Standard file based document commands
68 ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
69 ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
72 /////////////////////////////////////////////////////////////////////////////
73 // CCamShiftDemoApp construction
75 CCamShiftDemoApp::CCamShiftDemoApp()
77 // TODO: add construction code here,
78 // Place all significant initialization in InitInstance
81 /////////////////////////////////////////////////////////////////////////////
82 // The one and only CCamShiftDemoApp object
84 CCamShiftDemoApp theApp;
86 /////////////////////////////////////////////////////////////////////////////
87 // CCamShiftDemoApp initialization
89 BOOL CCamShiftDemoApp::InitInstance()
91 AfxEnableControlContainer();
93 // Standard initialization
94 // If you are not using these features and wish to reduce the size
95 // of your final executable, you should remove from the following
96 // the specific initialization routines you do not need.
99 Enable3dControls(); // Call this when using MFC in a shared DLL
101 Enable3dControlsStatic(); // Call this when linking to MFC statically
104 // Change the registry key under which our settings are stored.
105 // TODO: You should modify this string to be something appropriate
106 // such as the name of your company or organization.
107 SetRegistryKey(_T("Local AppWizard-Generated Applications"));
109 LoadStdProfileSettings(); // Load standard INI file options (including MRU)
111 // Register the application's document templates. Document templates
112 // serve as the connection between documents, frame windows and views.
114 CSingleDocTemplate* pDocTemplate;
115 pDocTemplate = new CSingleDocTemplate(
117 RUNTIME_CLASS(CCamShiftDemoDoc),
118 RUNTIME_CLASS(CMainFrame), // main SDI frame window
119 RUNTIME_CLASS(CCamShiftDemoView));
120 AddDocTemplate(pDocTemplate);
122 // Parse command line for standard shell commands, DDE, file open
123 CCommandLineInfo cmdInfo;
124 ParseCommandLine(cmdInfo);
126 // Dispatch commands specified on the command line
127 if (!ProcessShellCommand(cmdInfo))
130 // The one and only window has been initialized, so show and update it.
131 m_pMainWnd->ShowWindow(SW_SHOW);
132 m_pMainWnd->UpdateWindow();
138 /////////////////////////////////////////////////////////////////////////////
139 // CAboutDlg dialog used for App About
141 class CAboutDlg : public CDialog
147 //{{AFX_DATA(CAboutDlg)
148 enum { IDD = IDD_ABOUTBOX };
151 // ClassWizard generated virtual function overrides
152 //{{AFX_VIRTUAL(CAboutDlg)
154 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
159 //{{AFX_MSG(CAboutDlg)
160 // No message handlers
162 DECLARE_MESSAGE_MAP()
165 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
167 //{{AFX_DATA_INIT(CAboutDlg)
171 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
173 CDialog::DoDataExchange(pDX);
174 //{{AFX_DATA_MAP(CAboutDlg)
178 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
179 //{{AFX_MSG_MAP(CAboutDlg)
180 // No message handlers
184 // App command to run the dialog
185 void CCamShiftDemoApp::OnAppAbout()
191 /////////////////////////////////////////////////////////////////////////////
192 // CCamShiftDemoApp message handlers