Added stdwx.cpp/.h, for use with Precompiled Headers. See comments on files on how to use them. Also fixed setup.h support for many files.
Originally committed to SVN as r595.
This commit is contained in:
parent
0accf7431d
commit
5c1d9b28c4
14 changed files with 177 additions and 35 deletions
|
@ -13,6 +13,10 @@ void BaseFloatImage_GaussEdgeDetect( float* Img, int sizx, int sizy, float sigma
|
|||
void BaseFloatImage_GaussSmooth( float* Img, int sizx, int sizy, float sigma, float* Out );
|
||||
void BaseFloatImage_LanczosRescale( float* in, int inSx, int inSy, float* out, int outSx, int outSy );
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) ((a)<(b))?(a):(b)
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
@ -72,7 +76,7 @@ FexImgPyramid::FexImgPyramid( float* Img, int SizX, int SizY, float EdgeDetectSi
|
|||
|
||||
if( Levels == -1 ) Levels = 999;
|
||||
int mLvl = 0;
|
||||
int tsm = min(SizX,SizY);
|
||||
int tsm = MIN(SizX,SizY);
|
||||
while( tsm>1 && tsm%2==0 )
|
||||
{
|
||||
tsm/=Subsampling;
|
||||
|
|
|
@ -4,6 +4,14 @@
|
|||
// FexTracker.cpp : Defines the entry point for the DLL application.
|
||||
//
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) ((a)<(b))?(a):(b)
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(a,b) ((a)>(b))?(a):(b)
|
||||
#endif
|
||||
|
||||
#include "StdAfx.h"
|
||||
#include "stdio.h"
|
||||
|
||||
|
@ -22,7 +30,7 @@ FexTracker::FexTracker( int sx, int sy, int inFeatures )
|
|||
|
||||
bDebug = 0;
|
||||
|
||||
float subsampling = float(Cfg.SearchRange) / min(Cfg.WindowX,Cfg.WindowY);
|
||||
float subsampling = float(Cfg.SearchRange) / float(MIN(Cfg.WindowX,Cfg.WindowY));
|
||||
|
||||
if (subsampling < 1.0) { /* 1.0 = 0+1 */
|
||||
PyramidMaxLevels = 1;
|
||||
|
@ -303,7 +311,7 @@ void FexTracker::FindFeatures( int minFeatures )
|
|||
|
||||
// Subtract 1 from the start time of all newly found features
|
||||
for( int j=oldN;j<nFeatures;j++ )
|
||||
lFeatures[j].StartTime = max(0,lFeatures[j].StartTime-1);
|
||||
lFeatures[j].StartTime = MAX(0,lFeatures[j].StartTime-1);
|
||||
|
||||
|
||||
delete []list;
|
||||
|
|
|
@ -33,10 +33,10 @@
|
|||
// Contact: mailto:zeratul@cellosoft.com
|
||||
//
|
||||
|
||||
#ifndef NO_SPELLCHECKER
|
||||
#include "setup.h"
|
||||
#if USE_ASPELL == 1
|
||||
|
||||
#ifndef ASPELL_WRAP_H_RKEY9023809128309182
|
||||
#define ASPELL_WRAP_H_RKEY9023809128309182
|
||||
#pragma once
|
||||
|
||||
//////////
|
||||
// Headers
|
||||
|
@ -65,4 +65,3 @@ extern AspellWrapper Aspell;
|
|||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -167,7 +167,7 @@ AudioProvider *AudioProvider::GetAudioProvider(wxString filename, AudioDisplay *
|
|||
AudioProvider *provider = NULL;
|
||||
|
||||
// Select provider
|
||||
#ifdef USE_LAVC
|
||||
#if USE_LAVC == 1
|
||||
if (!provider) provider = new LAVCAudioProvider(filename, vprovider);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -36,8 +36,9 @@
|
|||
|
||||
///////////
|
||||
// Headers
|
||||
#include "setup.h"
|
||||
#if USE_LAVC == 1
|
||||
#include <wx/wxprec.h>
|
||||
#ifdef USE_LAVC
|
||||
#include "utils.h"
|
||||
#include "audio_provider_lavc.h"
|
||||
#include "video_provider_lavc.h"
|
||||
|
|
|
@ -36,10 +36,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifndef AUDIO_PROVIDER_LAVC_H
|
||||
#define AUDIO_PROVIDER_LAVC_H
|
||||
|
||||
#ifdef USE_LAVC
|
||||
#include "setup.h"
|
||||
#if USE_LAVC == 1
|
||||
|
||||
#define EMULATE_INTTYPES
|
||||
#include "audio_provider.h"
|
||||
|
@ -67,5 +65,3 @@ public:
|
|||
|
||||
#endif /* USE_LAVC */
|
||||
|
||||
#endif /* AUDIO_PROVIDER_LAVC_H */
|
||||
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
//
|
||||
|
||||
|
||||
#ifndef NO_SPELLCHECKER
|
||||
#include "setup.h"
|
||||
#if USE_ASPELL == 1
|
||||
|
||||
#pragma once
|
||||
#include <wx/wxprec.h>
|
||||
|
|
|
@ -806,7 +806,7 @@ void FrameMain::OnOpenTranslation(wxCommandEvent& WXUNUSED(event)) {
|
|||
// Open Spell Checker
|
||||
void FrameMain::OnOpenSpellCheck (wxCommandEvent &event) {
|
||||
videoBox->videoDisplay->Stop();
|
||||
#ifndef NO_SPELLCHECKER
|
||||
#if USE_ASPELL == 1
|
||||
wxArrayInt selList = SubsBox->GetSelection();
|
||||
if (selList.GetCount() == 1){
|
||||
AssDialogue * a = SubsBox->GetDialogue(selList.Item(0));
|
||||
|
|
|
@ -34,11 +34,11 @@
|
|||
//
|
||||
|
||||
|
||||
#include "setup.h"
|
||||
#if USE_LAVC == 1
|
||||
#include <wx/wxprec.h>
|
||||
#include "lavc_file.h"
|
||||
|
||||
#ifdef USE_LAVC
|
||||
|
||||
LAVCFile::Initializer LAVCFile::init;
|
||||
|
||||
LAVCFile::Initializer::Initializer()
|
||||
|
|
|
@ -36,9 +36,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifndef LAVC_FILE_H
|
||||
#define LAVC_FILE_H
|
||||
#ifdef USE_LAVC
|
||||
#include "setup.h"
|
||||
#if USE_LAVC == 1
|
||||
|
||||
#define EMULATE_INTTYPES
|
||||
#include <wx/filename.h>
|
||||
|
@ -67,5 +66,3 @@ public:
|
|||
};
|
||||
|
||||
#endif /* USE_LAVC */
|
||||
#endif /* LAVC_FILE_H */
|
||||
|
||||
|
|
49
core/stdwx.cpp
Normal file
49
core/stdwx.cpp
Normal file
|
@ -0,0 +1,49 @@
|
|||
// Copyright (c) 2006, Rodrigo Braz Monteiro
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// * Neither the name of the Aegisub Group nor the names of its contributors
|
||||
// may be used to endorse or promote products derived from this software
|
||||
// without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
//
|
||||
// AEGISUB
|
||||
//
|
||||
// Website: http://aegisub.cellosoft.com
|
||||
// Contact: mailto:zeratul@cellosoft.com
|
||||
//
|
||||
|
||||
|
||||
//
|
||||
// Precompiled Header Source File
|
||||
//
|
||||
// In order to use it, set the project to use stdwx.h as precompiled header and
|
||||
// insert it in every source file (under C/C++ -> Advanced -> Force Includes),
|
||||
// then set this file to generate the precompiled header
|
||||
//
|
||||
// Note: make sure that you disable use of precompiled headers on md5.c and
|
||||
// MatroskaParser.c, as well as any possible future .c files.
|
||||
//
|
||||
|
||||
|
||||
#include "stdwx.h"
|
94
core/stdwx.h
Normal file
94
core/stdwx.h
Normal file
|
@ -0,0 +1,94 @@
|
|||
// Copyright (c) 2006, Rodrigo Braz Monteiro
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// * Neither the name of the Aegisub Group nor the names of its contributors
|
||||
// may be used to endorse or promote products derived from this software
|
||||
// without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
//
|
||||
// AEGISUB
|
||||
//
|
||||
// Website: http://aegisub.cellosoft.com
|
||||
// Contact: mailto:zeratul@cellosoft.com
|
||||
//
|
||||
|
||||
|
||||
//
|
||||
// Precompiled Header File
|
||||
//
|
||||
// In order to use it, set the project to use this header as precompiled and
|
||||
// insert it in every source file (under C/C++ -> Advanced -> Force Includes),
|
||||
// then set stdwx.cpp to generate the precompiled header
|
||||
//
|
||||
// Note: make sure that you disable use of precompiled headers on md5.c and
|
||||
// MatroskaParser.c, as well as any possible future .c files.
|
||||
//
|
||||
|
||||
|
||||
////////////
|
||||
// C++ only
|
||||
#ifdef __cplusplus
|
||||
|
||||
/////////
|
||||
// Setup
|
||||
#include "setup.h"
|
||||
|
||||
|
||||
/////////////////////
|
||||
// wxWidgets headers
|
||||
#include <wx/wxprec.h>
|
||||
#include <wx/notebook.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/tglbtn.h>
|
||||
#include <wx/tokenzr.h>
|
||||
#include <wx/wfstream.h>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/sashwin.h>
|
||||
#include <wx/file.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/grid.h>
|
||||
#include <wx/fontdlg.h>
|
||||
#include <wx/clipbrd.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/stackwalk.h>
|
||||
#include <wx/spinctrl.h>
|
||||
#include <wx/wfstream.h>
|
||||
#include <wx/tipdlg.h>
|
||||
|
||||
|
||||
///////////////
|
||||
// STD headers
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
||||
|
||||
///////////////////////
|
||||
// Optional components
|
||||
#if USE_DIRECTSOUND == 1
|
||||
#include <dsound.h>
|
||||
#endif
|
||||
|
||||
|
||||
#endif // C++
|
|
@ -36,7 +36,8 @@
|
|||
|
||||
///////////
|
||||
// Headers
|
||||
#ifdef USE_LAVC
|
||||
#include "setup.h"
|
||||
#if USE_LAVC == 1
|
||||
#include <wx/wxprec.h>
|
||||
#include <wx/image.h>
|
||||
#include <algorithm>
|
||||
|
|
|
@ -36,18 +36,10 @@
|
|||
#pragma once
|
||||
|
||||
|
||||
///////////////////////////////////
|
||||
// Auto-enable LAVC on non-windows
|
||||
#ifndef __WINDOWS__
|
||||
#ifndef USE_LAVC
|
||||
#define USE_LAVC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
///////////
|
||||
// Headers
|
||||
#ifdef USE_LAVC
|
||||
#include "setup.h"
|
||||
#if USE_LAVC == 1
|
||||
#define EMULATE_INTTYPES
|
||||
#include <ffmpeg/avcodec.h>
|
||||
#include <ffmpeg/avformat.h>
|
||||
|
|
Loading…
Reference in a new issue