本文整理汇总了C++中agg::cbox_ctrl类的典型用法代码示例。如果您正苦于以下问题:C++ cbox_ctrl类的具体用法?C++ cbox_ctrl怎么用?C++ cbox_ctrl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了cbox_ctrl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: on_idle
void on_idle()
{
if(m_run.status())
{
if(m_cur_angle < 360.0)
{
m_cur_angle += m_step.value();
copy_img_to_img(1, 0);
#ifdef AGG_ACCURATE_TIME
start_timer();
#endif
transform_image(m_step.value());
#ifdef AGG_ACCURATE_TIME
m_time2 += elapsed_time();
#endif
m_num_steps++;
}
else
{
m_cur_angle = 0.0;
#ifndef AGG_ACCURATE_TIME
m_time2 = clock();
#endif
wait_mode(true);
m_run.status(false);
}
force_redraw();
}
else
{
wait_mode(true);
}
}
开发者ID:foogywoo,项目名称:drone,代码行数:33,代码来源:image_filters.cpp
示例2: on_idle
//------------------------------------------------------------------------
virtual void on_idle()
{
bool redraw = false;
if(m_rotate_polygon.status())
{
m_polygon_angle.value(m_polygon_angle.value() + 0.5);
if(m_polygon_angle.value() >= 180.0)
{
m_polygon_angle.value(m_polygon_angle.value() - 360.0);
}
redraw = true;
}
if(m_rotate_pattern.status())
{
m_pattern_angle.value(m_pattern_angle.value() - 0.5);
if(m_pattern_angle.value() <= -180.0)
{
m_pattern_angle.value(m_pattern_angle.value() + 360.0);
}
generate_pattern();
redraw = true;
}
if(redraw) force_redraw();
}
开发者ID:Bashakov,项目名称:agg,代码行数:28,代码来源:pattern_fill.cpp
示例3:
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);
}
开发者ID:foogywoo,项目名称:drone,代码行数:60,代码来源:image_filters.cpp
示例4: on_idle
//------------------------------------------------------------------------
virtual void on_idle()
{
bool redraw = false;
if(m_rotate_polygon.status())
{
m_polygon_angle.value(m_polygon_angle.value() + 0.5);
if(m_polygon_angle.value() >= 180.0)
{
m_polygon_angle.value(m_polygon_angle.value() - 360.0);
}
redraw = true;
}
if(m_rotate_image.status())
{
m_image_angle.value(m_image_angle.value() + 0.5);
if(m_image_angle.value() >= 180.0)
{
m_image_angle.value(m_image_angle.value() - 360.0);
}
redraw = true;
}
if(redraw) force_redraw();
}
开发者ID:4nakin,项目名称:CorsixTH-Android,代码行数:27,代码来源:image_transforms.cpp
示例5:
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);
}
开发者ID:zshipko,项目名称:libtwombly,代码行数:25,代码来源:trans_curve2_ft.cpp
示例6: on_ctrl_change
//------------------------------------------------------------------------
virtual void on_ctrl_change() {
if (m_rotate_polygon.status() || m_rotate_image.status()) {
wait_mode(false);
} else {
wait_mode(true);
}
force_redraw();
}
开发者ID:UIKit0,项目名称:agg,代码行数:9,代码来源:image_transforms.cpp
示例7: on_ctrl_change
virtual void on_ctrl_change()
{
if(m_reset.status())
{
on_init();
m_reset.status(false);
force_redraw();
}
}
开发者ID:zshipko,项目名称:libtwombly,代码行数:9,代码来源:scanline_boolean.cpp
示例8:
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);
}
开发者ID:Rodeo314,项目名称:vasFMC,代码行数:51,代码来源:idea.cpp
示例9: on_ctrl_change
//------------------------------------------------------------------------
virtual void on_ctrl_change()
{
if(m_rotate_polygon.status() || m_rotate_pattern.status())
{
wait_mode(false);
}
else
{
wait_mode(true);
}
generate_pattern();
force_redraw();
}
开发者ID:Bashakov,项目名称:agg,代码行数:15,代码来源:pattern_fill.cpp
示例10: on_draw
virtual void on_draw()
{
typedef agg::gamma_lut<agg::int8u, agg::int8u, 8, 8> gamma_lut_type;
typedef agg::pixfmt_bgr24_gamma<gamma_lut_type> pixfmt;
typedef agg::renderer_base<pixfmt> renderer_base;
typedef agg::renderer_scanline_aa_solid<renderer_base> renderer_solid;
gamma_lut_type gamma(m_gamma.value());
pixfmt pixf(rbuf_window(), gamma);
renderer_base rb(pixf);
renderer_solid ren(rb);
rb.clear(m_white_on_black.status() ? agg::rgba(0,0,0) : agg::rgba(1,1,1));
agg::rasterizer_scanline_aa<> ras;
agg::scanline_p8 sl;
agg::ellipse e;
// Render two "control" circles
ren.color(agg::rgba8(127,127,127));
e.init(m_x[0], m_y[0], 3, 3, 16);
ras.add_path(e);
agg::render_scanlines(ras, sl, ren);
e.init(m_x[1], m_y[1], 3, 3, 16);
ras.add_path(e);
agg::render_scanlines(ras, sl, ren);
double d = m_offset.value();
// Creating a rounded rectangle
agg::rounded_rect r(m_x[0]+d, m_y[0]+d, m_x[1]+d, m_y[1]+d, m_radius.value());
r.normalize_radius();
// Drawing as an outline
agg::conv_stroke<agg::rounded_rect> p(r);
p.width(1.0);
ras.add_path(p);
ren.color(m_white_on_black.status() ? agg::rgba(1,1,1) : agg::rgba(0,0,0));
agg::render_scanlines(ras, sl, ren);
ras.gamma(agg::gamma_none());
// Render the controls
agg::render_ctrl(ras, sl, rb, m_radius);
agg::render_ctrl(ras, sl, rb, m_gamma);
agg::render_ctrl(ras, sl, rb, m_offset);
agg::render_ctrl(ras, sl, rb, m_white_on_black);
}
开发者ID:Rodeo314,项目名称:vasFMC,代码行数:49,代码来源:rounded_rect.cpp
示例11: double
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);
}
}
开发者ID:Bashakov,项目名称:agg,代码行数:48,代码来源:graph_test.cpp
示例12:
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();
}
开发者ID:GordonSmith,项目名称:agg,代码行数:26,代码来源:rasterizers.cpp
示例13: draw_dashes_draft
//------------------------------------------------------------------------
void draw_dashes_draft()
{
pixfmt pixf(rbuf_window());
base_renderer rb(pixf);
primitives_renderer prim(rb);
outline_rasterizer ras(prim);
int i;
for(i = 0; i < m_graph.get_num_edges(); i++)
{
graph::edge e = m_graph.get_edge(i);
graph::node n1 = m_graph.get_node(e.node1, width(), height());
graph::node n2 = m_graph.get_node(e.node2, width(), height());
curve c(n1.x, n1.y, n2.x, n2.y);
dash_stroke_draft<curve> s(c, 6.0, 3.0, m_width.value());
int r = rand() & 0x7F;
int g = rand() & 0x7F;
int b = rand() & 0x7F;
int a = 255;
if(m_translucent.status()) a = 80;
prim.line_color(agg::srgba8(r, g, b, a));
ras.add_path(s);
}
}
开发者ID:Bashakov,项目名称:agg,代码行数:26,代码来源:graph_test.cpp
示例14: draw_scene
//------------------------------------------------------------------------
void draw_scene(scanline_rasterizer& ras,
solid_renderer& solid,
draft_renderer& draft)
{
ras.gamma(agg::gamma_none());
srand(100);
if(m_draw_nodes.status())
{
if(m_draft.status())
{
draw_nodes_draft();
}
else
{
draw_nodes_fine(ras);
}
}
if(m_draw_edges.status())
{
if(m_draft.status())
{
switch(m_type.cur_item())
{
case 0: draw_lines_draft(); break;
case 1: draw_curves_draft(); break;
case 2: draw_dashes_draft(); break;
}
}
else
{
switch(m_type.cur_item())
{
case 0: draw_lines_fine(ras, solid, draft); break;
case 1: draw_curves_fine(ras, solid, draft); break;
case 2: draw_dashes_fine(ras, solid, draft); break;
case 3:
case 4: draw_polygons(ras, solid, draft); break;
}
}
}
}
开发者ID:Bashakov,项目名称:agg,代码行数:43,代码来源:graph_test.cpp
示例15: on_ctrl_change
void on_ctrl_change()
{
if(m_single_step.status())
{
m_cur_angle += m_step.value();
copy_img_to_img(1, 0);
transform_image(m_step.value());
m_num_steps++;
force_redraw();
m_single_step.status(false);
}
if(m_run.status())
{
#ifdef AGG_ACCURATE_TIME
start_timer();
m_time1 = m_time2 = elapsed_time();
#else
m_time1 = m_time2 = clock();
#endif
m_num_pix = 0.0;
wait_mode(false);
}
if(m_refresh.status() || m_filters.cur_item() != m_cur_filter)
{
#ifdef AGG_ACCURATE_TIME
start_timer();
m_time1 = m_time2 = 0;
#else
m_time1 = m_time2 = clock();
#endif
m_num_pix = 0.0;
m_cur_angle = 0.0;
copy_img_to_img(1, 2);
transform_image(0.0);
m_refresh.status(false);
m_cur_filter = m_filters.cur_item();
m_num_steps = 0;
force_redraw();
}
}
开发者ID:foogywoo,项目名称:drone,代码行数:41,代码来源:image_filters.cpp
示例16: on_ctrl_change
virtual void on_ctrl_change()
{
if(m_animate.status() != m_prev_animate)
{
if(m_animate.status())
{
on_init();
int i;
for(i = 0; i < 6; i++)
{
m_dx[i] = ((rand() % 1000) - 500) * 0.01;
m_dy[i] = ((rand() % 1000) - 500) * 0.01;
}
wait_mode(false);
}
else
{
wait_mode(true);
}
m_prev_animate = m_animate.status();
}
}
开发者ID:zshipko,项目名称:libtwombly,代码行数:22,代码来源:trans_curve1.cpp
示例17:
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();
}
开发者ID:Bashakov,项目名称:agg,代码行数:38,代码来源:conv_dash_marker.cpp
示例18:
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();
}
开发者ID:asmboom,项目名称:PixelFarm,代码行数:15,代码来源:lion_outline.cpp
示例19: on_draw
virtual void on_draw()
{
int width = rbuf_window().width();
int height = rbuf_window().height();
typedef agg::renderer_base<pixfmt> renderer_base;
typedef agg::renderer_scanline_aa_solid<renderer_base> renderer_solid;
pixfmt pixf(rbuf_window());
renderer_base rb(pixf);
renderer_solid r(rb);
rb.clear(agg::rgba(1,1,1));
agg::trans_affine mtx;
mtx *= agg::trans_affine_translation(-g_base_dx, -g_base_dy);
mtx *= agg::trans_affine_scaling(g_scale, g_scale);
mtx *= agg::trans_affine_rotation(g_angle + agg::pi);
mtx *= agg::trans_affine_skewing(g_skew_x/1000.0, g_skew_y/1000.0);
mtx *= agg::trans_affine_translation(width/2, height/2);
if(m_scanline.status())
{
agg::conv_stroke<agg::path_storage> stroke(g_path);
stroke.width(m_width_slider.value());
stroke.line_join(agg::round_join);
agg::conv_transform<agg::conv_stroke<agg::path_storage> > trans(stroke, mtx);
agg::render_all_paths(g_rasterizer, g_scanline, r, trans, g_colors, g_path_idx, g_npaths);
}
else
{
typedef agg::renderer_outline_aa<renderer_base> renderer_type;
typedef agg::rasterizer_outline_aa<renderer_type> rasterizer_type;
double w = m_width_slider.value() * mtx.scale();
agg::line_profile_aa profile(w, agg::gamma_none());
renderer_type ren(rb, profile);
rasterizer_type ras(ren);
agg::conv_transform<agg::path_storage> trans(g_path, mtx);
ras.render_all_paths(trans, g_colors, g_path_idx, g_npaths);
}
agg::render_ctrl(g_rasterizer, g_scanline, rb, m_width_slider);
agg::render_ctrl(g_rasterizer, g_scanline, rb, m_scanline);
}
开发者ID:asmboom,项目名称:PixelFarm,代码行数:48,代码来源:lion_outline.cpp
示例20: render_edge_fine
void render_edge_fine(scanline_rasterizer& ras,
solid_renderer& ren_fine,
draft_renderer& ren_draft,
Source& src)
{
double x, y;
switch(m_draw)
{
case 0:
src.rewind(0);
while(!agg::is_stop(src.vertex(&x, &y)));
break;
case 1:
ras.reset();
ras.add_path(src);
break;
case 2:
ras.reset();
ras.add_path(src);
ras.sort();
break;
case 3:
{
int r = rand() & 0x7F;
int g = rand() & 0x7F;
int b = rand() & 0x7F;
int a = 255;
if(m_translucent.status()) a = 80;
ras.add_path(src);
if(m_type.cur_item() < 4)
{
ren_fine.color(agg::srgba8(r, g, b, a));
agg::render_scanlines(ras, m_sl, ren_fine);
}
else
{
ren_draft.color(agg::srgba8(r, g, b, a));
agg::render_scanlines(ras, m_sl, ren_draft);
}
}
break;
}
}
开发者ID:Bashakov,项目名称:agg,代码行数:47,代码来源:graph_test.cpp
注:本文中的agg::cbox_ctrl类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论