Approximation of stroked higher-order curved segments by quadratic bèzier curve segments
First Claim
1. A method of approximating cubic Bè
- zier path segments, the method comprising;
receiving a stroke width and a path including a cubic Bè
zier path segment;
computing a first endpoint position, a second endpoint position, a first tangent at the first endpoint, and a second tangent at the second endpoint for the cubic Bè
zier path segmentfitting an approximating quadratic Bè
zier curve segment to the endpoint positions and tangents computed for the cubic Bè
zier path segment;
determining whether the approximating quadratic Bè
zier curve segment is an accurate approximation of the cubic Bè
zier path segment based on a variance metric; and
stroking an approximated path including the approximating quadratic Bezier curve segment by;
constructing a bounding hull geometry that encloses the approximating quadratic Bè
zier curve segment;
writing results to a stencil buffer indicating whether sample points within the bounding hull geometry are inside of a stroke region specified by the stroke width and the approximated path; and
filling the stroke region by writing a color buffer using the results stored in the stencil buffer.
1 Assignment
0 Petitions
Accused Products
Abstract
One embodiment of the present invention sets forth a technique for subdividing stroked higher-order curved segments into quadratic Bèzier curve segments. Path stroking may be accelerated when a GPU or other processor is configured to perform the subdivision operations. Cubic Bèzier path segments are subdivided into quadratic Bèzier curve segments and other lower-order segments at key features. The quadratic Bèzier curve segments approximate the cubic Bèzier path segments. A variance metric is computed for each quadratic Bèzier curve segment, and when the variance metric indicates that the quadratic Bèzier curve segment deviates by more than a threshold from the corresponding portion of the cubic Bèzier path segment, the quadratic Bèzier curve segment is further subdivided. The path composed of the quadratic Bèzier curve segments is then stroked by rendering hull geometry that encloses the path.
44 Citations
17 Claims
-
1. A method of approximating cubic Bè
- zier path segments, the method comprising;
receiving a stroke width and a path including a cubic Bè
zier path segment;computing a first endpoint position, a second endpoint position, a first tangent at the first endpoint, and a second tangent at the second endpoint for the cubic Bè
zier path segmentfitting an approximating quadratic Bè
zier curve segment to the endpoint positions and tangents computed for the cubic Bè
zier path segment;determining whether the approximating quadratic Bè
zier curve segment is an accurate approximation of the cubic Bè
zier path segment based on a variance metric; andstroking an approximated path including the approximating quadratic Bezier curve segment by; constructing a bounding hull geometry that encloses the approximating quadratic Bè
zier curve segment;writing results to a stencil buffer indicating whether sample points within the bounding hull geometry are inside of a stroke region specified by the stroke width and the approximated path; and filling the stroke region by writing a color buffer using the results stored in the stencil buffer. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
- zier path segments, the method comprising;
-
11. A non-transitory computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to approximate cubic Bè
- zier path segments, by performing the steps of;
receiving a stroke width and a path including a cubic Bè
zier path segment;computing a first endpoint position, a second endpoint position, a first tangent at the first endpoint, and a second tangent at the second endpoint for the cubic Bè
zier path segmentfitting an approximating quadratic Bè
zier curve segment to the endpoint positions and tangents computed for the cubic Bè
zier path segment;determining whether the approximating quadratic Bè
zier curve segment is an accurate approximation of the cubic Bè
zier path segment based on a variance metric; andstroking an approximated path including the approximating quadratic Bè
zier curve segment by;constructing a bounding hull geometry that encloses the approximating quadratic Bè
zier curve segment;writing results to a stencil buffer indicating whether sample points within the bounding hull geometry are inside of a stroke region specified by the stroke width and the approximated path; and filling the stroke region by writing a color buffer using the results stored in the stencil buffer. - View Dependent Claims (12, 13, 14, 15, 16)
- zier path segments, by performing the steps of;
-
17. A system for approximate cubic Bè
- zier path segments, the system comprising;
a memory that is configured to store a stroke width and a path including a cubic Bè
zier path segment; anda processor that is coupled to the memory and configured to; receive the stroke width and the path including the cubic Bè
zier path segment;compute a first endpoint position, a second endpoint position, a first tangent at the first endpoint, and a second tangent at the second endpoint for the cubic Bè
zier path segmentfit an approximating quadratic Bè
zier curve segment to the endpoint positions and tangents computed for the cubic Bè
zier path segment;determine whether the approximating quadratic Bè
zier curve segment is an accurate approximation of the cubic Bè
zier path segment based on a variance metric; andstroke an approximated path including the approximating quadratic Bè
zier curve segment by;constructing a bounding hull geometry that encloses the approximating quadratic Bè
zier curve segment;writing results to a stencil buffer indicating whether sample points within the bounding hull geometry are inside of a stroke region specified by the stroke width and the approximated path; and filling the stroke region by writing a color buffer using the results stored in the stencil buffer.
- zier path segments, the system comprising;
Specification