public ReinhardToneMap(ImageFilmBase f, float pres = 1f, float poss = 1.2f, float b = 0.75f) : base(f) { this.PreScale = pres; this.PostScale = poss; this.Burn = b; }
public static IImageFilm CreateFilm(int width, int height, bool adaptive= false) { var imageFilm = adaptive ? (IImageFilm) new AdaptiveImageFilm(width, height) : new DefaultImageFilm(width, height); SamplerFactory.Instance.SetFilm(imageFilm); if (film == null) { film = (ImageFilmBase) imageFilm; } return imageFilm; }
public virtual void Initialize() { this.IntersectionDevice = new DadeCudaIntersectionDevice(Scene, null); //new MCOpenClIntersectionDevice(Scene, lowLatency, 0); this.engine = EngineFactory.CreateEngine(engineType, Scene, lowLatency); this.Film = (ImageFilmBase)engine.CreateFilm(width, height); var renderThreadsCount = Math.Min(engine.MaxThreadCount, this.RenderThreadsCount); this.RenderThreads = new RenderThread[renderThreadsCount]; int ht = height / renderThreadsCount; var samplingContext = new SamplingContext() { LightSampler = new LightSampler(Scene), SurfaceSampler = new SurfaceSampler(Scene) }; for (int i = 0; i < renderThreadsCount; i++) { var sampler = engine.CreateSampler(width, height, Scene.MaxPathDepth, i, ht*i, ht); samplingContext.PrimarySpaceSampler = sampler; RenderThreads[i] = engine.CreateRenderThread(i, IntersectionDevice, Scene, Film, new StillFrameManager(), samplingContext); } Tracer.TraceLine("Starting {0}", engineType); }
public LinearToneMap(ImageFilmBase f, float scale) : base(f) { Scale = scale; }
public QuadricToneMap(ImageFilmBase f) : base(f) { }
public ToneMapOperator(ImageFilmBase f) { imageFilmBase = f; }
public void Merge(ImageFilmBase b) { if (b.pixelData.Length != pixelData.Length) { throw new ArgumentException("Invalid film size"); } for (int index = 0; index < b.pixelData.Length; index++) { var pixelA = pixelData[index]; var pixelB = b.pixelData[index]; pixelData[index] = new SamplePixel() { Radiance = (pixelA.Radiance + pixelB.Radiance) * 0.5f, Weight = (pixelA.Weight + pixelB.Weight) * 0.5f, }; } }