예제 #1
0
            public void EachFrame(int frame, int frameNum, PictureData picture)
            {
                if (this.StartMargin != -1 && frame == this.StartMargin)
                {
                    this.Target = 0;
                }
                else if (this.EndMargin != -1 && frame == frameNum - this.EndMargin - this.FadeInOutSpan)
                {
                    this.Target = this.Max;
                }

                if (this.Level < this.Target)
                {
                    this.Level++;
                }
                else if (this.Target < this.Level)
                {
                    this.Level--;
                }

                if (0 < this.Level)
                {
                    picture.SetDrakness(this.Level * 1.0 / this.Max);
                }
            }
예제 #2
0
        public VideoData(PictureData mainPicture, int frameNum, string wDir)
        {
            if (mainPicture == null)
            {
                throw new Exception("mainPicture is null");
            }

            if (frameNum < 1 || IntTools.IMAX < frameNum)
            {
                throw new Exception("Bad frameNum: " + frameNum);
            }

            if (string.IsNullOrEmpty(wDir) || Directory.Exists(wDir) == false)
            {
                throw new Exception("Bad wDir: " + wDir);
            }

            this.MainPicture = mainPicture;
            this.FrameNum    = frameNum;
            this.WDir        = wDir;
        }