public void addSample(ImageSample sample) { if (null == m_samples) m_samples = new List<ImageSample>(); m_samples.Add(sample); }
public FrameBuffer startSamplingRegion(Rectangle region) { m_pixelSampler.setParams(m_imgPlaneRect, m_scene); FrameBuffer frameBuffer = new FrameBuffer(region.Width, region.Height); Camera camera = m_scene.getCamera(); for (int y = 0; y < region.Height; ++y) { for (int x = 0; x < region.Width; ++x) { ImageSample sample = new ImageSample(); sample.x = x; sample.y = y; sample.color = m_pixelSampler.samplePixel(x, y, region, camera); frameBuffer.addSample(x, y, sample); }//x }//y return frameBuffer; }
public void addSample(int x, int y, ImageSample sample) { int offset = y * width + x; pixelBuffer[offset].addSample(sample); }