Skip to content

Commit 217eac7

Browse files
committed
2007-03-21
1 parent e107549 commit 217eac7

14 files changed

+1636
-890
lines changed

Avisynth/Makefile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Makefile for VC
2+
3+
4+
all: delogo.dll
5+
6+
7+
delogo.dll: delogo.obj delogo.res
8+
link /DLL /OUT:delogo.dll delogo.obj delogo.res
9+
10+
.cpp.obj:
11+
cl /c /O2 /EHsc /Fo$@ $<
12+
13+
.rc.res:
14+
rc $<
15+
16+
delogo.cpp: avisynth.h ../logo.h delogo.h yuy2.h yv12.h
17+
18+
19+
clean:
20+
del *.obj *.res *.lib *.exp
21+
22+

avisynth.h Avisynth/avisynth.h

File renamed without changes.

Avisynth/delogo.cpp

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
//
2+
// Copylight (C) 2003 MakKi
3+
//
4+
// AvisynthがGPLなので、このソフトもGPLにします。
5+
//
6+
// This program is free software; you can redistribute it and/or modify
7+
// it under the terms of the GNU General Public License as published by
8+
// the Free Software Foundation; either version 2 of the License, or
9+
// (at your option) any later version.
10+
//
11+
// This program is distributed in the hope that it will be useful,
12+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
// GNU General Public License for more details.
15+
//
16+
// You should have received a copy of the GNU General Public License
17+
// along with this program; if not, write to the Free Software
18+
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
19+
// http://www.gnu.org/copyleft/gpl.html .
20+
//
21+
//
22+
23+
#include <windows.h>
24+
#include <math.h>
25+
#include "avisynth.h"
26+
#include "../logo.h"
27+
#include "delogo.h"
28+
#include "yuy2.h"
29+
#include "yv12.h"
30+
31+
32+
/*****************************************************************************/
33+
/** フィルタ作成
34+
*/
35+
template <class TYPE>
36+
class deLOGO_Create {
37+
enum {
38+
LOGOFILE =1, LOGONAME,
39+
POS_X, POS_Y, DEPTH,
40+
YC_Y , YC_U , YC_V ,
41+
START, F_IN , F_OUT, END,
42+
INTERLACED,
43+
};
44+
45+
public:
46+
static AVSValue __cdecl Create(AVSValue args,void *user_data,IScriptEnvironment *env)
47+
{
48+
PClip clip(args[0].AsClip());
49+
const char *logofile = args[LOGOFILE].AsString(NULL);
50+
const char *logoname = args[LOGONAME].AsString(NULL);
51+
52+
int pos_x = args[POS_X].AsInt(0);
53+
int pos_y = args[POS_Y].AsInt(0);
54+
int depth = args[DEPTH].AsInt(LOGO_DEFAULT_DEPTH);
55+
int yc_y = args[YC_Y].AsInt(0);
56+
int yc_u = args[YC_U].AsInt(0);
57+
int yc_v = args[YC_V].AsInt(0);
58+
int start = args[START].AsInt(0);
59+
int fadein = args[F_IN].AsInt(0);
60+
int fadeout = args[F_OUT].AsInt(0);
61+
int end = args[END].AsInt(-1);
62+
bool interlaced = args[INTERLACED].AsBool(false);
63+
64+
const VideoInfo& vi = clip->GetVideoInfo();
65+
66+
if(vi.IsYUY2()){
67+
return new deLOGO<TYPE,YUY2>(clip,logofile,logoname,pos_x,pos_y,depth,yc_y,yc_u,yc_v,start,fadein,fadeout,end,env);
68+
}
69+
else if(vi.IsYV12()){
70+
if(interlaced){
71+
return new deLOGO<TYPE,YV12i>(clip,logofile,logoname,pos_x,pos_y,depth,yc_y,yc_u,yc_v,start,fadein,fadeout,end,env);
72+
}
73+
else{
74+
return new deLOGO<TYPE,YV12p>(clip,logofile,logoname,pos_x,pos_y,depth,yc_y,yc_u,yc_v,start,fadein,fadeout,end,env);
75+
}
76+
}
77+
else{
78+
env->ThrowError("%s : Supprot only YUY2 or YV12. - YUY2,YV12専用",Name());
79+
}
80+
81+
return NULL;
82+
}
83+
84+
static const char *Name(void){ return TYPE::Name(); };
85+
static const char *Params(void){
86+
return "c[logofile]s[logoname]s[pos_x]i[pos_y]i[depth]i[yc_y]i[yc_u]i[yc_v]i[start]i[fadein]i[fadeout]i[end]i[interlaced]b";
87+
}
88+
};
89+
90+
/*****************************************************************************/
91+
/** エクスポート関数
92+
*/
93+
extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit2(IScriptEnvironment* env)
94+
{
95+
typedef deLOGO_Create<Add> AddLOGO;
96+
typedef deLOGO_Create<Erase> EraseLOGO;
97+
98+
env->AddFunction(EraseLOGO::Name(),EraseLOGO::Params(),EraseLOGO::Create,0);
99+
env->AddFunction(AddLOGO::Name(),AddLOGO::Params(),AddLOGO::Create,0);
100+
101+
return "DeLOGO plugin";
102+
}
103+

0 commit comments

Comments
 (0)