public override void OnDraw(Graphics2D graphics2D) { ImageBuffer widgetsSubImage = ImageBuffer.NewSubImageReference(graphics2D.DestImage, graphics2D.GetClippingRect()); GammaLookUpTable gamma = new GammaLookUpTable(gammaSlider.Value); IRecieveBlenderByte NormalBlender = new BlenderBGRA(); IRecieveBlenderByte GammaBlender = new BlenderGammaBGRA(gamma); ImageBuffer rasterGamma = new ImageBuffer(); rasterGamma.Attach(widgetsSubImage, GammaBlender); ImageClippingProxy clippingProxyNormal = new ImageClippingProxy(widgetsSubImage); ImageClippingProxy clippingProxyGamma = new ImageClippingProxy(rasterGamma); clippingProxyNormal.clear(new ColorF(1, 1, 1)); ScanlineRasterizer rasterizer = new ScanlineRasterizer(); scanline_unpacked_8 sl = new scanline_unpacked_8(); int size_mul = (int)pixelSizeSlider.Value; renderer_enlarged ren_en = new renderer_enlarged(size_mul); rasterizer.reset(); rasterizer.move_to_d(m_x[0] / size_mul, m_y[0] / size_mul); rasterizer.line_to_d(m_x[1] / size_mul, m_y[1] / size_mul); rasterizer.line_to_d(m_x[2] / size_mul, m_y[2] / size_mul); ren_en.RenderSolid(clippingProxyGamma, rasterizer, sl, Color.Black); ScanlineRenderer scanlineRenderer = new ScanlineRenderer(); scanlineRenderer.RenderSolid(clippingProxyGamma, rasterizer, sl, Color.Black); rasterizer.gamma(new gamma_none()); VertexStorage ps = new VertexStorage(); Stroke pg = new Stroke(ps); pg.Width = 2; ps.remove_all(); ps.MoveTo(m_x[0], m_y[0]); ps.LineTo(m_x[1], m_y[1]); ps.LineTo(m_x[2], m_y[2]); ps.LineTo(m_x[0], m_y[0]); rasterizer.add_path(pg); scanlineRenderer.RenderSolid(clippingProxyNormal, rasterizer, sl, new Color(0, 150, 160, 200)); base.OnDraw(graphics2D); }
public override void OnDraw(Graphics2D graphics2D) { GammaLookUpTable gamma = new GammaLookUpTable(gammaSlider.Value); IRecieveBlenderByte NormalBlender = new BlenderBGR(); IRecieveBlenderByte GammaBlender = new BlenderGammaBGR(gamma); ImageBuffer rasterNormal = new ImageBuffer(); rasterNormal.Attach(graphics2D.DestImage, NormalBlender); ImageBuffer rasterGamma = new ImageBuffer(); rasterGamma.Attach(graphics2D.DestImage, GammaBlender); ImageClippingProxy clippingProxyNormal = new ImageClippingProxy(rasterNormal); ImageClippingProxy clippingProxyGamma = new ImageClippingProxy(rasterGamma); clippingProxyNormal.clear(new RGBA_Floats(1, 1, 1)); ScanlineRasterizer ras = new ScanlineRasterizer(); scanline_unpacked_8 sl = new scanline_unpacked_8(); int size_mul = (int)pixelSizeSlider.Value; renderer_enlarged ren_en = new renderer_enlarged(size_mul); StyledTypeFace type = new StyledTypeFace(LiberationSansFont.Instance, 12); IVertexSource character = type.GetGlyphForCharacter('E'); character.rewind(0); ras.reset(); ras.add_path(character); ren_en.RenderSolid(clippingProxyGamma, ras, sl, RGBA_Bytes.Black); ScanlineRenderer scanlineRenderer = new ScanlineRenderer(); scanlineRenderer.RenderSolid(clippingProxyGamma, ras, sl, RGBA_Bytes.Black); ras.gamma(new gamma_none()); PathStorage ps = new PathStorage(); Stroke pg = new Stroke(ps); pg.width(2); DrawBigA(graphics2D); base.OnDraw(graphics2D); }
public override void OnDraw(Graphics2D graphics2D) { ImageBuffer widgetsSubImage = ImageBuffer.NewSubImageReference(graphics2D.DestImage, graphics2D.GetClippingRect()); GammaLookUpTable gamma = new GammaLookUpTable(gammaSlider.Value); IRecieveBlenderByte NormalBlender = new BlenderBGRA(); IRecieveBlenderByte GammaBlender = new BlenderGammaBGRA(gamma); ImageBuffer rasterGamma = new ImageBuffer(); rasterGamma.Attach(widgetsSubImage, GammaBlender); ImageClippingProxy clippingProxyNormal = new ImageClippingProxy(widgetsSubImage); ImageClippingProxy clippingProxyGamma = new ImageClippingProxy(rasterGamma); clippingProxyNormal.clear(new RGBA_Floats(1, 1, 1)); ScanlineRasterizer rasterizer = new ScanlineRasterizer(); scanline_unpacked_8 sl = new scanline_unpacked_8(); int size_mul = (int)pixelSizeSlider.Value; renderer_enlarged ren_en = new renderer_enlarged(size_mul); rasterizer.reset(); rasterizer.move_to_d(m_x[0] / size_mul, m_y[0] / size_mul); rasterizer.line_to_d(m_x[1] / size_mul, m_y[1] / size_mul); rasterizer.line_to_d(m_x[2] / size_mul, m_y[2] / size_mul); ren_en.RenderSolid(clippingProxyGamma, rasterizer, sl, RGBA_Bytes.Black); ScanlineRenderer scanlineRenderer = new ScanlineRenderer(); scanlineRenderer.RenderSolid(clippingProxyGamma, rasterizer, sl, RGBA_Bytes.Black); rasterizer.gamma(new gamma_none()); PathStorage ps = new PathStorage(); Stroke pg = new Stroke(ps); pg.width(2); ps.remove_all(); ps.MoveTo(m_x[0], m_y[0]); ps.LineTo(m_x[1], m_y[1]); ps.LineTo(m_x[2], m_y[2]); ps.LineTo(m_x[0], m_y[0]); rasterizer.add_path(pg); scanlineRenderer.RenderSolid(clippingProxyNormal, rasterizer, sl, new RGBA_Bytes(0, 150, 160, 200)); base.OnDraw(graphics2D); }