CN102819853B - Curve rendering intent and system - Google Patents
Curve rendering intent and system Download PDFInfo
- Publication number
- CN102819853B CN102819853B CN201110162427.8A CN201110162427A CN102819853B CN 102819853 B CN102819853 B CN 102819853B CN 201110162427 A CN201110162427 A CN 201110162427A CN 102819853 B CN102819853 B CN 102819853B
- Authority
- CN
- China
- Prior art keywords
- curve
- described curve
- sampling
- delta
- carries out
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Landscapes
- Image Generation (AREA)
Abstract
Disclose a kind of curve rendering intent and system.Wherein this curve rendering intent, being comprised: sampled by the curve played up needs, is a series of sampled points be positioned on curve by curve segmentation; The pixel nearest by sampled point of adjusting the distance is played up, and has carried out playing up for curve.This curve rendering system and method can avoid the process of pixel by pixel track curve, thus can avoid the problem that produces due to slope calculations mistake.
Description
Technical field
The present invention relates to graphics process field, relate more specifically to a kind of curve rendering intent and system.
Background technology
(namely two dimension (2D) curve is played up, Drawing of Curve) refer to, rasterizing carried out to the two-dimensional curve that will draw thus obtains a series of pixel to describe this curve, and realizing playing up this curve by playing up this series of pixel.2D curve conventional in computer graphics comprises second order Bayside curve, three rank Bayside curve and elliptic curves.The main thought of known 2D curve plotting method is, finds the nearest pixel of distance Curve one by one from the starting point of curve, by having played up the drafting of curve to the pixel found.In the process finding the nearest pixel of distance Curve, common way judges the next position needing the pixel of drawing according to curve at the slope of current pixel.Due to the shape very irregular of curve, in some cases, curve is at the slope of current pixel and curve self slope and misfit, thus obtains the location of pixels of mistake, makes whole piece Drawing of Curve mistake.
Summary of the invention
In view of above problem, the present invention proposes a kind of curve rendering intent and system of novelty.
According to the curve rendering intent of the embodiment of the present invention, comprising: sampled by the curve played up needs, is a series of sampled points be positioned on curve by curve segmentation; The pixel nearest by sampled point of adjusting the distance is played up, and has carried out playing up for curve.
Wherein, the part being less than 1 to slope absolute value on curve carries out the sampling in x direction, and the part being greater than 1 to slope absolute value on curve carries out the sampling in y direction.Curve is two-dimensional curve, and carries out two dimension sampling according to the resolution of display window to curve.Find out the sampled point when sampling to curve in x direction or y direction by following process: parametric equation x=x (t) utilizing curve, y=y (t) calculates the stepping step delta t of the parametric t when sampling to curve in x direction or y direction
xor Δ t
y; Utilize stepping step delta t
xor Δ t
y, and the parametric equation of curve calculate the coordinate of sampled point when sampling to curve in x direction or y direction.
According to the curve rendering system of the embodiment of the present invention, comprising: curve segmentation unit, for by needing the curve played up to sample, is a series of sampled points be positioned on curve by curve segmentation; Curve rendering unit, plays up for the pixel nearest by sampled point of adjusting the distance, has carried out playing up for curve.
Wherein, curve segmentation unit carries out the sampling in x direction to the part that slope absolute value on curve is less than 1, and the part being greater than 1 to slope absolute value on curve carries out the sampling in y direction.Curve is two-dimensional curve, and curve segmentation unit carries out two dimension sampling according to the resolution of display window to curve.Curve segmentation unit finds out the sampled point when sampling to curve in x direction or y direction by following process: parametric equation x=x (t) utilizing curve, and y=y (t) calculates the stepping step delta t of the parametric t when sampling to curve in x direction or y direction
xor Δ t
y; Utilize stepping step delta t
xor Δ t
y, and the parametric equation of curve calculate the coordinate of sampled point when sampling to curve in x direction or y direction.
The process of pixel by pixel track curve can be avoided according to the curve rendering system of the embodiment of the present invention and method, thus the problem that produces due to slope calculations mistake can be avoided.
Accompanying drawing explanation
Below in conjunction with accompanying drawing in the description of the specific embodiment of the present invention, the present invention may be better understood, wherein:
Fig. 1 shows the block diagram of the curve rendering system according to the embodiment of the present invention;
Fig. 2 shows the process flow diagram of the curve rendering intent according to the embodiment of the present invention; And
Fig. 3 shows the mode example of sampling to curve according to curve rendering system and the method for the embodiment of the present invention.
Embodiment
The characteristic sum exemplary embodiment of various aspects of the present invention will be described in detail below.Description below covers many details, to provide complete understanding of the present invention.But, it will be apparent to one skilled in the art that the present invention can implement when not needing some details in these details.Below the description of embodiment is only used to by illustrating example of the present invention to provide to the clearer understanding of the present invention.Any concrete configuration that the present invention proposes below being never limited to and algorithm, but cover any amendment of coherent element, parts and algorithm, replacement and improvement under the premise of without departing from the spirit of the present invention.
The present invention proposes a kind of curve and play up thinking, first according to the resolution of display window, two dimension sampling is carried out to curve, thus curve segmentation is become a series of sampled point be positioned on curve, then draw the drafting that the nearest pixel of distance sample completes whole piece curve.This method can avoid the process of traditional pixel by pixel track curve, thus can avoid the problem that produces due to slope calculations mistake.
Fig. 1 shows the block diagram of the curve rendering system according to the embodiment of the present invention.Fig. 2 shows the process flow diagram of the curve rendering intent according to the embodiment of the present invention.Below in conjunction with Fig. 1 and Fig. 2, the curve rendering system according to the embodiment of the present invention and method are described.
As shown in Figure 1, curve segmentation unit 102 and curve rendering unit 104 is comprised according to the curve rendering system of the embodiment of the present invention.Wherein, curve segmentation, for by needing the curve played up to sample, is a series of sampled points (that is, performing step S202) be positioned on curve by curve segmentation unit 102; Curve rendering unit 104 is played up for the pixel nearest by sampled point of adjusting the distance, and has carried out playing up (that is, performing step S204) curve.
Particularly, according in the curve rendering system of the embodiment of the present invention and method, the part being less than 1 to slope absolute value on the curve needing to play up carries out the sampling in x direction; The part needing slope absolute value on the curve played up to be greater than 1 is carried out to the sampling in y direction.Fig. 3 shows the mode example of sampling to curve according to embodiment of the present invention curve rendering system and method.
Illustrating according to the curve rendering system of the embodiment of the present invention and method is below a series of sampled points how found out on curve.In computer graphics, 2D curve generally includes elliptic curve, secondary Bessel function curve and three Bessel function curves.The curvilinear equation of these curves is all be described with the form of parametric equation usually, i.e. the form (wherein, y=f (x)) of x=x (t), y=y (t).
When sampling to curve in x direction, suppose that sampling interval is [x
0, x
m], then calculative sample point coordinate is (x
0, f (x
0)), (x
0+ 1, f (x
0+ 1)), (x
0+ 2, f (x
0+ 2)) ... (x
m, f (x
m)).According to the parametric equation of curve, when calculating a series of (t
0, t
1, t
2... t
m) meet x (t
0)=x
0, x (t
1)=x
0+ 1 ... x (t
m)=x
m, then f (x can be obtained
0)=y (t
0), f (x
0+ 1)=y (t
1) ... f (x
n)=y (t
n).
Equally, when sampling to curve in y direction, suppose that sampling interval is [y
0, y
n], then calculative sample point coordinate is (f
-1(y
0), y
0), (f
-1(y
0+ 1), y
0+ 1), (f
-1(y
0+ 2), y
0+ 2) ... (f
- 1(y
n), y
n).According to the parametric equation of curve, when calculating a series of (t
0, t
1, t
2... t
n) meet y (t
0)=y
0, y (t
1)=y
0+ 1 ... y (t
n)=y
n, then f can be obtained
-1(y
0)=y (t
0), f
-1(y
0+ 1)=y (t
1) ... f
-1(y
n)=y (t
n).
Here is the method for sampling for secondary Bezier, Cubic kolmogorov's differential system and elliptic curve.
Secondary Bezier
Its parametric equation is following form:
t∈[0,1]
When being less than the fractional-sample of 1 in x direction to the slope absolute value on secondary Bezier, the process of the coordinate of calculating sampling point is as follows:
The approximate solution of above-mentioned equation is
The coordinate of sampled point can pass through stepping Δ t
xand calculate x (t), y (t) obtains.
By similar method, when being greater than the fractional-sample of 1 in y direction to the slope absolute value on secondary Bezier, can obtain
The coordinate of sampled point can pass through stepping Δ t
yand calculate x (t), y (t) obtains.
After curve segmentation is become a series of sampled point, only need to carry out drawing the drafting that just can complete whole piece curve to the pixel nearest from sampled point.
Cubic kolmogorov's differential system
Its parametric equation is:
t∈[0,1]
When being less than the fractional-sample of 1 in x direction to the slope absolute value on Cubic kolmogorov's differential system, the process of the coordinate of calculating sampling point is as follows:
x(t+Δt)-x(t)=a
x(t+Δt)
3+b
x(t+Δt)
2+c
x(t+Δt)+d
x-(a
xt
3+b
xt
2+c
xt+d
x)
=a
x(3t
2Δt+3tΔt
2+Δt
3)+b
x(2tΔt+Δt
2)+c
xΔt
=a
xΔt
3+(3a
xt+b
x)Δt
2+(3a
xt
2+2b
xt+c
x)Δt
The approximate solution of above-mentioned equation is
The coordinate of sampled point can calculate x (t) by stepping Δ tx, and y (t) obtains.
By similar method, when being greater than the fractional-sample of 1 in y direction to the slope absolute value on Cubic kolmogorov's differential system, can obtain
The coordinate of sampled point can pass through stepping Δ t
yand calculate x (t), y (t) obtains.
After curve segmentation is become a series of sampled point, only need to carry out drawing the drafting that just can complete whole piece curve to the pixel nearest from sampled point.
Elliptic curve
Its parametric equation is
x(t)=acost-bsint
y(t)=ccost+dsint
t∈[0,2π]
When being less than the fractional-sample of 1 in x direction to the slope absolute value on elliptic curve, the process of the coordinate of calculating sampling point is as follows:
x(t+Δt)=a(costcosΔt-sintsinΔt)-b(sintcosΔt+costsinΔt)
=(acost-bsint)cosΔt-(asint+bcost)sinΔt
The approximate solution of above-mentioned equation is
The coordinate of sampled point can pass through stepping Δ t
xand calculate x (t), y (t) obtains.
By similar method, when being greater than the fractional-sample of 1 in y direction to the slope absolute value on elliptic curve, can obtain
The coordinate of sampled point can pass through stepping Δ t
yand calculate x (t), y (t) obtains.
After curve segmentation is become a series of sampled point, only need to carry out drawing the drafting that just can complete whole piece curve to the pixel nearest from sampled point.
Avoid the process of pixel by pixel track curve according to the curve rendering system of the embodiment of the present invention and method, thus avoid the problem produced due to slope calculations mistake.
Below the present invention is described with reference to specific embodiments of the invention, but those skilled in the art all understand, various amendment, combination and change can be carried out to these specific embodiments, and the spirit and scope of the present invention by claims or its equivalents can not be departed from.
Step can be performed as required with hardware or software.Note, without departing from the scope of the invention, the process flow diagram that can provide in this instructions adds step, therefrom removal step or amendment step wherein.In general, process flow diagram is just used to refer to a kind of possible sequence of the basic operation for practical function.
Embodiments of the invention can utilize the universal digital computer of programming, utilize special IC, programmable logic device (PLD), field programmable gate array, light, chemistry, the system of biological, quantum or nanometer engineering, assembly and mechanism realize.In general, function of the present invention can be realized by any means known in the art.Distributed or networked system, assembly and circuit can be used.The communication of data or to transmit can be wired, wireless or by any other means.
Also will recognize, according to the needs of application-specific, one or more in the key element shown in accompanying drawing by be more separated or more integrated mode realizes, or can be removed or to be deactivated even in some cases.The journey logic bomb that realization can be stored in machine readable media performs above-mentioned any method to allow computing machine, also within the spirit and scope of the present invention.
In addition, any signal arrows in accompanying drawing should be considered to be only exemplary, instead of restrictive, indicates unless otherwise specifically.When term be also contemplated as the ability of separation or combination is not known time, the combination of assembly or step also will be considered to describe.
Claims (8)
1. a curve rendering intent, comprising:
By to needing the curve played up to carry out uniform sampling, be a series of sampled points be positioned on described curve by described curve segmentation;
The pixel nearest by described sampled point of adjusting the distance is played up, and has carried out playing up for described curve, wherein
In x direction or y direction, uniform sampling is carried out to described curve by following process:
Utilize parametric equation x=x (t) of described curve, y=y (t) calculates the stepping step delta t of parametric t when carrying out uniform sampling in x direction or y direction to described curve
xor Δ t
y;
Utilize stepping step delta t
xor Δ t
y, and the parametric equation of described curve calculate the coordinate of sampled point when uniform sampling carrying out to described curve in x direction or y direction.
2. curve rendering intent according to claim 1, is characterized in that, the part being less than 1 to slope absolute value on described curve carries out the sampling in x direction.
3. curve rendering intent according to claim 1, is characterized in that, the part being greater than 1 to slope absolute value on described curve carries out the sampling in y direction.
4. curve rendering intent according to claim 1, is characterized in that, described curve is two-dimensional curve, and carries out two dimension sampling according to the resolution of display window to described curve.
5. a curve rendering system, comprising:
Described curve segmentation, for by needing the curve played up to carry out uniform sampling, is a series of sampled points be positioned on described curve by curve segmentation unit;
Curve rendering unit, plays up for the pixel nearest by described sampled point of adjusting the distance, has carried out playing up for described curve, wherein
Described curve segmentation unit carries out uniform sampling in x direction or y direction to described curve by following process:
Utilize parametric equation x=x (t) of described curve, y=y (t) calculates the stepping step delta t of parametric t when carrying out uniform sampling in x direction or y direction to described curve
xor Δ t
y;
Utilize stepping step delta t
xor Δ t
y, and the parametric equation of described curve calculate the coordinate of sampled point when uniform sampling carrying out to described curve in x direction or y direction.
6. curve rendering system according to claim 5, is characterized in that, described curve segmentation unit carries out the sampling in x direction to the part that slope absolute value on described curve is less than 1.
7. curve rendering system according to claim 5, is characterized in that, described curve segmentation unit carries out the sampling in y direction to the part that slope absolute value on described curve is greater than 1.
8. curve rendering system according to claim 5, is characterized in that, described curve is two-dimensional curve, and described curve segmentation unit carries out two dimension sampling according to the resolution of display window to described curve.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110162427.8A CN102819853B (en) | 2011-06-10 | 2011-06-10 | Curve rendering intent and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110162427.8A CN102819853B (en) | 2011-06-10 | 2011-06-10 | Curve rendering intent and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102819853A CN102819853A (en) | 2012-12-12 |
CN102819853B true CN102819853B (en) | 2015-11-25 |
Family
ID=47303956
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110162427.8A Expired - Fee Related CN102819853B (en) | 2011-06-10 | 2011-06-10 | Curve rendering intent and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102819853B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104243929A (en) * | 2014-09-26 | 2014-12-24 | 武汉烽火众智数字技术有限责任公司 | Display method for visual range of camera on electronic map |
CN104537698B (en) * | 2014-12-26 | 2017-11-28 | 北京航天飞行控制中心 | A kind of adaptive track method for drafting of curvature |
CN109978968B (en) * | 2019-04-10 | 2023-06-20 | 广州虎牙信息科技有限公司 | Video drawing method, device and equipment of moving object and storage medium |
CN113077530B (en) * | 2021-05-06 | 2022-06-24 | 衡阳师范学院 | Traditional curved surface pane construction method and device and electronic equipment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101189642A (en) * | 2005-06-06 | 2008-05-28 | 松下电器产业株式会社 | Curve plotting device, curve plotting method, parking support device, and vehicle |
CN101901488A (en) * | 2009-05-25 | 2010-12-01 | 富士通株式会社 | Method and device for curve approximation and method and device for controlling graphics display |
CN101911123A (en) * | 2008-01-15 | 2010-12-08 | 三菱电机株式会社 | Graphic drawing device and graphic drawing method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5476103B2 (en) * | 2009-11-27 | 2014-04-23 | 富士フイルム株式会社 | Page description data processing apparatus, method and program |
-
2011
- 2011-06-10 CN CN201110162427.8A patent/CN102819853B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101189642A (en) * | 2005-06-06 | 2008-05-28 | 松下电器产业株式会社 | Curve plotting device, curve plotting method, parking support device, and vehicle |
CN101911123A (en) * | 2008-01-15 | 2010-12-08 | 三菱电机株式会社 | Graphic drawing device and graphic drawing method |
CN101901488A (en) * | 2009-05-25 | 2010-12-01 | 富士通株式会社 | Method and device for curve approximation and method and device for controlling graphics display |
Non-Patent Citations (3)
Title |
---|
A Pixel Level Algorithm for Drawing Curves;Hongji Yang et al;《Proceedings of the 6th Chinese Automation & Computer Science Conference》;20000923;全文 * |
Topology and arrangement computation of semi-algebraic planar curves;L. Alberti et al;《Computer Aided Geometric Design》;20080722;第25卷;全文 * |
实平面奇异代数曲线的全局B样条逼近;方美娥 等;《软件学报》;20061031;第17卷(第10期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN102819853A (en) | 2012-12-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102819853B (en) | Curve rendering intent and system | |
US11192558B2 (en) | Method, apparatus, and system for providing road curvature data | |
US10599930B2 (en) | Method and apparatus of detecting object of interest | |
CN114390990B (en) | System and method for determining a target vehicle speed | |
US10402995B2 (en) | Method, apparatus, and system for real-time object detection using a cursor recurrent neural network | |
US10373002B2 (en) | Method, apparatus, and system for a parametric representation of lane lines | |
US11151447B1 (en) | Network training process for hardware definition | |
US9644976B2 (en) | Building missing movement path of an object | |
US8463289B2 (en) | Depersonalizing location traces | |
JP6048421B2 (en) | Cycle length estimation device for traffic light | |
US10928819B2 (en) | Method and apparatus for comparing relevant information between sensor measurements | |
Yang et al. | Spin transport in ferromagnet-InSb nanowire quantum devices | |
CN109154938B (en) | Classifying entities in a digital graph using discrete non-trace location data | |
US20200400439A1 (en) | Method, apparatus, and system for identifying map error based on road curvature data | |
JP2018112887A (en) | Information processing device, information processing method, and information processing program | |
Molignini et al. | Generating quantum multicriticality in topological insulators by periodic driving | |
US10776951B2 (en) | Method, apparatus, and system for an asymmetric evaluation of polygon similarity | |
CN111080648B (en) | Real-time image semantic segmentation algorithm based on residual learning | |
CN106092116A (en) | The generation of a kind of optimum travel route based on navigation terminal, air navigation aid and device | |
CN111104076B (en) | Map display method, map display device and storage medium | |
US20230150551A1 (en) | Systems and methods for determining an attention level of an occupant of a vehicle | |
US20160042722A1 (en) | Dynamic label arrangement device, display device, dynamic label arrangement method, and display method | |
CN110442719B (en) | Text processing method, device, equipment and storage medium | |
Teske et al. | Flopping-mode electron dipole spin resonance in the strong-driving regime | |
JP5333787B2 (en) | Image processing apparatus and image processing program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20151125 Termination date: 20180610 |