Computer plotter control

Abstract: A control system for a multi-color computer graphics plotter (200) divides the plot into a plurality of bands and calculates the approximate time required to draw each figure in each band in the required color. An intermediate output from the control system is the approximate total time required to draw each color in the plot. The control system, using a design philosophy of maximizing for the plotter's throughput, decides whether the plot will be completed faster if the plotter is (a) simply driven at its fastest speed, (b) slowed for at least 1 of the color passes, or (c) coupled to memory, with the entire plot being stored temporarily.

Description: This invention is in the field of computer graphics. More specifically, it is a method and apparatus for controlling a computer graphics raster plotter in a manner which improves the quality of the plot. Computer-graphics can be defined as any output from a computer that is presented in pictorial form. Although this definition does not necessarily exclude text, the main thrust of computer graphics is the display of graphs, pictures, maps and other similar types of data. Devices used to display computer graphics output include cathode ray tubes (CRT), liquid crystal displays (LCD) and single or multi-color plotters. Graphics display units must be able both to accept a high rate of data input and to display those data accurately and very quickly. Although it is possible to control a graphics plotter directly from the computer generating the plot, this often results in slowing down the rate at which the plot is drawn. Typically, plotters print one line of the plot at a given time. The data for each of these lines must be supplied to the plotter in a particular, "rasterized", form. The rate at which the computer can convert graphics data into rasterized form is often considerably less than the maximum speed that the plotter can print or display that data. If the computer is directly coupled to the plotter, this discrepancy in speeds slows the plotter's rate of output in an undesirable way. One solution to the problem of rasterizing data quickly enough to drive the plotter at high speeds has been to place an intermediate unit, or "controller", between the computer generating the graphical output and the plotter which draws it. In simple terms, the controller accepts high-level commands from the computer such as "draw a line from X,Y coördinates 2,7 to X,Y coördinates 6,9". The controller reduces these high-level commands into simpler commands and decides where dots or pixels need to be drawn or activated to create such a line. After the pattern of dots has been calculated, the controller commands the plotter to start printing, using the calculated dot pattern. Many controllers use two stages to create the desired final output. Fig. 1 of the accompanying drawings shows such a controller. The controller receives graphics commands over line 12 from host computer 13. Parser 17 takes these commands and breaks them down into a simpler set of commands. Then the parser divides the proposed output image into a series of so-called raster bands. The size of these bands is determined by the size of the individual buffer memories that are associated with rasterizer 19. For example, if rasterizer 19 has 256KB RAM buffer memories, the number of pixels which can be generated on any given line multiplied by the number of lines in each band will equal at most 256k. The parser also determines what objects will be drawn in each band. Once the commands and the contents of all the raster bands in a given plot are calculated, this information is forwarded to rasterizer 19. Rasterizer 19 calculates exactly which pixels in each band must be turned on to create the desired image (this calculation is repeated for each color ink that the plotter can use for each raster band). As these calculations are completed and the raster buffer memory for a given band is filled, the rasterizer begins writing to another raster buffer memory, if such is available. If only one raster memory is available, the raster memory sends its contents to the plotter while the rasterizer waits to generate more information. Most, if not all, controllers have at least two buffer memories. Each buffer is written to in succession, and outputs its data as soon as it is filled and when the plotter can accept the data. The process of calculating the pixels to be turned on, filling alternatively raster memory 21 or 23 therewith, and directing the contents of the raster memories to plotter 25, continues until all graphic information has been output. If there were only one buffer, plotting operations would frequently have to slow down. In some known machines this problem was solved by creating a large frame buffer to store data for the entire plot at one time. This approach has limited utility as plots often exceed the storage capacity of the frame buffer. It is obvious that as the complexity of the output increases, the length of time necessary for rasterizer 19 to calculate the exact pixel representations of the image for each color used by the plotter will also increase. When this complexity reaches a certain point, the memory buffer or buffers are able to output their contents much more quickly than rasterizer 19 can refill them. As this time differential increases, more and more pauses in the printing process develop, because of the buffer memories waiting for more output data. With many types of plotters, the pauses which occur when the rasterizer cannot fill the buffer memory quickly enough to keep the plotter moving create serious problems. For example, in laser plotters, dry toner may adhere to the fusing drum during the pause, ruining the drum and requiring repair or replacement. In electrostatic plotters, liquid toner begins to soak the paper during the pauses, creating a dark band of color where the paper was stopped, which band is called a "toner bar". Even in a CRT or LCD display, the pause of the cursor while more data are being generated by the rasterizer is, if not harmful, at least distracting. All these outcomes are an undesirable consequence of there being insufficient output from the rasterizer to keep pace with the output device's maximum output speed. The attempts to solve these problems have so far been unsatisfactory. Some plotters have a user-adjustable speed control which gives the operator the option to slow the movement of paper in the plotter, thereby giving the rasterizer more time to fill the respective buffers. Unfortunately, this manual method requires the operator to study the prospective plot prior to its actual printing and determine if the density of characters and color is too great to allow continuous high-speed paper movement. Also, in a plot requiring multiple passes, each pass using a different color ink, slow paper movement may be necessary for only one pass and not the others. Presetting the machine to slow speed in this instance will waste time during most of the passes in order to accommodate the single slow pass. In laser plotters, a standard technique has been to abort the plot if a situation occurs where the paper needs to be halted. Although the abort protects the fusing drum, it requires that a completely new plot be drawn. As the complexity of the plot has not changed, there is no guarantee that repeated aborts will not occur. This is obviously expensive in computer time and paper. A clear need thus exists for a controller for use with computer graphics output devices which can determine, prior to the start of either plotting or display, if the proposed output can be rasterized quickly enough to drive the plotter device at its highest speed and, if it cannot be rasterized that quickly, the controller should determine if low-speed output is preferable or if temporary storage on some intermediate memory would result in the maximum possible output speed. JP-A-59-177643 discloses a controller for a graphics plotter including a graphics processor which calculates the time required for data processings for each band, and regulates the speed at which the rasterized data is sent to the plotter in accordance with the result of the calculation. US-A-4,458,330 discloses a banded vector to raster converter system in which vectors are delivered to the system and stored in a vector memory in groups. Vectors are serially read out and converted into a series of coordinates of points along the vector. After the entire vector band has been rasterised the contents of the raster memory are output to a plotter. The present invention provides a method for improving the quality of computer graphics plots produced by computer graphics plotters and displays as defined in claim 1. The invention further provides a control unit for improving the quality of a plot produced by a computer graphics raster plotter as defined in claim 2. The present invention is a control system for a computer graphics monochrome or multi-color raster plotter. The use of the present invention is also envisaged in graphics plotters of all types, CRT or LCD display units, and other such devices. The control system operates in close conjunction with the parser and rasterizer. Graphics data are received from the host computer in a high-level data format that may or may not be sorted into bands or color separated. The parser if necessary breaks the data into sorted graphical elements. In this description, the terms 'elements' and 'phrases' are used to mean the computer commands which draw the various objects in the plot. These elements are often simpler elements than those used to describe the original form of the data. For example, polygons can be fractured into trapezoids,and a single large rectangle may be broken into several smaller rectangles. Plots are generally split into a series of bands, the length of each band being determined by the number of pixels on each line and the size of the raster buffer memories. Graphical objects often extend over several of these raster bands. The parser sorts the elements so that only those elements which draw objects in the current band are sent to the rasterizer. As the larger, more-complex graphical objects are split at band boundaries, they are placed in "sort bins". There is one sort bin for each raster band. When the parsing process is completed, rasterization begins. Data are sent to the rasterizer at the rate of one sort bin at a time, the next sort bin being determined by the direction of paper movement. In the present invention elements are not color separated, so all elements are sent to the rasterizer for each color pass. The rasterizer determines which elements are to be executed using the color of the current pass. In other embodiments of this invention, elements may be sent to the rasterizer in a color-separated format. The apparatus of the present invention cooperates with the parser during the sorting routines. During parsing, a timing measurement is made for each element and the total time required to execute each element is stored. The routines which break up larger, unsorted graphical objects into simpler, sorted objects are herein known as "phrase generators". When these phrase generators are ready to insert a new phrase or element into a sort bin, they do two things. First, a routine is called which determines the time required to draw the phrase or element. The timing data are passed to a sort routine which determines what color inks must be used to create the correct color for the phrase. The drawing time for each ink or toner needed to draw the phrase is added to the drawing time for that particular ink or toner for the particular raster band in which the phrase is to be executed. Thus, a running total time for each band for each ink is maintained. As every phrase requires some minimum amount of processing time, even in those bands and color passes in which it is not executed, the sort routine also adds this minimum time to the time totals for each ink color. The result of this processing is that at the end of the parsing for the entire plot, there is a time estimate for the required rasterizing time for each color ink in each raster band. This information is stored in a sort bin table and is used by the controller to determine the proper course of action for outputting the plot. The controller has two basic options once it determines that rasterization cannot be completed quickly enough to drive the plotter directly at full speed. The basic determination that data cannot be rasterized quickly enough to maintain maximum output speed is made using the drawing time determination. The speed at which data can be rasterized has been determined in the previously described fashion. If this rasterizing time estimate exceeds the maximum speed that data can be rasterized, one of the following options must be exercised. The first option is to allow the rasterizer to rasterize all the data from the parser and store the rasterized data in an external memory of some sort. Once all the raster data are stored, the external memory is used to send the raster data to the plotter at the rate required for high-speed plotting. This option is called spooling. The second option is to slow the movement of paper through the plotter during the entire plotting process or, alternatively, during one or another of the individual color passes. This option is called 'speed control'. The choice of which option to select is based on maintaining the greatest overall output from the plotter. A calculation is made as to the total time to complete the plot for each output option. The totals are compared and the lowest one selected. The user can always override the controller's choice. The present invention will now be described by way of example with reference to the accompanying drawings, in which: Fig. 1 is a block diagram of a known graphics plotter controller; Fig. 2 is a block diagram of a plotter control system of the present invention; Fig. 3 is a flow chart of the operation of a known controller; Fig. 4 is a high-level flow chart of the system of the present invention; Fig. 5 is a flow chart of the timing calculation section of the system of the present invention, and Fig. 6 is a flow chart of the control options selection portion of the present system. Fig. 2 is a block diagram of a graphics controller 99 showing the major components which comprise the operating environment of the present invention. The controller is comprised primarily of parser board 100 and rasterizer board 150. Plotter 200 is coupled to the outlet from rasterizer board 150. External memory 225 is coupled to both parser board 100 and rasterizer board 150. The host computer (not shown) is coupled to parser board 100. Parser board 100 receives high-level graphics commands from the host computer through inlet I/0 101. Direct memory access controller (DMA) 125 stores the high-level commands received from the host computer in internal memory 115. These commands are reduced into simpler commands by CPU 110. The simpler commands are then returned to internal memory 115. If the storage capacity of internal memory 115 is exceeded, these commands can be stored in external memory 225 by transmitting them through disk I/0 103. Once all commands have been reduced they are sent to rasterizer board 150 through outlet I/O 120. The simple commands are transmitted to CPU 160. Upon receiving the data and commands, CPU 160 determines the type of object which must be drawn. Lines, trapezoids, rectangles, and other more-complex objects which can be broken down into these enumerated simple objects are sent to drawing chip 170. Drawing chip 170 decides what portion of each object must be drawn in each band. This process is known as 'clipping' to those skilled in the art. CPU 160 performs the same function for such objects as circles. CPU 160 also determines the line thickness for all objects. Color chip 180 receives the rasterized commands from either CPU 160 or drawing chip 170. CPU 160 has also indicated to color chip 180 what color(s) the object(s) is (are) to be. Color chip 180 then determines, by reference to color memory 182, what pixel patterns of each toner are needed to generate the desired color. The patterns are then masked with the rasterized command to create the proper color for the object. An object may require only one toner, or it may require several. It should be noted that each tone requires a separate "pass" over the entire lot, to build up the correct colors successively. CPU 160, drawing chip 170, and color chip 180 operate on one band of the entire plot at a time. Only the portion of the whole object which fits within the next band to be plotted is analyzed for the foregoing points (start/finish point, line thickness, color). As the band is being processed, either memory controller 190 or memory controller 192 stores the band's rasterized data in either memory 191 or memory 193, respectively. Dual memory controllers and memories allow for the mode of operation where one memory is transmitting its contents to the plotter while the other memory is being filled with data for the next band. For purposes of this description, a raster band defines the individual drawing bands being stored in memory. In this system, the maximum number of pixels in each raster band per color/toner is equal to the size in bits of the memories 191 and 193. Overall operation of a known plotter is represented by the flow chart of Fig. 3. High-level data are received from the computer in step 50. The data received from the computer may or may not be sorted or color separated. At parsing step 52, the data are broken down into simpler elements and sorted. For example, polygons may be fractured into trapezoids, a large single rectangle may be broken into several smaller rectangles, etc. These objects are usually split at band boundaries. As discussed previously, the notion of a band refers to the size of the raster buffers. For example, if a band is equivalent to 200 scan lines on eight dots-per-m (dpm) plotter, then a 250 mm long plot (in the direction of paper movement) will be broken into 10 bands. After the data have been parsed, rasterizing 54 begins. During this step the parsed data are rasterized, meaning that the simple forms delivered from parsing are converted into the exact pattern of pixel elements that are required to recreate the object one band at a time, placed into the raster buffer memories (Fig. 1) and then output at step 56. As there are two raster buffer memories, one band is being rasterized while the other buffer memory supplies its data to the plot. This alternation continues until all data have been outputted. If, during the rasterizing step, it takes longer to rasterize one band than to output the other, the plotter will be "starved" for data and printing will stop, causing the previously-discussed problems. Fig. 4 is a high-level flow chart of how the present invention is incorporated into a standard plotter. During parsing 62, as complex objects are split at band boundaries, a sort bin is established for each band. After the split for each object is determined, the elements needed to draw these simpler objects are sent to a time calculator 64, where the time required to draw that element is calculated. The timing data developed by time determination step 64 are then sent to sorting step 66. In step 66 the proper sort bin for the element is found. Next, at step 68 the color of each object is examined to determine which toners are required to draw the object. Before the color determination can be made, the quality of the object, either transparent or opaque, must be known. The terms 'opaque' and 'transparent' have a special meaning herein. Objects may overlie one another in any given plot. The areas where such overlay occurs may be drawn in either a transparent or opaque mode. When transparent, the objects are each drawn completely independently and the toners required for each object are allowed to overlap. When the overlapping area is to be opaque, the second object and its toner completely overwrites the first object. This occurs during rasterization so no actual pigment overlap occurs during opaque drawing. After the quality and color of the object are determined, several actions take place at step 70. The time required to draw the object is added to the total for the band wherein the object is to be drawn, a separate band total being kept for each different toner. The object's drawing time is only added to the total for each toner pass required to draw the object. As a minimum amount of time is required for each phrase even for those toner passes in which the phrase does not participate, this minimum time is added to the time totals for each toner band pass in which the phrase does not participate. Steps 64 through 70 are repeated until all elements are processed. Thus, at the end of parsing the entire plot, the time needed to draw each band in each of the four toners is stored in the sort bin table. After the time per toner band pass is determined, a course of action is needed. Step 74, quality control decision, represents the entire decision-making and will be described in detail below. The present invention comprises basically two functional blocks: time calculation for each element in each band for each toner, and the quality control decision based on the times calculated in the first step. The details of these two steps will now be discussed. The code which performs the timing calculations is subdivided into the blocks or macros listed Table 1 below As certain common operations are performed in each of the blocks listed in Table 1, these common operations will be discussed first and a functional discussion of the blocks will follow. Whenever these common operations are mentioned during the detailed description of the individual macros, the reader should refer to the discussions below on how these operations are performed. Determining The Word Write Time In order to draw or "rasterize" an object into raster memory, write operations into raster memory with the appropriate pattern of ones and zeros required to represent the object accurately must be performed. In the present invention, this is done by performing 16-bit write operations, each of which is referred to herein as a "16-bit word write" or "word write". A known amount of time is required for each word write. The amount of time required to do word writes for either the whole object or a portion thereof is thus equal to the number of word writes needed to draw the object multiplied by the amount of time required for each word write. Determining the Number of 16-bit Word Writes in the Y Dimension Many objects are basically filled regions (solid areas of color) which have both an X and a Y dimension. A filled rectangle is the simplest example of this. A filled rectangle can be visualized as a given number of rows of dots, each row extending from a lower value to a higher value in the Y dimension, and then proceeding row by row successively in the X dimension. The row thus defines the width of the rectangle and the number of rows defines the height of the rectangle. Each 16-bit word contains one row of 16 dots in the Y dimension. Successive word addresses will lie next to each other along the same row of dots until the end of the scanline is reached. Once the number of 16-bit word writes needed to draw each row of the object is known,the total number of word writes needed to draw the object is easily calculated, as it equals the number for each row times the number of rows. The number of 16-bit word writes for each row can be determined as follows where: Ymin = the minimum Y coordinate for the row and Ymax = the maximum Y coordinate for the row, (Ymax/l6)-(Ymin/l6) + 1 = Number of 16-bit words/row. Starting and Ending Operations The time calculations for many objects includes the starting and ending latency time of the drawing chip. The calculations must also include the time required to load the registers of the drawing chip in order to command it to draw a particular object. Each of these calculations is a simple addition of an empirically determined constant time value. For the present invention, these times are 4.5 microseconds for starting and ending latency, and 9.4 microseconds for register loading. Establishing Minimum Setup and Load Times To draw most objects, a certain minimum amount of time is necessary to do the calculations and set up the rasterizer. For objects which are larger than a certain minimum size, some of these operations may overlap the drawing process of the previous object. For objects below this minimum size, the drawing time calculated for that object must be increased to a certain minimum time to allow for the possible loss of overlap time. These minimum times are determined empirically by drawing a number of objects at the minimum size and measuring the time required to do so. Establishing the minimum time to draw an object is thus a simple comparison of the total time calculated for the object in the normal manner with a constant (the minimum time which was determined empirically), the greater of the two being used as the drawing time for the object. Table Lookups Many objects of the same type can appear in the same plot. Some of these objects may be exactly the same size and shape, and will therefore require exactly the same amount of time to draw. Furthermore, it has been determined that many of these will be in the lower range of dimensions for such objects. For example, it has been found that for a large group of plots, most of the rectangles will contain less than 200 rows of dots in the x direction. By taking advantage of this fact, duplicate calculations which would give the same result can be eliminated and processing can be speeded up. Tables are established at the beginning of controller operations which will contain the times necessary to draw particular types of objects in a range of sizes. During processing, when determining the time necessary to draw an object, the program checks to see if the object is the same type and size as other objects whose drawing times have already been calculated and stored in the table. If it is, the calculations are not repeated. Instead, the result that was previously calculated is retrieved from the table. At this point in the processing, if the rasterization time of the object in question can be retrieved from the tables, processing of the new element is stopped and the stored result is used. Otherwise processing continues. Inter-scanline Time Objects which have sloping sides require a calculation to determine the starting and ending points of each row of dots as drawing proceeds from one row of dots to the next. For example, for a sloping line each row of dots may begin at a slightly different Y value. This requires that after each row of dots is drawn the starting and ending Y values be either incremented or decremented slightly in order to shift the next row of dots in the direction of the slope. The time required for this incrementing or decrementing must be added to the other times that have been calculated as being needed to draw the object. The amount of time which must be added to the total to account for inter-scanline time for the entire object is equal to the amount' of such time required for each row times the number of rows. BCMY versus RGB Color Systems Two of the most common systems of primary colors used in computer graphics are the BCMY system, which uses black, cyan, magenta and yellow as its primary colors, and the RGB color system, which uses red, green, and blue as its primary colors. Either system can be used herein to specify the colors of many types of objects, which results in slight differences in the times needed to rasterize these objects. The primary difference in these calculations concerns the constant referred to as "throw-away time", which is discussed below. Adding Time to the Sort Bin Table Once the time required to rasterize a particular object has been calculated, it must be added to the running total which is being kept for the raster band which contains the object. At the conclusion of the first phase of processing, this running total will be an estimate of the time required to rasterize all the objects contained in a given raster band. Different colors are created by mixing different amounts of the primary set of colors used by the graphics device. Thus, cyan and yellow can be mixed to produce various shades of green. In raster plotters, these different colors require different patterns of dots, with varying densities of dots producing varying densities of color. This requires a separate application of toner or ink for each of the primary set of colors, which in turn requires a separate pass of the plotter's writing head along the length of the plot to apply dots in each of the separate colors. Often the data for each pass must be rasterized separately in order to produce the pattern of dots required to arrive at the correct colors. This process is related to he concepts of opaque rasterization versus transparent rasterization. In opaque rasterization, each new object is represented in such a way as to obscure completely objects which were drawn earlier and which it overlays. In transparent rasterization the new objects are represented in a way which allows objects which are drawn beneath other objects to be seen. Thus for opaque rasterization, the pattern of ones and zeros left in raster buffer memory by the rasterization of previous objects must be replaced with the pattern of dots required by the object currently being rasterized. For transparent rasterization, the results of previous rasterization operations are left in the raster buffer memory, only those dots necessary to rasterize the current object being inserted. A further complication is that dots of each of the primary colors may overlap each other on the paper. For opaque rasterization, the pattern of ones and zeros in raster buffer memory from the previous rasterization operations must be replaced with those required for the current object during each color pass. For transparent rasterization, the pattern of ones needed to produce the dots of color necessary for the current object must be added. This means that during primary color passes in which the current object does not participate no rasterization is performed. Thus the time needed to rasterize an object during each color pass need only be added to the times for those color passes in which the object must be rasterized. For opaque objects, the object's time must be added to the times for all passes, as the object must be rasterized in all of the passes. For transparent objects, the current object's time must only be added to those passes which are required to draw the current object. This is determined by examining the color of the object when its time is to be added into the sort bin which will contain its phrase, and also by considering whether the object is to be drawn transparently or opaquely. Some time is required by the rasterizer to read the phrase even during color passes for which the phrase does not need to be rasterized. This "throw-away time" must be added to the running time total for these passes. The amount of this time will vary depending on whether the color of the object is defined in terms of BCMY or RGB. These throw-away times are determined empirically by measuring the time required to process phrases during a color pass which does not require their rasterization. Each of the timing macros contained in the current embodiment will now be discussed in some detail. The terms and calculations discussed in the previous sections will be referred to in these discussions as they apply to each of the individual macros. It should be noted that each of these macros relates to a particular kind of graphical object and that they are used in the calculation of the time necessary to rasterize an object of this type. Different rasterizer architectures will use a different set of graphical objects to render the desired images, and will therefore use a different set of calculations to determine rasterization times. Also, different sets of rasterizer hardware will have different timing characteristics and these must be reflected in the timing calculations used with each rasterizer. It should also be noted that while macro definitions are used in the current embodiment for these calculations, subroutine calls or in-line code could be used just as easily, resulting primarily in a change of programming style. Prior to entering any of these macros, the more-complex commands received from the host computer are broken into simpler elements. This is shown in Fig. 5 as step 502. Once the commands are reduced to simple elements, the element type is matched to a timing macro and the macro is executed (Fig. 5, step 504). The individual timing macros perform their timing calculations in the manner described below. WEIGH_RECT (Fig. 5, step 506; App. A, p. 1-2) This macro is used to calculate the rasterization time for a rectangle. First, the number of word-writes for a single row of dots is calculated by determining the number of 16-bit word writes in the Y dimension. Then the dimensions of the rectangle are checked and a table lookup performed to see if a similar rectangle has already been rasterized. If it is necessary to continue, the word-write time is calculated. The starting and ending latency and register load time is then added and set to the minimum setup and load time, if necessary. WEIGH_SW_XONLY (Fig. 5, step 508; App. A, p. 2-3) This macro is used to calculate the rasterization time for a line or vector phrase which has a width of one and which extends only in the X dimension. First, the dimensions of the vector are checked and a table lookup is done. If it is necessary to continue, the number of word-writes required is calculated. This will equal the number of dots to be drawn in the X dimension, as a word write must be done for each dot in this case. The word-write time is then calculated. The starting and ending latency and register load times are then added and the sum reset to the predefined minimum setup and load time when necessary. WEIGH_SW_YONLY (Fig. 5, step 510; App. A, p.3) This macro calculates the rasterization time for a line or vector phrase which has a width of one and which extends only in the Y dimension. First, the number of word-writes for the vector is calculated. Then the dimensions of the vector are compared to those in the table. If it is necessary to continue, the word-write time is calculated. The starting and ending latency and register load time is added and the total set to the minimum setup and load time when appropriate. WEIGH_TRAP (Fig. 5, step 512; App. A, p. 4-5) This macro calculates the rasterization time for a trapezoid. First, the number of word-writes for both the top and bottom rows of dots is calculated. Whether the trapezoid is entirely contained in the visible drawing region or it extends outside of this region is then considered. This consideration affects the number of word-writes performed for each row of dots. The number of word-writes will approximate the average of the top and bottom rows if the trapezoid is entirely within the visible region, but will be equal to the larger of the two if the trapezoid is not entirely within this region. The requisite table lookup is then performed. If it is necessary to continue, the word- write time is calculated. The inter-scanline time is added to this sum, along with the starting and ending latency and register load times. The final sum is set to a minimum setup and load time if necessary. WEIGH_SW (Fig. 5, step 514; App. A, p. 5-6) This macro calculates the rasterization time for a vector phrase which has a width of one and which extends in both X and Y dimensions. First, the absolute value of the delta Y value for the vector is calculated. Then the table lookup is performed. If it is necessary to continue, the word-write time for the vector is calculated. The inter-scanline time is added along with the starting and ending latency and register load times. Finally, the sum is compared to a minimum setup and load time and set to the minimum if necessary. WEIGH_CELL_TIME (Fig. 5, step 516; App. A, p. 6) This macro calculates the time required to rasterize a single "cell" of a larger "cell array" which uses the BCMY color system to define its colors. A cell array is a two-dimensional rectangular array of filled rectangles, each of which may be a different color. First, the word-write time is calculated. Separately, the starting and ending latency and register load time are added and saved as the "setup time". These results, the rasterization time per cell and the setup time, are saved and used later by the WEIGH_CELL_COLOR macro. WEIGH_CELL_TIME_RGB (Fig. 5, step 518; App. A, p. 6-7) This macro calculates the time required to rasterize a single "cell" of a larger "cell array" which uses the RGB color system to define its colors. It performs exactly the same calculations as WEIGH_CELL- TIME, but the results are used later by WEIGH_CELL_RGB instead of WEIGHCELLCOLOR. WEIGH_SCAN_TIME (Fig. 5, step 520; App. A, p. 7) This macro calculates the time required to rasterize a single pixel of a larger "scan row" which uses the BCMY color system to define its colors. A scan row is a one dimensional row of pixels, each of which may be a different color. First, the word-write time is calculated. Then the starting and ending latency and register load time is calculated. The results are saved and used later by the WEIGH_CELL_COLOR macro. WEIGH_SCAN_TIME_RGB (Fig. 5, step 522; App. A, p. 7-8) This macro calculates the time required to rasterize a single pixel of a larger "scan row" which uses the RGB color system to define its colors. It performs exactly the same calculations as WEIGH_SCAN_TIME, but the results are used later by WEIGH_CELL_RGB instead of WEIGH_CELL_COLOR.WElGH_CELL_COLOR (Fig. 5, step 524; App. A,.p. 8-9) This macro is used by the cell array and scan phrase generators to add the proper rasterization time for each cell or pixel to the appropriate running totals of each toner pass. This macro is used for cell arrays or scan rows which use the BCMY color system. It first locates the entry in the sort bin table for the appropriate raster band. It then multiplies the time required to rasterize each cell by the number of cells. These cells will all be the same color and adjacent to one another. It then adds the setup time for the entire group of cells once, as the entire group can be rasterized in one operation. It then resets the time to the predefined minimum setup and load time if necessary. Finally, the calculated time is added to the running totals for each of the appropriate color passes. WEIGH_CELL_RGB (Fig. 5, step 526; App. A, p. 9-10) This macro is used by the cell array and scan row phrase generators to add the rasterization time for each cell or pixel to the appropriate running totals for each toner pass. This is used for cell arrays or scan rows which define their colors using the RGB color system. It performs exactly the same sequence of calculations as WEIGH_CELL_COLOR, but uses a different constant for its throw-away time. WEIGH_CMYK_RASTER (Fig. 5, step 528; App. A, p. 10-11) This macro is used by the CMYK raster phrase generators to calculate the rasterization time for a single row of dots in a CMYK raster object. A CMYK raster object is a two-dimensional array of pixels which has been color separated using the BCMY color system. First, the length of the current row of dots is compared with the previous row which has already been processed. If it is identical, the result of the previous calculation is reused. Otherwise, the current length is multiplied by an empirically-determined constant and the result is saved for use in the calculations concerning the next row of dots. WEIGH_CMYK_TONERS (Fig. 5, step 530; App. A, p. 11) This macro is used by the CMYK raster phrase generators to add the rasterization time for each row of dots to the appropriate running totals for each toner pass. Flags are used by the routine to determine which toners are required to render the color of the object. It then adds the calculated time to the running totals for each of the appropriate color passes. WEIGH_RSTAMP (Fig. 5, step 532; App. A, p. 11-12) This macro is used by the raster stamp phrase generators to calculate the rasterization time for a "raster stamp". A raster stamp is a two-dimensional array of colored dots which has not been color separated. These are first defined and then used in a manner similar to the way bitmapped characters are handled in many computer graphics applications. First, the word-write time is calculated. Then the starting and ending latency and the register load time is added. This sum is compared and reset to a minimum setup and load time, if necessary. WEIGH_FVIS_FILL_CIRC (Fig. 5, step 534; App. A, p. 12) This macro calculates the rasterization time for a filled circle which is entirely within the current raster band. It first checks to see if the radius of the circle is within a certain range for which empirical time measurements have been made. If it is, it uses one of these measurements as its result. If it is not, it multiplies the radius by an empirically-determined constant to arrive at its result. WEIGH_PVIS_FILL_CIRC (Fig. 5, step 536; App. A, p. 12-13) This macro calculates the rasterization time for a filled circle which is not completely within the current raster band. It first determines the portion of the circle which is within the current raster band. It uses both the band number and the log base 2 of the number of scanlines contained in each band to calculate the X values for the first and last scanlines in which the circle is drawn in the raster band. It then takes the minimum of either the maximum X value for the circle or the X value for the last scanline in the raster band and subtracts from this number the maximum of either the minimum X value for the circle or the X value for the first scanline in which the circle is drawn in the raster band. The result of this is the X dimension of the circle in this raster band. The macro then checks to see if this dimension is within a certain range for which empirical time measurements have been made. If it is, it uses one of the empirical measurements as its result. If it is not, it multiplies the radius by an empirically determined constant to arrive at its result. WEIGH_FVIS_HOLL_CIRC (Fig. 5, step 538; App. A, p.13) This macro is used to calculate the rasterization time for a hollow circle, similar to a doughnut, which is entirely within the current raster band. It simply multiplies the radius by both an empirically-determined constant and by the width of the filled region of the circle to arrive at its result. WEIGH_PVIS_HOLL_CIRC (Fig. 5, step 540; App. A, p. 13) This macro calculates the rasterization time for a hollow circle, similar to a doughnut, which is not completely within the current raster band. It first determines the portion which is within the current raster band. It uses both the band number and the log base 2 of the number of scanlines contained in each band to calculate the X values for the first and last scanlines in the raster band. It then takes the minimum of either the maximum X value for the circle or the X value for the last scanline in the raster band and subtracts from this number the maximum of either the minimum X value for the circle or the X value for the first scanline in the raster band. The result of this is the X dimension of the circle in this raster band. It then multiplies this dimension by an empirically-determined constant and by the width of the filled region of the circle to arrive at its result. WEIGH_MW_YONLY (Fig. 5, step 542; App. A, p. 14) This macro calculates the rasterization time for a line whose width is greater than one, and which has only a Y dimension. It first calculates the word-write time. It then adds the starting and ending latency and the register load time. The result is set to the minimum for setup and loading, if necessary. WEIGHT_MW_XONLY (Fig. 5, step 544; App. A, p. 14-15) This macro calculates the rasterization time for a line whose width is greater than one, and which has an X dimension. It performs exactly the same calculations as WEIGH_MW WEIGH_MW_TOP (Fig. 5, step 546; App. A, p. 15) This macro calculates the rasterization time for a line whose width is greater than one and which extends in both the X and Y dimensions, and which has its minimum X value in the current raster band. It simply does a subroutine call to "weigh_mw_top" to calculate its value. WEIGH_MW_MIDDLE (Fig. 5, step 548; App. A, p. 15) This macro calculates the rasterization time for a line whose width is greater than one, and which extends in both the X and Y dimensions, and which does not have minimum X value in the current raster band. It uses a subroutine call to "weigh_mw_middle" to calculate its result. WEIGH_CORNER (App. A, p. 24-25) This macro is used by weigh_mw_top and weigh_mw middle to calculate the rasterization time for a triangle which makes up part of a line whose width is greater than one, and which extends in both the X and Y dimensions. It first calculates the absolute value of both the X and Y dimensions of the triangle. It then calculates the number of word writes required for the bottom of the triangle. It then uses either this value or one half of this value to calculate the word-write time for a single row of dots, depending on whether or not the line is completely within the visible drawing region, as in WEIGH_TRAP for trapezoids under the same conditions. It then calculates the inter-scanline time and adds that time and the starting and ending latency to the sum. The result is added to a running total for the line, which is a parameter to be sent to the macros. WEIGH_MIDDLE (App. A, p. 25-26) This macro is used by weigh_mw_top and weigh_mw_middle to calculate the rasterization time for a parallelogram which makes up part of a line whose width is greater than one, and which extends in both the X and Y dimensions. It first calculates the absolute value of both the X and Y dimensions of the parallelogram. Next, the number of word writes required for a single row of dots is calculated. Then, either this value or one half of this value is used to calculate the word-write time for a single row of dots, depending on whether or not the line is completely within the visible drawing region, as in WEIGH-TRAP for trapezoids under the same conditions. The inter-scanline time is then calculated and added, along with the starting and ending latency times. Finally, the result is added to a running total for the line, which is sent to the macro. weigh_mw_top (App. A, p. 26-28) This subroutine is used to calculate the rasterization time for a line whose width is greater than one, which extends in both the X and Y dimensions, and which has its minimum X value in the current raster band. It uses the macros WEIGH CORNER and WEIGH MIDDLE to do much of its work. The length and width of the line define a rectangular region which is not aligned with the X and Y axes. This region thus has four "corners" which indicate its boundaries. It is drawn in three connected regions, the regions being an upper triangle, a central parallelogram, and a lower inverted triangle. The program begins by calculating the indices of the raster bands which contain the minimum X value of the line and the X value of the next corner, proceeding in the X direction. This region is triangular in shape. It then checks to see if the entire triangle is contained in the current raster band and, if not, it calculates the dimensions of the part which is. It then uses WEIGH_CORNER to calculate the rasterization time for this triangular region. If the entire region is contained in the current raster band, it adds an empirically determined "pause time", which is the time required to set up the drawing chip to continue rasterizing the next region of the line, herein known as the "middle" parallelogram. Next, the index of the raster band which contains the next corner is calculated and used to check to see if the entire middle region, which is a parallelogram, is contained in the current raster band. If it is not, it calculates the dimensions of that portion which is and uses WEIGH MIDDLE to calculate its rasterization time and add it to the total time for the line so far. If the entire region is contained in the current raster band, it adds the pause time and calculates the index of the raster band containing the maximum X value of the line, which will define the end of the final region of the line, known herein as the "bottom" inverted triangle. It then checks to see if the entire bottom is contained in the current raster band and, if it is not, it calculates the dimensions of the portion which is. It uses WEIGH_CORNER to calculate the rasterization time for the bottom region, and adds this time to the total calculated to this point. Finally, it adds in the register load time and sets the total to a predefined minimum if necessary. weigh_mw_middle (App. A, p. 28-29) This subroutine is used to calculate the rasterization time for a line whose width is greater than one, which extends in both the X and Y dimensions, and which does not have its minimum X value in the current raster band. It uses the macros WEIGH CORNER and WEIGH_MIDDLE to do much of its work. It performs the same calculations as was used in weigh_mw_top for the two "middle" and "bottom" regions. gr_init_autoquality (App. A, p. 29-31) This subroutine is used at the beginning of controller processing to set up the tables of common values for many types of objects. To do so it must allocate memory blocks for such tables and insert the proper values into them. It uses several of the macros discussed earlier to calculate the exact values which must be inserted. gr_free_autoquality (App. A, p. 31-32) This subroutine is used at the end of controller processing to de-allocate the memory blocks which were allocated in gr_init_autoquality. The results from macros numbered 506 through 514, 524, 526 and 530 through 548 are then processed at step 550 to determine their color and the toners necessary to create these colors. After the toner requirements are determined, the rasterization time for these elements is added to the sort bin table for the appropriate toners at step 560. The results from macros 516 through 522 and 528 are stored for later calculations at step 570. These steps complete the timing calculation. After the timing information has been calculated, the appropriate action to ensure good plot quality can be selected. Once it has been determined that data cannot be rasterized fast enough to drive the plotter directly at full speed, two basic options are available. The first is to slow down the movement of paper, and the other is to complete all rasterization, saving the raster data on disk, prior to starting paper movement. The choice between these options is affected by several factors. The user may have restricted these options to only one choice by configuring the controller in a certain way. This could be the case if the user never wants paper to move at any but the fastest possible speed. Additionally, some plotters do not have the capability of being slowed down. The availability and size of the memory (disk) where the raster data are to be stored determines whether or not the entire plot can be spooled before beginning the pot. In general, if both options are available, the option with the highest throughput (production of a plot of acceptable quality in the least amount of time) will be chosen. For each toner pass, only a single choice will be made. There is no slowing of the paper or raster spooling for partial toner passes. The first step in making this choice is to examine all sort bins which actually contain data (it should be noted that many sort bins will not contain data). Each sort bin has stored within it the time required to rasterize the band associated therewith. The pass (there is one pass per toner color) which requires the longest time to rasterize is retrieved and used in further calculations. These times are added to the times required to perform a "band switch" (change to the next band). The band-switching time is essentially dead time between the rasterization of the present band and the succeeding band. The total length of the plot must also be determined in order to find the time required for each toner pass. The number of copies of the plot to be produced is also considered. If the paper is slowed for the first plot, the paper will move slower for every copy of the plot, not just the first one. If the decision is made to store the raster data, then the raster data can be output at top speed for each copy. This option is also affected by the plotter, as some plotters, particularly those which use cut sheets of paper as opposed to a roll of paper, require that all the toner passes for each separate copy be completed before the next copy can be begun. For these plotters, it may be best to spool all toner passes before beginning paper movement, so that all copies can be output at maximum speed with a minimum of delay between each copy. The times required to print the plot, for both spooling all raster data and controlling the paper movement speed, must be calculated. A separate time total is calculated for both options and the totals are then compared to see which will result in faster plotting. For the spooling option, the disk overhead resulting from the spooling process must be considered. For the speed control option, given that only a certain set of speeds is supported by each plotter, the speed which is just below the maximum rasterization speed for the slowest band of the plots is selected for the comparison operations. The total plotting speed, given this rate of paper movement and the length of the plot, must next be calculated. For example, at 12 mm per second (paper speed), a 300 mm plot will require 24 seconds. Any extra paper to be included at the beginning or end of the plot and between copies must also be included. For plots which require multiple passes, the time needed to rewind the paper, as well as the time needed to plot registration marks, must also be included. Registration marks are small blocks or lines printed during the first toner pass and used as markers or spacing indicators during subsequent toner passes. They are necessary as the paper stretches slightly during each pass, requiring continuous realignment. As the plotting of registration marks is done in parallel with the spooling for the first color pass, the time needed for the first pass is effectively reduced. At the end of these calculations, the choice can be made whether to raster spool or speed control the plot for each color pass for all copies of the plot. Typically, different passes will require different spool/speed selections to achieve good plot quality with optimal plotter throughput. The operation of the quality control selection program will now be explained with reference to Fig. 6. Initialization step 600 initializes the program to the non-spool option and full speed printing of the plot. A test is made to see if the total time to rasterize the plot has exceeded the limit of the time counting variable. If this variable has become negative, then the plot is simply too complex for any option other than spooling the data to the outside disk memory, and all other steps in the control options program are skipped. At step 602 the band requiring the most time to rasterize for each of the four toners in the plotter is selected. The time to switch to another band is added to the time retrieved in step 602 at step 606. This time is converted into its equivalent plotter speed in mm per second. If multiple copies of the plot are required, the time calculated in step 608 is multiplied by the number of copies (step 610) and the extra time required to move the paper the required amount between copies and to buffer the end of the copies is added (Fig. 6, step 612. At step 614 the spooling time for the raster data of the entire pass is calculated. The spooling time is then added to each color's total drawing time at step 616. The first pass can take advantage of the time to place registration marks on the plot so this time is subtracted from the raster time. Finally, at step 618 the time required to send the plot data to the plotter is added to the running total. This sum is the total time to plot the entire pass using spooling. At step 620 the paper speed for the plotter is selected. This speed must be just below the maximum speed that data can be rasterized. The total time to output the whole pass at that speed becomes the comparison time. This total time is calculated at step 622. At step 624, the final spool time is compared with the final speed control time. If the speed control time is less than the spool time, a comparison is made at step 628 to see if the maximum drawing speed time is less than the plotter's minimum paper speed. If it is not, the choice is made to control the speed of the plotter for that color at step 632. On the other hand, if the spool time is found to be less than the speed control time at step 624, spooling is chosen at step 630, unless the spooled data will not fit within the external disk, which test is performed at step 626. In that case, speed control 632 is again chosen. Although the invention has been described in the specific environment of a multi-color plotter, it can readily be adapted for use with such display devices as CRTs and LCDs.

