本文整理汇总了C++中agg::path_storage::start_new_path方法的典型用法代码示例。如果您正苦于以下问题:C++ path_storage::start_new_path方法的具体用法?C++ path_storage::start_new_path怎么用?C++ path_storage::start_new_path使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类agg::path_storage
的用法示例。
在下文中一共展示了path_storage::start_new_path方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例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);
}
示例2: parse_lion
unsigned parse_lion(agg::path_storage& path, agg::rgba8* colors, unsigned* path_idx)
{
// Parse the lion and then detect its bounding
// box and arrange polygons orientations (make all polygons
// oriented clockwise or counterclockwise)
const char* ptr = g_lion;
unsigned npaths = 0;
while(*ptr)
{
if(*ptr != 'M' && isalnum(*ptr))
{
unsigned c = 0;
sscanf(ptr, "%x", &c);
// New color. Every new color creates new path in the path object.
path.close_polygon();
colors[npaths] = agg::rgb8_packed(c);
path_idx[npaths] = path.start_new_path();
npaths++;
while(*ptr && *ptr != '\n') ptr++;
if(*ptr == '\n') ptr++;
}
else
{
float x = 0.0;
float y = 0.0;
while(*ptr && *ptr != '\n')
{
int c = *ptr;
while(*ptr && !isdigit(*ptr)) ptr++;
x = atof(ptr);
while(*ptr && isdigit(*ptr)) ptr++;
while(*ptr && !isdigit(*ptr)) ptr++;
y = atof(ptr);
if(c == 'M')
{
path.close_polygon();
path.move_to(x, y);
}
else
{
path.line_to(x, y);
}
while(*ptr && isdigit(*ptr)) ptr++;
while(*ptr && *ptr != '\n' && !isalpha(*ptr)) ptr++;
}
if(*ptr == '\n') ptr++;
}
}
path.arrange_orientations_all_paths(agg::path_flags_cw);
return npaths;
}
示例3: SolidPolygon
void CAggMemoryDC::SolidPolygon(
const PointF* points,
const Color& clr,
unsigned point_count)
{
if (m_buf==0)
return;
if(m_npaths>0)
{
m_pathCache.close_polygon();
m_colorsCache[m_countpaths] = agg::rgba8(clr.GetR(), clr.GetG(), clr.GetB(), clr.GetA());
m_path_idxCache[m_countpaths] = m_pathCache.start_new_path();
m_countpaths++;
m_pathCache.move_to(points->x, points->y);
while(--point_count>0)
{
points++;
m_pathCache.line_to(points->x, points->y);
}
}
else
{
pixel_format pixf(m_rbuf);
ren_base renb(pixf);
solid_renderer ren_solid(renb);
ATLASSERT(point_count>0);
m_path.remove_all();
m_path.move_to(points->x, points->y);
while(--point_count>0)
{
points++;
m_path.line_to(points->x, points->y);
}
m_ras_aa.reset();
m_ras_aa.clip_box(0, 0, m_rcUpdate.Width(), m_rcUpdate.Height());
m_ras_aa.add_path(m_transpath);
ren_solid.color(agg::rgba8(clr.GetR(), clr.GetG(), clr.GetB(), clr.GetA()));
agg::render_scanlines(m_ras_aa, m_sl, ren_solid);
}
}