Skip to content

Commit e107549

Browse files
committed
2004-02-11
1 parent c195f96 commit e107549

File tree

4 files changed

+48
-21
lines changed

4 files changed

+48
-21
lines changed

delogo.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ AVSValue __cdecl Create_EraseLOGO(AVSValue args, void *user_data, IScriptEnviron
5959
int pos_x = args[POS_X].AsInt(0);
6060
int pos_y = args[POS_Y].AsInt(0);
6161
int depth = args[DEPTH].AsInt(LOGO_DEFAULT_DEPTH);
62+
int yc_y = args[YC_Y].AsInt(0);
63+
int yc_u = args[YC_U].AsInt(0);
64+
int yc_v = args[YC_V].AsInt(0);
6265
int start = args[START].AsInt(0);
6366
int fadein = args[F_IN].AsInt(0);
6467
int fadeout = args[F_OUT].AsInt(0);
@@ -67,7 +70,7 @@ AVSValue __cdecl Create_EraseLOGO(AVSValue args, void *user_data, IScriptEnviron
6770
const VideoInfo& vi = clip->GetVideoInfo();
6871

6972
if(vi.IsYUY2())
70-
return new EraseLOGO_YUY2(clip,logofile,logoname,pos_x,pos_y,depth,start,fadein,fadeout,end,env);
73+
return new EraseLOGO_YUY2(clip,logofile,logoname,pos_x,pos_y,depth,yc_y,yc_u,yc_v,start,fadein,fadeout,end,env);
7174
else
7275
env->ThrowError("ErazeLOGO : YUY2専用");
7376

@@ -85,6 +88,9 @@ AVSValue __cdecl Create_AddLOGO(AVSValue args, void *user_data, IScriptEnvironme
8588
int pos_x = args[POS_X].AsInt(0);
8689
int pos_y = args[POS_Y].AsInt(0);
8790
int depth = args[DEPTH].AsInt(LOGO_DEFAULT_DEPTH);
91+
int yc_y = args[YC_Y].AsInt(0);
92+
int yc_u = args[YC_U].AsInt(0);
93+
int yc_v = args[YC_V].AsInt(0);
8894
int start = args[START].AsInt(0);
8995
int fadein = args[F_IN].AsInt(0);
9096
int fadeout = args[F_OUT].AsInt(0);
@@ -93,7 +99,7 @@ AVSValue __cdecl Create_AddLOGO(AVSValue args, void *user_data, IScriptEnvironme
9399
const VideoInfo& vi = clip->GetVideoInfo();
94100

95101
if(vi.IsYUY2())
96-
return new AddLOGO_YUY2(clip,logofile,logoname,pos_x,pos_y,depth,start,fadein,fadeout,end,env);
102+
return new AddLOGO_YUY2(clip,logofile,logoname,pos_x,pos_y,depth,yc_y,yc_u,yc_v,start,fadein,fadeout,end,env);
97103
else
98104
env->ThrowError("AddLOGO : YUY2専用");
99105

delogo.h

+26-9
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,16 @@ extern AVSValue __cdecl Create_AddLOGO(AVSValue args, void *user_data, IScriptEn
3939

4040
inline void Init_EraseLOGO(IScriptEnvironment* env)
4141
{
42-
env->AddFunction("EraseLOGO","c[logofile]s[logoname]s[pos_x]i[pos_y]i[depth]i[start]i[fadein]i[fadeout]i[end]i",Create_EraseLOGO, 0);
42+
env->AddFunction("EraseLOGO","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",Create_EraseLOGO, 0);
4343
}
4444
inline void Init_AddLOGO(IScriptEnvironment* env)
4545
{
46-
env->AddFunction("AddLOGO","c[logofile]s[logoname]s[pos_x]i[pos_y]i[depth]i[start]i[fadein]i[fadeout]i[end]i",Create_AddLOGO, 0);
46+
env->AddFunction("AddLOGO","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",Create_AddLOGO, 0);
4747
}
4848
enum {
4949
LOGOFILE =1, LOGONAME,
5050
POS_X, POS_Y, DEPTH,
51+
YC_Y , YC_U , YC_V ,
5152
START, F_IN , F_OUT, END
5253
};
5354

@@ -64,7 +65,7 @@ class deLOGO_Base : public GenericVideoFilter {
6465
LOGO_HEADER* lgh;
6566

6667
deLOGO_Base(const PClip& clip,const char* logofile,const char* logoname,int pos_x,int pos_y,
67-
int depth,int start,int fadein,int fadeout,int end, IScriptEnvironment *env,const char* filtername) : GenericVideoFilter(clip)
68+
int depth,int y,int u,int v,int start,int fadein,int fadeout,int end, IScriptEnvironment *env,const char* filtername) : GenericVideoFilter(clip)
6869
{
6970
const VideoInfo& vi = clip->GetVideoInfo();
7071

@@ -80,13 +81,29 @@ class deLOGO_Base : public GenericVideoFilter {
8081
ReadLogoData(logofile,logoname);
8182
if(pos_x!=0 || pos_y!=0 || depth!=LOGO_DEFAULT_DEPTH)
8283
AdjustLogo(pos_x,pos_y,depth);
84+
if(y!=0 || u!=0 || v!= 0)
85+
ColorTuning(y*16,u*16,v*16);
8386
}
8487
catch(char* err){
8588
env->ThrowError("%s: %s",filtername,err);
8689
}
8790
}
8891
void ReadLogoData(const char* logofile,const char* logoname);
89-
void AdjustLogo(int x,int y,int depth); // AviUtlオリジナルの色空間
92+
void AdjustLogo(int x,int y,int depth); // AviUtlオリジナル色空間のまま
93+
void ColorTuning(int y,int u,int v) // 色調整
94+
{
95+
int i,j;
96+
LOGO_PIXEL* lgp = (LOGO_PIXEL*)(lgh +1);
97+
98+
for(i=lgh->h;i;--i){
99+
for(j=lgh->w;j;--j){
100+
lgp->y += y;
101+
lgp->cb += u;
102+
lgp->cr += v;
103+
++lgp;
104+
}
105+
}
106+
}
90107
void Logo_YUY2();
91108
void Logo_YV420(){};
92109

@@ -112,7 +129,7 @@ class deLOGO_Base : public GenericVideoFilter {
112129
int Clamp(int n, int l, int h)
113130
{ return (n < l) ? l : (n > h) ? h : n; }
114131

115-
// ITU-R TB.601に沿ってAviUtlのYCから変換
132+
// ITU-R TB.601に合うようにAviUtlのYCを圧縮
116133
int TB601_Y(int y)
117134
{ return ((y +(16<<4)) * 220 +128)/ 256; }
118135
int TB601_C(int c)
@@ -130,8 +147,8 @@ class EraseLOGO_YUY2 : public deLOGO_Base {
130147

131148
public:
132149
EraseLOGO_YUY2(const PClip& clip,const char* logofile,const char* logoname,
133-
int pos_x,int pos_y,int depth,int start,int fadein,int fadeout,int end,IScriptEnvironment *env)
134-
: deLOGO_Base(clip,logofile,logoname,pos_x,pos_y,depth,start,fadein,fadeout,end,env,GetName())
150+
int pos_x,int pos_y,int depth,int y,int u,int v,int start,int fadein,int fadeout,int end,IScriptEnvironment *env)
151+
: deLOGO_Base(clip,logofile,logoname,pos_x,pos_y,depth,y,u,v,start,fadein,fadeout,end,env,GetName())
135152
{ Logo_YUY2(); }
136153

137154
static const char* GetName(){ return "EraseLOGO"; }
@@ -147,8 +164,8 @@ class AddLOGO_YUY2 : public deLOGO_Base {
147164

148165
public:
149166
AddLOGO_YUY2(const PClip& clip,const char* logofile,const char* logoname,
150-
int pos_x,int pos_y,int depth,int start,int fadein,int fadeout,int end,IScriptEnvironment *env)
151-
: deLOGO_Base(clip,logofile,logoname,pos_x,pos_y,depth,start,fadein,fadeout,end,env,GetName())
167+
int pos_x,int pos_y,int depth,int y,int u,int v,int start,int fadein,int fadeout,int end,IScriptEnvironment *env)
168+
: deLOGO_Base(clip,logofile,logoname,pos_x,pos_y,depth,y,u,v,start,fadein,fadeout,end,env,GetName())
152169
{ Logo_YUY2(); }
153170

154171
static const char* GetName(){ return "AddLOGO"; }

delogo.rc

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
2828
//
2929

3030
VS_VERSION_INFO VERSIONINFO
31-
FILEVERSION 0,0,1,4
31+
FILEVERSION 0,0,2,0
3232
PRODUCTVERSION 0,0,1,0
3333
FILEFLAGSMASK 0x3fL
3434
#ifdef _DEBUG
@@ -46,12 +46,12 @@ BEGIN
4646
BEGIN
4747
VALUE "Comments", "YUY2��p\0"
4848
VALUE "FileDescription", "���ߐ����S �t�B���^ Plugin for AviSynth 2.5\0"
49-
VALUE "FileVersion", "0.0.1.4\0"
49+
VALUE "FileVersion", "0.0.2.0\0"
5050
VALUE "InternalName", "deLogo\0"
5151
VALUE "LegalCopyright", "(C) MakKi\0"
5252
VALUE "OriginalFilename", "delogo.dll\0"
5353
VALUE "ProductName", "���ߐ����S �t�B���^\0"
54-
VALUE "ProductVersion", "0.01d\0"
54+
VALUE "ProductVersion", "0.02\0"
5555
END
5656
END
5757
BLOCK "VarFileInfo"

readme.txt

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-----------------------------------------------------------------------
2-
���ߐ����S �t�B���^ for AviSynth 2.5 ver 0.01d by MakKi
2+
���ߐ����S �t�B���^ for AviSynth 2.5 ver 0.02 by MakKi
33
-----------------------------------------------------------------------
44

55
�y�@�\�z
@@ -11,18 +11,21 @@
1111
�E���S�t��
1212
AddLOGO(logofile="", logoname="",
1313
pos_x=0, pos_y=0, depth=128,
14+
yc_y=0, yc_u=0, yc_v=0,
1415
start=0, fadein=0, fadeout=0, end=-1)
1516
�E���S����
1617
EraseLOGO(logofile="", logoname="",
1718
pos_x=0, pos_y=0, depth=128,
19+
yc_y=0, yc_u=0, yc_v=0,
1820
start=0, fadein=0, fadeout=0, end=-1)
1921

20-
logofile : ���S�t�@�C�����i�ȗ��s�j *.ldp�A*.lgd�̂ǂ�����g�p�ł��܂��B
21-
logoname : ���S�� �i�ȗ��j �ȗ������ꍇ�̓��S�f�[�^�t�@�C���̐擪�ɕۑ�����Ă��郍�S���g�p���܂��B
22-
pos_x, pox_y : �ʒu���� 1/4�s�N�Z���P�ʂɒ������܂��B
23-
depth : �s�����x�i�[�x�j���� 128��100%�Ƃ��Ē������܂��B
24-
start, end : �J�n��I���t���[�� �t���[���ԍ��Ŏw�肵�Ă��������Bend<start�̎���start�ȍ~�̑S�Ẵt���[���Ŏ��s����܂��B
25-
fadein, fadeout : �t�F�[�h�t���[���� ���S���t�F�[�h�����܂��B
22+
logofile : ���S�t�@�C�����i�ȗ��s�j *.ldp�A*.lgd�̂ǂ�����g�p�ł��܂��B
23+
logoname : ���S�� �i�ȗ��j �ȗ������ꍇ�̓��S�f�[�^�t�@�C���̐擪�ɕۑ�����Ă��郍�S���g�p���܂��B
24+
pos_x, pox_y : �ʒu���� 1/4�s�N�Z���P�ʂɒ������܂��B
25+
yc_y, yc_u, yc_v : �F���� ���S�̐F�𒲐����܂��B
26+
depth : �s�����x�i�[�x�j���� 128��100%�Ƃ��Ē������܂��B
27+
start, end : �J�n��I���t���[�� �t���[���ԍ��Ŏw�肵�Ă��������Bend<start�̎���start�ȍ~�̑S�Ẵt���[���Ŏ��s����܂��B
28+
fadein, fadeout : �t�F�[�h�t���[���� ���S���t�F�[�h�����܂��B
2629

2730
start, end �ȊO�̃p�����[�^��AviUtl�p���ߐ����S�t�B���^�̃p�����[�^�Ƌ��ʂł��B
2831
���S�f�[�^�̍쐬�ɂ�AviUtl�p���S��̓v���O�C�����g�p���Ă��������B
@@ -60,6 +63,7 @@
6063

6164
�y�X�V�����z
6265

66+
2004/02/11 ver 0.02 �E���S�̐F�̒����@�\��lj�
6367
2003/11/05 ver 0.01d �E�ׂ��ȃo�O�C��
6468
2003/11/02 ver 0.01c �Epos_x,pos_y�̋������������������̂��C��
6569
�ECrop���Ă��鎞���S�������o�O�C��

0 commit comments

Comments
 (0)