Abstract:
A value of a parameter t corresponding to the adjacent next plot point on a bit map memory in an x or y direction is calculated, one of the x or y coordinate values of a current plot point is changed by 1 to calculate a coordinate in the same direction of the next plot point, and the other coordinate of the next plot point is calculated on the basis of an approximated parameter t and cubic curve, thereby plotting the next plot point on the bit map memory.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a plot method and a plot apparatus suitable for expressing a curve such as an edge of a character or a figure using a curve of an nth order, e.g., a Bezier cubic curve. 
     2. Description of the Related Art 
     &#34;Post Script&#34; developed by Adobe Systems Co., or the like, is a well-known program language for expressing information including a character font or a figure in various equipment such as a laser beam printer and a display. In order to express a curve such as an edge of a character or a figure using such a program language, the Bezier cubic curve is finally used. The Bezier cubic curve is described in &#34;An Introduction to Splines for use in Computer Graphics and Geometric Modeling&#34; by Richard H. Bartels et al. published by Morgan Kaufmann Publishers. Inc, California. A character font is described in &#34;The Metafont Book&#34; by Donald E. Knuth published by Addison Wesley Publishing Company. 
     Bezier cubic curve B(t) is represented by following equation (1) using parameter t: 
     
         B(t)=x.sub.0 (t)Q.sub.0 +x.sub.1 (t)Q.sub.1 +x.sub.2 (t)Q.sub.2 +x.sub.3 (t)Q.sub.3                                                ( 1) 
    
     where 
     x 0  (t)=(1-t) 3   
     x 1  (t)=3(1-t) 2  t 
     x 2  (t)=3(1-t)t 2   
     x 3  (t)=t 3   
     0≦t≦1 
     and Q 0  to Q 3  are points of the position vectors designated to determine a shape. Q 0  and Q 3  are start and end points of curve segment B(t) within the range of 0≦t≦1, respectively. Q 0  to Q 3  are also called control points. 
     In general, a conventional Post Script printer control section of, e.g., a desk top publishing system for printing a character font or a figure represented by a Post Script language comprises microprocessor 113 as a main unit of the control section and main memory 114, which stores programs and data of microprocessor 113, as shown in FIG. 1. An image of a page to be printed is stored in a portion of a memory area of memory 114. It is a matter of course that, in some systems, this portion is formed independently of memory 114 as a bit map memory. 
     In FIG. 1, microprocessor 113 is connected to desk top publishing system main unit 111 through interface 112. Microprocessor 113 interprets a Post Script language supplied from system main unit 111 through interface 112, performs the plotting calculations required for forming an edge line of a character or the like, plots the edge line, and then performs fill processing for filling an interior. Thereafter, page printing is performed by controlling a printer (not shown), e.g., a laser beam printer. 
     Conventional Bezier cubic curve plot processing performed by microprocessor 113 will be described with reference to a flow chart shown in FIG. 2. 
     Control points Q 0  to Q 3  are designated on a figure to be described below. X component x(t) and y component y(t) of an edge of the figure are determined from control points Q 0  to Q 3  using equation (1) above. Functions x(t) and y(t) are represented by following equations (2) and (3): 
     
         x(t)=a.sub.x t.sup.3 +b.sub.x t.sup.2 +c.sub.x t+d.sub.x   ( 2) 
    
     
         y(t)=a.sub.y t.sup.3 +b.sub.y t.sup.2 +c.sub.y t+d.sub.y   ( 3) 
    
     where a x , b x , c x , d x , a y , b y , c y , and d y  are the coefficients determined in accordance with the x and y components of position vectors (control points) Q 0  to Q 3 . 
     First, in step S11, microprocessor 113 calculates the coefficients in equations (2) and (3) from control points Q 0 , Q 1 , Q 2 , and Q 3 , of a Bezier cubic curve segment to be plotted. A domain of parameter t is equally divided into n portions (n is a predetermined number), thereby obtaining t values t 1 , t 2 , . . . , t n-1 . In steps S12 to S15, x and y coordinates of each of points P 1 , P 2 , . . . , P n-1  on the curve corresponding to the respective obtained t values are calculated using equations (2) and (3). The x and y coordinates are rounded to approximate integers P i  int. Data are plotted on an image memory region in memory 114 in accordance with the obtained integers. Thereafter, in step S16, adjacent points between points Q 0 , P 1  int, P 2  int, . . . , P n  lint, Q 3  are sequentially interpolated with straight lines, and interpolated data are plotted. In this case, value n is often 16 or 64. 
     However, the above conventional plot apparatus has the following problems. 
     That is, the Post Script language includes several hundred commands. Therefore, when microprocessor 113 serially processes interpretation of the complex Post Script language for a large amount of data to be processed, the processing speed of the system is reduced. 
     In addition, when an edge of a smaller character which is generally widely used is to be plotted, each of the curve segments constituting the edge of the character has a smaller value than that of a dot interval, i.e., an image lattice interval of a printer in a laser beam printer or the like. For this reason, even if t values are different, the segments are often plotted at a single lattice point. Therefore, calculation of a plot point for each t value is inefficient, resulting in a low processing speed. 
     Furthermore, when an edge of a larger character is to be plotted, the above problem is not significant as compared with the case wherein a smaller character is plotted. However, a plot interval is increased to a multiple of a lattice point interval. Therefore, when the edge is printed, it becomes obvious that a curve is approximated by straight lines. That is, a smooth curve cannot be obtained. This tendency is significant when the value of n is small and a curvature is large. 
     SUMMARY OF THE INVENTION 
     The present invention has been made in consideration of the above situation and has as its object to provide a plot method and a plot apparatus which can prevent, when a figure or the like is to be plotted using a curve of an nth order, e.g., a Bezier cubic curve segment, useless repetitive calculation of a single plot point and can prevent a plot interval from being increased larger than a lattice point interval, thereby achieving high-speed processing and drawing a smooth curve. 
     The apparatus can plot figure F (x(t), y(t)) represented by functions x(t) and y(t) of nth order at high speed. In this case, functions x(t) and y(t) are given by the following equations: ##EQU1## where values from a x0  to a xn  and a y0  to a yn  are predetermined. 
     The apparatus comprises: a bit map memory for storing image bit data; and a plotter responsive to an input figure processing command for selecting one of functions x(t) and y(t) in accordance with slopes of tangents of functions x(t) and y(t) at current value t m  of parameter t, calculating next integer u m+1  of current integer u m  of the selected function, calculating value t m+1  of parameter t corresponding to integer u m+1 , calculating integer v m+1  approximate to a value of the other function at value t m+1 , and plotting the image bit data in the bit map memory in accordance with integers u m+1  and v m+1 . 
     Functions x(t) and y(t) can be Bezier cubic curves which satisfy the following relations, respectively: 
     
         x(t)=P.sub.0 (t)Q.sub.0x +P.sub.1 (t)Q.sub.1x +P.sub.2 (t)Q.sub.2x +P.sub.3 (t)Q.sub.3x 
    
     
         y(t)=P.sub.0 (t)Q.sub.0y +P.sub.1 (t)Q.sub.1y +P.sub.2 (t)Q.sub.2y +P.sub.3 (t)Q.sub.3y 
    
     where 
     P 0  (t)=(1-t) 3   
     P 1  (t)=3(1-t) 2  t 
     P 2  (t)=3(1-t)t 2   
     P 3  (t)=t 3   
     0≦t≦1, and 
     Q 0  (Q 0x ,Q 0y ) to Q 3  (Q 3x ,Q 3y ) are coordinate positions designated in advance to determine a shape. 
     In order to achieve the above object, a plot method comprises the steps of: calculating next integer u m+1  of current integer u m  of a selected one of the above functions x(t) and y(t) at current value t m  of parameter t in response to a figure processing command; calculating value t m+1  of parameter t corresponding to integer u m+1  ; calculating integer v m+1  approximate to a value of the other function at value t m+1  ; and plotting the image bit data in a bit map memory in accordance with calculated integers u m+1  and v m+1 . 
     As described above, according to the present invention, each plot point represented using a curve of an nth order, e.g., the Bezier cubic curve is always offset from an immediately preceding plot point by at least one lattice point in the x or y direction and therefore does not overlap it. Therefore, a single point is not plotted again, i.e., useless repetitive calculation of a single point can be prevented, resulting in high-speed processing. In addition, according to the present invention, since a plot point array continues in units of lattice points in the x or y direction, processing of connecting adjacent plot points by a straight line (linear approximation processing) need not be performed. Therefore, even if a character including a curve having a large curvature is printed in an enlarged scale, there is no possibility that an unnatural curve having a noticeable straight portion will be formed. Furthermore, since the processing can be performed by two processors, high-speed processing can be performed. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram showing an arrangement of a conventional plot apparatus; 
     FIG. 2 is a flow chart for explaining an operation of the conventional plot apparatus; 
     FIGS. 3A and 3B are graphs for explaining a principle of the present invention; 
     FIG. 4 is a block diagram showing an arrangement of a first embodiment of a plot apparatus according to the present invention; 
     FIGS. 5A and 5B are flow charts for explaining an operation of the plot apparatus of the first embodiment; 
     FIG. 6 is a graph for schematically explaining an operation of plot processing of the plot apparatus according to the present invention; and 
     FIG. 7 is a flow chart for explaining an operation of a plot apparatus according to a second embodiment of the present invention. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     A plot apparatus according to the present invention will be described in detail below with reference to the accompanying drawings. 
     An arrangement of a first embodiment of the plot apparatus according to the present invention will be described below with reference to FIG. 4. 
     In FIG. 4, interface 112 receives a Post Script command from a main unit (not shown) and supplies it to versatile microprocessor 21. Microprocessor 21 interprets most of the Post Script commands. Main memory 22 is used by microprocessor 21 and similar to main memory 114 shown in FIG. 1. Microprocessor 21 is connected through interface 24 to high-speed operation microprocessor (e.g., the XL8000 series available from WEITEK Co.) 23 for receiving only commands (e.g., CURVE and LINE) directly concerning generation of image bit data (bit map memory data) of the Post Script commands from microprocessor 21. Interface 24 may transmit/receive commands and image bit data through main memory 22. Bit map memory 25 for storing image bit data is connected to microprocessors 21 and 23. Note that commands to be executed by microprocessor 23 (i.e., those directly concerning bit image generation) are often continuously supplied. Therefore, in order to increase a ratio of time in which both microprocessors 21 and 23 operate, interface 24 includes FIFO (First In First Out) buffer memory 26. This buffer memory can be prepared as software in a portion of main memory 22 not subjected to display and printing image data stored in bit map memory 25. 
     Plot processing performed by microprocessor 23 shown in FIG. 4 will be schematically described below with reference to FIGS. 3A and 3B. FIG. 3A shows a curve represented by equation (2), i.e., Bezier cubic function x(t) of an x component of figure P (x(t),y(t)), and FIG. 3B shows a curve represented by equation (3), i.e., Bezier cubic function y(t) of a y component. 
     First, microprocessor 23 calculates differential values of functions x(t) and y(t), i.e., slopes x(0) and y(0) of tangents obtained when t=0 which corresponds to Q 0 , and compares their absolute values. In FIGS. 3A and 3B, the following inequality is obtained: 
     
         |y(t)|&gt;|x(t) , where t=0 
    
     This inequality indicates that a change in function y(t) is larger than in function x(t) as parameter t is increased. In this case, microprocessor 23 calculates approximation value t 1  of parameter t at which function y(t) takes next integer y 1  in accordance with y(0) obtained when t=0, i.e., the slope of the tangent of function y(t) obtained when t=0 as shown in FIG. 3B. Then, microprocessor 23 calculates function value x(t 1 ) using t 1 , and calculates integer x 0  approximate to value x(t 1 ). Thereafter, microprocessor 23 writes image bit data corresponding to point P 1  in coordinates (x 0 ,y 1 ) on memory 25. 
     After the above processing is completed, t=t 1  is set, and similar processing is repeatedly performed in the same manner as when t=0. In this case, function value y(t 1 ) need not be calculated in order to obtain value y 1 . That is, value y 1  can be obtained by only adding or subtracting 1 to or from y 0  at the immediately preceding plot point. Whether 1 is added or subtracted at value t n  is determined in accordance with differential value y(t n ) at value t n . When a value of t which is sequentially calculated as described above satisfies t≧1,  control point Q 3  as an end point is passed, and therefore plot processing of this curve segment is completed. Note that whether a point corresponding to last t (t 3  in FIGS. 3A and 3B) obtained when t≧1 is to be plotted on memory 25 is determined in accordance with whether value t3 or t2 is closer to 1. 
     The above plot processing of microprocessor 23 will be described in more detail below with reference to flow charts in FIGS. 5A and 5B. 
     In step S41, microprocessor 21 receives a Post Script command from interface 112 and interprets the command. In step S42, microprocessor 21 determines whether the command is to be executed by microprocessor 21 or 23. If microprocessor 21 determines that the command is to be executed by microprocessor 23, it sends the command to microprocessor 23 through interface 24. When microprocessor 23 receives the command sent through interface 24, it executes the command and writes image bit data into memory 25 in step S43 of FIG. 5A. Microprocessor 21 checks, interprets, and executes the next command while microprocessor 23 performs the above bit image generation operation. In this manner, microprocessors 21 and 23 can operate simultaneously. In addition, microprocessor 21 can be a versatile microprocessor capable of processing various tasks and a high-speed operation microprocessor capable of processing a large amount of data at high speed can be used as microprocessor 23. Therefore, processing can be executed at higher speed than in the conventional arrangement shown in FIG. 1. 
     When microprocessor 23 receives the command from microprocessor 21 in step S21 of FIG. 5B, it calculates coefficients in equations (2) and (3) from predetermined control points Q 0 , Q 1 , Q 2 , and Q 3  of a figure P (x(t),y(t)) to be plotted. If microprocessor 23 determines that special processing is to be performed during calculation in step S21, the special processing is executed in step S22. The special processing is executed when, e.g., a curve segment is very short in memory 25. In this case, data is plotted directly from polygon Q 0  Q 1  Q 2  Q 3  formed by the control points without calculating a cubic equation. If a curve segment has a peak, the special processing is required because a differential value cannot be calculated. However, the Bezier cubic curve for expressing a character font normally has no peak. 
     If microprocessor 23 determines that the special processing need not be executed, the flow advances to step S23. Step S23 is part of the initializing processing in which only processing required to understand the following processing flow is represented as an independent step. That is, an order of steps S21 to S23 is not essential. In step S23, 0 (lower limit of t) is set, and differential values of functions x(t) and y(t) represented by equations (2) and (3) obtained when t=0, i.e., slopes x(0) and y(0) of the tangents are calculated. In addition, end flag E to be described later is initialized to be 0 in step S23. 
     When microprocessor 23 completes the above initializing processing, it calculates differential values x(t) and y(t) at a current of value of t of parameter t of functions x(t) and y(t) in step S24. Microprocessor 23 checks which of the absolute values of differential values y(t) and x(t) is larger. If the absolute value of differential value y(t) is larger, processing from step S25 to be described below is executed. If the absolute value of differential value x(t) is larger, other processing is executed. The other processing is similar to the following description, except that the functions y(t) and x(t) are switched, and therefore its description will be omitted. Note that if the absolute values equal each other, either processing may be performed. 
     If |y(t)|≧|x(t), the flow advances to step S25, and microprocessor 23 calculates 
     
         t+(1-ε)/|y(t)| 
    
     using current t value and the absolute value of y(t) to obtain a new t value t 1  at which function y(t) takes the next integer, i.e., a t value t 1  corresponding to the next plot point. Note that an initial value of ε is a difference between a y coordinate value of point Q 0  as shown in FIG. 6 and that of plot point Q 0  (=Q 0  int) corresponding to point Q 0 . When microprocessor 23 completes step S25, it sets ε to be 0 in order to perform processing in step S25 in a loop thereafter to be executed thereafter (step S26). 
     When microprocessor 23 completes step S26, it checks whether the value of parameter t calculated in step S25 exceeds an upper limit of a domain (i.e., t≧1) or not (i.e., t&lt;1), thereby determining an end of the plot processing of the curve segment (step S27). If t&lt;1, the processing must be continued. Therefore, the flow advances to step S28, and microprocessor 23 performs +1 or -1 processing of y coordinate value y 0  int at current plot point, thereby calculating y coordinate value y 1  int at next plot point (step S28). In this case, whether +1 or -1 processing is to be performed is determined in accordance with the polarity of differential value y(t 0 ) used in determination in step S24, i.e., polarity of the slope of the tangent or differential value y(t 0 ) at value to of parameter t corresponding to a current plot point. If the value is positive, +1 processing is adopted, and if the value is negative, -1 processing is adopted. Thereafter, microprocessor 23 calculates function x(t 1 ) using value t 1  of parameter t calculated in step S25 and equation (2) and then calculates integer x 1  int approximate to an x coordinate value of the next plot point (step S29). Then, microprocessor 23 plots image bit data at coordinates P iint  (x 1  int, y 1  int) (=P 1 ) on memory 25 calculated in steps S29 and S28 (step S30), and checks in step S31 whether end flag E is 0 or 1. If E=0, in order to continue the plot processing of the curve segment, microprocessor 23 calculates differential values x(t 1 ) and y(t 1 ) at the value t 1  of parameter t calculated in step S25, and the flow returns to step S24. 
     If t≧1 is determined in step S27, the flow advances to step S33, and microprocessor 23 checks whether the last point is to be plotted in accordance with whether value t L  of parameter t corresponding to the last point and value t L-1  of parameter t corresponding to the immediately preceding plot point is approximate to 1. More specifically, this determination is performed as follows. That is, t L  is closer to 1 than t L-1  if following inequality (4) is satisfied: 
     
         t.sub.L -1&lt;1-t.sub.L-1                                     (4) 
    
     t L-1  and t L  satisfy following equation (5) as is apparent from the processing (for ε=0) in step S25: 
     
         t.sub.L-1 =t.sub.L-1 /|y(t.sub.L)|       (5) 
    
     Therefore, when inequality (4) is substituted in equation (5), inequality (4) is given by: 
     
         t.sub.L -1&lt;1-{t.sub.L-1 /|y(t.sub.L)|} 
    
     That is, inequality (4) is rewritten as following inequality (6): 
     t L  -1/{2y(t L )}-1&lt;0                               (6) 
     Therefore, in step S33, a value of the left side of inequality (6) is calculated, and whether t L  is approximate to 1 is checked in accordance with whether the calculated value is negative or positive, thereby determining whether the last point is to be plotted. 
     If the value of the left side of inequality (6) is negative, i.e., t L  is closer to 1 than t L-1 , microprocessor 23 sets 1 in end flag E (step S34) and then executes steps S28 to S30. Thereafter, microprocessor 23 checks the state of end flag E in step S31, and the flow advances to end processing in step S35 (because E=1). If the value of the left side of inequality (6) is positive, i.e., t L-1  is closer to 1 than t L , the last point need not be plotted, and therefore the flow advances directly from step S33 to S35. In step S35, in order to plot the next curve segment, control point Q 3  as an end point of the currently plotted curve segment is used as control point Q 0  as a start point, and differences δ and ε of x and y coordinates between point Q 0  and a start plot point of a curve segment to be plotted next, i,e., the last plot point of the currently plotted curve segment are calculated. 
     In the above description and the flow chart in FIG. 5B, processing to be performed when |y(t)|&lt;|x(t)| is omitted. If necessary, x need only be replaced with y in steps S25, S28, S29, and S34. 
     In the above processing, cubic functions x(t) and y(t) and quadratic functions x(t) and y(t) are directly calculated. However, if the functions are calculated by a differential operation using digital differentiation, the number of multiplication and division operations can be reduced. 
     An operation of a second embodiment will be described below with reference to FIG. 7. An arrangement of the second embodiment is similar to that shown in FIG. 4, and its operation is substantially the same as that shown in FIG. 5B. Therefore, only a difference will be described below. 
     In step S51 similar to step S21, plot point Q 3int  (Q 3xint ,Q 3yint ) (=Q 3 ) approximate to end point Q 3  is calculated. Then, processing similar to the plot processing shown in FIG. 5B is performed. In step S52 similar to step S31 in FIG. 5B, it is checked whether calculated plot point P i  (x iint , y iint ) is equal to plot point Q 3int  (Q 3xint , Q 3yint ) as an end point. If the points equal each other, step S35 is executed, and preparation for processing of the next curve segment is performed. In this manner, processing concerning the end point can be executed at higher speed than that of the processing shown in FIG. 5B.