这篇教程C++ vgAppendPathData函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中vgAppendPathData函数的典型用法代码示例。如果您正苦于以下问题:C++ vgAppendPathData函数的具体用法?C++ vgAppendPathData怎么用?C++ vgAppendPathData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了vgAppendPathData函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: draw_pointstatic void draw_point(VGfloat x, VGfloat y){ static const VGubyte cmds[] = {VG_MOVE_TO_ABS, VG_LINE_TO_ABS, VG_LINE_TO_ABS, VG_LINE_TO_ABS, VG_CLOSE_PATH}; const VGfloat coords[] = { x - 2, y - 2, x + 2, y - 2, x + 2, y + 2, x - 2, y + 2}; VGPath path; VGPaint fill; path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1, 0, 0, 0, VG_PATH_CAPABILITY_ALL); vgAppendPathData(path, 5, cmds, coords); fill = vgCreatePaint(); vgSetParameterfv(fill, VG_PAINT_COLOR, 4, black_color); vgSetPaint(fill, VG_FILL_PATH); vgDrawPath(path, VG_FILL_PATH); vgDestroyPath(path); vgDestroyPaint(fill);}
开发者ID:Distrotech,项目名称:mesa-demos,代码行数:25,
示例2: testVlineTovoid testVlineTo(VGPath p, float y, VGPathAbsRel absrel){ VGubyte seg = VG_VLINE_TO | absrel; VGfloat data = y; vgAppendPathData(p, 1, &seg, &data);}
开发者ID:Chazzz,项目名称:pyShiva,代码行数:7,
示例3: add_charstatic void add_char ( VGFont font, FT_Face face, FT_ULong c ){ // Pango already provides us with the font index, not the glyph UNICODE // point. FT_Load_Glyph( face, c, FT_LOAD_DEFAULT ); FT_Outline *outline = &face->glyph->outline; VGPath path; path = vgCreatePath( VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.f, 0.f, 0, 0, VG_PATH_CAPABILITY_ALL ); // It could be a blank. If any character doesn't have a glyph, though, // nothing is drawn by vgDrawGlyphs. if ( outline->n_contours > 0 ) { convert_outline( outline->points, outline->tags, outline->contours, outline->n_contours, outline->n_points ); vgAppendPathData( path, segments_count, segments, coords ); } VGfloat origin[] = { 0.f, 0.f }; VGfloat escapement[] = { float_from_26_6(face->glyph->advance.x), float_from_26_6(face->glyph->advance.y) }; vgSetGlyphToPath( font, c, path, VG_TRUE, origin, escapement ); vgDestroyPath( path );}
开发者ID:allenbarnett5,项目名称:mpddisplay,代码行数:28,
示例4: openVGRelative void OpenVG_SVGHandler::onPathQuad( float x1, float y1, float x2, float y2) { VGubyte seg = VG_QUAD_TO | openVGRelative(); VGfloat data[4]; data[0] = x1; data[1] = y1; data[2] = x2; data[3] = y2; vgAppendPathData(_current_group->current_path->path, 1, &seg, data); }
开发者ID:lukelutman,项目名称:MonkSVG,代码行数:7,
示例5: loadfont// loadfont loads font path data// derived from http://web.archive.org/web/20070808195131/http://developer.hybrid.fi/font2openvg/renderFont.cpp.txtFontinfo loadfont(const int *Points, const int *PointIndices, const unsigned char *Instructions, const int *InstructionIndices, const int *InstructionCounts, const int *adv, const short *cmap, int ng) { Fontinfo f; int i; memset(f.Glyphs, 0, MAXFONTPATH * sizeof(VGPath)); if (ng > MAXFONTPATH) { return f; } for (i = 0; i < ng; i++) { const int *p = &Points[PointIndices[i] * 2]; const unsigned char *instructions = &Instructions[InstructionIndices[i]]; int ic = InstructionCounts[i]; VGPath path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_S_32, 1.0f / 65536.0f, 0.0f, 0, 0, VG_PATH_CAPABILITY_ALL); f.Glyphs[i] = path; if (ic) { vgAppendPathData(path, ic, instructions, p); } } f.CharacterMap = cmap; f.GlyphAdvances = adv; f.Count = ng; f.descender_height = 0; f.font_height = 0; return f;}
开发者ID:ajstarks,项目名称:openvg,代码行数:33,
示例6: loadTigervoid loadTiger(){ int i; VGPath temp; temp = testCreatePath(); tigerPaths = (VGPath*)malloc(pathCount * sizeof(VGPath)); vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); vgTranslate(-100,100); vgScale(1,-1); for (i=0; i<pathCount; ++i) { vgClearPath(temp, VG_PATH_CAPABILITY_ALL); vgAppendPathData(temp, commandCounts[i], commandArrays[i], dataArrays[i]); tigerPaths[i] = testCreatePath(); vgTransformPath(tigerPaths[i], temp); } tigerStroke = vgCreatePaint(); tigerFill = vgCreatePaint(); vgSetPaint(tigerStroke, VG_STROKE_PATH); vgSetPaint(tigerFill, VG_FILL_PATH); vgLoadIdentity(); vgDestroyPath(temp);}
开发者ID:chagge,项目名称:openVG-1,代码行数:28,
示例7: addLineTovoid Path::addArcTo(const FloatPoint& point1, const FloatPoint& point2, float radius){ // See http://philip.html5.org/tests/canvas/suite/tests/spec.html#arcto. const FloatPoint& point0 = m_path->m_currentPoint; if (!radius || point0 == point1 || point1 == point2) { addLineTo(point1); return; } FloatSize v01 = point0 - point1; FloatSize v21 = point2 - point1; // sin(A - B) = sin(A) * cos(B) - sin(B) * cos(A) double cross = v01.width() * v21.height() - v01.height() * v21.width(); if (fabs(cross) < 1E-10) { // on one line addLineTo(point1); return; } double d01 = hypot(v01.width(), v01.height()); double d21 = hypot(v21.width(), v21.height()); double angle = (piDouble - fabs(asin(cross / (d01 * d21)))) * 0.5; double span = radius * tan(angle); double rate = span / d01; FloatPoint startPoint = FloatPoint(point1.x() + v01.width() * rate, point1.y() + v01.height() * rate); rate = span / d21; FloatPoint endPoint = FloatPoint(point1.x() + v21.width() * rate, point1.y() + v21.height() * rate); // Fa: large arc flag, makes the difference between SCWARC_TO and LCWARC_TO // respectively SCCWARC_TO and LCCWARC_TO arcs. We always use small // arcs for arcTo(), as the arc is defined as the "shortest arc" of the // circle specified in HTML 5. // Fs: sweep flag, specifying whether the arc is drawn in increasing (true) // or decreasing (0) direction. const bool anticlockwise = cross < 0; // Translate the large arc and sweep flags into an OpenVG segment command. const VGubyte segmentCommand = anticlockwise ? VG_SCCWARC_TO_ABS : VG_SCWARC_TO_ABS; const VGubyte pathSegments[] = { VG_LINE_TO_ABS, segmentCommand }; const VGfloat pathData[] = { startPoint.x(), startPoint.y(), radius, radius, 0, endPoint.x(), endPoint.y() }; m_path->makeCompatibleContextCurrent(); vgAppendPathData(m_path->vgPath(), 2, pathSegments, pathData); ASSERT_VG_NO_ERROR(); m_path->m_currentPoint = endPoint;}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:60,
示例8: vgCreatePathint FreeFormDrawing::draw ( ){ Control::draw(); list<vector<VGuint>>::iterator SCiter = m_stroke_color.begin(); list<vector<VGufloat>>::iterator SWiter = m_stroke_widths.begin(); list<vector<VGubyte>>::iterator Cmditer = m_commands.begin(); list<vector<VGufloat>>::iterator Coorditer = m_coords.begin(); for ( ; Coorditer!=m_coords.end(); ) { int numCmds = Cmditer.size(); int numCoords = Coorditer.size(); VGPath path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, // scale,bias numCmds, numCoords, VG_PATH_CAPABILITY_ALL); StrokeWidth ( *SWiter ); Stroke_l ( 0xFFFF00FF ); vgAppendPathData(path, numCmds, commands, Coorditer->data() ); vgDrawPath (path, VG_STROKE_PATH ); SCiter++; SWiter++; Cmditer++; Coorditer++; }}
开发者ID:stenniswood,项目名称:bk_code,代码行数:27,
示例9: testLineTovoid testLineTo(VGPath p, float x, float y, VGPathAbsRel absrel){ VGubyte seg = VG_LINE_TO | absrel; VGfloat data[2]; data[0] = x; data[1] = y; vgAppendPathData(p, 1, &seg, data);}
开发者ID:Chazzz,项目名称:pyShiva,代码行数:8,
示例10: testSquadTovoid testSquadTo(VGPath p, float x2, float y2,VGPathAbsRel absrel){ VGubyte seg = VG_SQUAD_TO | absrel; VGfloat data[2]; data[0] = x2; data[1] = y2; vgAppendPathData(p, 1, &seg, data);}
开发者ID:Chazzz,项目名称:pyShiva,代码行数:8,
示例11: vgAppendPathDatavoid simpleVGPath::lineTo(float x, float y){ VGubyte seg = VG_LINE_TO | VG_ABSOLUTE; float data[2]; data[0] = x; data[1] = y; vgAppendPathData(_path, 1, &seg, data);}
开发者ID:CLOUDS-Interactive-Documentary,项目名称:ofxShivaVG,代码行数:8,
示例12: testScubicTovoid testScubicTo(VGPath p, float x2, float y2, float x3, float y3, VGPathAbsRel absrel){ VGubyte seg = VG_SCUBIC_TO | absrel; VGfloat data[4]; data[0] = x2; data[1] = y2; data[2] = x3; data[3] = y3; vgAppendPathData(p, 1, &seg, data);}
开发者ID:Chazzz,项目名称:pyShiva,代码行数:10,
示例13: vgAppendPathDatavoid Path::addBezierCurveTo(const FloatPoint& controlPoint1, const FloatPoint& controlPoint2, const FloatPoint& endPoint){ static const VGubyte pathSegments[] = { VG_CUBIC_TO_ABS }; const VGfloat pathData[] = { controlPoint1.x(), controlPoint1.y(), controlPoint2.x(), controlPoint2.y(), endPoint.x(), endPoint.y() }; m_path->makeCompatibleContextCurrent(); vgAppendPathData(m_path->vgPath(), 1, pathSegments, pathData); ASSERT_VG_NO_ERROR(); m_path->m_currentPoint = endPoint;}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:11,
示例14: testArcTovoid testArcTo(VGPath p, float rx, float ry, float rot, float x, float y, VGPathSegment type, VGPathAbsRel absrel){ VGubyte seg = type | absrel; VGfloat data[5]; data[0] = rx; data[1] = ry; data[2] = rot; data[3] = x; data[4] = y; vgAppendPathData(p, 1, &seg, data);}
开发者ID:Chazzz,项目名称:pyShiva,代码行数:11,
示例15: Java_com_example_startvg_VG11_vgAppendPathData // C function:: void vgAppendPathData(VGPath dstPath, VGint numSegments, // const VGubyte * pathSegments, const void * pathData); JNIEXPORT jint JNICALL Java_com_example_startvg_VG11_vgAppendPathData( JNIEnv * env, jobject obj, jlong dstPathHandle, jint numSegments, jobject pathSegments, jobject pathData) { vgAppendPathData( (VGPath) dstPathHandle, (VGint) numSegments, (const VGubyte *) pathSegments, (const void *) pathData ); }
开发者ID:gdawg,项目名称:androidvg,代码行数:14,
示例16: initstatic voidinit(void){ VGfloat clearColor[] = {1.0f, 1.0f, 1.0f, 1.0f};/* white color */ VGfloat fillColor[] = {1.0f, 0.0f, 0.0f, 1.0f};/* red color */ static const VGubyte segments[4] = {VG_MOVE_TO_ABS, VG_SCCWARC_TO_ABS, VG_SCCWARC_TO_ABS, VG_CLOSE_PATH}; VGfloat data[12]; const VGfloat cx = 0, cy=29, width=80, height=40; const VGfloat hw = width * 0.5f; const VGfloat hh = height * 0.5f; data[0] = cx + hw; data[1] = cy; data[2] = hw; data[3] = hh; data[4] = 0; data[5] = cx - hw; data[6] = cy; data[7] = hw; data[8] = hh; data[9] = 0; data[10] = data[0]; data[11] = cy; vgSetfv(VG_CLEAR_COLOR, 4, clearColor); vgSeti(VG_RENDERING_QUALITY, VG_RENDERING_QUALITY_NONANTIALIASED); path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 0, 0, VG_PATH_CAPABILITY_ALL); if (path == VG_INVALID_HANDLE) { return; } paint = vgCreatePaint(); if (paint == VG_INVALID_HANDLE) { vgDestroyPath(path); return; } vgAppendPathData(path, 4, segments, data); vgSetParameterfv(paint, VG_PAINT_COLOR, 4, fillColor); vgSetParameteri( paint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR); vgSetPaint(paint, VG_FILL_PATH);}
开发者ID:Distrotech,项目名称:mesa-demos,代码行数:47,
示例17: vgft_font_convert_glyphsVCOS_STATUS_T vgft_font_convert_glyphs(VGFT_FONT_T *font, unsigned int char_height, unsigned int dpi_x, unsigned int dpi_y){ FT_UInt glyph_index; FT_ULong ch; if (FT_Set_Char_Size(font->ft_face, 0, char_height, dpi_x, dpi_y)) { FT_Done_Face(font->ft_face); vgDestroyFont(font->vg_font); return VCOS_EINVAL; } ch = FT_Get_First_Char(font->ft_face, &glyph_index); while (ch != 0) { if (FT_Load_Glyph(font->ft_face, glyph_index, FT_LOAD_DEFAULT)) { FT_Done_Face(font->ft_face); vgDestroyFont(font->vg_font); return VCOS_ENOMEM; } VGPath vg_path; FT_Outline *outline = &font->ft_face->glyph->outline; if (outline->n_contours != 0) { vg_path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 0, 0, VG_PATH_CAPABILITY_ALL); assert(vg_path != VG_INVALID_HANDLE); convert_outline(outline->points, outline->tags, outline->contours, outline->n_contours, outline->n_points); vgAppendPathData(vg_path, segments_count, segments, coords); } else { vg_path = VG_INVALID_HANDLE; } VGfloat origin[] = { 0.0f, 0.0f }; VGfloat escapement[] = { float_from_26_6(font->ft_face->glyph->advance.x), float_from_26_6(font->ft_face->glyph->advance.y) }; vgSetGlyphToPath(font->vg_font, glyph_index, vg_path, VG_FALSE, origin, escapement); if (vg_path != VG_INVALID_HANDLE) { vgDestroyPath(vg_path); } ch = FT_Get_Next_Char(font->ft_face, ch, &glyph_index); } return VCOS_SUCCESS;}
开发者ID:JasOnRadC1iFfe,项目名称:summer2015,代码行数:46,
注:本文中的vgAppendPathData函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ vgDestroyImage函数代码示例 C++ vfwprintf函数代码示例 |