public void ConfigureWatermark_TopLeftP720() { VideoStandard videoStandard = VideoStandards.P720; Watermark watermark = Watermark.ConfigureNewWatermark(WatermarkPosition.TOP_LEFT, videoStandard); var expectedOffsetX = Sizes.WatermarkPadding / (double)videoStandard.Width; var expectedOffsetY = Sizes.WatermarkPadding / (double)videoStandard.Height; int expectedHeight = (int)(videoStandard.Height * Sizes.WatermarkHeightNormalization); Assert.AreEqual(expectedOffsetX, watermark.OffsetX); Assert.AreEqual(expectedOffsetY, watermark.OffsetY); Assert.AreEqual(expectedHeight, watermark.Image.Height); }
public void ConfigureWatermark_BottomRightP480() { int expectedHeight, expectedWidth; VideoStandard videoStandard = VideoStandards.P480; Watermark watermark = Watermark.ConfigureNewWatermark(WatermarkPosition.BOTTOM_RIGHT, videoStandard); expectedHeight = expectedWidth = (int)(videoStandard.Height * Sizes.WatermarkHeightNormalization); var expectedOffsetX = (videoStandard.Width - expectedWidth - Sizes.WatermarkPadding) / (double)videoStandard.Width; var expectedOffsetY = (videoStandard.Height - expectedHeight - Sizes.WatermarkPadding) / (double)videoStandard.Height; Assert.AreEqual(expectedOffsetX, watermark.OffsetX); Assert.AreEqual(expectedOffsetY, watermark.OffsetY); Assert.AreEqual(expectedHeight, watermark.Image.Height); }
protected virtual void OnButtonOkClicked(object sender, System.EventArgs e) { TreeIter iter; /* Get size info */ sizecombobox.GetActiveIter(out iter); encSettings.VideoStandard = (VideoStandard)stdStore.GetValue(iter, 1); /* Get encoding profile info */ formatcombobox.GetActiveIter(out iter); encSettings.EncodingProfile = (EncodingProfile)encStore.GetValue(iter, 1); /* Get quality info */ qualitycombobox.GetActiveIter(out iter); encSettings.EncodingQuality = (EncodingQuality)qualStore.GetValue(iter, 1); encSettings.OutputFile = mediafilechooser1.CurrentPath; encSettings.Framerate_n = App.Current.Config.FPS_N; encSettings.Framerate_d = App.Current.Config.FPS_D; encSettings.TitleSize = 20; encSettings.EnableAudio = audiocheckbutton.Active; encSettings.EnableTitle = descriptioncheckbutton.Active; if (watermarkcheckbutton.Active) { encSettings.Watermark = Watermark.ConfigureNewWatermark(WatermarkPosition.TOP_RIGHT, encSettings.VideoStandard, App.Current.Config.Watermark); } else { encSettings.Watermark = null; } if (!SplitFiles && String.IsNullOrEmpty(EncodingSettings.OutputFile)) { App.Current.Dialogs.WarningMessage(Catalog.GetString("Please, select a video file.")); } else if (SplitFiles && String.IsNullOrEmpty(OutputDir)) { App.Current.Dialogs.WarningMessage(Catalog.GetString("Please, select an output directory.")); } else { Respond(ResponseType.Ok); } }