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);
        }
Exemple #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));
        }
Exemple #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));
 }
Exemple #4
0
        // format - see enum pix_format_e {};
        // flip_y - true if you want to have the Y-axis flipped vertically.
        public PlatformSupportAbstract(PixelFormats format, ERenderOrigin RenderOrigin)
        {
            m_format         = format;
            m_bpp            = GetBitDepthForPixelFormat(format);
            m_RenderOrigin   = RenderOrigin;
            m_initial_width  = 10;
            m_initial_height = 10;
            m_resize_mtx     = MatrixFactory <T> .NewIdentity(VectorDimension.Two);

            m_rbuf_img = new List <RasterBuffer>();
        }
 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));
 }
Exemple #6
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);
        }
        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));
        }
Exemple #8
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));
        }
Exemple #9
0
        //typedef agg.renderer_base<pixfmt> renderer_base;
        //typedef agg.renderer_scanline_aa_solid<renderer_base> renderer_solid;

        public perspective_application(PixelFormats format, ERenderOrigin RenderOrigin)
            : base(format, RenderOrigin)
        {
            parse_lion();

            m_quad       = new AGG.UI.polygon_ctrl <T>(4, 5.0);
            m_trans_type = new AGG.UI.rbox_ctrl <T>(420, 5.0, 420 + 130.0, 55.0);
            m_quad.SetXN(0, g_x1);
            m_quad.SetYN(0, g_y1);
            m_quad.SetXN(1, g_x2);
            m_quad.SetYN(1, g_y1);
            m_quad.SetXN(2, g_x2);
            m_quad.SetYN(2, g_y2);
            m_quad.SetXN(3, g_x1);
            m_quad.SetYN(3, g_y2);

            m_trans_type.add_item("Bilinear");
            m_trans_type.add_item("Perspective");
            m_trans_type.cur_item(0);
            AddChild(m_trans_type);
        }
Exemple #10
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);
        }
