这篇教程C++ vgDrawPath函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中vgDrawPath函数的典型用法代码示例。如果您正苦于以下问题:C++ vgDrawPath函数的具体用法?C++ vgDrawPath怎么用?C++ vgDrawPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了vgDrawPath函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: displayvoid display(float interval){ VGfloat cc[] = {0,0,0,1}; vgSetfv(VG_CLEAR_COLOR, 4, cc); vgClear(0,0,testWidth(),testHeight()); vgSeti(VG_MATRIX_MODE, VG_MATRIX_FILL_PAINT_TO_USER); vgLoadIdentity(); vgTranslate(tx, ty); vgRotate(ang); vgScale(sx, sy); vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); vgLoadIdentity(); vgSetPaint(radialFill, VG_FILL_PATH); vgDrawPath(p, VG_FILL_PATH); vgTranslate(tx, ty); vgRotate(ang); vgScale(sx, sy); vgSetPaint(blackFill, VG_FILL_PATH | VG_STROKE_PATH); vgDrawPath(radius, VG_STROKE_PATH); vgDrawPath(center, VG_STROKE_PATH); vgDrawPath(focus, VG_FILL_PATH);}
开发者ID:Chazzz,项目名称:pyShiva,代码行数:28,
示例2: ASSERTvoid PainterOpenVG::drawLine(const IntPoint& from, const IntPoint& to){ ASSERT(m_state); if (m_state->strokeDisabled()) return; m_surface->makeCurrent(); VGPath path = vgCreatePath( VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0 /* scale */, 0.0 /* bias */, 2 /* expected number of segments */, 4 /* expected number of total coordinates */, VG_PATH_CAPABILITY_APPEND_TO); ASSERT_VG_NO_ERROR(); VGUErrorCode errorCode; // Try to align lines to pixels, centering them between pixels for odd thickness values. if (fmod(m_state->strokeThickness + 0.5, 2.0) < 1.0) errorCode = vguLine(path, from.x(), from.y(), to.x(), to.y()); else if ((to.y() - from.y()) > (to.x() - from.x())) // more vertical than horizontal errorCode = vguLine(path, from.x() + 0.5, from.y(), to.x() + 0.5, to.y()); else errorCode = vguLine(path, from.x(), from.y() + 0.5, to.x(), to.y() + 0.5); if (errorCode == VGU_NO_ERROR) { vgDrawPath(path, VG_STROKE_PATH); ASSERT_VG_NO_ERROR(); } vgDestroyPath(path); ASSERT_VG_NO_ERROR();}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:35,
示例3: render void render() { vgSetPaint(paint_, VG_FILL_PATH); assert(!vgGetError()); vgDrawPath(path_, VG_FILL_PATH); assert(!vgGetError()); }
开发者ID:JamesHarrison,项目名称:omxplayer,代码行数:7,
示例4: 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,
示例5: 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,
示例6: displayvoid display(float interval){ VGfloat cc[] = {0,0,0,1}; vgSetfv(VG_CLEAR_COLOR, 4, cc); vgClear(0,0,testWidth(),testHeight()); vgSeti(VG_MATRIX_MODE, VG_MATRIX_FILL_PAINT_TO_USER); vgLoadIdentity(); vgTranslate(tx, ty); vgScale(sx, sy); vgRotate(a); vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); vgLoadIdentity(); vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE); vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_MULTIPLY); vgLoadIdentity(); vgSetPaint(patternFill, VG_FILL_PATH); /*vgDrawPath(p, VG_FILL_PATH);*/ vgDrawImage(backImage); vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); vgLoadIdentity(); vgTranslate(tx, ty); vgScale(sx, sy); vgRotate(a); vgSetPaint(blackFill, VG_FILL_PATH | VG_STROKE_PATH); vgDrawPath(org, VG_FILL_PATH);}
开发者ID:Chazzz,项目名称:pyShiva,代码行数:33,
示例7: Text// Text renders a string of text at a specified location, size, using the specified font glyphs// derived from http://web.archive.org/web/20070808195131/http://developer.hybrid.fi/font2openvg/renderFont.cpp.txtvoid Text(VGfloat x, VGfloat y, const char *s, Fontinfo f, int pointsize) { VGfloat size = (VGfloat) pointsize, xx = x, mm[9]; vgGetMatrix(mm); int character; unsigned char *ss = (unsigned char *)s; while ((ss = next_utf8_char(ss, &character)) != NULL) { int glyph = f.CharacterMap[character]; if (character >= MAXFONTPATH-1) { continue; } if (glyph == -1) { continue; //glyph is undefined } VGfloat mat[9] = { size, 0.0f, 0.0f, 0.0f, size, 0.0f, xx, y, 1.0f }; vgLoadMatrix(mm); vgMultMatrix(mat); vgDrawPath(f.Glyphs[glyph], VG_FILL_PATH); xx += size * f.GlyphAdvances[glyph] / 65536.0f; } vgLoadMatrix(mm);}
开发者ID:ajstarks,项目名称:openvg,代码行数:27,
示例8: display//Display functionsvoid display(float interval){ int i; const VGfloat *style; VGfloat clearColor[] = {1,1,1,1}; if (animate) { ang += interval * 360 * 0.1f; if (ang > 360) ang -= 360; } vgSetfv(VG_CLEAR_COLOR, 4, clearColor); vgClear(0,0,testWidth(),testHeight()); vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); vgLoadIdentity(); vgTranslate(testWidth()/2 + tx,testHeight()/2 + ty); vgScale(sx, sy); vgRotate(ang); for (i=0; i<pathCount; ++i) { style = styleArrays[i]; vgSetParameterfv(tigerStroke, VG_PAINT_COLOR, 4, &style[0]); vgSetParameterfv(tigerFill, VG_PAINT_COLOR, 4, &style[4]); vgSetf(VG_STROKE_LINE_WIDTH, style[8]); vgDrawPath(tigerPaths[i], (VGint)style[9]); // Bingo!!, Draw it!! } vgFlush();}
开发者ID:chagge,项目名称:openVG-1,代码行数:31,
示例9: drawstatic voiddraw(void){ vgClear(0, 0, window_width(), window_height()); vgDrawPath(path, VG_FILL_PATH); vgFlush();}
开发者ID:Distrotech,项目名称:mesa-demos,代码行数:8,
示例10: poly// poly makes either a polygon or polylinevoid poly(VGfloat * x, VGfloat * y, VGint n, VGbitfield flag) { VGfloat points[n * 2]; VGPath path = newpath(); interleave(x, y, n, points); vguPolygon(path, points, n, VG_FALSE); vgDrawPath(path, flag); vgDestroyPath(path);}
开发者ID:ajstarks,项目名称:openvg,代码行数:9,
示例11: drawstatic voiddraw(void){ vgClear(0, 0, window_width(), window_height()); vgLoadIdentity(); vgTranslate(50, 21); vgDrawPath(path, VG_FILL_PATH); vgFlush();}
开发者ID:Distrotech,项目名称:mesa-demos,代码行数:9,
示例12: Java_com_example_startvg_VG11_vgDrawPath // C function:: void vgDrawPath(VGPath path, VGbitfield paintModes); JNIEXPORT jint JNICALL Java_com_example_startvg_VG11_vgDrawPath( JNIEnv * env, jobject obj, jlong path, jint paintModes ){ vgDrawPath( (VGPath) path, (VGbitfield) paintModes ); }
开发者ID:gdawg,项目名称:androidvg,代码行数:11,
示例13: drawstatic voiddraw(void){ VGint WINDSIZEX = window_width(); VGint WINDSIZEY = window_height(); VGPaint fill; VGPath box; VGfloat color[4] = {1.f, 0.f, 0.f, 1.f}; VGfloat bgCol[4] = {0.7f, 0.7f, 0.7f, 1.0f}; VGfloat transCol[4] = {0.f, 0.f, 0.f, 0.f}; VGImage image = vgCreateImage(VG_sRGBA_8888, img_width, img_height, VG_IMAGE_QUALITY_NONANTIALIASED); /* Background clear */ fill = vgCreatePaint(); vgSetParameterfv(fill, VG_PAINT_COLOR, 4, color); vgSetPaint(fill, VG_FILL_PATH); box = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1, 0, 0, 0, VG_PATH_CAPABILITY_ALL); /* Rectangle to cover completely 16x16 pixel area. */ RectToPath(box, 0, 0, 64, 64); vgSetfv(VG_CLEAR_COLOR, 4, transCol); vgClearImage(image, 0, 0, img_width, img_height); vgSetfv(VG_CLEAR_COLOR, 4, color); vgClearImage(image, 10, 10, 12, 12); //vgImageSubData(image, pukki_64x64_data, pukki_64x64_stride, // VG_sRGBA_8888, 0, 0, 32, 32); vgSeti(VG_MASKING, VG_TRUE); vgLoadIdentity(); vgSetfv(VG_CLEAR_COLOR, 4, bgCol); vgClear(0, 0, WINDSIZEX, WINDSIZEY); vgMask(image, VG_FILL_MASK, 0, 0, window_width(), window_height()); vgMask(image, VG_SET_MASK, x_pos, y_pos, 100, 100); vgDrawPath(box, VG_FILL_PATH); //vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE); //vgTranslate(-10, -10); //vgDrawImage(image); vgDestroyPaint(fill); vgDestroyPath(box);}
开发者ID:Distrotech,项目名称:mesa-demos,代码行数:50,
示例14: OnPaintLRESULT OnPaint(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam){ VGPaint strokePaint = vgCreatePaint(); vgSetPaint(strokePaint, VG_STROKE_PATH); VGfloat color[4] = { 1.0f, 0.0f, 0.0f, 1.0f }; vgSetParameterfv(strokePaint, VG_PAINT_COLOR, 4, &color[0]); VGPath line = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1, 0, 0, 0, VG_PATH_CAPABILITY_ALL); vguLine(line, 20, 20, 130, 130); VGPath square = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1, 0, 0, 0, VG_PATH_CAPABILITY_ALL); vguRect(square, 10.0f, 10.0f, 130.0f, 50.0f); vgSetf(VG_STROKE_LINE_WIDTH, 7.0f); vgDrawPath(line, VG_STROKE_PATH); vgDrawPath(square, VG_STROKE_PATH); ::ValidateRect(hWnd, NULL); return 0;}
开发者ID:UIKit0,项目名称:MonkVG,代码行数:24,
示例15: setAttributevoid NwSvgFigure::draw(){ setAttribute(); VGbitfield paintModes = 0; if( STROKE_NONE != m_svgAttribute.nStrokeType ) { paintModes |= VG_STROKE_PATH; } if( FILL_NONE != m_svgAttribute.nFillType ) { paintModes |= VG_FILL_PATH; } vgDrawPath(m_path, paintModes); //vgFinish(); vgClearPath(m_path, VG_PATH_CAPABILITY_ALL);}
开发者ID:nurozhikun,项目名称:nuroOpenVG,代码行数:16,
示例16: drawstatic voiddraw(void){ VGfloat point[2], tangent[2]; int i = 0; vgClear(0, 0, window_width(), window_height()); vgSetPaint(fill, VG_FILL_PATH); vgDrawPath(path, VG_FILL_PATH); draw_marks(path); vgFlush();}
开发者ID:Distrotech,项目名称:mesa-demos,代码行数:16,
示例17: eglMakeCurrentvoid CTSmallWindowOpenVG::RenderL() { CTWindow::RenderL(); // Make sure that this egl status is active eglMakeCurrent(iDisplay, iSurface, iSurface, iContextVG); VGfloat clearColor[4] = {0.1f, 0.2f, 0.4f, 1.f}; VGfloat scaleFactor = Size().iWidth/200.f; if (Size().iHeight/200.f < scaleFactor) { scaleFactor = Size().iHeight/200.f; } iCurrentRotation = iTime; if (iCurrentRotation >= 360.f) { iCurrentRotation -= 360.f; } vgSetfv(VG_CLEAR_COLOR, 4, clearColor); vgClear(0, 0, Size().iWidth, Size().iHeight); vgLoadIdentity(); vgTranslate((float)Size().iHeight / 2, (float)Size().iHeight / 2); vgScale(scaleFactor, scaleFactor); vgRotate(iCurrentRotation); vgTranslate(-50.f, -50.f); vgSeti(VG_BLEND_MODE, VG_BLEND_SRC_OVER); vgSeti(VG_FILL_RULE, VG_EVEN_ODD); vgSetPaint(iFillPaint, VG_FILL_PATH); vgSetf(VG_STROKE_LINE_WIDTH, 10.f); vgSeti(VG_STROKE_CAP_STYLE, VG_CAP_ROUND); vgSeti(VG_STROKE_JOIN_STYLE, VG_JOIN_ROUND); vgSetf(VG_STROKE_MITER_LIMIT, 0.f); vgSetPaint(iStrokePaint, VG_STROKE_PATH); vgDrawPath(iPath, VG_FILL_PATH | VG_STROKE_PATH); iTime++; eglSwapBuffers(iDisplay, iSurface); }
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:46,
示例18: drawstatic voiddraw(void){ VGPath line; VGPaint fillPaint; VGubyte lineCommands[3] = {VG_MOVE_TO_ABS, VG_LINE_TO_ABS, VG_LINE_TO_ABS}; VGfloat lineCoords[] = {-2.0f,-1.0f, 0.0f,0.0f, -1.0f, -2.0f}; VGfloat clearColor[] = {0.0f, 0.0f, 0.0f, 1.0f};/* black color */ VGfloat fillColor[] = {1.0f, 1.0f, 1.0f, 1.0f};/* white color */ //VGfloat testRadius = 60.0f; VGfloat testRadius = 10.0f; int WINDSIZEX = window_width(); int WINDSIZEY = window_height(); line = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 0, 0, VG_PATH_CAPABILITY_ALL); fillPaint = vgCreatePaint(); vgSetf(VG_STROKE_LINE_WIDTH, 1.0f); //vgSeti(VG_STROKE_CAP_STYLE, VG_CAP_ROUND); vgSeti(VG_STROKE_CAP_STYLE, VG_CAP_BUTT); vgSeti(VG_STROKE_JOIN_STYLE, VG_JOIN_ROUND); //vgSeti(VG_STROKE_JOIN_STYLE, VG_JOIN_BEVEL); vgSeti(VG_RENDERING_QUALITY, VG_RENDERING_QUALITY_BETTER); vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); vgLoadIdentity(); vgTranslate(60, 60); vgScale(testRadius * 2, testRadius * 2); vgAppendPathData(line, 3, lineCommands, lineCoords); vgSetfv(VG_CLEAR_COLOR, 4, clearColor); vgSetPaint(fillPaint, VG_STROKE_PATH); vgSetParameterfv(fillPaint, VG_PAINT_COLOR, 4, fillColor); vgSetParameteri( fillPaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR); vgClear(0, 0, WINDSIZEX, WINDSIZEY); vgDrawPath(line, VG_STROKE_PATH); vgDestroyPath(line); vgDestroyPaint(fillPaint);}
开发者ID:Distrotech,项目名称:mesa-demos,代码行数:46,
示例19: displayvoid display(float interval){ VGfloat cc[] = {0,0,0,1}; angle += interval * 0.4 * PI; if (angle > 2*PI) angle -= 2*PI; amount = (sin(angle) + 1) * 0.5f; createMorph(); vgSetfv(VG_CLEAR_COLOR, 4, cc); vgClear(0,0,testWidth(),testHeight()); vgLoadIdentity(); vgTranslate(testWidth()/2, testHeight()/2); vgScale(1.5, 1.5); vgDrawPath(iMorph, VG_FILL_PATH);}
开发者ID:gdawg,项目名称:androidvg,代码行数:17,
示例20: pushTransformvoid OpenVG_SVGHandler::draw_recursive( group_t& group ) { // push the group matrix onto the stack pushTransform( group.transform ); vgLoadMatrix( topTransform().m ); for ( list<path_object_t>::iterator it = group.path_objects.begin(); it != group.path_objects.end(); it++ ) { path_object_t& po = *it; uint32_t draw_params = 0; if ( po.fill ) { vgSetPaint( po.fill, VG_FILL_PATH ); draw_params |= VG_FILL_PATH; } if ( po.stroke ) { vgSetPaint( po.stroke, VG_STROKE_PATH ); vgSetf( VG_STROKE_LINE_WIDTH, po.stroke_width ); draw_params |= VG_STROKE_PATH; } if( draw_params == 0 ) { // if no stroke or fill use the default black fill vgSetPaint( _blackBackFill, VG_FILL_PATH ); draw_params |= VG_FILL_PATH; } // set the fill rule vgSeti( VG_FILL_RULE, po.fill_rule ); // trasnform pushTransform( po.transform ); vgLoadMatrix( topTransform().m ); vgDrawPath( po.path, draw_params ); popTransform(); vgLoadMatrix( topTransform().m ); } for ( list<group_t>::iterator it = group.children.begin(); it != group.children.end(); it++ ) { draw_recursive( *it ); } popTransform(); vgLoadMatrix( topTransform().m );}
开发者ID:micahpearlman,项目名称:MonkSVG,代码行数:42,
示例21: displayvoid display(float interval){ int x,y,p; VGfloat white[] = {1,1,1,1}; vgSetfv(VG_CLEAR_COLOR, 4, white); vgClear(0, 0, testWidth(), testHeight()); vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); for (y=0, p=0; y<3; ++y) { for (x=0; x<3; ++x, ++p) { if (p > NUM_PRIMITIVES) break; vgLoadIdentity(); vgTranslate(100 + x*150, 100 + y*150); vgDrawPath(primitives[p], VG_STROKE_PATH); } }}
开发者ID:cg123,项目名称:pyShiva,代码行数:20,
注:本文中的vgDrawPath函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ vgSeti函数代码示例 C++ vgDestroyPath函数代码示例 |