public NoiseField(DisplayOpenGL parent, IVisualizerFormat visualizer, Dictionary <string, object> config) { if (visualizer is not IContinuous1D) { Log.Error("NoiseField cannot be used with this visualizer, as it does not output 1D continuous data."); throw new InvalidOperationException("Incompatible visualizer. Must implement IContinuous1D."); } if (ColorChord.NoteFinder is not BaseNoteFinder) { throw new Exception("NoiseField currently only supports BaseNoteFinder."); } this.HostWindow = parent; this.DataSource = (IContinuous1D)visualizer; Configurer.Configure(this, config); }
public BlockMatrix(DisplayOpenGL parent, IVisualizerFormat visualizer) { if (visualizer is not IDiscrete2D) { Log.Error("BlockMatrix cannot use the provided visualizer, as it does not output 2D discrete data."); throw new InvalidOperationException("Incompatible visualizer. Must implement IDiscrete2D."); } this.HostWindow = parent; this.DataSource = (IDiscrete2D)visualizer; this.CountX = this.DataSource.GetWidth(); this.CountY = this.DataSource.GetHeight(); this.TextureData = new byte[CountX * CountY * 4]; this.NextTextureData = new byte[CountX * CountY * 4]; this.SetupDone = false; }
public bool SupportsFormat(IVisualizerFormat format) => format is IContinuous1D;
public bool SupportsFormat(IVisualizerFormat format) => format is IDiscrete1D;