Exemple #11
0
        /*
         * public virtual ~gradients_application()
         * {
         *  FILE* fd = fopen(full_file_name("settings.dat"), "w");
         *  fprintf(fd, "%f\n", m_center_x);
         *  fprintf(fd, "%f\n", m_center_y);
         *  fprintf(fd, "%f\n", m_scale);
         *  fprintf(fd, "%f\n", m_angle);
         *  fprintf(fd, "%f\n", m_spline_r.x(0));
         *  fprintf(fd, "%f\n", m_spline_r.y(0));
         *  fprintf(fd, "%f\n", m_spline_r.x(1));
         *  fprintf(fd, "%f\n", m_spline_r.y(1));
         *  fprintf(fd, "%f\n", m_spline_r.x(2));
         *  fprintf(fd, "%f\n", m_spline_r.y(2));
         *  fprintf(fd, "%f\n", m_spline_r.x(3));
         *  fprintf(fd, "%f\n", m_spline_r.y(3));
         *  fprintf(fd, "%f\n", m_spline_r.x(4));
         *  fprintf(fd, "%f\n", m_spline_r.y(4));
         *  fprintf(fd, "%f\n", m_spline_r.x(5));
         *  fprintf(fd, "%f\n", m_spline_r.y(5));
         *  fprintf(fd, "%f\n", m_spline_g.x(0));
         *  fprintf(fd, "%f\n", m_spline_g.y(0));
         *  fprintf(fd, "%f\n", m_spline_g.x(1));
         *  fprintf(fd, "%f\n", m_spline_g.y(1));
         *  fprintf(fd, "%f\n", m_spline_g.x(2));
         *  fprintf(fd, "%f\n", m_spline_g.y(2));
         *  fprintf(fd, "%f\n", m_spline_g.x(3));
         *  fprintf(fd, "%f\n", m_spline_g.y(3));
         *  fprintf(fd, "%f\n", m_spline_g.x(4));
         *  fprintf(fd, "%f\n", m_spline_g.y(4));
         *  fprintf(fd, "%f\n", m_spline_g.x(5));
         *  fprintf(fd, "%f\n", m_spline_g.y(5));
         *  fprintf(fd, "%f\n", m_spline_b.x(0));
         *  fprintf(fd, "%f\n", m_spline_b.y(0));
         *  fprintf(fd, "%f\n", m_spline_b.x(1));
         *  fprintf(fd, "%f\n", m_spline_b.y(1));
         *  fprintf(fd, "%f\n", m_spline_b.x(2));
         *  fprintf(fd, "%f\n", m_spline_b.y(2));
         *  fprintf(fd, "%f\n", m_spline_b.x(3));
         *  fprintf(fd, "%f\n", m_spline_b.y(3));
         *  fprintf(fd, "%f\n", m_spline_b.x(4));
         *  fprintf(fd, "%f\n", m_spline_b.y(4));
         *  fprintf(fd, "%f\n", m_spline_b.x(5));
         *  fprintf(fd, "%f\n", m_spline_b.y(5));
         *  fprintf(fd, "%f\n", m_spline_a.x(0));
         *  fprintf(fd, "%f\n", m_spline_a.y(0));
         *  fprintf(fd, "%f\n", m_spline_a.x(1));
         *  fprintf(fd, "%f\n", m_spline_a.y(1));
         *  fprintf(fd, "%f\n", m_spline_a.x(2));
         *  fprintf(fd, "%f\n", m_spline_a.y(2));
         *  fprintf(fd, "%f\n", m_spline_a.x(3));
         *  fprintf(fd, "%f\n", m_spline_a.y(3));
         *  fprintf(fd, "%f\n", m_spline_a.x(4));
         *  fprintf(fd, "%f\n", m_spline_a.y(4));
         *  fprintf(fd, "%f\n", m_spline_a.x(5));
         *  fprintf(fd, "%f\n", m_spline_a.y(5));
         *  double x1,y1,x2,y2;
         *  m_profile.values(&x1, &y1, &x2, &y2);
         *  fprintf(fd, "%f\n", x1);
         *  fprintf(fd, "%f\n", y1);
         *  fprintf(fd, "%f\n", x2);
         *  fprintf(fd, "%f\n", y2);
         *  fclose(fd);
         * }
         */

        GradientsApplication(PixelFormats format, ERenderOrigin RenderOrigin)
            : base(format, RenderOrigin)
        {
            m_profile      = new gamma_ctrl <T>(10.0, 10.0, 200.0, 170.0 - 5.0);
            m_spline_r     = new spline_ctrl <T>(210, 10, 210 + 250, 5 + 40, 6);
            m_spline_g     = new spline_ctrl <T>(210, 10 + 40, 210 + 250, 5 + 80, 6);
            m_spline_b     = new spline_ctrl <T>(210, 10 + 80, 210 + 250, 5 + 120, 6);
            m_spline_a     = new spline_ctrl <T>(210, 10 + 120, 210 + 250, 5 + 160, 6);
            m_GradTypeRBox = new AGG.UI.rbox_ctrl <T>(10.0, 180.0, 200.0, 300.0);
            m_GradWrapRBox = new rbox_ctrl <T>(10, 310, 200, 375);

            m_pdx = (M.Zero <T>());
            m_pdy = M.Zero <T>();
            m_SaveData.m_center_x = (center_x);
            m_SaveData.m_center_y = (center_y);
            m_SaveData.m_scale    = M.One <T>();
            m_prev_scale          = M.One <T>();
            m_SaveData.m_angle    = M.Zero <T>();
            m_prev_angle          = M.Zero <T>();
            m_scale_x             = M.One <T>();
            m_prev_scale_x        = M.One <T>();
            m_scale_y             = M.One <T>();
            m_prev_scale_y        = M.One <T>();
            m_mouse_move          = (false);


            AddChild(m_profile);
            AddChild(m_spline_r);
            AddChild(m_spline_g);
            AddChild(m_spline_b);
            AddChild(m_spline_a);
            AddChild(m_GradTypeRBox);
            AddChild(m_GradWrapRBox);

            m_profile.border_width(2.0, 2.0);

            m_spline_r.background_color(new RGBA_Bytes(1.0, 0.8, 0.8));
            m_spline_g.background_color(new RGBA_Bytes(0.8, 1.0, 0.8));
            m_spline_b.background_color(new RGBA_Bytes(0.8, 0.8, 1.0));
            m_spline_a.background_color(new RGBA_Bytes(1.0, 1.0, 1.0));

            m_spline_r.border_width(1.0, 2.0);
            m_spline_g.border_width(1.0, 2.0);
            m_spline_b.border_width(1.0, 2.0);
            m_spline_a.border_width(1.0, 2.0);
            m_GradTypeRBox.border_width(2.0, 2.0);
            m_GradWrapRBox.border_width(2.0, 2.0);

            m_spline_r.point(0, 0.0, 1.0);
            m_spline_r.point(1, 1.0 / 5.0, 1.0 - 1.0 / 5.0);
            m_spline_r.point(2, 2.0 / 5.0, 1.0 - 2.0 / 5.0);
            m_spline_r.point(3, 3.0 / 5.0, 1.0 - 3.0 / 5.0);
            m_spline_r.point(4, 4.0 / 5.0, 1.0 - 4.0 / 5.0);
            m_spline_r.point(5, 1.0, 0.0);
            m_spline_r.update_spline();

            m_spline_g.point(0, 0.0, 1.0);
            m_spline_g.point(1, 1.0 / 5.0, 1.0 - 1.0 / 5.0);
            m_spline_g.point(2, 2.0 / 5.0, 1.0 - 2.0 / 5.0);
            m_spline_g.point(3, 3.0 / 5.0, 1.0 - 3.0 / 5.0);
            m_spline_g.point(4, 4.0 / 5.0, 1.0 - 4.0 / 5.0);
            m_spline_g.point(5, 1.0, 0.0);
            m_spline_g.update_spline();

            m_spline_b.point(0, 0.0, 1.0);
            m_spline_b.point(1, 1.0 / 5.0, 1.0 - 1.0 / 5.0);
            m_spline_b.point(2, 2.0 / 5.0, 1.0 - 2.0 / 5.0);
            m_spline_b.point(3, 3.0 / 5.0, 1.0 - 3.0 / 5.0);
            m_spline_b.point(4, 4.0 / 5.0, 1.0 - 4.0 / 5.0);
            m_spline_b.point(5, 1.0, 0.0);
            m_spline_b.update_spline();

            m_spline_a.point(0, 0.0, 1.0);
            m_spline_a.point(1, 1.0 / 5.0, 1.0);
            m_spline_a.point(2, 2.0 / 5.0, 1.0);
            m_spline_a.point(3, 3.0 / 5.0, 1.0);
            m_spline_a.point(4, 4.0 / 5.0, 1.0);
            m_spline_a.point(5, 1.0, 1.0);
            m_spline_a.update_spline();

            m_GradTypeRBox.add_item("Circular");
            m_GradTypeRBox.add_item("Diamond");
            m_GradTypeRBox.add_item("Linear");
            m_GradTypeRBox.add_item("XY");
            m_GradTypeRBox.add_item("sqrt(XY)");
            m_GradTypeRBox.add_item("Conic");
            m_GradTypeRBox.cur_item(0);

            m_GradWrapRBox.add_item("Reflect");
            m_GradWrapRBox.add_item("Repeat");
            m_GradWrapRBox.add_item("Clamp");
            m_GradWrapRBox.cur_item(0);

            /*
             * FILE* fd = fopen(full_file_name("settings.dat"), "r");
             * if(fd)
             * {
             *  float x;
             *  float y;
             *  float x2;
             *  float y2;
             *  float t;
             *
             *  fscanf(fd, "%f\n", &t); m_center_x = t;
             *  fscanf(fd, "%f\n", &t); m_center_y = t;
             *  fscanf(fd, "%f\n", &t); m_scale = t;
             *  fscanf(fd, "%f\n", &t); m_angle = t;
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_r.point(0, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_r.point(1, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_r.point(2, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_r.point(3, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_r.point(4, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_r.point(5, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_g.point(0, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_g.point(1, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_g.point(2, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_g.point(3, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_g.point(4, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_g.point(5, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_b.point(0, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_b.point(1, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_b.point(2, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_b.point(3, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_b.point(4, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_b.point(5, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_a.point(0, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_a.point(1, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_a.point(2, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_a.point(3, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_a.point(4, x, y);
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y); m_spline_a.point(5, x, y);
             *  m_spline_r.update_spline();
             *  m_spline_g.update_spline();
             *  m_spline_b.update_spline();
             *  m_spline_a.update_spline();
             *  fscanf(fd, "%f\n", &x);
             *  fscanf(fd, "%f\n", &y);
             *  fscanf(fd, "%f\n", &x2);
             *  fscanf(fd, "%f\n", &y2);
             *  m_profile.values(x, y, x2, y2);
             *  fclose(fd);
             * }
             */
        }
        image_filters_application(PixelFormats format, ERenderOrigin RenderOrigin)
            : base(format, RenderOrigin)
        {
            m_step      = new SliderWidget <T>(115, 5, 400, 11);
            m_radius    = new SliderWidget <T>(115, 5 + 15, 400, 11 + 15);
            m_filters   = new rbox_ctrl <T>(0.0, 0.0, 110.0, 210.0);
            m_normalize = new cbox_ctrl <T>(8.0, 215.0, "Normalize Filter");

            m_refresh              = new ButtonWidget <T>(8.0, 273.0, "Refresh", 8, 1, 1, 3);
            m_refresh.ButtonClick += RefreshImage;
            m_run                      = new ButtonWidget <T>(8.0, 253.0, "RUN Test!", 8, 1, 1, 3);
            m_run.ButtonClick         += RunTest;
            m_single_step              = new ButtonWidget <T>(8.0, 233.0, "Single Step", 8, 1, 1, 3);
            m_single_step.ButtonClick += SingleStep;

            m_cur_angle        = (0.0);
            m_cur_filter       = (1);
            m_num_steps        = (0);
            m_num_pix          = (0.0);
            m_time1            = (0);
            m_time2            = (0);
            m_ScanlinePacked   = new ScanlinePacked8();
            m_Rasterizer       = new RasterizerScanlineAA <T>();
            m_ScanlineUnpacked = new ScanlineUnpacked8();
            m_SpanAllocator    = new SpanAllocator();

            AddChild(m_radius);
            AddChild(m_step);
            AddChild(m_filters);
            AddChild(m_run);
            AddChild(m_single_step);
            AddChild(m_normalize);
            AddChild(m_refresh);
            //m_single_step.text_size(7.5);
            m_normalize.SetFontSize(7.5);
            m_normalize.status(true);

            m_radius.label("Filter Radius={0:F2}");
            m_step.label("Step={0:F2}");
            m_radius.range(2.0, 8.0);
            m_radius.value(4.0);
            m_step.range(1.0, 10.0);
            m_step.value(5.0);

            m_filters.add_item("simple (NN)");
            m_filters.add_item("bilinear");
            m_filters.add_item("bicubic");
            m_filters.add_item("spline16");
            m_filters.add_item("spline36");
            m_filters.add_item("hanning");
            m_filters.add_item("hamming");
            m_filters.add_item("hermite");
            m_filters.add_item("kaiser");
            m_filters.add_item("quadric");
            m_filters.add_item("catrom");
            m_filters.add_item("gaussian");
            m_filters.add_item("bessel");
            m_filters.add_item("mitchell");
            m_filters.add_item("sinc");
            m_filters.add_item("lanczos");
            m_filters.add_item("blackman");
            m_filters.cur_item(1);

            m_filters.border_width(0, 0);
            m_filters.background_color(new RGBA_Doubles(0.0, 0.0, 0.0, 0.1));
            m_filters.text_size(6.0);
            m_filters.text_thickness(0.85);
        }
