Exemple #1
0
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_idx(-1),
        m_gamma(130 + 10.0, 10.0 + 4.0, 130 + 150.0, 10.0 + 8.0 + 4.0, !flip_y),
        m_alpha(130 + 150.0 + 10.0, 10.0 + 4.0, 500 - 10.0, 10.0 + 8.0 + 4.0, !flip_y),
        m_test(130 + 10.0, 10.0 + 4.0 + 16.0,    "Test Performance", !flip_y)
    {
        m_x[0] = 100 + 120; m_y[0] = 60;
        m_x[1] = 369 + 120; m_y[1] = 170;
        m_x[2] = 143 + 120; m_y[2] = 310;

        add_ctrl(m_gamma);
        m_gamma.range(0.0, 1.0);
        m_gamma.value(0.5);
        m_gamma.label("Gamma=%1.2f");
        m_gamma.no_transform();

        add_ctrl(m_alpha);
        m_alpha.range(0.0, 1.0);
        m_alpha.value(1.0);
        m_alpha.label("Alpha=%1.2f");
        m_alpha.no_transform();

        add_ctrl(m_test);
        m_test.no_transform();
    }
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_ctrl_color(agg::rgba(0, 0.3, 0.5, 0.3)),
        m_line1(5),
        m_scale_x(5.0,   5.0, 240.0, 12.0, !flip_y),
        m_start_x(250.0, 5.0, 495.0, 12.0, !flip_y)
    {
        m_line1.line_color(m_ctrl_color);
        m_line1.xn(0) = 20;
        m_line1.yn(0) = 20;
        m_line1.xn(1) = 500-20;
        m_line1.yn(1) = 500-20;
        m_line1.xn(2) = 500-60;
        m_line1.yn(2) = 20;
        m_line1.xn(3) = 40;
        m_line1.yn(3) = 500-40;
        m_line1.xn(4) = 100;
        m_line1.yn(4) = 300;
        m_line1.close(false);

        add_ctrl(m_line1);
        m_line1.transform(m_scale);

        m_scale_x.label("Scale X=%.2f");
        m_scale_x.range(0.2, 3.0);
        m_scale_x.value(1.0);
        add_ctrl(m_scale_x);
        m_scale_x.no_transform();

        m_start_x.label("Start X=%.2f");
        m_start_x.range(0.0, 10.0);
        m_start_x.value(0.0);
        add_ctrl(m_start_x);
        m_start_x.no_transform();
    }
Exemple #3
0
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_ctrl_color(agg::rgba(0, 0.3, 0.5, 0.3)),
        m_scale_x(5.0,   5.0, 240.0, 12.0, !flip_y),
        m_start_x(250.0, 5.0, 495.0, 12.0, !flip_y)
    {
        m_curve1.line_color(m_ctrl_color);
        m_curve2.line_color(m_ctrl_color);
        m_curve3.line_color(m_ctrl_color);
        m_curve4.line_color(m_ctrl_color);
        m_curve5.line_color(m_ctrl_color);
        m_curve6.line_color(m_ctrl_color);
        m_curve7.line_color(m_ctrl_color);
        m_curve8.line_color(m_ctrl_color);
        m_curve9.line_color(m_ctrl_color);

        m_curve1.curve(64, 19, 14, 126, 118, 266, 19, 265);
        m_curve2.curve(112, 113, 178, 32, 200, 132, 125, 438);
        m_curve3.curve(401, 24, 326, 149, 285, 11, 177, 77);
        m_curve4.curve(188, 427, 129, 295, 19, 283, 25, 410);
        m_curve5.curve(451, 346, 302, 218, 265, 441, 459, 400);
        m_curve6.curve(454, 198, 14, 13, 220, 291, 483, 283);
        m_curve7.curve(301, 398, 355, 231, 209, 211, 170, 353);
        m_curve8.curve(484, 101, 222, 33, 486, 435, 487, 138);
        m_curve9.curve(143, 147, 11, 45, 83, 427, 132, 197);

        add_ctrl(m_curve1);
        add_ctrl(m_curve2);
        add_ctrl(m_curve3);
        add_ctrl(m_curve4);
        add_ctrl(m_curve5);
        add_ctrl(m_curve6);
        add_ctrl(m_curve7);
        add_ctrl(m_curve8);
        add_ctrl(m_curve9);

        m_curve1.no_transform();
        m_curve2.no_transform();
        m_curve3.no_transform();
        m_curve4.no_transform();
        m_curve5.no_transform();
        m_curve6.no_transform();
        m_curve7.no_transform();
        m_curve8.no_transform();
        m_curve9.no_transform();

        m_scale_x.label("Scale X=%.2f");
        m_scale_x.range(0.2, 3.0);
        m_scale_x.value(1.0);
        m_scale_x.no_transform();
        add_ctrl(m_scale_x);

        m_start_x.label("Start X=%.2f");
        m_start_x.range(0.0, 10.0);
        m_start_x.value(0.0);
        m_start_x.no_transform();
        add_ctrl(m_start_x);
    }
