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); }
the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_step (115, 5, 400, 11, !flip_y), m_radius(115, 5+15, 400, 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_run (8.0, 245.0, "RUN Test!", !flip_y), m_single_step(8.0, 230.0, "Single Step", !flip_y), m_refresh (8.0, 265.0, "Refresh", !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_radius); add_ctrl(m_step); add_ctrl(m_filters); add_ctrl(m_run); add_ctrl(m_single_step); add_ctrl(m_normalize); add_ctrl(m_refresh); m_run.text_size(7.5); m_single_step.text_size(7.5); m_normalize.text_size(7.5); m_refresh.text_size(7.5); m_normalize.status(true); m_radius.label("Filter Radius=%.3f"); m_step.label("Step=%3.2f"); 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(agg::rgba(0.0, 0.0, 0.0, 0.1)); m_filters.text_size(6.0); m_filters.text_thickness(0.85); }
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_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"); }
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(); }
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); }
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); }
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_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(); }
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); }
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"); }
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"); }
//------------------------------------------------------------------------ the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_polygon_angle(5, 5, 145, 11, !flip_y), m_polygon_scale(5, 5+14, 145, 12+14, !flip_y), m_image_angle (155, 5, 300, 12, !flip_y), m_image_scale (155, 5+14, 300, 12+14, !flip_y), m_rotate_polygon(5, 5+14+14, "Rotate Polygon", !flip_y), m_rotate_image (5, 5+14+14+14, "Rotate Image", !flip_y), m_example(-3.0, 14+14+14+14, -3.0, 14+14+14+14, !flip_y), m_flag(0) { add_ctrl(m_polygon_angle); add_ctrl(m_polygon_scale); add_ctrl(m_image_angle); add_ctrl(m_image_scale); add_ctrl(m_rotate_polygon); add_ctrl(m_rotate_image); add_ctrl(m_example); m_polygon_angle.label("Polygon Angle=%3.2f"); m_polygon_scale.label("Polygon Scale=%3.2f"); m_polygon_angle.range(-180.0, 180.0); m_polygon_scale.range(0.1, 5.0); m_polygon_scale.value(1.0); m_image_angle.label("Image Angle=%3.2f"); m_image_scale.label("Image Scale=%3.2f"); m_image_angle.range(-180.0, 180.0); m_image_scale.range(0.1, 5.0); m_image_scale.value(1.0); m_example.add_item("0"); m_example.add_item("1"); m_example.add_item("2"); m_example.add_item("3"); m_example.add_item("4"); m_example.add_item("5"); m_example.add_item("6"); m_example.cur_item(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); }
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_polygon_angle(5, 5, 145, 12, !flip_y), m_polygon_scale(5, 5+14, 145, 12+14, !flip_y), m_pattern_angle(155, 5, 300, 12, !flip_y), m_pattern_size (155, 5+14, 300, 12+14, !flip_y), m_pattern_alpha(310, 5, 460, 12, !flip_y), m_rotate_polygon(5, 5+14+14, "Rotate Polygon", !flip_y), m_rotate_pattern(5, 5+14+14+14, "Rotate Pattern", !flip_y), m_tie_pattern (155, 5+14+14, "Tie pattern to polygon", !flip_y), m_flag(0), m_pattern(0) { add_ctrl(m_polygon_angle); add_ctrl(m_polygon_scale); add_ctrl(m_pattern_angle); add_ctrl(m_pattern_size); add_ctrl(m_pattern_alpha); add_ctrl(m_rotate_polygon); add_ctrl(m_rotate_pattern); add_ctrl(m_tie_pattern); m_polygon_angle.label("Polygon Angle=%3.2f"); m_polygon_angle.range(-180.0, 180.0); m_polygon_scale.label("Polygon Scale=%3.2f"); m_polygon_scale.range(0.1, 5.0); m_polygon_scale.value(1.0); m_pattern_angle.label("Pattern Angle=%3.2f"); m_pattern_angle.range(-180.0, 180.0); m_pattern_size.label("Pattern Size=%3.2f"); m_pattern_size.range(10, 40); m_pattern_size.value(30); m_pattern_alpha.label("Background Alpha=%.2f"); m_pattern_alpha.value(0.1); }
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); }
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(); }
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_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(); }
the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_width(180 + 10.0, 5.0, 130 + 300.0, 12, !flip_y), m_alpha1(5, 5, 180, 12, !flip_y), m_alpha2(5, 25, 180, 32, !flip_y), m_alpha3(5, 45, 180, 52, !flip_y), m_alpha4(5, 65, 180, 72, !flip_y), m_invert_order(190, 25, "Invert Z-Order") { add_ctrl(m_width); m_width.range(-20.0, 50.0); m_width.value(10.0); m_width.label("Width=%1.2f"); add_ctrl(m_alpha1); m_alpha1.range(0, 1); m_alpha1.value(1); m_alpha1.label("Alpha1=%1.3f"); add_ctrl(m_alpha2); m_alpha2.range(0, 1); m_alpha2.value(1); m_alpha2.label("Alpha2=%1.3f"); add_ctrl(m_alpha3); m_alpha3.range(0, 1); m_alpha3.value(1); m_alpha3.label("Alpha3=%1.3f"); add_ctrl(m_alpha4); m_alpha4.range(0, 1); m_alpha4.value(1); m_alpha4.label("Alpha4=%1.3f"); add_ctrl(m_invert_order); }
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); }
the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_type(-1, -1, -1, -1, !flip_y), m_width(110+80, 8.0, 110+200.0+80, 8.0 + 7.0, !flip_y), m_benchmark(110+200+80+8, 8.0-2.0, "Benchmark", !flip_y), m_draw_nodes(110+200+80+8, 8.0-2.0+15.0, "Draw Nodes", !flip_y), m_draw_edges(200+200+80+8, 8.0-2.0+15.0, "Draw Edges", !flip_y), m_draft(200+200+80+8, 8.0-2.0, "Draft Mode", !flip_y), m_translucent(110+80, 8.0-2.0+15.0, "Translucent Mode", !flip_y), m_graph(200, 100), m_gradient_colors(), m_draw(3) { add_ctrl(m_type); m_type.text_size(8.0); m_type.add_item("Solid lines"); m_type.add_item("Bezier curves"); m_type.add_item("Dashed curves"); m_type.add_item("Poygons AA"); m_type.add_item("Poygons Bin"); m_type.cur_item(0); add_ctrl(m_width); m_width.num_steps(20); m_width.range(0.0, 5.0); m_width.value(2.0); m_width.label("Width=%1.2f"); m_benchmark.text_size(8.0); m_draw_nodes.text_size(8.0); m_draft.text_size(8.0); m_draw_nodes.status(true); m_draw_edges.status(true); add_ctrl(m_benchmark); add_ctrl(m_draw_nodes); add_ctrl(m_draw_edges); add_ctrl(m_draft); add_ctrl(m_translucent); agg::rgba c1(1, 1, 0, 0.25); agg::rgba c2(0, 0, 1); int i; for(i = 0; i < 256; i++) { m_gradient_colors[i] = c1.gradient(c2, double(i) / 255.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(); }
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); }
the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_method (10.0, 10.0, 130.0, 55.0, !flip_y), m_radius (130 + 10.0, 10.0 + 4.0, 130 + 300.0, 10.0 + 8.0 + 4.0, !flip_y), m_shadow_ctrl(4), m_shape(m_path) { add_ctrl(m_method); m_method.text_size(8); m_method.add_item("Single Color"); m_method.add_item("Color LUT"); m_method.cur_item(1); add_ctrl(m_radius); m_radius.range(0.0, 40.0); m_radius.value(15.0); m_radius.label("Blur Radius=%1.2f"); add_ctrl(m_shadow_ctrl); m_path.remove_all(); m_path.move_to(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.line_to(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.line_to(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.line_to(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.line_to(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.close_polygon(); m_path.move_to(28.47, 9.62); m_path.line_to(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.close_polygon(); agg::trans_affine shape_mtx; shape_mtx *= agg::trans_affine_scaling(4.0); shape_mtx *= agg::trans_affine_translation(150, 100); m_path.transform(shape_mtx); agg::bounding_rect_single(m_shape, 0, &m_shape_bounds.x1, &m_shape_bounds.y1, &m_shape_bounds.x2, &m_shape_bounds.y2); m_shadow_ctrl.xn(0) = m_shape_bounds.x1; m_shadow_ctrl.yn(0) = m_shape_bounds.y1; m_shadow_ctrl.xn(1) = m_shape_bounds.x2; m_shadow_ctrl.yn(1) = m_shape_bounds.y1; m_shadow_ctrl.xn(2) = m_shape_bounds.x2; m_shadow_ctrl.yn(2) = m_shape_bounds.y2; m_shadow_ctrl.xn(3) = m_shape_bounds.x1; m_shadow_ctrl.yn(3) = m_shape_bounds.y2; m_shadow_ctrl.line_color(agg::rgba(0, 0.3, 0.5, 0.3)); m_color_lut.resize(256); unsigned i; const agg::int8u* p = g_gradient_colors; for(i = 0; i < 256; i++) { m_color_lut[i] = agg::rgba8(p[0], p[1], p[2], (i > 63) ? 255 : i * 4);//p[3]); //m_color_lut[i].premultiply(); p += 4; } }
the_application(agg::pix_format_e format, bool flip_y) : agg::platform_support(format, flip_y), m_radius (5.0, 5.0, 780-5, 10.0, !flip_y), m_bilinear (8.0, 30.0+15*0, "bilinear", !flip_y), m_bicubic (8.0, 30.0+15*1, "bicubic ", !flip_y), m_spline16 (8.0, 30.0+15*2, "spline16", !flip_y), m_spline36 (8.0, 30.0+15*3, "spline36", !flip_y), m_hanning (8.0, 30.0+15*4, "hanning ", !flip_y), m_hamming (8.0, 30.0+15*5, "hamming ", !flip_y), m_hermite (8.0, 30.0+15*6, "hermite ", !flip_y), m_kaiser (8.0, 30.0+15*7, "kaiser ", !flip_y), m_quadric (8.0, 30.0+15*8, "quadric ", !flip_y), m_catrom (8.0, 30.0+15*9, "catrom ", !flip_y), m_gaussian (8.0, 30.0+15*10, "gaussian", !flip_y), m_bessel (8.0, 30.0+15*11, "bessel ", !flip_y), m_mitchell (8.0, 30.0+15*12, "mitchell", !flip_y), m_sinc (8.0, 30.0+15*13, "sinc ", !flip_y), m_lanczos (8.0, 30.0+15*14, "lanczos ", !flip_y), m_blackman (8.0, 30.0+15*15, "blackman", !flip_y), m_num_filters(0) { m_filters[m_num_filters++] = &m_bilinear; m_filters[m_num_filters++] = &m_bicubic; m_filters[m_num_filters++] = &m_spline16; m_filters[m_num_filters++] = &m_spline36; m_filters[m_num_filters++] = &m_hanning; m_filters[m_num_filters++] = &m_hamming; m_filters[m_num_filters++] = &m_hermite; m_filters[m_num_filters++] = &m_kaiser; m_filters[m_num_filters++] = &m_quadric; m_filters[m_num_filters++] = &m_catrom; m_filters[m_num_filters++] = &m_gaussian; m_filters[m_num_filters++] = &m_bessel; m_filters[m_num_filters++] = &m_mitchell; m_filters[m_num_filters++] = &m_sinc; m_filters[m_num_filters++] = &m_lanczos; m_filters[m_num_filters++] = &m_blackman; unsigned i = 0; m_filter_func[i++] = &m_filter_bilinear; m_filter_func[i++] = &m_filter_bicubic; m_filter_func[i++] = &m_filter_spline16; m_filter_func[i++] = &m_filter_spline36; m_filter_func[i++] = &m_filter_hanning; m_filter_func[i++] = &m_filter_hamming; m_filter_func[i++] = &m_filter_hermite; m_filter_func[i++] = &m_filter_kaiser; m_filter_func[i++] = &m_filter_quadric; m_filter_func[i++] = &m_filter_catrom; m_filter_func[i++] = &m_filter_gaussian; m_filter_func[i++] = &m_filter_bessel; m_filter_func[i++] = &m_filter_mitchell; m_filter_func[i++] = &m_filter_sinc; m_filter_func[i++] = &m_filter_lanczos; m_filter_func[i++] = &m_filter_blackman; for(i = 0; i < m_num_filters; i++) { add_ctrl(*m_filters[i]); } m_radius.range(2.0, 8.0); m_radius.value(4.0); m_radius.label("Radius=%.3f"); add_ctrl(m_radius); }