コード例 #1
0
DEdgeMask2::DEdgeMask2(PClip _child, PClip clip2, PClip clip3, const char * s, 
			              bool setDivisor, int div, int _X, int _Y, int _w, int _h,
                       int y, int u, int v, bool _mmx, bool _isse, IScriptEnvironment* env) :
BaseFilter(_child, _X, _Y, _w, _h, y, u, v, _mmx, _isse, env, "EdgeMask"), child2(clip2), child3(clip3)
{
   const VideoInfo& vi2 = child2->GetVideoInfo();
	const VideoInfo& vi3 = child3->GetVideoInfo();

   CheckFrameSize(vi, vi2, env);
   CheckFrameSize(vi, vi3, env);
   CheckColorSpace(vi, env);
   CheckColorSpace(vi2, env);
   CheckColorSpace(vi3, env);

   AnalyseString(s,array,env);

   BM_Fun = &DEdgeMask2::BuildMask;

	if ( setDivisor )
	{
		divisor = div;
	}
	else {
		divisor = 0;
		for ( int i = 0; i < 9; i++ )
		{
			divisor += (array[i] > 0) ? array[i] : 0;
		}
	}
}
コード例 #2
0
ファイル: ReadConfFile.c プロジェクト: waz525/HttpsServer
void ReadConfFile( char * FileName )
{
	char str[100];
	int i;
	char c ;
	FILE *fd ;

	fd=fopen(FileName,"r");
	c=fgetc(fd);
	i=0;
	q=(struct CFG_LINK *)malloc(sizeof(struct CFG_LINK));
	p=q;
	head=q;	
	while(c!=EOF)
	{
		if(c==' '||c=='\t')
		{
			c=fgetc(fd);
			continue ;
		}
		if(c=='\n')
		{
			str[i]='\0';
			AnalyseString(str);
			i=0;
			c=fgetc(fd);
			continue ;
		}
		str[i++]=c;
		c=fgetc(fd);
	}
	p->next=NULL;
	free(q);
	q=head;	
}