the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_gamma_lut(2.0),
        m_quad(4, 5.0),
        m_trans_type(400, 5.0, 430+170.0, 100.0, !flip_y),
        m_gamma(5.0, 5.0+15*0, 400-5, 10.0+15*0, !flip_y),
        m_blur (5.0, 5.0+15*1, 400-5, 10.0+15*1, !flip_y),
        m_old_gamma(2.0)
    {
        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);
        add_ctrl(m_trans_type);

        m_gamma.range(0.5, 3.0);
        m_gamma.value(2.0);
        m_gamma.label("Gamma=%.3f");
        add_ctrl(m_gamma);

        m_blur.range(0.5, 5.0);
        m_blur.value(1.0);
        m_blur.label("Blur=%.3f");
        add_ctrl(m_blur);
    }
Exemple #2
0
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_polygons (5.0,     5.0, 5.0+205.0,  110.0,  !flip_y),
        m_operation(555.0,   5.0, 555.0+80.0, 55.0,  !flip_y),
        m_alpha_buf(0),
        m_alpha_mask_rbuf(),
        m_alpha_mask(m_alpha_mask_rbuf),
        m_x(0),
        m_y(0)
    {
        m_operation.add_item("AND");
        m_operation.add_item("SUB");
        m_operation.cur_item(0);
        add_ctrl(m_operation);
        m_operation.no_transform();

        m_polygons.add_item("Two Simple Paths");
        m_polygons.add_item("Closed Stroke");
        m_polygons.add_item("Great Britain and Arrows");
        m_polygons.add_item("Great Britain and Spiral");
        m_polygons.add_item("Spiral and Glyph");
        m_polygons.cur_item(3);
        add_ctrl(m_polygons);
        m_polygons.no_transform();
    }
 the_application(agg::pix_format_e format, bool flip_y) :
     agg::platform_support(format, flip_y),
     m_quad1(4, 5.0),
     m_quad2(4, 5.0),
     m_trans_type(420, 5.0, 420+130.0, 145.0, !flip_y),
     m_reset     (350, 5.0,  "Reset", !flip_y),
     m_mul1      (5.0,  5.0, 340.0, 12.0, !flip_y),
     m_mul2      (5.0, 20.0, 340.0, 27.0, !flip_y)
 {
     m_trans_type.add_item("Union");
     m_trans_type.add_item("Intersection");
     m_trans_type.add_item("Linear XOR");
     m_trans_type.add_item("Saddle XOR");
     m_trans_type.add_item("Abs Diff XOR");
     m_trans_type.add_item("A-B");
     m_trans_type.add_item("B-A");
     m_trans_type.cur_item(0);
     add_ctrl(m_trans_type);
     add_ctrl(m_reset);
     add_ctrl(m_mul1);
     add_ctrl(m_mul2);
     m_mul1.value(1.0);
     m_mul2.value(1.0);
     m_mul1.label("Opacity1=%.3f");
     m_mul2.label("Opacity2=%.3f");
 }
Exemple #4
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();
    }
Exemple #5
0
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_idx(-1),
        m_radius(10, 10, 600-10,   19,    !flip_y),
        m_gamma(10, 10+20, 600-10, 19+20, !flip_y),
        m_offset(10, 10+40, 600-10, 19+40, !flip_y),
        m_white_on_black(10, 10+60, "White on black")
    {
        m_x[0] = 100;   m_y[0] = 100;
        m_x[1] = 500;   m_y[1] = 350;
        add_ctrl(m_radius);
        add_ctrl(m_gamma);
        add_ctrl(m_offset);
        add_ctrl(m_white_on_black);
        m_gamma.label("gamma=%4.3f");
        m_gamma.range(0.0, 3.0);
        m_gamma.value(1.8);

        m_radius.label("radius=%4.3f");
        m_radius.range(0.0, 50.0);
        m_radius.value(25.0);

        m_offset.label("subpixel offset=%4.3f");
        m_offset.range(-2.0, 3.0);

        m_white_on_black.text_color(agg::rgba8(127, 127, 127));
        m_white_on_black.inactive_color(agg::rgba8(127, 127, 127));
    }
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_feng(),
        m_fman(m_feng),
        m_poly1(6, 5.0),
        m_poly2(6, 5.0),
        m_num_points      (5.0, 5.0, 340.0, 12.0, !flip_y),
        m_fixed_len       (350, 5.0,  "Fixed Length", !flip_y),
        m_preserve_x_scale(465, 5.0,  "Preserve X scale", !flip_y),
        m_animate         (350, 25.0, "Animate", !flip_y),
        m_prev_animate(false)
    {
        add_ctrl(m_fixed_len);
        add_ctrl(m_preserve_x_scale);
        add_ctrl(m_animate);
        m_fixed_len.status(true);
        m_preserve_x_scale.status(true);
        m_num_points.range(10.0, 400.0);
        m_num_points.value(200.0);
        m_num_points.label("Number of intermediate Points = %.3f");
        add_ctrl(m_num_points);

        m_poly1.close(false);
        m_poly2.close(false);
    }
    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 #8