Exemple #4
0
  the_application(agg::pix_format_e format, bool flip_y)
      : agg::platform_support(format, flip_y),
        m_idx(-1),
        m_join(10.0, 10.0, 133.0, 80.0, !flip_y),
        m_cap(10.0, 80.0 + 10.0, 133.0, 80.0 + 80.0, !flip_y),
        m_width(130 + 10.0, 10.0 + 4.0, 500.0 - 10.0, 10.0 + 8.0 + 4.0,
                !flip_y),
        m_miter_limit(130 + 10.0, 20.0 + 10.0 + 4.0, 500.0 - 10.0,
                      20.0 + 10.0 + 8.0 + 4.0, !flip_y) {
    m_x[0] = 57 + 100;
    m_y[0] = 60;
    m_x[1] = 369 + 100;
    m_y[1] = 170;
    m_x[2] = 143 + 100;
    m_y[2] = 310;

    add_ctrl(m_join);
    m_join.text_size(7.5);
    m_join.text_thickness(1.0);
    m_join.add_item("Miter Join");
    m_join.add_item("Miter Join Revert");
    m_join.add_item("Round Join");
    m_join.add_item("Bevel Join");
    m_join.cur_item(2);

    add_ctrl(m_cap);
    m_cap.add_item("Butt Cap");
    m_cap.add_item("Square Cap");
    m_cap.add_item("Round Cap");
    m_cap.cur_item(2);

    add_ctrl(m_width);
    m_width.range(3.0, 40.0);
    m_width.value(20.0);
    m_width.label("Width=%1.2f");

    add_ctrl(m_miter_limit);
    m_miter_limit.range(1.0, 10.0);
    m_miter_limit.value(4.0);
    m_miter_limit.label("Miter Limit=%1.2f");

    m_join.no_transform();
    m_cap.no_transform();
    m_width.no_transform();
    m_miter_limit.no_transform();
  }
Exemple #5
0
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_magn_slider  (5,   5, 495,  12, !flip_y),
        m_radius_slider(5,  20, 495,  27, !flip_y)
    {
        parse_lion();
        add_ctrl(m_magn_slider);

        m_magn_slider.no_transform();
        m_magn_slider.range(0.01, 4.0);
        m_magn_slider.value(3.0);
        m_magn_slider.label("Scale=%3.2f");

        add_ctrl(m_radius_slider);
        m_radius_slider.no_transform();
        m_radius_slider.range(0.0, 100.0);
        m_radius_slider.value(70.0);
        m_radius_slider.label("Radius=%3.2f");

    }
Exemple #6
0
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_idx(-1),
        m_cap(10.0, 10.0, 130.0, 80.0, !flip_y),
        m_width(130 + 10.0, 10.0 + 4.0, 130 + 150.0, 10.0 + 8.0 + 4.0, !flip_y),
        m_smooth(130 + 150.0 + 10.0, 10.0 + 4.0, 500 - 10.0, 10.0 + 8.0 + 4.0, !flip_y),
        m_close(130 + 10.0, 10.0 + 4.0 + 16.0,    "Close Polygons", !flip_y),
        m_even_odd(130 + 150.0 + 10.0, 10.0 + 4.0 + 16.0, "Even-Odd Fill", !flip_y)
    {
        m_x[0] = 57  + 100; m_y[0] = 60;
        m_x[1] = 369 + 100; m_y[1] = 170;
        m_x[2] = 143 + 100; m_y[2] = 310;

        add_ctrl(m_cap);
        m_cap.add_item("Butt Cap");
        m_cap.add_item("Square Cap");
        m_cap.add_item("Round Cap");
        m_cap.cur_item(0);
        m_cap.no_transform();

        add_ctrl(m_width);
        m_width.range(0.0, 10.0);
        m_width.value(3.0);
        m_width.label("Width=%1.2f");
        m_width.no_transform();

        add_ctrl(m_smooth);
        m_smooth.range(0.0, 2.0);
        m_smooth.value(1.0);
        m_smooth.label("Smooth=%1.2f");
        m_smooth.no_transform();

        add_ctrl(m_close);
        m_close.no_transform();

        add_ctrl(m_even_odd);
        m_even_odd.no_transform();
    }
Exemple #7
0
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_width_slider(5, 5, 150, 12, !flip_y),
        m_scanline(160, 5, "Use Scanline Rasterizer", !flip_y)
    {
        parse_lion();
        add_ctrl(m_width_slider);
        m_width_slider.no_transform();
        m_width_slider.range(0.0, 4.0);
        m_width_slider.value(1.0);
        m_width_slider.label("Width %3.2f");

        add_ctrl(m_scanline);
        m_scanline.no_transform();
    }
Exemple #8
0
  the_application(agg::pix_format_e format, bool flip_y)
      : agg::platform_support(format, flip_y),
        m_gamma(5.0, 5.0, 340.0, 12.0, !flip_y),
        m_mouse_x(200),
        m_mouse_y(200) {
    m_gamma.range(0.5, 2.5);
    m_gamma.value(1.0);
    m_gamma.label("Gamma = %.3f");
    add_ctrl(m_gamma);
    m_gamma.no_transform();

    m_gamma_lut.gamma(m_gamma.value());
    m_old_gamma = m_gamma.value();

    build_gradient_lut();
  }