Exemple #13
0
        public blur_application(PixelFormats format, ERenderOrigin RenderOrigin)
            : base(format, RenderOrigin)
        {
            m_rbuf2         = new RasterBuffer();
            m_shape_bounds  = new RectDouble <T>();
            m_method        = new rbox_ctrl <T>(10.0, 10.0, 130.0, 70.0);
            m_radius        = new SliderWidget <T>(130 + 10.0, 10.0 + 4.0, 130 + 300.0, 10.0 + 8.0 + 4.0);
            m_shadow_ctrl   = new polygon_ctrl <T>(4);
            m_channel_r     = new cbox_ctrl <T>(10.0, 80.0, "Red");
            m_channel_g     = new cbox_ctrl <T>(10.0, 95.0, "Green");
            m_channel_b     = new cbox_ctrl <T>(10.0, 110.0, "Blue");
            m_FlattenCurves = new cbox_ctrl <T>(10, 315, "Convert And Flatten Curves");
            m_FlattenCurves.status(true);

            AddChild(m_method);
            m_method.text_size(8);
            m_method.add_item("Stack Blur");
            m_method.add_item("Recursive Blur");
            m_method.add_item("Channels");
            m_method.cur_item(1);

            AddChild(m_radius);
            m_radius.range(0.0, 40.0);
            m_radius.value(15.0);
            m_radius.label("Blur Radius={0:F2}");

            AddChild(m_shadow_ctrl);

            AddChild(m_channel_r);
            AddChild(m_channel_g);
            AddChild(m_channel_b);
            AddChild(m_FlattenCurves);
            m_channel_g.status(true);

            m_sl    = new ScanlinePacked8();
            m_path  = new PathStorage <T>();
            m_shape = new ConvCurve <T>(m_path);

            m_path.RemoveAll();
            m_path.MoveTo(28.47, 6.45);
            m_path.Curve3(21.58, 1.12, 19.82, 0.29);
            m_path.Curve3(17.19, -0.93, 14.21, -0.93);
            m_path.Curve3(9.57, -0.93, 6.57, 2.25);
            m_path.Curve3(3.56, 5.42, 3.56, 10.60);
            m_path.Curve3(3.56, 13.87, 5.03, 16.26);
            m_path.Curve3(7.03, 19.58, 11.99, 22.51);
            m_path.Curve3(16.94, 25.44, 28.47, 29.64);
            m_path.LineTo(28.47, 31.40);
            m_path.Curve3(28.47, 38.09, 26.34, 40.58);
            m_path.Curve3(24.22, 43.07, 20.17, 43.07);
            m_path.Curve3(17.09, 43.07, 15.28, 41.41);
            m_path.Curve3(13.43, 39.75, 13.43, 37.60);
            m_path.LineTo(13.53, 34.77);
            m_path.Curve3(13.53, 32.52, 12.38, 31.30);
            m_path.Curve3(11.23, 30.08, 9.38, 30.08);
            m_path.Curve3(7.57, 30.08, 6.42, 31.35);
            m_path.Curve3(5.27, 32.62, 5.27, 34.81);
            m_path.Curve3(5.27, 39.01, 9.57, 42.53);
            m_path.Curve3(13.87, 46.04, 21.63, 46.04);
            m_path.Curve3(27.59, 46.04, 31.40, 44.04);
            m_path.Curve3(34.28, 42.53, 35.64, 39.31);
            m_path.Curve3(36.52, 37.21, 36.52, 30.71);
            m_path.LineTo(36.52, 15.53);
            m_path.Curve3(36.52, 9.13, 36.77, 7.69);
            m_path.Curve3(37.01, 6.25, 37.57, 5.76);
            m_path.Curve3(38.13, 5.27, 38.87, 5.27);
            m_path.Curve3(39.65, 5.27, 40.23, 5.62);
            m_path.Curve3(41.26, 6.25, 44.19, 9.18);
            m_path.LineTo(44.19, 6.45);
            m_path.Curve3(38.72, -0.88, 33.74, -0.88);
            m_path.Curve3(31.35, -0.88, 29.93, 0.78);
            m_path.Curve3(28.52, 2.44, 28.47, 6.45);
            m_path.ClosePolygon();

            m_path.MoveTo(28.47, 9.62);
            m_path.LineTo(28.47, 26.66);
            m_path.Curve3(21.09, 23.73, 18.95, 22.51);
            m_path.Curve3(15.09, 20.36, 13.43, 18.02);
            m_path.Curve3(11.77, 15.67, 11.77, 12.89);
            m_path.Curve3(11.77, 9.38, 13.87, 7.06);
            m_path.Curve3(15.97, 4.74, 18.70, 4.74);
            m_path.Curve3(22.41, 4.74, 28.47, 9.62);
            m_path.ClosePolygon();

            IAffineTransformMatrix <T> shape_mtx = MatrixFactory <T> .NewIdentity(VectorDimension.Two);

            shape_mtx.Scale(M.New <T>(4.0));
            shape_mtx.Translate(MatrixFactory <T> .CreateVector2D(150, 100));
            m_path.Transform(shape_mtx);

            BoundingRect <T> .BoundingRectSingle(m_shape, 0, ref m_shape_bounds);

            m_shadow_ctrl.SetXN(0, m_shape_bounds.x1);
            m_shadow_ctrl.SetYN(0, m_shape_bounds.y1);
            m_shadow_ctrl.SetXN(1, m_shape_bounds.x2);
            m_shadow_ctrl.SetYN(1, m_shape_bounds.y1);
            m_shadow_ctrl.SetXN(2, m_shape_bounds.x2);
            m_shadow_ctrl.SetYN(2, m_shape_bounds.y2);
            m_shadow_ctrl.SetXN(3, m_shape_bounds.x1);
            m_shadow_ctrl.SetYN(3, m_shape_bounds.y2);
            m_shadow_ctrl.line_color(new RGBA_Doubles(0, 0.3, 0.5, 0.3));
        }