0
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_gamma (115,  5,    500-5, 11,     !flip_y),
        m_radius(115,  5+15, 500-5, 11+15,  !flip_y),
        m_filters(0.0, 0.0, 110.0, 210.0, !flip_y),
        m_normalize  (8.0, 215.0, "Normalize Filter", !flip_y),
        m_cur_angle(0.0),
        m_cur_filter(1),
        m_num_steps(0),
        m_num_pix(0.0),
        m_time1(0),
        m_time2(0)
    {
        add_ctrl(m_gamma);
        add_ctrl(m_radius);
        add_ctrl(m_filters);
        add_ctrl(m_normalize);
        m_normalize.text_size(7.5);
        m_normalize.status(true);

        m_radius.label("Filter Radius=%.3f");
        m_radius.range(2.0, 8.0);
        m_radius.value(4.0);

        m_gamma.label("Gamma=%.3f");
        m_gamma.range(0.5, 3.0);
        m_gamma.value(1.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(agg::rgba(0.0, 0.0, 0.0, 0.1));
        m_filters.text_size(6.0);
        m_filters.text_thickness(0.85);
    }
Exemple #9
0
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_rotate(10,  3, "Rotate", !flip_y),
        m_even_odd(60, 3, "Even-Odd", !flip_y),
        m_draft(130, 3, "Draft", !flip_y),
        m_roundoff(175, 3, "Roundoff", !flip_y),
        m_angle_delta(10, 21, 250-10, 27, !flip_y),
        m_redraw_flag(true)
    {
        m_angle_delta.label("Step=%4.3f degree");

        g_attr[g_npaths++] = path_attributes(g_path.start_new_path(),
                                             agg::rgba8(255, 255, 0),
                                             agg::rgba8(0,   0,   0),
                                             1.0);

        g_path.concat_poly(g_poly_bulb, AGG_POLY_SIZE(g_poly_bulb), true);

        g_attr[g_npaths++] = path_attributes(g_path.start_new_path(),
                                             agg::rgba8(255,  255, 200),
                                             agg::rgba8(90,   0,   0),
                                             0.7);

        g_path.concat_poly(g_poly_beam1, AGG_POLY_SIZE(g_poly_beam1), true); 
        g_path.concat_poly(g_poly_beam2, AGG_POLY_SIZE(g_poly_beam2), true); 
        g_path.concat_poly(g_poly_beam3, AGG_POLY_SIZE(g_poly_beam3), true); 
        g_path.concat_poly(g_poly_beam4, AGG_POLY_SIZE(g_poly_beam4), true); 

        g_attr[g_npaths++] = path_attributes(g_path.start_new_path(),
                                             agg::rgba8(0, 0, 0),
                                             agg::rgba8(0, 0, 0),
                                             0.0);

        g_path.concat_poly(g_poly_fig1, AGG_POLY_SIZE(g_poly_fig1), true); 
        g_path.concat_poly(g_poly_fig2, AGG_POLY_SIZE(g_poly_fig2), true); 
        g_path.concat_poly(g_poly_fig3, AGG_POLY_SIZE(g_poly_fig3), true); 
        g_path.concat_poly(g_poly_fig4, AGG_POLY_SIZE(g_poly_fig4), true); 
        g_path.concat_poly(g_poly_fig5, AGG_POLY_SIZE(g_poly_fig5), true); 
        g_path.concat_poly(g_poly_fig6, AGG_POLY_SIZE(g_poly_fig6), true); 

        m_rotate.text_size(7);
        m_even_odd.text_size(7);
        m_draft.text_size(7);
        m_roundoff.text_size(7);
        add_ctrl(m_rotate);
        add_ctrl(m_even_odd);
        add_ctrl(m_draft);
        add_ctrl(m_roundoff);
        add_ctrl(m_angle_delta);
        m_angle_delta.value(0.01);
    }
Exemple #10
0
 the_application(agg::pix_format_e format, bool flip_y) :
     agg::platform_support(format, flip_y),
     m_angle(5,  5,    300, 12,    !flip_y),
     m_scale(5,  5+15, 300, 12+15, !flip_y)
 {
     add_ctrl(m_angle);
     add_ctrl(m_scale);
     m_angle.label("Angle=%3.2f");
     m_scale.label("Scale=%3.2f");
     m_angle.range(-180.0, 180.0);
     m_angle.value(0.0);
     m_scale.range(0.1, 5.0);
     m_scale.value(1.0);
 }
Exemple #11
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 #12
0
int connect(const char *desc, int argc, char **argv)
{
	char argstr[BUF_SIZE];
	int instance, ret;
	const struct argconfig_commandline_options command_line_options[] = {
		{"transport",       't', "LIST", CFG_STRING, &cfg.transport,       required_argument, "transport type" },
		{"nqn",             'n', "LIST", CFG_STRING, &cfg.nqn,             required_argument, "nqn name" },
		{"traddr",          'a', "LIST", CFG_STRING, &cfg.traddr,          required_argument, "transport address" },
		{"trsvcid",         's', "LIST", CFG_STRING, &cfg.trsvcid,         required_argument, "transport service id (e.g. IP port)" },
		{"host-traddr",     'w', "LIST", CFG_STRING, &cfg.host_traddr,     required_argument, "host traddr (e.g. FC WWN's)" },
		{"hostnqn",         'q', "LIST", CFG_STRING, &cfg.hostnqn,         required_argument, "user-defined hostnqn" },
		{"nr-io-queues",    'i', "LIST", CFG_STRING, &cfg.nr_io_queues,    required_argument, "number of io queues to use (default is core count)" },
		{"keep-alive-tmo",  'k', "LIST", CFG_STRING, &cfg.keep_alive_tmo,  required_argument, "keep alive timeout period in seconds" },
		{"reconnect-delay", 'c', "LIST", CFG_STRING, &cfg.reconnect_delay, required_argument, "reconnect timeout period in seconds" },
		{NULL},
	};

	argconfig_parse(argc, argv, desc, command_line_options, &cfg,
			sizeof(cfg));

	ret = build_options(argstr, BUF_SIZE);
	if (ret)
		return ret;

	if (!cfg.nqn) {
		fprintf(stderr, "need a -n argument\n");
		return -EINVAL;
	}

	instance = add_ctrl(argstr);
	if (instance < 0)
		return instance;
	return 0;
}
Exemple #13
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 #14
0
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_alpha_dst(5, 5,    400, 11,    !flip_y),
        m_alpha_src(5, 5+15, 400, 11+15, !flip_y),
        m_comp_op(420, 5.0, 420+170.0, 395.0, !flip_y)
    {
        m_alpha_dst.label("Dst Alpha=%.2f");
        m_alpha_dst.value(1.0);
        add_ctrl(m_alpha_dst);

        m_alpha_src.label("Src Alpha=%.2f");
        m_alpha_src.value(1.0);
        add_ctrl(m_alpha_src);

        m_comp_op.text_size(6.8);
        m_comp_op.add_item("clear");
        m_comp_op.add_item("src");
        m_comp_op.add_item("dst");
        m_comp_op.add_item("src-over");
        m_comp_op.add_item("dst-over");
        m_comp_op.add_item("src-in");
        m_comp_op.add_item("dst-in");
        m_comp_op.add_item("src-out");
        m_comp_op.add_item("dst-out");
        m_comp_op.add_item("src-atop");
        m_comp_op.add_item("dst-atop");
        m_comp_op.add_item("xor");
        m_comp_op.add_item("plus");
        m_comp_op.add_item("minus");
        m_comp_op.add_item("multiply");
        m_comp_op.add_item("screen");
        m_comp_op.add_item("overlay");
        m_comp_op.add_item("darken");
        m_comp_op.add_item("lighten");
        m_comp_op.add_item("color-dodge");
        m_comp_op.add_item("color-burn");
        m_comp_op.add_item("hard-light");
        m_comp_op.add_item("soft-light");
        m_comp_op.add_item("difference");
        m_comp_op.add_item("exclusion");
        m_comp_op.add_item("contrast");
        m_comp_op.add_item("invert");
        m_comp_op.add_item("invert-rgb");
        m_comp_op.cur_item(3);
        add_ctrl(m_comp_op);
    }
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_angle     (5,      5,    150,     12,    !flip_y),
        m_scale     (5,      5+15, 150,     12+15, !flip_y),
        m_period    (5+170,  5,    150+170, 12,    !flip_y),
        m_amplitude (5+170,  5+15, 150+170, 12+15, !flip_y),
        m_distortion(480,    5,    600,     90,    !flip_y),

        m_center_x(0.0),
        m_center_y(0.0),
        m_phase(0.0)
    {
        add_ctrl(m_angle);
        add_ctrl(m_scale);
        add_ctrl(m_amplitude);
        add_ctrl(m_period);
        add_ctrl(m_distortion);
        m_angle.label("Angle=%3.2f");
        m_scale.label("Scale=%3.2f");
        m_angle.range(-180.0, 180.0);
        m_angle.value(20.0);
        m_scale.range(0.1, 5.0);
        m_scale.value(1.0);

        m_amplitude.label("Amplitude=%3.2f");
        m_period.label("Period=%3.2f");
        m_amplitude.range(0.1, 40.0);
        m_period.range(0.1, 2.0);
        m_amplitude.value(10.0);
        m_period.value(1.0);

        m_distortion.add_item("Wave");
        m_distortion.add_item("Swirl");
        m_distortion.add_item("Wave-Swirl");
        m_distortion.add_item("Swirl-Wave");
        m_distortion.cur_item(0);

        unsigned i;
        const agg::int8u* p = g_gradient_colors;
        for(i = 0; i < 256; i++)
        {
            m_gradient_colors[i] = agg::rgba8(p[0], p[1], p[2], p[3]);
            p += 4;
        }
    }
 the_application(agg::pix_format_e format, bool flip_y) :
     agg::platform_support(format, flip_y),
     m_alpha(5, 5, 320-5, 10+5, !flip_y)
 {
     m_alpha.label("Alpha=%1.0f");
     m_alpha.range(0, 255);
     m_alpha.value(255);
     add_ctrl(m_alpha);
 }
Exemple #17
0
  the_application(agg::pix_format_e format, bool flip_y, unsigned num_points)
      : agg::platform_support(format, flip_y),
        m_num_points(num_points),
        m_points(new scatter_point[num_points]),
        m_scale_ctrl_z(5, 5, start_width - 5, 12, !flip_y),
        m_slider_ctrl_sel(5, 20, start_width - 5, 27, !flip_y),
        m_slider_ctrl_size(5, 35, start_width - 5, 42, !flip_y) {

    m_spline_r.init(6, spline_r_x, spline_r_y);
    m_spline_g.init(6, spline_g_x, spline_g_y);
    m_spline_b.init(6, spline_b_x, spline_b_y);

    add_ctrl(m_scale_ctrl_z);
    add_ctrl(m_slider_ctrl_sel);
    add_ctrl(m_slider_ctrl_size);

    m_slider_ctrl_size.label("Size");
    m_slider_ctrl_sel.label("Selectivity");
  }
Exemple #18
0
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_close      (10.0, 10.0, 130.0, 80.0, !flip_y),
        m_width      (130 + 10.0, 10.0 + 4.0, 130 + 300.0, 10.0 + 8.0 + 4.0, !flip_y),
        m_auto_detect(130 + 10.0, 10.0 + 4.0 + 16.0,    "Autodetect orientation if not defined", !flip_y)
    {
        add_ctrl(m_close);
        m_close.add_item("Close");
        m_close.add_item("Close CW");
        m_close.add_item("Close CCW");
        m_close.cur_item(0);

        add_ctrl(m_width);
        m_width.range(-100.0, 100.0);
        m_width.value(0.0);
        m_width.label("Width=%1.2f");

        add_ctrl(m_auto_detect);
    }
Exemple #19
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 #20
0
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_polygons     (5.0,     5.0, 5.0+205.0,   110.0,  !flip_y),
        m_fill_rule    (200,     5.0, 200+105.0,    50.0,  !flip_y),
        m_scanline_type(300,     5.0, 300+115.0,    70.0,  !flip_y),
        m_operation    (535.0,   5.0, 535.0+115.0, 145.0,  !flip_y)
    {
        m_operation.add_item("None");
        m_operation.add_item("OR");
        m_operation.add_item("AND");
        m_operation.add_item("XOR Linear");
        m_operation.add_item("XOR Saddle");
        m_operation.add_item("A-B");
        m_operation.add_item("B-A");
        m_operation.cur_item(2);
        add_ctrl(m_operation);
        m_operation.no_transform();

        m_fill_rule.add_item("Even-Odd");
        m_fill_rule.add_item("Non Zero");
        m_fill_rule.cur_item(1);
        add_ctrl(m_fill_rule);
        m_fill_rule.no_transform();

        m_scanline_type.add_item("scanline_p");
        m_scanline_type.add_item("scanline_u");
        m_scanline_type.add_item("scanline_bin");
        m_scanline_type.cur_item(1);
        add_ctrl(m_scanline_type);
        m_scanline_type.no_transform();

        m_polygons.add_item("Two Simple Paths");
        m_polygons.add_item("Closed Stroke");
        m_polygons.add_item("Great Britain and Arrows");
        m_polygons.add_item("Great Britain and Spiral");
        m_polygons.add_item("Spiral and Glyph");
        m_polygons.cur_item(3);
        add_ctrl(m_polygons);
        m_polygons.no_transform();
    }
Exemple #21
0
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_slider1      (10, 10,    600-10, 17,    !flip_y),
        m_slider_spiral(10, 10+20, 600-10, 17+20, !flip_y),
        m_slider_base_y(10, 10+40, 600-10, 17+40, !flip_y)
    {
        add_ctrl(m_slider1);
        m_slider1.range(0.0, 100.0);
        m_slider1.num_steps(5);
        m_slider1.value(32.0);
        m_slider1.label("Some Value=%1.0f");

        add_ctrl(m_slider_spiral);
        m_slider_spiral.label("Spiral=%.3f");
        m_slider_spiral.range(-0.1, 0.1);
        m_slider_spiral.value(0.0);

        add_ctrl(m_slider_base_y);
        m_slider_base_y.label("Base Y=%.3f");
        m_slider_base_y.range(50.0, 200.0);
        m_slider_base_y.value(120.0);
    }
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_thickness(5, 5,    400-5, 11,    !flip_y),
        m_gamma    (5, 5+15, 400-5, 11+15, !flip_y),
        m_contrast (5, 5+30, 400-5, 11+30, !flip_y)
    {
        add_ctrl(m_thickness);
        add_ctrl(m_gamma);
        add_ctrl(m_contrast);

        m_thickness.label("Thickness=%3.2f");
        m_gamma.label("Gamma=%3.2f");
        m_contrast.label("Contrast");

        m_thickness.range(0.0, 3.0);
        m_gamma.range(0.5, 3.0);
        m_contrast.range(0.0, 1.0);

        m_thickness.value(1.0);
        m_gamma.value(1.0);
        m_contrast.value(1.0);
    }
Exemple #23
0
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_polygons (5.0,     5.0, 5.0+205.0,  110.0,  !flip_y),
        m_operation(555.0,   5.0, 555.0+80.0, 130.0,  !flip_y)
    {
        m_operation.add_item("None");
        m_operation.add_item("OR");
        m_operation.add_item("AND");
        m_operation.add_item("XOR");
        m_operation.add_item("A-B");
        m_operation.add_item("B-A");
        m_operation.cur_item(2);
        add_ctrl(m_operation);

        m_polygons.add_item("Two Simple Paths");
        m_polygons.add_item("Closed Stroke");
        m_polygons.add_item("Great Britain and Arrows");
        m_polygons.add_item("Great Britain and Spiral");
        m_polygons.add_item("Spiral and Glyph");
        m_polygons.cur_item(3);
        add_ctrl(m_polygons);
    }
 the_application(agg::pix_format_e format, bool flip_y) :
     agg::platform_support(format, flip_y),
     m_alpha(2,  2,  200, 30,  6, !flip_y)
 {
     m_alpha.value(0, 1.0);
     m_alpha.value(1, 1.0);
     m_alpha.value(2, 1.0);
     m_alpha.value(3, 0.5);
     m_alpha.value(4, 0.5);
     m_alpha.value(5, 1.0);
     m_alpha.update_spline();
     add_ctrl(m_alpha);
 }
Exemple #25
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 #26
0
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_path(),
        m_expand(5,     5,    256-5, 11,    !flip_y),
        m_gamma (5,     5+15, 256-5, 11+15, !flip_y),
        m_scale (256+5, 5,    512-5, 11,    !flip_y),
        m_rotate(256+5, 5+15, 512-5, 11+15, !flip_y),
        m_min_x(0.0),
        m_min_y(0.0),
        m_max_x(0.0),
        m_max_y(0.0),
        m_x(0.0),
        m_y(0.0),
        m_dx(0.0),
        m_dy(0.0),
        m_drag_flag(false)
    {
        add_ctrl(m_expand);
        add_ctrl(m_gamma);
        add_ctrl(m_scale);
        add_ctrl(m_rotate);

        m_expand.label("Expand=%3.2f");
        m_expand.range(-1, 1.2);
        m_expand.value(0.0);

        m_gamma.label("Gamma=%3.2f");
        m_gamma.range(0.0, 3.0);
        m_gamma.value(1.0);

        m_scale.label("Scale=%3.2f");
        m_scale.range(0.2, 10.0);
        m_scale.value(1.0);

        m_rotate.label("Rotate=%3.2f");
        m_rotate.range(-180.0, 180.0);
        m_rotate.value(0.0);
    }
 the_application(agg::pix_format_e format, bool flip_y) :
     agg::platform_support(format, flip_y),
     m_quad(4, 5.0),
     m_trans_type(460, 5.0, 420+170.0, 60.0, !flip_y),
     m_test_flag(false)
 {
     m_trans_type.text_size(8);
     m_trans_type.text_thickness(1);
     m_trans_type.add_item("Affine");
     m_trans_type.add_item("Bilinear");
     m_trans_type.add_item("Perspective");
     m_trans_type.cur_item(2);
     add_ctrl(m_trans_type);
 }
Exemple #28
0
    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_idx(-1),
        m_dilation(5, 5,    400-5, 11,    !flip_y),
        m_gamma   (5, 5+15, 400-5, 11+15, !flip_y),
        m_alpha   (5, 5+30, 400-5, 11+30, !flip_y)

    {
        m_x[0] = 57;    m_y[0] = 60;
        m_x[1] = 369;   m_y[1] = 170;
        m_x[2] = 143;   m_y[2] = 310;
       
        add_ctrl(m_dilation);
        add_ctrl(m_gamma);
        add_ctrl(m_alpha);

        m_dilation.label("Dilation=%3.2f");
        m_gamma.label("Linear gamma=%3.2f");
        m_alpha.label("Opacity=%3.2f");

        m_dilation.value(0.175);
        m_gamma.value(0.809);
        m_alpha.value(1.0);
    }
Exemple #29
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();
  }
