Пример #1
0
        image_resample_application(PixelFormats format, ERenderOrigin RenderOrigin)
            : base(format, RenderOrigin)
        {
            m_gamma_lut  = new GammaLut(2.0);
            m_quad       = new AGG.UI.polygon_ctrl <T>(4, 5.0);
            m_trans_type = new AGG.UI.rbox_ctrl <T>(400, 5.0, 430 + 170.0, 100.0);
            m_gamma      = new AGG.UI.SliderWidget <T>(5.0, 5.0 + 15 * 0, 400 - 5, 10.0 + 15 * 0);
            m_blur       = new AGG.UI.SliderWidget <T>(5.0, 5.0 + 15 * 1, 400 - 5, 10.0 + 15 * 1);
            m_old_gamma  = M.New <T>(2);

            g_rasterizer = new RasterizerScanlineAA <T>();
            g_scanline   = new ScanlineUnpacked8();

            m_trans_type.text_size(7);
            m_trans_type.add_item("Affine No Resample");
            m_trans_type.add_item("Affine Resample");
            m_trans_type.add_item("Perspective No Resample LERP");
            m_trans_type.add_item("Perspective No Resample Exact");
            m_trans_type.add_item("Perspective Resample LERP");
            m_trans_type.add_item("Perspective Resample Exact");
            m_trans_type.cur_item(4);
            AddChild(m_trans_type);

            m_gamma.range(0.5, 3.0);
            m_gamma.value(2.0);
            m_gamma.label("Gamma={0:F3}");
            AddChild(m_gamma);

            m_blur.range(0.5, 5.0);
            m_blur.value(1.0);
            m_blur.label("Blur={0:F3}");
            AddChild(m_blur);
        }
Пример #2
0
        public rounded_rect_application(PixelFormats format, ERenderOrigin RenderOrigin)
            : base(format, RenderOrigin)
        {
            m_idx                   = (-1);
            m_radius                = new AGG.UI.SliderWidget <T>(10, 10, 600 - 10, 19);
            m_gamma                 = new AGG.UI.SliderWidget <T>(10, 10 + 20, 600 - 10, 19 + 20);
            m_offset                = new AGG.UI.SliderWidget <T>(10, 10 + 40, 600 - 10, 19 + 40);
            m_white_on_black        = new cbox_ctrl <T>(10, 10 + 60, "White on black");
            m_DrawAsOutlineCheckBox = new cbox_ctrl <T>(10 + 180, 10 + 60, "Fill Rounded Rect");

            m_x[0] = M.New <T>(100); m_y[0] = M.New <T>(100);
            m_x[1] = M.New <T>(500); m_y[1] = M.New <T>(350);
            AddChild(m_radius);
            AddChild(m_gamma);
            AddChild(m_offset);
            AddChild(m_white_on_black);
            AddChild(m_DrawAsOutlineCheckBox);
            m_gamma.label("gamma={0:F3}");
            m_gamma.range(0.0, 3.0);
            m_gamma.value(1.8);

            m_radius.label("radius={0:F3}");
            m_radius.range(0.0, 50.0);
            m_radius.value(25.0);

            m_offset.label("subpixel offset={0:F3}");
            m_offset.range(-2.0, 3.0);

            m_white_on_black.text_color(new RGBA_Bytes(127, 127, 127));
            m_white_on_black.inactive_color(new RGBA_Bytes(127, 127, 127));

            m_DrawAsOutlineCheckBox.text_color(new RGBA_Doubles(.5, .5, .5));
            m_DrawAsOutlineCheckBox.inactive_color(new RGBA_Bytes(127, 127, 127));
        }
Пример #3
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));
 }
Пример #4
0
 public component_rendering_application(PixelFormats format, ERenderOrigin RenderOrigin)
     : base(format, RenderOrigin)
 {
     m_alpha = new AGG.UI.SliderWidget <T>(5, 5, 320 - 5, 10 + 5);
     m_UseBlackBackground = new UI.cbox_ctrl <T>(5, 5 + 18, "Draw Black Background");
     m_alpha.label("Alpha={0:F0}");
     m_alpha.range(0, 255);
     m_alpha.value(255);
     AddChild(m_alpha);
     AddChild(m_UseBlackBackground);
     m_UseBlackBackground.text_color(new RGBA_Bytes(127, 127, 127));
 }
Пример #5
0
        image1_application(PixelFormats format, ERenderOrigin RenderOrigin)
            : base(format, RenderOrigin)
        {
            m_angle = new AGG.UI.SliderWidget <T>(5, 5, 300, 12);
            m_scale = new AGG.UI.SliderWidget <T>(5, 5 + 15, 300, 12 + 15);

            AddChild(m_angle);
            AddChild(m_scale);
            m_angle.label("Angle={0:F2}");
            m_scale.label("Scale={0:F2}");
            m_angle.range(-180.0, 180.0);
            m_angle.value(0.0);
            m_scale.range(0.1, 5.0);
            m_scale.value(1.0);
        }
Пример #6
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));
        }
Пример #7
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));
        }
Пример #8
0
        gouraud_application(PixelFormats format, ERenderOrigin RenderOrigin)
            : base(format, RenderOrigin)
        {
            m_idx      = (-1);
            m_dilation = new AGG.UI.SliderWidget <T>(5, 5, 400 - 5, 11);
            m_gamma    = new AGG.UI.SliderWidget <T>(5, 5 + 15, 400 - 5, 11 + 15);
            m_alpha    = new AGG.UI.SliderWidget <T>(5, 5 + 30, 400 - 5, 11 + 30);
            m_x[0]     = M.New <T>(57); m_y[0] = M.New <T>(60);
            m_x[1]     = M.New <T>(369); m_y[1] = M.New <T>(170);
            m_x[2]     = M.New <T>(143); m_y[2] = M.New <T>(310);

            AddChild(m_dilation);
            AddChild(m_gamma);
            AddChild(m_alpha);

            m_dilation.label("Dilation={0:F2}");
            m_gamma.label("Linear gamma={0:F2}");
            m_alpha.label("Opacity={0:F2}");

            m_dilation.value(0.175);
            m_gamma.value(0.809);
            m_alpha.value(1.0);
        }