Bezier spline to quadratic polynomial fragment conversion
BACKGROUND 
     1. Field of the Invention 
     The present invention relates to the representation of curves in graphics systems and, in particular, describes a methods by which objects described by cubic polynomials can be converted into corresponding quadratic polynomial descriptions. 
     2. Description of the Related Art 
     Computerised graphics systems generally form an image based upon one or more graphic objects, each defining a particular shape, component or line in the image. Typically, each object is defined by an outline curve which defines the interior of the object which can be displayed, by varying the colour between the interior and the exterior of the outline curve the outline curve can itself define a portion of an objects structure. 
     One popular form of defining the outline of each object is a spline format and the most popular spline formats are various forms for parametric cubic polynomials, such as Bezier curves. Other types of cubic polynomials that can be used are Hermite and B-splines. 
     Although cubic polynomials have been used for a number of years to produce high quality graphic images, such images take a substantial time to calculate and display in view of the need to calculate the roots of a cubic polynomial in order to obtain the various pixel locations of the curve outline on each scan-line of the display, such as a video display unit or a printer. 
     Although current levels of technology are sufficient to produce hardware able to perform the necessary calculations required to display cubic polynomials in real-time for full video animation, such hardware is highly complex, expensive and therefore not readily accessible to consumer markets. 
     Reference is hereby made to the following patent specifications lodged concurrently herewith and the disclosure of which is hereby incorporated by cross-reference: 
     (i) U.S. patent application Ser. No. 08/053,373, filed Apr. 28, 1993, claiming priority from Australian Patent Application No. PL2147, filed Apr. 29, 1992, entitled &#34;A Real-Time Object Based Graphics System&#34;; 
     (iv) U.S. patent application Ser. No. 08/053,363, filed Apr. 28, 1993, claiming priority from Australian Patent Application No. PL 2156, filed Apr. 29, 1992, entitled &#34;Edge Calculation for Graphics Systems&#34;; 
     (v) U.S. patent application Ser. No. 08/053,378, filed Apr. 28, 1993, claiming priority from Australian Patent Application No. PL 2142, filed Apr. 29, 1992, entitled: &#34;A Preprocessing Pipeline for RTO Graphics System&#34;; 
     (vi) U.S. patent application Ser. No. 08/053,231 claiming priority from Australian Patent Application No. PL 2145 Apr. 29, 1992, entitled &#34;Object Sorting for Graphics Systems&#34;; and 
     (vii) U.S. patent application Ser. No. 08/053,219, filed Apr. 28, 1993, claiming priority from Australian Patent Application No. PL 2150, filed Apr. 29, 1992, entitled &#34;Object Based Graphics Using Quadratic Polynomial Fragments&#34;. 
     In the above specifications it is proposed to use an alternative format for the representation of curve outline. Instead of using cubic polynomials, and cubic splines in particular, it is proposed to use quadratic polynomial fragments (QPF&#39;s). QPF&#39;s, in view of their representation being based upon quadratic polynomials as opposed to cubic polynomials, can be more easily calculated, preferably by two separate additions, and thereby permit the real-time calculation and rendering of object based images. 
     In this manner, a graphic object can be divided into a plurality of QPF&#39;s which define various portions of the object outline and from which the object edges can be calculated prior to display of the image. 
     As specifically described in Australian Patent Application No. PL 2150, filed Apr. 29, 1992, entitled &#34;Object Based Graphics Using Quadratic Polynomial Fragments&#34;, a QPF can be described by the following QPF data components: START --  PIXEL, ΔPIXEL, ΔΔPIXEL, START --  LINE, and END --  LINE. In this manner, such QPF data can be used to generate pixel location values (PIXEL) along the QPF between the START --  LINE and END --  LINE in the following manner: 
     PIXEL (line n+1 )=PIXEL (line n )+ΔPIXEL (line n ) 
     ΔPIXEL (line n+1 )=ΔPIXEL (line n )+ΔΔPIXEL 
     where 
     PIXEL (line n  =START --  LINE)=START --  PIXEL; and 
     ΔPIXEL (line n  =START --  LINE)=ΔPIXEL. 
     Because there currently exists large numbers of graphic objects described by cubic polynomials such as Bezier splines, it is desirable that a means be provided by which objects described in known spline formats can be converted into QPF&#39;s. 
     SUMMARY OF THE INVENTION 
     It is an object of the present invention to substantially overcome, or ameliorate at least one of the aforementioned difficulties with the prior art. 
     In accordance with a first aspect of the present invention there is disclosed a method for converting an object of a computerized graphics system described by a plurality of spline formats into a corresponding object described by a plurality of quadratic polynomial fragments (QPF), said method comprising, for each spline of said object, the steps of: 
     (a). selecting start and end points on said spline and designating same as corresponding start and end points on the corresponding QPF; 
     (b). determining from the control points of the spline, coefficients of the quadratic polynomial describing said QPF; 
     (c). using the coefficients to determine if an error between the spline and the quadratic polynomial is below a predetermined level; and 
     (d). if so, determining from said coefficients, QPF data describing said quadratic polynomial. 
     If the error is not below the predetermined amount, then 
     (e). the spline is divided into two or more sub-splines for which a corresponding quadratic polynomial is determined. This step is repeated if necessary until the error between each quadratic polynomial and the corresponding sub-spline is below the predetermined amount. The error can be an area error and/or an angle error. 
     In accordance with a second aspect of the present invention there is disclosed a method for converting an object of a computerized graphic system described by a plurality of spline formats into a corresponding object described by a plurality of quadratic polynomial fragments (QPF), said method comprising, for each spline of said object, the steps of: 
     (a). selecting start and end points on said spline and designating same as corresponding start and end points for a plurality of QPF&#39;s on the corresponding QPF; 
     (b). determining from the control points of the spline, coefficients of the quadratic polynomial describing each said QPF; 
     (c). using the coefficients to determine if an error between the spline and the quadratic polynomials is below a predetermined level; and 
     (d) if so, determining from said coefficients, QPF data describing said quadratic polynomials. 
     If the error is not below the predetermined amount, then 
     (e). the spline is divided into two or more sub-splines for which a corresponding quadratic polynomial(s) is determined using steps (a) to (d) from either the first or second aspect. This step is repeated if necessary until the area error between each quadratic polynomial and the corresponding sub-spline is below the predetermined amount. 
     In accordance with another aspect of the present invention there is disclosed a computer system adapted for the conversion of spline-based graphic objects into quadratic polynomial fragments by means of the steps (a)-(d) above. 
     In accordance with another aspect of the present invention there is disclosed a memory device configured for the storage of graphic object data characterised in that said data comprises a plurality of quadratic polynomial fragments. 
     Preferably the error is an area error or an angle error, and most preferably both. 
     In accordance with another aspect of the present invention there is disclosed a method for convening an object of a computerized graphics system described by a plurality of spline formats into a corresponding object described by a plurality of quadratic polynomial fragments (QPF), said method comprising, for each spline of said object, the steps of: 
     determining a set of equations with corresponding variable values describing an error associated with the said splines and their corresponding QPFs, and 
     optimizing said set of equations to determine a best set of variable values. 
     In accordance with another aspect of the present invention there is disclosed a method for converting a portion of an object of a computerized graphics system, said portion being described by a plurality of splines forming a closed loop, into a corresponding object described by a plurality of quadratic polynomial fragments (QPF), said method comprising the steps of: 
     (a) selecting a first spline of said closed loop and with said first spline: 
     (i) selecting a QPF starting point corresponding to the starting point of a first spline, 
     (ii) calculating a corresponding starting QPF having the same starting slope and same end slope as said spline, 
     (iii) measuring the difference between the endpoint of said QPF and the end point of said first spline, 
     (iv) if said difference is less than a predetermined tolerance, then accepting said starting QPF as a sufficiently accurate approximation to the first spline and proceeding with steps (b) and (c) for the other splines in the closed loop, 
     (v) if said difference is not less than a predetermined tolerance, then splitting said first spline into at least two spline portions and applying step (a) to a first portion of said first spline, and steps (b) and (c) to the other portions, 
     (b) with all the intermediate splines in said closed loop: 
     (i) selecting an endpoint of a previously calculated QPF as the starting point of a current QPF, 
     (ii) calculating a current QPF having the same starting slope and same end slope as the corresponding said intermediate spline, 
     (iii) measuring the difference between the endpoint of said current QPF and the end point of said corresponding intermediate spline, 
     (iv) if said difference is less than a predetermined tolerance, then accepting said current QPF as a sufficiently accurate approximation of the corresponding intermediate spline and proceeding with steps (b) and (c) for the other splines in the closed loop, 
     (v) if said difference is not less than a predetermined tolerance, then splitting said current spline into at least two spline portions and performing steps (b) and (c) on said splines portions, and 
     (c) with a final spline in said closed loop 
     (i) selecting an endpoint of a previously calculated QPF as the starting point of a last QPF, 
     (ii) calculating a last QPF having the same starting slope and same end point as said final spline, 
     (iii) determining if a predetermined criteria is satisfied between said last QPF and said final spline, 
     (iv) if said criteria is satisfied, then accepting said final QPF as a sufficiently accurate approximation to the final spline, 
     (v) if said difference is not less than a predetermined tolerance, then splitting said final spline into at least two spline portions and performing steps (b) and (c) on said splines portions. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     Although the present invention is applicable to splines other than Bezier splines, a preferred embodiment of the present invention which relates to the conversion of Bezier splines to QPF&#39;s will now be described with reference to the drawings in which: 
     FIG. 1 is an illustration of a single QPF and the appropriate QPF data components used to describe the curve; 
     FIG. 2 illustrates the area difference between a spline and its corresponding QPF; 
     FIG. 3 is similar to FIG. 2 but shows the matching of two parabolas to a single spline; 
     FIG. 4 illustrates the process of fitting N QPF&#39;s to a portion of a spline; 
     FIG. 5 illustrates the process of FIG. 4 whereby continuity between QPF&#39;s is maintained; 
     FIG. 6 is a flow chart illustrating the simulated annealing process; 
     FIG. 7 is an illustration of the start of a third method of converting splines to QPFs; 
     FIG. 8 is an illustration of a continuation of the method of FIG. 7; and 
     FIG. 8 is an illustration of the continuation of the third method of converting splines to QPFs. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     Referring to FIG. 1, a single QPF is shown illustrated which commences at a START --  LINE at a START --  PIXEL and extends to an END --  LINE. The horizontal lines seen in FIG. 1, represent the scan lines of a display such as the raster lines of a video display unit or the scan lines of a printer. The QPF data is configured so that the value of each pixel on each line for a particular QPF can be calculated in the manner described earlier. 
     CURVE DEFINITION 
     Bezier splines, in general, are usually described by a parametric equation of the form: 
     
         r=r(u)=a.sub.0 +ua.sub.1 +u.sup.2 a.sub.2 +u.sup.3 a.sub.3 (EQ 1) 
    
     This form can be used to independently determine x and y, via the parameter u, where u varies between 0 and 1. ##EQU1## 
     For a cubic spline, the formulae are as given in Equation (3). ##EQU2## 
     A Quadratic Polynomial Fragment (QPF) represents a section of a parabola. As such, its formula can be expressed as 
     
         y=f(x)=ax.sup.2 +bx+cx.sub.start ≦x≦x.sub.end (EQ 4) 
    
     QPF&#39;s have been developed specifically, but not exclusively, for graphic object image rendering, using apparatus such as that disclosed in the herebefore cross-referenced Australian Patent Application No. PL2147, filed Apr. 29, 1992. 
     Accordingly, as the scan line progresses, the curve&#39;s new pixel value is calculated from the ΔPIXEL and ΔΔPIXEL values of the QPF. As such, for graphics systems, the more correct representation of Equation (4) is: 
     
         pixel=f(line)=a line.sup.2 +b line+c                       (EQ 5) 
    
     That is, x is taken to be the line direction, and y to be the pixel direction. 
     Note that if a is equal to zero, the QPF represents a straight line. 
     Furthermore, the Bezier Splines of the preferred embodiment are described using the standard 4 point format. That is P 0  (x 0 ,y 0 ) is the starting end-point, P 1  (x 1 ,y 1 ) and P 2  (x 2 ,y 2 ) are subsequent control points, and P 3  (x 3 ,y 3 ) is the finishing end-point. Also the preferred embodiment seeks to match QPF&#39;s to the spline that have both first and second order continuity. First order continuity is where two curves have coincident end points. Second order continuity is achieved where the end points are coincident and the curves have the same slope at the joining point. 
     A RECURSIVE CONVERSION METHOD 
     A preferred method for converting a spline to a QPF called a recursive conversion method will now be described. 
     CONVERSION REQUIREMENTS 
     In converting a spline to a QPF, the following attributes are desirable: 
     Identical End-Points 
     It is important that the start and end points of the spline and QPF be identical (to maintain first order continuity). This is shown by the relationship of Equation (6). Substituting Equation (4) into Equation (6) and solving simultaneously shows that b and c are linear in terms of a. This relationship is shown in Equation (7). ##EQU3## 
     Area Tolerance 
     The curves should follow similar paths. A tolerance measure must therefore be determined to measure the allowable deviation from the original path. Preferably, this tolerance should be defined in terms of errors that the eye can detect. Such a definition is extremely complex, however, because in some circumstances large deviations will be acceptable (e.g. if the deviation is smooth and doesn&#39;t flatten an edge which should be curved,) whereas in others even small deviations are unacceptable (e.g. if the small deviation is sharp, or flattens a slight curve.). 
     One method for controlling this error is to define the tolerance in terms of the allowable area between the original spline and the QPF. Because a small distance deviation from the original path will increase the accumulated area as the spline&#39;s length increases, this area tolerance must be taken on an area-per-unit-length basis. 
     Angle Tolerance 
     Second order continuity must be maintained in visual applications, as the eye is particularly sensitive to changes in gradient between lines. As a parabola does not have the same number of degrees of freedom as a spline, it is not guaranteed that a perfect match can be found for the gradients of the spline&#39;s endpoints in any single QPF. Consequently a tolerance for angle deviation is necessary in the conversion. Note that this must be angle deviation, not gradient deviation, as some slopes have zero or infinite gradients. 
     Flatness Tolerance 
     The conversion algorithm should attempt to minimise the number of QPFs required to represent a spline. This requirement can be facilitated by the introduction of a flatness tolerance. That is, a measure of the spline&#39;s deviation from a straight line can be made. If this deviation is smaller than the specified tolerance, the spline is considered to be a straight line, and is therefore converted to a single, linear, QPF. 
     Coefficient Limits 
     QPFs are designed to be rendered in real time by the calculation of ΔPixel and ΔΔPixel values. Any hardware doing these calculations will have limits on the values that these variables can take; these limits will be defined by the size of internal registers. For example, in the apparatus of Australian Patent Application No. PL2147, filed of Apr. 29, 1992, ΔPixel must be in the range -128 to +127.996093750, while ΔΔPixel must be in the range -0.5 to +0.499984741. 
     The ΔPixel limit imposes the maximum slope that can be matched. Beyond this limit, the line must be considered vertical, and therefore discarded. 
     The ΔPixel limit imposes a limit on the value of the matching parabola&#39;s a coefficient. Given a QPF defined as in Equation (5), ΔΔPixel is given by: ##EQU4## 
     For the apparatus Australian Patent Application No. PL2147 of 29th Apr., 1992, therefore, a is limited to the range -0.25 to +0.249992371. 
     THE GENERAL CONVERSION PROCESS 
     From the requirements as previously outlined, a general conversion process can be created. This process is as follows: 
     
         ______________________________________                                    
IF The spline is flat (within the specified tolerance)                    
THEN                                                                      
  Convert it to a linear QPF                                              
ELSE                                                                      
  Match one or more parabola(s) to the spline, maintaining                
  first-order continuity, and the limits of a.                            
  IF The area error and angle errors are within tolerance                 
  THEN                                                                    
   Convert the parabola(s) to QPF(s).                                     
  ELSE                                                                    
   Split the spline, and repeat the above for each end                    
   individually.                                                          
  ENDIF                                                                   
ENDIF                                                                     
______________________________________                                    
 
    
     MATCHING PARABOLAS TO THE SPLINE 
     When matching parabolas to a spline, there is no reason why it must be matched with only one parabola; in fact, this gives unsatisfactory results most of the time. In general, better results can be obtained by matching more than one parabola, but the mathematics makes the procedure very computer-intensive if more than two parabolas are used. 
     Therefore, if a one-parabola or two-parabola match cannot be found, the spline is preferably split into subsplines, and the sub-splines converted. 
     MATCHING A SINGLE PARABOLA MINIMIZING THE VISUAL AREA ERROR 
     Referring now to FIG. 2, there is shown one way of describing how well a QPF 22 fits a spline 21, is to find the area under the spline and subtract the area under the QPF. 
     This area difference 23 between the curves is preferably squared to keep the resulting area measure at all times positive, resulting in a mean squared error term in Equation (9). ##EQU5## 
     Equation (9) can be represented in terms of a, b, and c by substituting Equation (4) as follows: ##EQU6## 
     Expanding Equation (10) and representing in terms of a, b, and c gives: ##EQU7## 
     Collecting the integral values then, the error term becomes: ##EQU8## 
     Equation (7) can be applied to Equation (12) to show that the error term is a quadratic in a which can then be minimised to find the value of a that will produce the smallest area error. ##EQU9## 
     Equation (13) is a general area error term for any spline and parabola whose start and end points match. However the computation is very intensive for each of the integral terms. A way of avoiding some of this processing to calculate the error term is to translate the spline so that its start point is at the origin. Once the matching parabola is found, it can be translated back to the original spline position. With the starting point of the spline at the origin, the following relations then become true: ##EQU10## 
     Symbolic evaluation of the integrals, and simplifying the expressions results in Equation (15), Equation (16) and Equation (17), which define α, β and γ in terms of the control points of the spline. ##EQU11## 
     Once α, β and γ are known, Equation (13) can be used to calculate a for the minimum-area parabola. If a is outside the allowed limits (see the previous discussion entitled Coefficient Limits) it should be set to the nearest limit. 
     Once a is known, the area error can be calculated. The error term is absolute, and should be divided by the length of the spline to yield a relative error. If the error is acceptable (within a predetermined tolerance), then the parabola (Equation (14) gives b and c in terms of a) is a good fit, and can be used to generate the QPF (remembering to translate the parabola back to the original starting position). If the area is not acceptable, the original spline (untranslated) can be split into sub-splines, and the conversion procedure can be carried out recursively on each sub-spline. An example procedure for splitting splines is to take the position parametrically halfway down the spline (u=1/2), although an alternative approach can be to split at the points of inflection or some other heuristic. 
     The pseudocode for this process is as follows: 
     
         ______________________________________                                    
parabola = Calc.sub.-- MinError.sub.-- Parabola(spline)                   
IF a is outside the limits                                                
THEN                                                                      
  Move a to the nearest limit.                                            
ENDIF                                                                     
area.sub.-- err = Calc.sub.-- Min.sub.-- Area.sub.-- Error(spline,        
parabola) / Length                                                        
(spline)                                                                  
IF area.sub.-- err &lt; area.sub.-- tolerance                                
  Found.sub.-- QPF(parabola)                                              
ELSE                                                                      
  Split.sub.-- And.sub.-- Convert(spline)                                 
FI                                                                        
______________________________________                                    
 
    
     AN ALTERNATIVE AREA MINIMIZATION METHOD 
     While the minimisation of the visual area, as described above, is the most correct approach to area minimisation, the mathematics behind it are complex, and the conversion process is therefore computationally expensive. An alternative method exists which simplifies the mathematics by providing a simplified error measure. 
     This method involves converting the parabola to a spline, and minimising the area between the &#34;y&#34; curve of the original spline, and the &#34;y&#34; curve of the new, parabolic spline. Errors between the &#34;x&#34; curves are ignored, so this approach is not as correct as the visual area approach. It does, however, produce acceptable results with a reduced computation time. 
     It can be shown that, given a section of a parabola thus: 
     
         y=ax.sup.2 +bx+c where x.sub.a ≦x≦x.sub.b    (EQ 18) 
    
     an equivalent spline can be identified with four points thus: 
     
         x.sub.q0 =x.sub.a                                          (EQ 19) 
    
     
         y.sub.q0 =y.sub.a ax.sup.2.sub.a +bx.sub.a +c              (EQ 20) ##EQU12## 
    
     Given the spline equivalent of a parabola, an error term can be calculated in an equivalent manner to the error given in Equation (9), i.e.: ##EQU13## where, q(u) is the spline&#39;s y equation as given in Equation (3), and 
     
         q.sub.q (u)=y.sub.qo +(-3y.sub.qo +3y.sub.q1)u+(3y.sub.q0 -6y.sub.q1 +3y.sub.q1)u.sup.2 +(-y.sub.qo +3y.sub.q1 -3y.sub.q2 +y.sub.q3)u.sup.3 (EQ 28) 
    
     Evaluation of this integral results in an error value equal to: ##EQU14## 
     This error term can be simplified by translating the spline and the parabola to the origin, thereby setting x 0  and y 0  to zero. The result is: ##EQU15## 
     If the derivative of the area error with respect to a is equated to zero, the value of a which minimises the area difference results. This value is given by: ##EQU16## 
     If the parabola is translated to the origin, this becomes: ##EQU17## 
     Once the value of a is found, the area error can be calculated by the use of Equation (29) or Equation (30). If the area error is within tolerance, it is a straight-forward exercise to evaluate the values of b and c, given the fact that the parabola has the given a, and passes through the points (x a ,y a ) and (x b ,y b ). 
     MAINTAINING SECOND-ORDER CONTINUITY 
     When matching a single parabola to a spline, three degrees of freedom are available. These are the parabola&#39;s a, b and c coefficients. By imposing the two constraints &#34;both endpoints must match&#34;, the degrees of freedom are reduced to 1. It is possible, therefore to impose one extra constraint. As described above, this is taken to be &#34;minimise the area error.&#34; 
     Further constraints cannot be imposed, therefore. In particular, constraints on the slope of the parabola at the spline&#39;s end-points cannot be imposed. 
     As a result, the &#34;minimum area&#34; parabola obtained by either of the above methods may not be the best visual match because it may not have a tolerable second order continuity. The conversion algorithm can also account for angle differences by the use of an angle tolerance. 
     The difference is preferably measured in degrees, not in terms of the slope. This is because small slope differences translate into large angle differences at low angles (near 0 degrees,) while large slope differences translate into small angle differences as the angle approaches 90 degrees. 
     To maintain second order continuity, therefore, the angles at the start and end points of the spline and parabola must match within a specified tolerance. The pseudocode for determining if the start angle is within a tolerance can be described as: 
     
         ______________________________________                                    
spline.sub.-- angle = Calculate angle the spline&#39;s tangent at P0 makes    
        with the horizontal                                               
parabola.sub.-- angle = Calculate the angle the parabola&#39;s tangent at     
        point P0 makes with the horizontal.                               
IF The absolute value of (spline.sub.-- angle - parabola.sub.-- angle)    
is                                                                        
below the angle tolerance                                                 
THEN                                                                      
  return TRUE                                                             
ELSE                                                                      
  return FALSE                                                            
ENDIF                                                                     
______________________________________                                    
 
    
     A similar check should be made at the spline&#39;s finishing point. 
     If the spline has matched the area tolerance, but fails the angle tolerance at either end, it may be possible to adjust the angles to be within tolerance while the (albeit increased) area error remains within the area tolerance. This is achieved by choosing the end point which exhibits the larger angle error, and moving the parabola&#39;s angle towards the spline until it comes within tolerance. At this point, a new parabola is calculated in the following manner: 
     Given that the parabola must pass through two points x a ,y a ) and (x b  Y b ), and the slope of the parabola at (x a ,y a ) is m a , then this results in: ##EQU18## 
     Solving these simultaneously gives: ##EQU19## 
     The new parabola can then be checked for its angle and area errors. If it is within tolerance, it is accepted. If not, the spline is split as described previously in the section entitled Minimising the Visual Area Error. 
     MATCHING TWO PARABOLAS 
     Referring now to FIG. 2, them is shown shows a single parabola QPF 22 matched to a single spline 21. 
     Referring now to FIG. 3, there is shown two parabolas QPF1 25, QPF2 26 which can be similarly matched to the spline 24. 
     When matching two parabolas, seven degrees of freedom are gained: the a, b and c coefficients of each parabola, and the x-coordinate of the point where they join 30. The following constraints can therefore be applied while leaving one degree of freedom: 
     first end-point 27 must match, 
     the slope at first end-point 27 must match, 
     second end-point 28 must match, 
     the slope at the second end-point 28 must match, 
     both parabolas must meet at the designated joining x-coordinate 30, and 
     the slopes of the parabolas must match at the joining point. 
     In other words, constraints can be imposed which guarantee second-order continuity for the matching parabolas. At the same, time, one degree of freedom remains to allow area error 29 to be minimised. 
     If the degree of freedom is exercised by choosing the x-coordinate (x join ) of the point at which the parabolas meet 30, then the above constraints can be expressed mathematically as set out below: 
     If the two end-points are (x a ,y a ) and (x b ,y b ), and each has a slope of m a  and m b  respectively, then: ##EQU20## 
     By solving the above simultaneous equations, it can be shown that: ##EQU21## 
     Note that the above solutions are valid for every value of x join  between (but not including) x a  and x b . In other words, any x-coordinate between the two end-points can be chosen as a joining point. This is equivalent to saying that the join can be made at the spline&#39;s x-coordinate given by any value of u between 0 and 1 (not inclusive.) 
     MINIMIZING THE AREA 
     Once the two parabolas are found, the area error between them and the original spline can be calculated. This can be done by either the methods described previously entitled Minimising the Visual Area Error or the method entitled an Alternative Area Minimization Note that the mathematics of the area error calculations is made easier if the spline 24 is also split in two at a value of u corresponding to x join . In this way, the single-parabola formulae can be used to calculate the area error for each split; the results can then be added. The formulae for splitting the spline will be outlined below. 
     The optimal value chosen for x join  is the one which minimises the area error. The complexity of the mathematics behind such a solution means that simplified numerical methods for the discovery of an approximate minimum are best used. For example of a simplified numerical method, the area error can be calculated for x join  corresponding to values of u of 0.1, 0.2, . . . 0.8, 0.9 and the minimum of these values can then be chosen. 
     MATCHING MORE THAN TWO PARABOLAS 
     In a manner similar to that used to match two parabolas to the spline, more than two parabolas can be matched by: 
     guaranteeing that the slopes at the spline&#39;s end-points match, and 
     adjusting the joining points of the parabolas between the spline&#39;s end-points. 
     While this is possible, the mathematics involved is quite complex due to the number of degrees of freedom available (i.e. the position of all of the joining points.) The search for an optimal solution requires the use of a long, computationally-intensive numerical optimization method. Although one such method will be discussed hereinafter, in the present method, if the two-parabola approach does not yield a suitable result, the spline is split, and the subsequent splines are matched. 
     THE RECURSIVE CONVERSION METHOD 
     Given the above, the recursive conversion algorithm can be developed as follows: 
     
         ______________________________________                                    
IF The spline is within the flatness tolerance.                           
THEN                                                                      
  Convert it to a straight line joining the end points.                   
  Return                                                                  
ENDIF                                                                     
Calculate minimum-area single parabola for spline (i.e. α, β,  
γ, a                                                                
and b)                                                                    
IF a is outside its allowable limits                                      
THEN                                                                      
  set a to the nearest limit                                              
ENDIF                                                                     
Calculate the area error term between the resultant parabola and          
the spline                                                                
IF the area is not within the area tolerance                              
THEN                                                                      
  A two-parabola match is required                                        
ELSE                                                                      
Calculate the start and end angles for spline and                         
parabola                                                                  
IF start and end angles are within tolerance                              
THEN                                                                      
  Convert parabola to QPF                                                 
  A two-parabola match is not required.                                   
ELSE                                                                      
  IF the angle at p3 deviates by more than the angle at                   
  P0                                                                      
  THEN                                                                    
   Calculate a new parabola based on p0 and p3,                           
   with the angle at p3 being the spline&#39;s p3-                            
   angle, offset by the angle tolerance                                   
   IF the new parabola has a within limits, has a                         
   good angle at p0, and has a good area error                            
   THEN                                                                   
    Convert the new parabola to a QPF.                                    
    A two-parabola match is not required.                                 
   ELSE                                                                   
    A two-parabola match is required.                                     
   ENDIF                                                                  
  ELSE                                                                    
   Calculate a new parabola based on p0 and p3,                           
   with the angle at p0 being the spline&#39;s p0-                            
   angle, offset by the angle tolerance                                   
   IF the new parabola has a within limits, has a                         
   good angle at p3, and has a good area error                            
   THEN                                                                   
    Convert the new parabola to a QPF.                                    
    A two-parabola match is not required.                                 
   ELSE                                                                   
    A two-parabola match is required.                                     
   ENDIF                                                                  
  ENDIF                                                                   
 ENDIF                                                                    
ENDIF                                                                     
IF a two-parabola match is required                                       
THEN                                                                      
   FOR u = 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9 (for               
     example)                                                             
   DO                                                                     
    Calculate the spline&#39;s x-coordinate (x.sub.s) for the                 
    current value of u.                                                   
    Calculate the two parabolas which match the spline                    
    and join at x.sub.s                                                   
    Calculate the area error between the splines and the                  
    parabolas.                                                            
    IF The value of a for each parabola is within limits                  
    AND The area error is within the allowed tolerance                    
    THEN                                                                  
     Record that a suitable two-parabola match has                        
     been found.                                                          
     IF The area error is better than any match found                     
     thus far                                                             
     THEN                                                                 
      Install the current match as the optimum                            
      match                                                               
     ENDIF                                                                
    ELSE                                                                  
     IF No suitable two-parabola match has been found                     
     yet AND The area error is better than any error                      
     found thus far                                                       
     THEN                                                                 
     Install the current parabolas as the closest                         
     contender.                                                           
     ENDIF                                                                
    ENDIF                                                                 
   DONE                                                                   
ENDIF                                                                     
IF A suitable two-parabola match was found                                
THEN                                                                      
   Convert the parabolas to QPFs.                                         
ELSE                                                                      
   Split the spline at the value of u which resulted in the               
   closest contender.                                                     
   Reiterate the whole process to convert each sub-spline                 
   separately.                                                            
ENDIF                                                                     
______________________________________                                    
 
    
     SPLITTING A SPLINE 
     In order to implement the spline to QPF conversion, it is necessary in many places to split a spline. For example: 
     if no suitable match can be made, the spline is to be split, and the sub-splines matched. 
     when evaluating the area error of a two-parabola match, the calculation is simplified if the original spline is split at the parabolas&#39; joining point. 
     To do this, a formula is needed for splitting a spline into two sub-splines. It can be shown that if a given spline defined by points (x 0 ,y 0 ), (x 1 ,y 1 ), (x 2 ,y 2 ) and (x 3 ,y 3 ) is split at a given value of u, then the two sub-splines are in themselves Bezier Splines. The first sub-spline is defined by points (x a0 ,y a0 ), (x a1 ,y a1 ), (x a2 ,y a2 ) and x a3 ,y a3 ), and the second by points (x b0 ,y b0 ), (x b1 ,y b1 ), (x b2 ,y b2 ) and (x b3 ,y b3 ), where: 
     
         x.sub.a0 =x.sub.0                                          (EQ 53) 
    
     
         x.sub.a1 =(1-u)x.sub.0 +ux.sub.1                           (EQ 54) 
    
     
         x.sub.a2 =(1-u).sup.2 x.sub.0 +2u(1-u)x.sub.1 +u.sup.2 x.sub.2 (EQ 55) 
    
     
         x.sub.a3 (1-u).sup.3 x.sub.0 =+3u(1-u).sup.2 x.sub.1 +3u.sup.2 (1-u)x.sub.2 +u.sup.3 x.sub.3 =x.sub.b0                                (EQ 56) 
    
     
         x.sub.b0 =(1-u).sup.3 x.sub.0 +3u(1-u).sup.2 x.sub.1 +3u.sup.2 (1-u)x.sub.2 +u.sup.3 x.sub.3 =x.sub.a3                                (EQ 57) 
    
     
         x.sub.b1 =(1-u).sup.2 x.sub.1 +2u(1-u)x.sub.2 +u.sup.2 x.sub.3 (EQ 58) 
    
     
         x.sub.b2 =(1-u)x.sub.2 +u.sup.2 x.sub.3                    (EQ 59) 
    
     
         x.sub.b3 =x.sub.3                                          (EQ 60) 
    
     with a similar calculation being carried out for y. 
     OBJECT CONVERSION USING OPTIMIZATION METHOD 
     As mentioned previously, in computer based graphics system each object is normally made up of a collection of splines that form the outline of a particular object. By way of example, a character in a series of characters is normally stored as a series of splines laid out so that the overall form of that character conforms to a particular font, with slight variations in the splines resulting in changes in the font. Although the present embodiment is particularly useful in dealing with splines making up character fonts, it is not limited thereto. 
     A system using QPF&#39;s to render a particular image is likely to have limited storage capabilities and a limited capacity to deal with a finite number of QPF&#39;s at any particular time. It is therefore important when converting splines to QPF&#39;s to ensure that the number of QPF&#39;s created for each graphics object is kept at a minimum. The present method is best used when storage space is to be minimized and computational time is available to compute a satisfactory solution. 
     As can be seen from Equation (3) the x and y values for a generic spline can be expressed in the form: 
     
         x=p(u)=lu.sup.3 +mu.sup.2 +nu+p                            (EQ 61) 
    
     
         y=q(u)=eu.sup.3 +fu.sup.2 +gu+h                            (EQ 62) 
    
     and a QPF takes the form as expressed in Equation (4) 
     Assuming that the overall object is to be rendered on a x-y plane the spline format is particularly advantageous as multiple values of y can exist for a given value of x and vica-versa so curves such as circles and ellipses can be easily rendered. 
     In using QPF&#39;s to approximate splines, it is not possible with a QPF to get multiple values of y for a single value of x and so curves such as circles and ellipses must be represented by multiple QPF segments. 
     One method for solving this problem when converting a spline to corresponding QPF&#39;s is to consider the turning points of the spline function with x with respect to u. These turning points occurs at the solution to the equation: ##EQU22## 
     The solutions to this equation are the values of the parameter u where the spline undergoes a turning point with respect to u. Equation (63) has up to two distinct solutions, which means that a spline can not contain more than two turning points with respect to x. Thus a given spline can be built with a maximum of three one valued functions of x. It is therefore possible to split a the given spline into branches that are, by themselves, one value functions of x by splitting the spline at its turning points. For the purposes of the present method, it is assumed that this process is carried out so that Equation (61) and Equation (62) correspond to a spline that forms a one value function of x. 
     A good criteria to approximate a spline with a QPF is actually trying to minimize the distance between the ordinates of the points with the same abscissa. However, in most of the cases, only one QPF is not adequate to get a good result. 
     It is therefore appropriate to formulate the solution of the problem in a more general way considering the approximation of a spline with N QPFs. 
     Referring now to FIG. 4, there is shown the general case of spline 31 which is to be approximated by N QPF&#39;s 32, 33, 34 etc. 
     Each QPF is of the form: 
     
         f.sub.i (x)=m.sub.i x.sup.2 +n.sub.i x+o.sub.i             (EQ 64) 
    
     with i ε{0, . . . , N-1}, x ε[x i , x i+1  ] and 
     
         p(u.sub.a)≡x.sub.0 &lt;x.sub.1 &lt; . . . &lt;x.sub.i &lt; . . . &lt;x.sub.N-1 &lt;x.sub.N ≡p(u.sub.b)                                (EQ 65) 
    
     Now we can define a difference measure 35 between the spline and one of the N QPFs, by determining for a particular value of x, the y value of the spline 31, by first taking the inverse being: 
     
         u=p.sup.-1 (x)                                             (EQ 66) 
    
     and the using Equation (62) to determine y. Difference measure 35 can then be defined as 
     
         (f.sub.i (x)-q(p.sup.-1 (x))).sup.2                        (EQ 67) 
    
     A measure of the area error between the spline and the QPF&#39;s can then be defined in similar terms to Equation (9): ##EQU23## 
     Where p -1  (x is the inverse of the cubic function p(u) defined in Equation (61). As a result of the restriction that the spline must be a one value function of x, such an inverse exists and is uniquely determined. 
     The integral in Equation (68) represents an absolute value measure of the area between the QPF and spline and is greater than or equal to zero and is equal to 0 only if the spline and the QPF are coincident in the interval [x i , x i+1  ]. Thus, by minimizing this integral, we decrease the area error between the QPF and the spline. 
     Initially the inverse p -1  (x) in Equation (68) would appear to be difficult to evaluate in practice. Although methods exist for the finding of an inverse of a cubic function, a better method of evaluating this integral is to rearrange the integral in Equation (68) with a sensible change of variable. 
     By making the change of variable of x=p(u) and noting that dx=p&#39;(u)du and that p -1  (p(u))=u, Equation (68) becomes: ##EQU24## with u i  such that x i  =p(u i ). 
     The integral in Equation (69) is much simpler to evaluate as it is in a polynomial form and can be evaluated exactly without numerical techniques. 
     Hence Equation (68) can be seen as a possible measure of the error produced in approximating a particular stretch of spline with a QPF. Given Equation (31), this error is a function of the parameters of the QPF  i , n i  o and the splitting points  i , x i+ . 
     If we now sum the contribution to the error for each of the N QPF&#39;s, we get a global measure of the total error: ##EQU25## 
     Given p(u and q(u , Err will be a function of 4N-1 variables as each of the N QPF&#39;s gives 3 degrees of freedom being  i , n i  o. Additionally, the joining points of the QPF&#39;s also provide additional variables, apart from x 0  and x N , which by virtue of Equation (65) are fixed to coincide with the endpoint of the spline, resulting in N-1 variables in total. 
     Thus, in a first instance, approximating a spline with N QPFs can be formulated as a minimization problem in a 4N-1 dimensional space with Err as objective function and minimizing Err by varying the 4N-1 parameters, decreases the `distance` between the spline and the N QPFs. 
     Unfortunately, minimizing Equation (70) by itself may not give very high quality results as reducing the difference measure 35 between the spline and the QPFs does not guarantee the continuity of adjoining QPF&#39;s 36, 37, which will result in a severe degradation of the image. Hence, the continuity of endpoints should preferably be also enforced. 
     Referring now to FIG. 5, it is necessary to further restrict Equation (70) so as to guarantee the continuity of the QPF&#39;s. For example, QPFs 39, 40 are continuous at their endpoint 41. 
     In order to fulfil this additional constraint, the following restrictions must be placed on the QPF&#39;s. 
     The start point of our approximating curve must be coincident with one end of the spline: 
     
         q(u.sub.a)=f.sub.0 (x.sub.0) q(u.sub.a)=m.sub.0 x.sub.0.sup.2 +n.sub.0 x.sub.0 +o.sub.0                                          (EQ 71) 
    
     Each QPF must be coincident with the next one. Hence, f 0  (x 1  must be equal to f 1  (x 1 , f 1  (x 2  to  2  (x 2  and so on. In the general case: 
     
         f.sub.i-1 (x.sub.i)=f.sub.i (x.sub.i) m.sub.i-1 x.sub.i.sup.2 +n.sub.i-1 x.sub.i +o.sub.i-1 =m.sub.i x.sub.i.sup.2 +n.sub.i x.sub.i +o.sub.i (EQ 72) 
    
     with i εe {1, . . . , N-1}. 
     Finally the end of our approximating QPF&#39;s must be coincident with the end of the spline: 
     
         q(u.sub.b)=f.sub.N-1 (x.sub.N) q(u.sub.b)=m.sub.N-1 x.sub.N.sup.2 +n.sub.N-1 x.sub.N +o.sub.N-1                             (EQ 73) 
    
     This requires an additional N+1 constraints on the QPF&#39;s guarantee a continuous approximating curve. Therefore, by adding N+1 constraints, we no longer have a minimization problem with 4N-1 degrees of freedom, but with only 3N-2 degrees. 
     In addition to guaranteeing the continuity of the approximating function, the approximation curve can be further improved by taking into account that the human eye is very sensitive to sharp changes of the derivative of a curve which may occur at the endpoints 41. 
     Therefore, preferably the search space is restricted even further so that the continuity of the derivatives at each endpoint is also achieved. 
     Initially, the derivative of the QPF and the derivative of the spline at the starting point must be coincident: ##EQU26## with ##EQU27## being the derivative of the spline at the point x 0  =p(u a ) by the chain rule. 
     The derivative of the QPFs must also be the same at each join, hence: 
     
          iε{1, . . . , N-1}f&#39;.sub.i-1 (x.sub.i)=f&#39;.sub.i (x.sub.i) 2m.sub.i-1 x.sub.i +n.sub.i-1 =2m.sub.i x.sub.i +n.sub.i  (EQ 75) 
    
     Finally, the derivative of the last QPF must be equal to the one of the spline at the end point: ##EQU28## 
     The assurance of continuity of derivatives will therefore add another N+1 constraints to the minimization problem which results in a total of 2N-3 degrees of freedom remaining. 
     In summary, the key issues in the formulation of the minimization problem are as follows: 
     creating a function whose minimum gives the best match between the spline and the QPFs; 
     adding constraints to the search space in order to get the continuity of the approximating function; and 
     adding further constraints in order to get the continuity of the first derivative of the approximating function. 
     The resulting approximating function can therefore be expressed as a function with 2N-3 independent variables, as putting constraints on the problem is equivalent to establishing relations among different variables of the problem and therefore reducing the number of independent variables. It is therefore possible to express some variables as function of others and substitute them in an objective function, which in this case is Equation (68), thereby reducing the number of independent variables. 
     One additional problem which may occur with the present embodiment is that the derivative of the spline may approach infinity, for example, where the spline forms a fragment of a circle. This problem is especially likely to occur at the endpoints of the spline. 
     One method of dealing with this problem is to have a separate test for dealing with excessive gradients whereby the excessive gradient is considered to be a straight line and dealt with as outlined previously under the section entitled `Coefficient Limits`. 
     OPTIMIZATION 
     Although, ideally, every possible value of the remaining variables could be evaluated to determine which particular set of values will produce the lowest objective function, this is most often, in practice, impracticable due to the excessive numbers of variations of variables available. 
     Many different methods are known in the art for optimizing problems with excessive numbers of possible variable variations. In a first simple method, known as the steepest descent algorithm the variables are changed so that the variation in search space is in the opposite direction of the gradient of the objective function, therefore tending to minimize it. Unfortunately, this method of optimization may often become stuck in a local minimum state, failing to find the optimal solution. 
     SIMULATED ANNEALING 
     In the present embodiment the preferable method of optimization of the objective function is by means of simulated annealing. For a detailed explanation of the process of simulated annealing reference is made to &#34;Optimization by Simulated Annealing&#34; by S. Kirkpatrick, C. D. Gelatt, Jr., and M. P. Vecchi, (1983) Science, 220: 671-680. A brief outline of the process of simulated annealing is presented as follows: 
     The first step in a simulated annealing process is to state the problem at hand as an objective function, with a set of variables x 1  to x m  : 
     
         value=obj.sub.-- fn(x.sub.1,x.sub.2,x.sub.3,x.sub.4, . . . , x.sub.m) (EQ 77) 
    
     The objective function is be able to be evaluated to a given value dependant on the current values of its variables x 1  to x m . 
     The values of the variables x 1  to x m  are given a small random change and the objective function is re-evaluated and compared to the old value of the objective function. The change in the objective function will be referred to as Δobj. 
     If the change in the variables has resulted in a lower objective function then the new set of variables is always accepted. If the change in the variables resulted in a higher value for the objective function then the new set of variables may or may not be accepted. The decision to accept the variables is determined with a given probability, the preferred probability of acceptance is: ##EQU29## where T is the simulated `temperature` of the system. 
     Hence for a given Δobj, a high temperature T will result in a high probability of acceptance of the change in the values of x 1  to x m , where as at a low temperature T, there will only be a small probability of acceptance. The temperature T is initially set to be quite high and is reduced slightly in each iteration of the annealing loop. The overall structure of a program implementing the simulating annealing process is as follows: 
     
         ______________________________________                                    
T = start.sub.-- temperature;                                             
variables = start.sub.-- variables                                        
loop.sub.-- until (convergence or temperature.sub.-- to.sub.-- cold)      
 {                                                                        
  /* generate random change of variables*/                                
  new.sub.-- variables = random.sub.-- small.sub.-- change(variables);    
  /* evaluate random change */                                            
  Δobj = objective.sub.-- function(new.sub.-- variables) -          
objective.sub.-- function(variables);                                     
if( Δobj &lt;= 0)                                                      
{   /* always accept improvements */                                      
    variables = new.sub.-- variables;                                     
 }                                                                        
else if (random.sub.-- float.sub.-- between.sub.-- 0.sub.-- and.sub.-- 1( 
) &lt; exp(-Δobj/T))                                                   
 {                                                                        
  /* sometimes accept degradation */                                      
  variables = new.sub.-- variables;                                       
 }                                                                        
ELSE                                                                      
 {                                                                        
  /* reject new.sub.-- variables*/                                        
 }                                                                        
decrease T slightly, according to annealing schedule;                     
}                                                                         
______________________________________                                    
 
    
     A flow chart for use in implementing the above algorithm is shown in FIG. 6. 
     In the present method, the objective function to be used can preferably be defined as shown in Equation (68), although modifications of this equation may still produce suitable results. 
     ENDPOINT DEVIATION METHOD 
     A third method of converting splines to QPFs will now be described. This method is particularly designed for use with spline structures that form closed loops which are presented contiguously in a nose to tail order. In this method it is desired to provide a robust method which does not introduce artifacts into the resulting QPFs that adversely affect the quality of the graphical output, while providing a method that converts splines to QPF&#39;s in a minimum amount of time. Other objectives are to minimize the number of QPFs created while maintaining positional continuity between parabolic sections thereby ensuring that the QPF equivalent of the spline profile remains closed. Additionally, the slope continuity between the parabolic sections is maintained to within a predetermined tolerance, thereby ensuring a reasonable probability of a visually smooth approximation to the source spline. 
     The present method provides a means for converting splines to parabolas on demand and hence the arbitrary scaling and rotation of spline formatted images can be achieved while satisfying the requirement for a parabolic definition of a curves geometry. 
     As noted in the previous method, the spline description given in Equation (1) is easily capable of defining a spline that is multi-valued. That is, for each (X) pixel value, there can exist two or more (Y) line values. To overcome this the method first examines the algebraic components of each spline and splits the spline where necessary. 
     The parametric equation for the spline given in Equation (1) has eight degrees of freedom in two dimensions (x,y) and these degrees of freedom can often be determined by specifying the start and end points with their respective tangent directions. The parabolic format of the QPF, given in Equation (4) has three degrees of freedom and these are usually specified in one of two possible ways. Either: 
     specify the start point, the end point and a slope at one end, or 
     specify the start point and the slope at both ends. 
     The latter description is used as a basis for this method of converting splines to a collection of QPFs. 
     Referring now to FIG. 7, there is shown the start of a profile calculation from the start point 43 of the spline 42. From this starting point a parabola 46 is calculated so that it passes through the start point 43 and has the same start and end slopes as the given spline. 
     The X value of the endpoint of the parabola 44 of the parabola 46 is then measured and compared with the endpoint of the spline 45. If the deviation in the line direction 47 is less than a predetermined tolerance then the parabola 46 is accepted as a sufficiently accurate approximation of the spline 42 and the method is then applied to the next spline, otherwise the spline 42 is split into two splines using methods outlined previously and the method is recursively applied to each half of the spline 42. 
     Referring now to FIG. 8, once a previous parabola 48 has been calculated, then the end point of previous parabola 49 is used as the starting point for the current parabola 51 rather than the start point of the current spline 50, while also ensuring that the parabola maintains positional continuity as well as slope continuity where required. 
     The parabolic curve representation as described previously cannot cope with vertical or near-vertical slopes as the gradient can be forced to exceed the maximum possible gradient. To overcome this the method separately detects this condition and sets the slope of the corresponding QPF to a maximum positive or maximum negative slope appropriately. 
     As the process progresses around the spline profile, both positional and slope continuity are adhered to between QPF segments. In order to close the profile however the alternative solution of calculating a parabola to pass through a start point, end point and start slope must be used. This will affect the slope constraint between the last and first parabolic segment. 
     The visual significance of this event can be substantially overcome in the majority of circumstances by preprocessing the given spline profile so that the start point 43 if the first QPF approximation starts at a slope discontinuity. Thus when the algorithm terminates there is no requirement to match slope continuity. 
     If no slope discontinuity exists on the spline profile, the method can further reduce the effect of the terminating discontinuity by altering the start slope of the last parabola in favour of the end slope so that the visual impact of the resulting termination discontinuity is minimised. 
     As a criterion for determining whether it is necessary to split the last parabola into sub-parabolas, a point somewhere along the parabola can be used and the distance between the parabola and its corresponding spline measured. The preferred point is one which is approximately two-thirds of the length of the parabola. If this distance is greater than a predetermined amount, the spline and corresponding parabola may be split and the process continued. 
     The foregoing describes only a few embodiments of the conversion of a spline based graphical object representation to a quadratic polynomial based representation and modifications, obvious to those skilled in the art, can be made thereto without departing from the scope of the present invention.