Exemple #30
0
static int do_discover(char *argstr, bool connect)
{
	struct nvmf_disc_rsp_page_hdr *log = NULL;
	char *dev_name;
	int instance, numrec = 0, ret;

	instance = add_ctrl(argstr);
	if (instance < 0)
		return instance;

	if (asprintf(&dev_name, "/dev/nvme%d", instance) < 0)
		return errno;
	ret = nvmf_get_log_page_discovery(dev_name, &log, &numrec);
	free(dev_name);
	remove_ctrl(instance);

	switch (ret) {
	case DISC_OK:
		if (connect)
			connect_ctrls(log, numrec);
		else if (cfg.raw)
			save_discovery_log(log, numrec);
		else
			print_discovery_log(log, numrec);
		break;
	case DISC_GET_NUMRECS:
		fprintf(stderr,
			"Get number of discovery log entries failed.\n");
		break;
	case DISC_GET_LOG:
		fprintf(stderr, "Get discovery log entries failed.\n");
		break;
	case DISC_NO_LOG:
		fprintf(stderr, "No discovery log entries to fetch.\n");
		break;
	case DISC_NOT_EQUAL:
		fprintf(stderr,
		"Numrec values of last two get dicovery log page not equal\n");
		break;
	default:
		fprintf(stderr, "Get dicovery log page failed: %d\n", ret);
		break;
	}

	return ret;
}