예제 #1
0
        public override void OnDraw()
        {
#if SourceDepth24
            pixfmt_alpha_blend_rgb pf = new pixfmt_alpha_blend_rgb(rbuf_window(), new blender_bgr());
#else
            FormatRGBA pf = new FormatRGBA(rbuf_window(), new BlenderBGRA());
#endif
            FormatClippingProxy ren_base = new FormatClippingProxy(pf);
            ren_base.Clear(new RGBA_Doubles(1.0, 1.0, 1.0));

            ScanlineUnpacked8        sl  = new ScanlineUnpacked8();
            RasterizerScanlineAA <T> ras = new RasterizerScanlineAA <T>();
#if true
            render_gouraud(sl, ras);
#else
            agg.span_allocator span_alloc = new span_allocator();
            span_gouraud_rgba  span_gen   = new span_gouraud_rgba(new rgba8(255, 0, 0, 255), new rgba8(0, 255, 0, 255), new rgba8(0, 0, 255, 255), 320, 220, 100, 100, 200, 100, 0);
            span_gouraud       test_sg    = new span_gouraud(new rgba8(0, 0, 0, 255), new rgba8(0, 0, 0, 255), new rgba8(0, 0, 0, 255), 320, 220, 100, 100, 200, 100, 0);
            ras.add_path(test_sg);
            renderer_scanlines.render_scanlines_aa(ras, sl, ren_base, span_alloc, span_gen);
            //renderer_scanlines.render_scanlines_aa_solid(ras, sl, ren_base, new rgba8(0, 0, 0, 255));
#endif


            ras.Gamma(new GammaNone());
            m_dilation.SetTransform(trans_affine_resizing());
            //m_dilation.Render(ras, sl, ren_base);
            m_gamma.SetTransform(trans_affine_resizing());
            //m_gamma.Render(ras, sl, ren_base);
            m_alpha.SetTransform(trans_affine_resizing());
            //m_alpha.Render(ras, sl, ren_base);
            base.OnDraw();
        }
예제 #2
0
 public lion_application(PixelFormats format, ERenderOrigin RenderOrigin)
     : base(format, RenderOrigin)
 {
     m_AlphaSlider = new UI.SliderWidget <T>(M.New <T>(5), M.New <T>(5), M.New <T>(512 - 5), M.New <T>(12));
     parse_lion();
     AddChild(m_AlphaSlider);
     m_AlphaSlider.SetTransform(MatrixFactory <T> .NewIdentity(VectorDimension.Two));
     m_AlphaSlider.label("Alpha {0:F3}");
     m_AlphaSlider.value(M.New <T>(0.1));
 }
예제 #3
0
        public lion_outline_application(PixelFormats format, ERenderOrigin RenderOrigin)
            : base(format, RenderOrigin)
        {
            m_width_slider = new AGG.UI.SliderWidget <T>(5, 5, 150, 12);
            m_scanline     = new AGG.UI.cbox_ctrl <T>(160, 5, "Use Scanline Rasterizer");
            m_scanline.status(true);
            parse_lion();
            AddChild(m_width_slider);
            m_width_slider.SetTransform(MatrixFactory <T> .NewIdentity(VectorDimension.Two));
            m_width_slider.range(0.0, 4.0);
            m_width_slider.value(1.0);
            m_width_slider.label("Width {0:F2}");

            AddChild(m_scanline);
            m_scanline.SetTransform(MatrixFactory <T> .NewIdentity(VectorDimension.Two));
        }
예제 #4
0
        public alpha_mask2_application(PixelFormats format, ERenderOrigin RenderOrigin)
            : base(format, RenderOrigin)
        {
            m_alpha_mask_rbuf = new RasterBuffer();
#if USE_CLIPPING_ALPHA_MASK
            m_alpha_mask = new AlphaMaskByteClipped(m_alpha_mask_rbuf, 1, 0);
#else
            m_alpha_mask = new AlphaMaskByteUnclipped(m_alpha_mask_rbuf, 1, 0);
#endif

            m_num_cb       = new UI.SliderWidget <T>(5, 5, 150, 12);
            m_slider_value = M.Zero <T>();
            parse_lion();
            AddChild(m_num_cb);
            m_num_cb.range(5, 100);
            m_num_cb.value(10);
            m_num_cb.label("N={0:F3}");
            m_num_cb.SetTransform(MatrixFactory <T> .NewIdentity(VectorDimension.Two));
        }