public override IEnumerable <Canvas2> GetImageSequence() { ShadowSpectraData ss = new ShadowSpectraData(); for (; ;) { this.Wave.SetWavPart(DoubleTools.ToInt((this.Frame * 1.0 / AudioPicMP4Props.FPS + AudioPicMP4Props.AUDIO_DELAY_SEC) * this.Wave.WavHz)); SpectrumGraph0001 sg = new SpectrumGraph0001(hz => this.Wave.GetSpectrum(hz)); ss.Projection(sg.Spectra); int w = sg.Spectra.Length * (BAR_WIDTH + BAR_INTERVAL) + BAR_INTERVAL; Canvas2 frameImg = new Canvas2(w, AudioPicMP4Props.VIDEO_H); PictureUtils.Fill(frameImg, Color.Transparent); this.DrawSpectra(frameImg, sg, ss); yield return(frameImg); } }
public override IEnumerable <Canvas2> GetImageSequence() { ShadowSpectraData ssL = new ShadowSpectraData(); ShadowSpectraData ssR = new ShadowSpectraData(); for (; ;) { this.Wave.SetWavPart(DoubleTools.ToInt((this.Frame * 1.0 / AudioPicMP4Props.FPS + AudioPicMP4Props.AUDIO_DELAY_SEC) * this.Wave.WavHz)); SpectrumGraph0001 sgL = new SpectrumGraph0001(hz => this.Wave.GetSpectrum_L(hz)) { R1 = 0.5, R2 = 0.5 }; SpectrumGraph0001 sgR = new SpectrumGraph0001(hz => this.Wave.GetSpectrum_R(hz)) { R1 = 0.5, R2 = 0.5 }; ssL.Projection(sgL.Spectra); ssR.Projection(sgR.Spectra); int w = sgL.Spectra.Length * (BAR_WIDTH + BAR_INTERVAL) + BAR_INTERVAL; Canvas2 frameImg_L = new Canvas2(w, AudioPicMP4Props.VIDEO_H); Canvas2 frameImg_R = new Canvas2(w, AudioPicMP4Props.VIDEO_H); PictureUtils.Fill(frameImg_L, Color.Transparent); PictureUtils.Fill(frameImg_R, Color.Transparent); this.DrawSpectra(frameImg_L, sgL, ssL, Color.FromArgb(255, 255, 200), false); this.DrawSpectra(frameImg_R, sgR, ssR, Color.FromArgb(200, 255, 255), true); Canvas2 frameImg = new Canvas2(w * 2, AudioPicMP4Props.VIDEO_H); PictureUtils.Paste(frameImg, frameImg_L, 0, 0, w, AudioPicMP4Props.VIDEO_H); PictureUtils.Paste(frameImg, frameImg_R, w, 0, w, AudioPicMP4Props.VIDEO_H); yield return(frameImg); } }