Exemple #14
0
 public NeHeLesson5(PixelFormats format, ERenderOrigin RenderOrigin)
     : base(1.0f / 60.0f, 5, format, RenderOrigin)
 {
 }
Exemple #15
0
 public RockBlasterGame(PixelFormats format, ERenderOrigin RenderOrigin)
     : base(1.0f / 60.0f, 5, format, RenderOrigin)
 {
 }
Exemple #16
0
        public GamePlatform(double SecondsPerUpdate, int MaxUpdatesPerDraw, PixelFormats format, ERenderOrigin RenderOrigin)
            : base(format, RenderOrigin)
        {
            m_ShowFrameRate     = true;
            m_SecondsPerUpdate  = SecondsPerUpdate;
            m_MaxUpdatesPerDraw = MaxUpdatesPerDraw;
            wait_mode(false);

            AudioSystem <T> .Startup();
        }
Exemple #17
0
 public SmartSweeperApplication(AGG.UI.PlatformSupportAbstract <T> .PixelFormats format, ERenderOrigin RenderOrigin)
     : base(1.0f / 60.0f, 5, format, RenderOrigin)
 {
 }
Exemple #18
0
 gouraud_mesh_application(PixelFormats format, ERenderOrigin RenderOrigin)
     : base(format, RenderOrigin)
 {
     //        m_gamma.gamma(2.0);
 }