本文整理汇总了C++中SVGPathByteStream类的典型用法代码示例。如果您正苦于以下问题:C++ SVGPathByteStream类的具体用法?C++ SVGPathByteStream怎么用?C++ SVGPathByteStream使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SVGPathByteStream类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ASSERT
void SVGAnimatedPathAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to)
{
ASSERT(from->type() == AnimatedPath);
ASSERT(from->type() == to->type());
SVGPathByteStream* fromPath = from->path();
SVGPathByteStream* toPath = to->path();
unsigned fromPathSize = fromPath->size();
if (!fromPathSize || fromPathSize != toPath->size())
return;
addToSVGPathByteStream(toPath, fromPath);
}
示例2: buildAnimatedSVGPathByteStream
bool buildAnimatedSVGPathByteStream(const SVGPathByteStream& fromStream, const SVGPathByteStream& toStream, SVGPathByteStream& result, float progress)
{
ASSERT(&toStream != &result);
result.clear();
if (toStream.isEmpty())
return true;
SVGPathByteStreamBuilder builder(result);
SVGPathByteStreamSource fromSource(fromStream);
SVGPathByteStreamSource toSource(toStream);
return SVGPathBlender::blendAnimatedPath(fromSource, toSource, builder, progress);
}
示例3: addToSVGPathByteStream
bool addToSVGPathByteStream(SVGPathByteStream& fromStream, const SVGPathByteStream& byStream, unsigned repeatCount)
{
if (fromStream.isEmpty() || byStream.isEmpty())
return true;
OwnPtr<SVGPathByteStream> fromStreamCopy = fromStream.copy();
fromStream.clear();
SVGPathByteStreamBuilder builder(fromStream);
SVGPathByteStreamSource fromSource(*fromStreamCopy);
SVGPathByteStreamSource bySource(byStream);
SVGPathBlender blender(&fromSource, &bySource, &builder);
return blender.addAnimatedPath(repeatCount);
}
示例4: buildSVGPathByteStreamFromString
bool buildSVGPathByteStreamFromString(const String& d, SVGPathByteStream& result, PathParsingMode parsingMode)
{
result.clear();
if (d.isEmpty())
return true;
// The string length is typically a minor overestimate of eventual byte stream size, so it avoids us a lot of reallocs.
result.reserveInitialCapacity(d.length());
SVGPathByteStreamBuilder builder(result);
SVGPathStringSource source(d);
SVGPathParser parser(&source, &builder);
bool ok = parser.parsePathDataFromSource(parsingMode);
result.shrinkToFit();
return ok;
}
示例5: addToSVGPathByteStream
bool addToSVGPathByteStream(SVGPathByteStream& streamToAppendTo, const SVGPathByteStream& byStream, unsigned repeatCount)
{
// Why return when streamToAppendTo is empty? Don't we still need to append?
if (streamToAppendTo.isEmpty() || byStream.isEmpty())
return true;
// Is it OK to make the SVGPathByteStreamBuilder from a stream, and then clear that stream?
SVGPathByteStreamBuilder builder(streamToAppendTo);
SVGPathByteStream fromStreamCopy = streamToAppendTo;
streamToAppendTo.clear();
SVGPathByteStreamSource fromSource(fromStreamCopy);
SVGPathByteStreamSource bySource(byStream);
return SVGPathBlender::addAnimatedPath(fromSource, bySource, builder, repeatCount);
}
示例6: buildStringFromByteStream
bool buildStringFromByteStream(const SVGPathByteStream& stream, String& result, PathParsingMode parsingMode)
{
if (stream.isEmpty())
return true;
SVGPathByteStreamSource source(stream);
return SVGPathParser::parseToString(source, result, parsingMode);
}
示例7: buildSVGPathByteStreamFromString
bool buildSVGPathByteStreamFromString(const String& d, SVGPathByteStream& result, PathParsingMode parsingMode)
{
result.clear();
if (d.isEmpty())
return true;
SVGPathStringSource source(d);
return SVGPathParser::parseToByteStream(source, result, parsingMode);
}
示例8: buildSVGPathByteStreamFromSVGPathSegList
bool buildSVGPathByteStreamFromSVGPathSegList(const SVGPathSegList& list, SVGPathByteStream& result, PathParsingMode parsingMode)
{
result.clear();
if (list.isEmpty())
return true;
SVGPathSegListSource source(list);
return SVGPathParser::parseToByteStream(source, result, parsingMode);
}
示例9: buildPathFromByteStream
bool buildPathFromByteStream(const SVGPathByteStream& stream, Path& result)
{
if (stream.isEmpty())
return true;
SVGPathBuilder builder(result);
SVGPathByteStreamSource source(stream);
return SVGPathParser::parse(source, builder);
}
示例10: buildSVGPathSegListFromByteStream
bool buildSVGPathSegListFromByteStream(const SVGPathByteStream& stream, SVGPathElement& element, SVGPathSegList& result, PathParsingMode parsingMode)
{
if (stream.isEmpty())
return true;
SVGPathSegListBuilder builder(element, result, parsingMode == NormalizedParsing ? PathSegNormalizedRole : PathSegUnalteredRole);
SVGPathByteStreamSource source(stream);
return SVGPathParser::parse(source, builder, parsingMode);
}
示例11: buildPathFromByteStream
bool buildPathFromByteStream(const SVGPathByteStream& stream, Path& result)
{
if (stream.isEmpty())
return true;
SVGPathBuilder builder(result);
SVGPathByteStreamSource source(stream);
SVGPathParser parser(&source, &builder);
return parser.parsePathDataFromSource(NormalizedParsing);
}
示例12: getPointAtLengthOfSVGPathByteStream
FloatPoint getPointAtLengthOfSVGPathByteStream(const SVGPathByteStream& stream, float length)
{
if (stream.isEmpty())
return FloatPoint();
SVGPathTraversalStateBuilder builder(PathTraversalState::TraversalPointAtLength, length);
SVGPathByteStreamSource source(stream);
SVGPathParser parser(&source, &builder);
parser.parsePathDataFromSource(NormalizedParsing);
return builder.currentPoint();
}
示例13: getTotalLengthOfSVGPathByteStream
float getTotalLengthOfSVGPathByteStream(const SVGPathByteStream& stream)
{
if (stream.isEmpty())
return 0;
SVGPathTraversalStateBuilder builder(PathTraversalState::TraversalTotalLength);
SVGPathByteStreamSource source(stream);
SVGPathParser parser(&source, &builder);
parser.parsePathDataFromSource(NormalizedParsing);
return builder.totalLength();
}
示例14: getSVGPathSegAtLengthFromSVGPathByteStream
unsigned getSVGPathSegAtLengthFromSVGPathByteStream(const SVGPathByteStream& stream, float length)
{
if (stream.isEmpty())
return 0;
SVGPathTraversalStateBuilder builder(PathTraversalState::TraversalSegmentAtLength, length);
SVGPathByteStreamSource source(stream);
SVGPathParser parser(&source, &builder);
parser.parsePathDataFromSource(NormalizedParsing);
return builder.pathSegmentIndex();
}
示例15: buildStringFromByteStream
bool buildStringFromByteStream(const SVGPathByteStream& stream, String& result, PathParsingMode parsingMode)
{
if (stream.isEmpty())
return true;
SVGPathStringBuilder builder;
SVGPathByteStreamSource source(stream);
SVGPathParser parser(&source, &builder);
bool ok = parser.parsePathDataFromSource(parsingMode);
result = builder.result();
return ok;
}