Claims: A method for improving the quality of computer graphics plots produced by computer graphics plotters and displays which parse high-level data and commands received from a host computer and rasterize the parsed data and commands, the rasterized data and commands being used by the plotter to produce the plot, the method comprising estimating the time required to rasterize the parsed data and commands; comparing the time estimated to rasterize the data and commands to a known time within which the data and commands can be rasterized by the plotter to be able to produce the plot at a known maximum speed ; producing the plot at the maximum speed if the estimated time is less than said known time; if the estimated time is greater than said known time: producing the plot at a speed slower than the maximum speed; or storing all rasterized data and commands in an external memory prior to using them to produce the plot at maximum speed if the total time to store the data and produce the plot at maximum speed is less than the total time to produce the plot at the slower speed. A control unit for improving the quality of a plot produced by a computer graphics raster plotter, the plotter receiving high-level drawing commands, parsing these drawing commands into simple commands in a parsing means, and rasterizing these simple commands in a rasterizing means to produce the plot, the control unit comprising means (64) for calculating the time required to rasterize the simple commands, the time calculating means being coupled to parsing means (100), and plot quality control means (74) coupled to the time calculating means (64), the plot quality control means including means for comparing the calculated time required to rasterize the commands with a known time within which the commands can be rasterized by the plotter to be able to produce the plot at a known maximum speed, means for commanding the plotter to plot at maximum speed if the calculated time to rasterize the commands is less than said known time, means for commanding the plotter to plot at one of a predefined set of slower speeds if the calculated time is greater than said known time, and means for commanding the rasterizer means to store the rasterized commands before using these rasterized commands to drive the plotter, if the calculated time exceeds said known time and if the total time to store the rasterized commands and produce the plot at maximum speed is less than the total time to produce the plot at the slower speed. The control unit of claim 2, wherein the computer graphics raster plotter is a multicolor raster plotter. The control unit of claim 2 or 3, wherein the plotter can be driven at any one of a predefined group of speeds. The control unit of any of claims 2 to 4, wherein an external memory means (225) is coupled thereto for storing computer graphics commands and data in rasterized form.

Inventors: CROWE ROBERT THOMAS, CROWE, ROBERT THOMAS
Applicants: XEROX CORP, XEROX CORPORATION
Application year: 1990
Main classification: G06F3
IPC codes: B43L13, G06F3, G06K15, G06T11