Abstract:
A raster image processing system and method accepts a digital page description as a series of page elements (text, graphics, images, etc.) and creates output video-ready (“flattened”) raster without allocating large amounts of raster memory (arrays of pixels) and without creating a display list of all page elements. This technique improves performance (greater speed with fewer resources consumed) in the typical output process: rendering, image processing, compression, and transmission. The method records each page element in memory in a manner that largely retains the inherent compression of the element description, and fully retains the positional relationships with its neighboring elements. Where an incoming page element overlaps an existing one, the intersections are calculated on the fly, and elements underneath are immediately split, merged, shrunken, or deleted. Each incoming page element is immediately processed and recorded as described above, and then discarded. The result is a continuously precise, simple, non-overlapping (“flat”) representation of the final output raster. In other words, in one embodiment, the representation starts empty, then stays compressed and flat throughout while accumulating representations of page elements.

Description:
PRIORITY APPLICATION  
       [0001]     This application claims priority under 35 U.S.C. §119(e) from U.S. Provisional Patent Application Ser. No. 60/641,682, entitled “Digital Image Processing Without Rasterization” and filed Jan. 6, 2005, the entirety of this is hereby incorporated by reference. 
     
    
     BACKGROUND OF THE INVENTION  
       [0002]     1. Field of the Invention  
         [0003]     This invention relates generally to methods and systems for rendering computer-generated page descriptions into raster pixel arrays for use in digital output systems such as printers.  
         [0004]      2 . Description of the Related Art  
         [0005]     Output systems for digital images include computer displays (“monitors”) and printers. Users of computer software such as word processors, drawing programs, and spreadsheets create documents that place text, graphics, and bitmaps (e.g. photographs) on one or more pages of a document. Other sources of digital page descriptions are the World Wide Web (notably HTML pages), and computer software (e.g. database systems generate reports, 3D software creates polygon meshes of artificial scenes, etc.). When such a digital page must be output to a monitor or printer, software is invoked to describe precisely the location and attributes for each page element. All of the page elements combined form the page description. Each page element, with an arbitrary position, color, and size, is specified sequentially. This implies that a subsequent element may fully or partially overlap an earlier page element. The horizontal and vertical element positions are normally described in a two-dimensional coordinate system with the usual (X,Y), while the drawing order of the elements is often known as the Z order.  
         [0006]     However, the simple horizontal scanning video circuits in computer monitors and print engine controllers accept only flat (2D), linear sequences of bits. These bits must show the parts of each page element that are finally visible on the line after any overlaps among elements are resolved. In the (X, Y, Z) scheme, this means that for each Y line on the page, the output video can accept only the bits along one line at a time. One or more bits constitute a picture element, or “pixel”; there is one pixel for each X position.  
         [0007]     Because these video output circuits are so simple, the combination of a quite general page element (at the level of the generating software) such as a green-filled rectangle partially obscured by a red circle is far too complex to be handled in real time during actual display or output. The page elements must first be converted into the much simpler scanline raster structure described above, and any Z-order overlaps must be resolved prior to final output.  
         [0008]     By far the most common solution to this problem is software known as a rasterizer, also known as a “RIP” (Raster Image Processor), which simply allocates a full page (the “frame buffer”) of raster memory (or in a more limited case a strip or “band”) and then draws (“rasterizes”) each page element into the raster memory. A computer monitor typically displays in real time so the viewer sees the drawing of each element apparently instantaneously, but for a printer the full page description (all the page elements) must arrive before output can start. This is because even the very last page element might draw something on the first line, and once the printing process starts, it normally starts from the top down and cannot reverse. Ink or toner deposited on paper cannot be erased.  
         [0009]     The process of rasterizing takes a page element and “scan converts” the element into the horizontal and vertical arrays of pixels that visually correspond to the element. For example, a green rectangle 50 lines high and 75 pixels across will put 3,750 (50×75) green pixels into the raster structure, 75 pixels on each of 50 lines, at the position in the raster corresponding to the page position of the element.  
         [0010]     If a subsequent page element, say a red circle, appears and overlaps part or all of the green rectangle, because the red circle appears later (higher in the Z order) then the red pixels replace (typically) the green pixels exactly where the red circle overlaps the green rectangle.  
         [0011]     The problem of resolving overlaps in a conventional rasterizer is solved by large amounts of computer RAM (in which each pixel is randomly and directly accessible) with direct memory overwrites of pixels that are obscured.  
         [0012]     This scheme is entirely general and is well-suited to handling millions or even billions of page elements appearing in random positions. The amount of frame buffer RAM remains constant irrespective of the number of page elements.  
         [0013]     Even in the case of poor programming in which an identical page element is mistakenly sent millions of times, there is no memory cost. Each element is drawn (possibly over previous ones) and then the element is discarded. There is only the cost of CPU time.  
         [0014]     Once all the page elements have been rasterized, this now greatly-simplified raster data is ready to be sent to the output device.  
         [0015]     Even for medium resolution monitors (1024×768 is now common), modem computers use graphics “accelerator” chips to speed up this process of rasterization. When dealing with a printed page, however, current quality requirements demand at least 600×600 pixels per inch (also known as DPI or Dots Per Inch), which is 5,100×6,600 pixels for an 8½×11″ area on paper. For the best quality, rasterizers for printers process “continuous tone” or “contone” pixels, typically taken to mean 8 bits per primary color. For a CMYK (color) printer then, each pixel is 32 bits, or four 8-bit bytes. A full page raster for US Letter paper is 5100×6600×4=134,640,000 bytes (approximately 128 MB).  
         [0016]     Even by today&#39;s standards, this is a large amount of computer RAM, particularly on a computer with other concurrent processes and a large operating system (e.g. Microsoft Windows). And, if the quality required doubles in each of X and Y to 1200×1200 DPI, as with newer printers, then the RAM required for the frame buffer quadruples. A full frame buffer for US Letter paper for 32-bit CMYK contone at 1200×1200 DPI requires 538,560,000 bytes (over ½ gigabyte).  
         [0017]     Modem CPUs are dramatically faster internally than the RAM can operate. The bridge between the very fast CPUs and the slow RAM are the CPU caches, known as L1 (fastest) and L2 (fast) for Level 1 and Level 2 caches. Access to slow RAM is through the much smaller caches. A Pentium 4 CPU for example typically has just 8 KB L1 and 256 KB L2 caches.  
         [0018]     The link to the rasterizing problem is this: because the page elements can appear randomly, the rasterizer puts the elements&#39; pixels into the RAM as it receives them, and there is potential for cache “thrashing”. As page elements appear all over the page, a particular region of slow RAM might be brought in to the CPU cache repeatedly during the page rasterization, having been displaced repeatedly by different RAM regions. Conceivably the same slow RAM areas could be brought into the cache thousands of times per page. Because of the cache architectures (with cache lines), modem CPUs access memory more efficiently using sequential access compared to random access.  
         [0019]     So, one big performance problem with conventional rasterizers is that they consume too much slow RAM.  
         [0020]     But this problem is just the beginning. The bulk of the frame buffer causes further big problems “downstream” since this huge amount of raster data must be both processed and then delivered eventually to the simple print engine video circuits.  
         [0021]     The second big problem, derived from the first, is that in high-quality print systems further image-processing steps are required (color matching, trapping, halftoning, etc.). In typical simple systems, these post-rasterization operations are applied to each pixel in the raster. If some of these operations are neighborhood operations (which examine and adjust each pixel in the context of its immediate neighbors), the CPU cost can be enormous: many times longer than the rasterization process itself.  
         [0022]     A third big problem then arises from the bulky “raw” raster. The print engine circuits may be in a device separate from the raster frame buffer. This print architecture is known as “raster” or “host-based”, or incorrectly as “GDI” (taken from Microsoft Windows Graphical Device Interface), where the user (or client) PC performs the rasterizing and hosts the raster frame buffer.  
         [0023]     A raster printer connected to a PC via USB1 can accept at best about 1 million bytes per second. Taking our 1200×1200×32 Letter example where the raster frame buffer is over 500 million bytes, that single page would take over 500 seconds just to transmit (over 8 minutes). The 600×600×32 Letter page would take over 2 minutes to transfer. (Printers connected via Ethernet have widely varying bandwidth, but sometimes perform even worse than USB.) And, a laser printer would need an equivalent and expensive amount of RAM to store the entire frame buffer since once the laser engine starts it cannot stop, and any delay in the arrival of the data after engine start would mean an incomplete print.  
         [0024]     Since the printer&#39;s manufacturer would be unable to sell such a slow and expensive printer, the conventional solution to this problem is compression of the raster. Once the final raster is complete, a post-rasterizing compression step is applied to reduce the number of bytes that must be transmitted.  
         [0025]     But, as is well known in the art, there is a fundamental trade-off with compression methods: the greater the compression, the greater the CPU time cost. So, with these very large raster frame buffers, to effectively compress the data often takes more CPU time than to rasterize in the first place.  
         [0026]     Further straining this bloated, inefficient, slow system is a optional quality requirement that each page element be handled differently by class of element. For example, a different halftone screen might be applied to text as compared to the screen for bitmaps (photos).  
         [0027]     This implies, for the conventional rasterizer, that even more RAM must be allocated per pixel. The page element type (text, graphics, image, etc.) must be recorded in the frame buffer as well as the color information. The CMYK contone system described earlier would need to expand typically by at least another byte per pixel: 5 bytes per pixel. Another problem immediately presents itself: this odd number is awkward for modem computers. Filling and changing 5 bytes (40 bits) is a mismatch for 32-bit computers. So, the extra page element information (also known as “metadata” or “tag” bits) is typically allocated alongside the RAM in a parallel array of bytes. Now each logical row in the page has two RAM arrays: one of 32-bit CMYK pixels, and another of 8-bit metadata bytes. These two separate arrays now are even more likely to “thrash” the cache.  
         [0028]     A final, fatal blow to the conventional rasterizer is an even higher quality requirement on color pixel precision. Microsoft has announced 128-bit per pixel color for its next major Windows release (code-named “Longhorn”). If the rasterizer must handle 128-bit pixels for optimum quality (i.e. no loss from the digital source), then the amount of RAM required is quadrupled again. In our 1200×1200 DPI case, the raw raster frame buffer for US Letter at 128-bits/pixel is over two billion bytes.  
         [0029]     In the prior art, there are numerous attempts to alleviate the bulk and slowness inherent in simple rasterizers. None solve the original problem without introducing new major problems.  
         [0030]     The main ideas in the prior art to reduce the RAM requirement involve either “banding” or “display lists”, or both.  
         [0031]     In the “banding” case, instead of allocating the entire frame buffer, typically a strip or band is allocated. If the page is 6000 lines, then a 600 line band would mean only 1/10 the RAM. What&#39;s wrong with this? There are two main drawbacks. First, the entire set of page elements must be recorded (into a “display list”) to play back (rasterize) for each band on the page. Since the band buffer is now a mere fraction of the full page description, the display list must be complete. Second, elements that span more than one band must be processed more than once.  
         [0032]     The display list problem is small for simple pages. A system making the display list for the text on this page wouldn&#39;t need much storage for the list. But for complex pages, the display list storage problem is crippling or fatal. A computer program generating polygons for an artificial scene might generate billions of polygons. All of these must be recorded in the display list before the banding rasterizer can begin. While this is an extreme case, every display list/banding scheme must handle the case where it runs out of resources (RAM, disk space, etc.) in which to record the display list. Upon overflow, some of the prior art attempts to “fallback” to raw raster at a lower quality, but the fundamental problem remains: there will be pages that either outright fail to print, or at least fail to print at the normal quality level.  
         [0033]     The second performance problem with banding, though less severe, may still impair performance dramatically. Page elements that span multiple bands must be accessed and processed for each band in which they appear. The simplest method is to draw each element, repeatedly and fully, for each band, discarding any lines which are above or below the current banding buffer. Generating then discarding that raster data wastes CPU time. While it is sometimes possible to “clip” the element cleanly at band boundaries, often this is not entirely precise and is inefficient again due to wasted results.  
         [0034]     A third method well known in the prior art is the use of sorted “active” object lists with the banding buffer as little as one line. While this can cut down on redundant pixel drawing, it retains the problem of display list overflow, and adds the problem of object sorting.  
         [0035]     A fourth method involves a display list that creates per line a sorted list of active runs which are then “flattened” prior to output. This method retains the display list overflow problem, and adds the problem of potentially huge active object and active runs lists.  
         [0036]     Accordingly, there is a need in the art for a system and method to produce the raster needed for output displays and print engines without either allocating huge amounts of slow RAM, or creating potentially huge slow display lists.  
       SUMMARY OF THE INVENTION  
       [0037]     In an embodiment, a raster image processing system and method accepts a digital page description as a series of page elements (text, graphics, images, etc.) and creates output video-ready (“flattened”) raster without allocating large amounts of raster memory (arrays of pixels) and without creating a display list of all page elements. This technique dramatically improves performance (greater speed with fewer resources consumed) in the typical output process: rendering, image processing, compression, and transmission. The method records each page element in memory in a manner that largely retains the inherent compression of the element description, and fully retains the positional relationships with its neighboring elements. Where an incoming page element overlaps an existing one, the intersections are calculated on the fly, and elements underneath are split, merged, shrunken, or deleted. Each incoming page element is processed and recorded as described above, and then discarded. The result is a simple, non-overlapping (“flat”) representation of the final output raster. In other words, in one embodiment, the representation starts empty, then stays compressed and flat throughout while accumulating representations of page elements.  
         [0038]     One embodiment of the invention is a method of processing a page description comprising forming at least one segment for a scanline and merging the segment into a collection of flattened segments.  
         [0039]     The method may further comprise receiving a page element. In addition, the method may further comprise processing the page element to form the at least one segment. Also, the page element may span at least one scanline. Furthermore, the collection of flattened segments may be ordered. The method may further comprise receiving a page element comprising instructions of at least one of location, shape, color, and attributes of items on a page.  
         [0040]     The segment may comprise at least one of the group consisting of a color segment, a pattern segment, a pattern extended segment, a bitmap segment, a source bitmap segment, a compressed bitmap segment, a palette color segment, a palette pattern segment, a palette pattern extended segment, and a palette bitmap segment. In addition, the page description may be used for printing.  
         [0041]     The method may further comprise creating an object, wherein the object stores in memory at least one of the location, shape, color, and other attributes of the page element. Also, the scanline may be a visible scanline. In addition, the segment may comprise the horizontal intersection of the scanline with the page element, and the segment may comprise previously merged segments for the scanline. Furthermore, the segment may be null.  
         [0042]     The merging of the segment into the collection of flattened segments may further comprise performing a sequential search. The method may also further comprise indexing the collection of flattened segments. In addition, merging the segment into the collection of flattened segments may comprise accessing the index. Furthermore, the method may be implemented as computer readable program code stored in a computer accessible storage medium.  
         [0043]     Another embodiment of the invention relates to an apparatus for processing a digital page description comprising: at least one segment stored in a computer accessible storage medium, wherein the segment is associated with a scanline and wherein the segment is formed from a page element; a collection of flattened segments stored in the computer accessible storage medium, wherein the collection of flattened segments is associated with the scanline; and a processor that is configured to merge the segment into the collection of flattened segments.  
         [0044]     The apparatus may further comprise a page element. Also, the processor may be further configured to process the page element to form the at least one segment. In addition, the page element may span at least one scanline. Furthermore, the collection of flattened segments may be ordered.  
         [0045]     The page element may comprise instructions of at least one of location, shape, color, and attributes of items on a page. Also, the segment may comprise at least one of the group consisting of a color segment, a pattern segment, a pattern extended segment, a bitmap segment, a source bitmap segment, a compressed bitmap segment, a palette color segment, a palette pattern segment, a palette pattern extended segment, and a palette bitmap segment. In addition, the page description may be used for printing.  
         [0046]     The processor may be further configured to create an object, wherein the object stores in the memory at least one of the location, shape, color, and other attributes of the page element. Also, the scanline may be a visible scanline. In addition, the segment may comprise the horizontal intersection of the scanline with the page element, and the segment comprises previously merged segments for the scanline. Furthermore, the segment may be null. The apparatus may further comprise an index of the collection of flattened segments. Also, the processor may be further configured to access the index.  
         [0047]     Yet another embodiment of the invention relates to an apparatus for processing a page description comprising: means for forming at least one segment for a scanline; and means for merging the segment into a collection of flattened segments.  
         [0048]     The apparatus may further comprise means for processing the page element to form the at least one segment. Also, the apparatus may further comprise means for creating an object, wherein the object stores in memory at least one of the location, shape, color, and other attributes of the page element. In addition, the apparatus may further comprise means for indexing the collection of flattened segments.  
         [0049]     For purposes of summarizing the invention, certain aspects, advantages and novel features of the invention have been described herein. It is to be understood that not necessarily all such advantages may be achieved in accordance with any particular embodiment of the invention. Thus, the invention may be embodied or carried out in a manner that achieves or optimizes one advantage or group of advantages as taught herein without necessarily achieving other advantages as may be taught or suggested herein. In addition, the following definitions provide a general background pertaining to a variety of different embodiments of the invention, and are provided by way of example and are not intended to be limiting.  
       GLOSSARY  
       [0050]     Cell: The term “cell” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, a data structure representing a variable-width area within a Scanline or Region; in order to speed Segment insertion, the array of cells can be randomly-addressed by X position to find the leftmost or rightmost Segment in the cell.  
         [0051]     Current Segment: The term “current segment” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, a Segment from a Page Element already merged that currently intersects the Incoming Segment.  
         [0052]     DPI: The term “DPI” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, dots per inch  
         [0053]     Flattened: The term “flattened” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, non-overlapping Segments or Regions; 2D (X and Y; no Z).  
         [0054]     Glyph: The term “glyph” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, a bitmap representation of a single letter in a font at a specific size.  
         [0055]     Granularity: The term “granularity” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, the maximum number of cells per scanline  
         [0056]     Incoming Segment: The term “incoming segment” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, a Segment from the newest Page Element received from the Page Description.  
         [0057]     Inherent Compression: The term “inherent compression” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, the reduction in data storage inherent in the abstract but precise description of a Page Element, as compared to raw pixel arrays. For example, a filled polygon specified by its vertices has inherent compression since only the polygon boundaries are needed to precisely describe the raster areas covered; its inner fill areas are implied since they are filled edge-to-edge.  
         [0058]     Macro: The term “macro” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, saved output stream fragments with a unique identifier (UID), ready to be replayed in full by invoking the UID.  
         [0059]     Object (type/class): The term “object” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, a Page Element type, such as text, graphics, or image.  
         [0060]     Opacity: The term “opacity” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, the degree of transparency in the incoming Page Element. Full opacity is of course an opaque element; zero opacity is fully transparent such that the element is invisible; other opacity levels blend the source and destination pixels by the opacity percentage of the incoming Page Element.  
         [0061]     Opaque: The term “opaque” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, a common drawing mode in which source pixels in the page element overwrite destination pixels.  
         [0062]     Palette: The term “palette” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, a subset of colors used to save space in representing and processing common or repeated colors. For example, if addressed by a single 8-bit BYTE there is a maximum of 256 colors in the palette.  
         [0063]     Page Description: The term “page description” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, the list of Page Elements for an output page.  
         [0064]     Page Element: The term “page element” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, a precise drawing command to mark a page, typically comprising various text, graphics, and image commands.  
         [0065]     Pattern: The term “pattern” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, a pixel array intended to fill a Segment or tile a region by repetition.  
         [0066]     Raster-op (rop): The term “raster-op” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, the combination by logical operator (e.g. XOR, AND, NOT, etc.) of source (S), destination (D), and pattern (P) pixels. A binary rop combines S and D. A ternary rop combines S, D, and P.  
         [0067]     Refinement: The term “refinement” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, addition and adjustment of the Scanline&#39;s Cells if the number of Segments per Cell overflows, up to the Granularity limit.  
         [0068]     Region: The term “region” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, a two-dimensional raster area with an arbitrary boundary, often described by an array of vertically-contiguous rectangles and/or Segments.  
         [0069]     Scanline: The term “scanline” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, an array of device pixels corresponding to a full row in the output page or display.  
         [0070]     Segment: The term “segment” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, an abstract but precise drawing command for a single Scanline; can be of several types derived from the originating Page Element.  
         [0071]     Translation: The term “translation” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, the direct conversion from one abstract page description to another differing page description with little or no loss of Inherent Compression; as contrasted with the expansion of the first representation to raw pixel arrays, and the compression of those arrays into the second representation.  
         [0072]     Traversal: The term “traversal” as used herein is a broad term and is used in its ordinary sense and includes, without limitation, moving through a linked list. For example, a right-threaded list (with each node carrying a pointer to its immediate right neighbor) allows one to start at the leftmost node, and traverse sequentially rightward.  
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0073]     A general architecture that implements the various features of the invention will now be described with reference to the drawings. The drawings and the associated descriptions are provided to illustrate embodiments of the invention and not to limit the scope of the invention. Throughout the drawings, reference numbers are re-used to indicate correspondence between referenced elements.  
         [0074]     The current embodiment is described in reference to the drawings, in which:  
         [0075]      FIG. 1  shows a flowchart for the overall page processing method, according to an embodiment of the invention.  
         [0076]      FIG. 2  shows a flowchart for processing each page element, according to an embodiment of the invention.  
         [0077]      FIG. 3  shows a flowchart of the method to merge one or more Incoming Segments into Current Segments (if any), according to an embodiment of the invention.  
         [0078]      FIG. 4  shows a flowchart of the method to determine the Current Segment on a row at which the Incoming Segments are merged, according to an embodiment of the invention.  
         [0079]      FIG. 5  shows a flowchart to determine whether or not to Refine all cells, a single cells, or none, according to an embodiment of the invention.  
         [0080]      FIG. 6  shows a flowchart illustrating the method of cell refinement, according to an embodiment of the invention. 
     
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS  
       [0081]     Certain embodiments of this invention flatten incoming page elements while largely retaining their inherent compression. The following table explains the concept of inherent compression for each page element class.  
                                           Page                   Element       Class   Specification   Inherent Compression   Example                   Text   Specified as an   Unique characters per   “This is a test” has 7           array of [(x, y)   font/size are stored run-   unique letters (“T”, “h”,           position, glyph   length compressed in a   “i”, “s”, “a”, “t”, “e”), with           ID]   document glyph cache.   each glyph run-length                   compressed (18 pt yields                   3:1 or better).       Graphics   Specified as   The array of vertices   A rectangle with corners at           object type   consumes just 2 integers   (100, 100) and (500, 500) is           (rectangle, line,   per vertex (8 bytes each   specified with just two           polygon, etc.)   on a 32-bit CPU)   vertices, compared to a           with two or more       raster area of 400 × 400 = 160,000           (x, y) vertices.       pixels.       Images   Specified as a   For printing, typically the   A 3″ × 4″ photo from a web           source image, and   source image is lower-   page arrives with 96 dpi           a destination   resolution than the   source pixels. The source           rectangle.   destination printer page   pixel area is 3 × 4 × 96 × 96 = 110,592;               area, often resulting in   the destination               significant stretching of   pixel area of 3 × 4 × 600 × 600 = 4,320,000               the source image both   is more than               horizontally and   39 times larger.               vertically.       Patterns   A page element   The pattern bitmap is   For the 400 × 400 pixel       (Page   can be pattern-   tiled repeatedly across the   rectangle described above,       Element   filled instead of   entire raster area to be   a cross-hatch pattern of 8 × 8       fill   solid-filled. The   filled, an area which is   pixels takes just 64 pixels       attribute)   pattern is   typically much larger than   to specify, compared to the           specified as a   the pattern bitmap.   full raster area of 160,000           bitmap.       pixels.                  
 
         [0082]     As described above and shown in  FIG. 1 , a high-level view of a page processing method is shown. For a given page (S 10 ), the method first receives and processes the page elements (S 20 ), then second, translates the results into a form suitable for the output target (S 30 ). In a printing system, at end of page (S 40 ), another page may be accepted and processed.  
         [0083]      FIG. 2  breaks down the process of step S 20  in more detail. A page comprises zero or more page elements, which are composed and sent from a higher-level process. At start of page, the current embodiment method starts with almost nothing. Unlike a conventional raster system which typically allocates and clears a full frame buffer before the first page element arrives, one embodiment of the invention allocates only an array of row pointers, one per row in the page, all of which are NULL (empty).  
         [0084]     When a page element is received (S 100 ), an Object is created in memory (S 110 ) to capture its attributes: color, pattern, object class, and anything else unrelated to the position and size.  
         [0085]     The page element spans one or more lines. For each visible line (S 120 ), the page element intersects the line in zero or more locations. These horizontal pairs of intersections are called Segments. Often the segments arrive already sorted in ascending (left to right) horizontal (x) order; if not, the segments are sorted. Also, since the segments are derived from a single (flat) page element, it should be impossible that any segments overlap. Each segment is checked and corrected if any such overlaps exists.  
         [0086]     If there are one or more Segments on the line, these Incoming Segments are then merged with Current Segments (if any) (S 130 ). This process repeats until the lines in the Page Element are processed (S 140 ). At step (S 150 ), the method returns to (S 100 ) to await more Page Elements.  
         [0087]     Steps S 110  and S 120  create Object and Segment structures in memory. See TABLE 1 below for the Object structure members.  
                         TABLE 1                           Object Structure            Object Member   Description               Type   Object type (plain, bitmap, . . . )       ColorType   Page element class for color processing       Index   Palette index (if any)       Translated   Colors have been translated? (Boolean)       Color   Color (direct)       pPalette   Pointer to Palette (if any)       pObjectRight   Pointer to next Object       pPattern   Pointer to full pattern pixel array (rows and columns)                  
 
         [0088]     If an incoming bitmap page element has a source resolution less than the destination resolution (requiring source pixels to be stretched to fit the destination area), then a special Bitmap Object is created so as to reduce, typically dramatically, the storage required. See TABLE 2 below for the additional Bitmap Object structure members.  
                             TABLE 2                           Bitmap Object Structure                Bitmap Object               Member   Description                       Object   Inherits Object members           StretchInfo   Information for pfnStretch to stretch               source bitmap pixels to destination               (includes source and destination rectangles)           pfnStretch   Points to bitmap stretching function (source               pixels to destination)           StretchX   Integer stretching factor for horizontal pixels           pbCompressed   Pointer to current destination pixel array               (compressed)           cbCompressedMax   Maximum byte count in pbCompressed           cbCompressed   Current byte count in pbCompressed           nLines   Destination line count for the bitmap           LastLine   Last vertical line (absolute)           MacroDstLine   Current row macro vertical position           MacroID   Unique identifier for current row macro           MacroXX   Horizontal span for current row macro           Bits   Pointer to pixel array                      
 
         [0089]     For example, Microsoft&#39;s Internet Explorer (Version 6) prepares each bitmap or photo at the screen dots-per-inch (DPI), which is typically 96. 96×96 dpi bitmaps are sent during printing, which for 600 DPI printing requires a greater than 6× stretch in each of the horizontal and vertical page directions. By storing just the source bitmaps, the storage required is less than 1/36as great as storing destination (600×600 DPI) bitmap pixels.  
         [0090]     At least some segments, in an embodiment, are stored with a 16-byte base structure, as shown below in TABLE 3.  
                             TABLE 3                           Segment Structure (base)            Segment Member   Size (in bytes)   Description               X1   2   Starting X position       X2   2   Ending X position       Type   1   Type (e.g. color, pattern,               bitmap, etc.)       Raster-op   1   Logical drawing operator       Object Type   1   Page Element class       Palette Index   1   (if needed)       pRight   4   Pointer to immediate right               neighbor segment       Union { Color, pExtra }   4   Direct Color, or pointer to               Extra information                  
 
         [0091]     To enhance further the overall efficiency of the storage and processing of Segments from Page Elements, numerous segment Types are used. These types are shown in TABLE 4 below:  
                                                   TABLE 4                           Segment Types            Segment                   Type   Description   Color or Extra Pointer   Extra Data (Location)                    1   Color   Color   None       2   Pattern   -&gt; Pattern Extra Block   Pattern in Object       3   Pattern   -&gt; Pattern Extra Block   Pattern in Extra Block           Extended       4   Bitmap   -&gt; Bitmap Extra Block   Uncompressed bitmap                   data in Extra Block       5   Source   -&gt; Bitmap Extra Block   Source bitmap in           Bitmap       Object       6   Compressed   -&gt; Bitmap Extra Block   Compressed bitmap           Bitmap       data in Extra Block       7   Unused       8   Palette Color   -&gt; Palette   Page Palette       9   Palette   -&gt; Pattern Extra Block   Pattern in Object           Pattern       10   Palette   -&gt; Pattern Extra Block   Pattern in Extra Block           Pattern           Extended       11   Palette   -&gt; Bitmap Extra Block   Bitmap (palette           Bitmap       indices) in Extra Block                  
 
         [0092]     For example, the simplest segment is the Color segment, which occupies just 16 bytes in the current embodiment. It has just one key attribute: its Color. Its compression value should be obvious: for x1=0 and x2=3999, the Color value of 4,000 32-bit pixels is stored in this 16-byte segment, a compression ratio of 16000:16 (1000:1).  
         [0093]     See TABLE 5 below for the extra structure members stored for Pattern Segment types. A pattern segment carries (via PatternExtra) either its own unique pattern, or a pointer to a pattern row in an Object. For example, an alternating pattern of red and green pixels (a PatternWidth of 2) can be defined, with the segment (x1,x2) indicating the overall span of the pattern for the segment. Continuing the example, with a pattern width of 2 and x1=100 and x2=219, then the pattern, when drawn, would be replicated 60 times, starting at destination pixel  100 . The starting pattern alignment is handled by (x1 modulo PatternWidth). The storage cost for a pattern segment varies with the PatternWidth. For example, with a PatternWidth of 4 (with 4-byte color values), the pattern itself consumes 16 bytes, along with the root segment (16 bytes), and the PatternExtra structure (16 bytes), the total is 48 bytes. The Pattern segment in this example becomes cost-effective when the span is greater than 12 pixels. A 120 pixel span in raw raster terms takes (120×4) 480 bytes, so the equivalent Pattern segment achieves the same representation with a 10:1 compression ratio.  
                         TABLE 5                           Pattern Extra Structure            PatternExtra           Member   Description               Shift   Left shift count (pixels -&gt; bytes) for Pattern Row pixel           size       Pattern Width   Width of the pattern in pixels       cbCompressed   If compressed, byte count of compressed pattern row       Union { pPalette,   If pixels are palette indices, then points to Palette;       pObject }   if not Pattern Extended, pObject has pattern       pPatternRow   Points to pixel array defining the pattern                  
 
         [0094]     Bitmap segments have extra data that carry the pixel arrays for the bitmap. These are one of four types: (1) bitmap for direct destination raster pixel arrays, (2) source bitmap segments that link to the original source bitmap pixels in the Page Element (Object), (3) compressed segments which are similar to bitmap segments but have their pixel arrays compressed, and (4) palette bitmaps whose pixel arrays are palette indices instead of full direct colors. TABLE 6 below shows the BitmapExtra structure members.  
                         TABLE 6                           Bitmap Extra Structure            BitmapExtra           Member   Description               X0   X position for offset 0 in pixel array       DestLine   Destination vertical line (relative to top as line zero)       Color   Source color (for ternary rop)       pObject   Pointer to Bitmap Object       pPalette   Pointer to Palette (if PaletteBitmap)       Shift   Shift left count (pixels -&gt; bytes) for pixel array (pBits)       cPixels   Pixel count in pBits       cbBits   Byte count in pBits       pBits   Pointer to pixel array                  
 
         [0095]     The current embodiment storage cost for a Bitmap segment is 16 bytes (root) and 32 bytes (Bitmap extra). For a Source bitmap segment there is no additional cost because the source pixel arrays are stored in the Bitmap Object. For typical pages (e.g. HTML pages from the World Wide Web) the photos and bitmaps are typically low-resolution in order to speed the download times. The originating programs send instructions to stretch the lower resolution images to an area on the page. These source images are typically on the order of 100 dpi (dots per inch). Storage of the source pixels arrays in this case, compared to a final destination raster resolution of 600 dpi, is 1/36 the storage (100×100)/(600×600), a compression ratio of 36:1.  
         [0096]     In order to avoid storing direct uncompressed pixel arrays of full destination resolution, compression techniques are applied. If the resulting compressed byte stream consumes less storage, a Compressed Bitmap segment is created instead of a raw Bitmap segment. The compression method of course can be anything suitable; in the current embodiment a simple PackBits style method is used to compress runs of consecutive identical pixels, while storing the straight pixel arrays where no runs are found.  
         [0097]     Additional segment types use color palettes to further reduce storage and processing. A Palette Color segment, for example, has its color defined by Index (8-bit in the current embodiment), with the 256-color palette referenced by the Extra pointer. While this particular segment type does not save any memory (it is also 16 bytes), back-end color processing (color correction, etc.) can greatly benefit by color processing the palette just once, and then redundant colors on the page need not be color processed. Additionally, for Palette Pattern and Palette Bitmap segments, the color pixel arrays are stored, in the current embodiment, as 8-bit bytes instead of 32-bit full color pixels, thus providing a 4:1 storage improvement for large patterns and bitmaps.  
         [0098]      FIG. 3  shows the expansion of step S 130 , which merges Incoming Segments into a row. Because the page representation starts empty, a row may not yet exist (S 200 ). If not, then a row structure (see TABLE 7 below) is created in step S 210  that serves as the root for a linked-list of segments, and indexing cells (if any). Of course if the row did not exist, then there are no underlying Current Segments, so the Incoming Segments are simply inserted (S 220 ) into the row, preserving their left-to-right order. Processing continues on the next row (S 230  returns to S 140 ).  
                         TABLE 7                           Row Structure            Row Member   Description               Shift   Left shift count (pixels -&gt; cells) to index cell array       CellOverload   Threshold for cell refinement       cCells   Count of cells attached to this row       Bits   Status bits       pLeftmostSegment   Pointer to leftmost Segment on this row       pRightmostSegment   Pointer to rightmost Segment on this row       pXlate2Cell   Pointer to translation array to index cells       pCell   Pointer to cells (if any) attached to this row                    
         [0099]     If the row exists, then there are Current Segments. The Incoming Segments will be added to the row, and in one embodiment are added or merged to preserve the left-to-right order of the segments on the row. Therefore in step S 240  the method finds where to start. Any Current Segments entirely to the left of the first Incoming Segment are irrelevant, as they will be undisturbed. So, the procedure finds the leftmost Current Segment that intersects or is fully right of the first Incoming Segment.  
         [0100]     If there is no intersection, the Incoming Segment is inserted and Step S 250  is repeated while there are more Incoming Segments (S 260 ).  
         [0101]     If there is an intersection, a more complex merge procedure is performed. For example, suppose there are two Current Segments at (100,200) and (300,400), and the Incoming Segment is at (250,350). The first Current Segment is too far left, but the second actually intersects, and that is where the merging procedure begins.  
         [0102]     At step S 250 , each intersection case often involves one or more operations to fully merge the Incoming Segments and keep the non-overlapping row order intact. These segment operations include: shrink, copy, delete, and insert.  
         [0103]     Continuing the example above, the Incoming Segment (250,350) is inserted after the (100,200) segment and before the (300,400) segment, which shrinks to what is still visible (351, 400).  
         [0104]     Step S 250  is repeated while there are more Incoming Segments (S 260 ).  
         [0105]     Finally, after the Incoming Segments are merged, it may be necessary to refine the cell structures that enable efficient search. If the number of searches is deemed to be excessive (more on this later), then a cell refinement process (S 280 ) is done.  
         [0106]      FIG. 4  shows the process of step S 240  in detail. There are two main cases. First, if the row is relatively simple (there are no cell indexes), then a sequential search is made to find the target Current Segment. Second, if the row has become more complex with a large number of segments, then there may be cell index structures available to start the search close to the target, thus involving a small number of comparisons of the relative segment positions.  
         [0107]     The count of the comparisons (a measure of compute-time performance expense) is important to adapt the cell structures to the complexity of the row. This variable Tests is initialized to zero at the beginning of the Merge process (S 400 ). After all the Incoming Segments are merged, Tests is used (S 270 ) to either refine the cell structures for the entire row (FULL refinement), or for a single cell c. This is described as the Refinement mode: either FULL or single cell c.  
         [0108]     If the row has no cells (S 410 ), then a search begins at the row&#39;s leftmost segment (S 420 ), and continues until the Current Segment&#39;s right point (x2) is greater than or equal to the left point (x1) of the Incoming Segment (CS.x2&gt;=IS.x1). Otherwise (CS.x2&lt;IS.x1) the Current Segment is obviously fully left of the Incoming Segment. Each comparison increments Tests. The Refinement mode is set to FULL since there are no cells yet.  
         [0109]     If the row has cells (S 410 ), then we can jump to the vicinity in the row based on the left point (x1) of the first Incoming Segment (S 430 ). Each cell has its starting point (leftmost point in the cell), and both a pointer to the leftmost and rightmost segments in the cell. TABLE 8 below shows the cell structure members:  
                             TABLE 8                           Cell Structure                Cell Member   Description                       OffsetX   Left edge of cell           pLeftmostSegment   Pointer to leftmost Segment in Cell           pRightmostSegment   Pointer to rightmost Segment in Cell                      
 
         [0110]     In the current embodiment, the cells do not have to be the same width. The Refinement process produces a wide cell where there are few segments, and increasingly narrow cells in areas of greater segment density. This keeps the comparison count very low, and therefore very fast.  
         [0111]     The width of a cell can be determined by subtracting the cell&#39;s left offset from the left offset of the adjacent cell to the right.  
         [0112]     The actual indexing procedure, in the current embodiment, involves setting a cell granularity during page setup. For example, a granularity of 64 sets the minimum cell width to be approximately 1/64 of the overall page width. In this example, on a page 8,192 pixels wide, the minimum cell width would be 128 (8192/64). This also implies a maximum of 64 cells per row.  
         [0113]     An additional CellOverload parameter, in the current embodiment, controls the refinement process. In order to keep the number of cells per row low (thereby saving memory) a cell is made as wide as possible such that the number of segments in the cell does not exceed the CellOverload parameter.  
         [0114]     Continuing the example, assuming the CellOverload parameter is 8, suppose the row has only 4 segments whose right point (x2) is less than 1,024, but dozens of segments between 1,024 and 1,151. The first cell (cell index 0) would span (0,1023) with just 4 segments, and the second minimum-width cell (cell index 1) would span (1024,1151) with the dozens of segments.  
         [0115]     To support this variable-width cell array, the actual indexing, based on the Incoming Segment&#39;s left point (IS.x1), is done through a byte-array (pXlate2Cell) of granularity width. Continuing the example, since the first cell spans 8 granular units, then the first 8 elements in pXlate2Cell have a cell index of 0. The 9th byte would be 1 for cell 1 (the 2nd cell).  
         [0116]     It should now be clear that this method allows very fast direct indexing of variable-width cells, jump-starting the search process very close to the eventual intersecting Current Segment. Experimental observation has shown this technique to involve fewer comparisons even than a binary search.  
         [0117]     Once the cell is indexed and we have its index number c, the segment of interest is the rightmost in the cell (S 430 ).  
         [0118]     However, it is possible that the cell exists but that no segments are currently present (they may have been deleted). If in step S 435  the rightmost segment (CS) is null, then since we prefer to start as close as possible to the target (IS.x1), then in step S 440  we decrement the cell index c until a rightmost cell segment is non-null. Since that segment is obviously fully left of IS.x1, the right link of that segment is the final target Current Segment.  
         [0119]     If in step S 435  the cell&#39;s rightmost segment is non-null, then we start with that segment (CS) and further analyze its position.  
         [0120]     Since IS.x1 may be anywhere within the cell, and CS is the rightmost segment in the cell, it is possible that CS is too far right (S 445 ). If so, in step S 450  we start at the cell&#39;s leftmost segment to find the first intersecting (or fully right) segment. Again we increment Tests at each comparison. The Refinement mode is set for the single cell c to be refined.  
         [0121]     It is also possible that CS is too far left (S 455 ). For example, if the cell spans (0,1023) and the first and only segment spans (100,200) and the Incoming Segment spans (500,600), then the cell&#39;s current rightmost segment is too far left. This case is easily handled (S 470 ) by linking right of CS. Since that segment must be in a cell to the right, it is guaranteed to either intersect or be fully right of IS.x 1.  
         [0122]     If CS is neither too far right (S 445 ) nor too far left (S 455 ), then it intersects the Incoming Segment, and we are ready to begin the merging process.  
         [0123]     A Traversal structure is employed for tracking the current segment (for the insertion point and intersection evaluation), the current cell, and for the convenience of tracking the previous segment. The current embodiment employs just a right-threaded linked segment list to save storage space. See TABLE 9 below Traversal structure members:  
                         TABLE 9                           Traversal Structure            Traverse Member   Description               pRow   Pointer to row being traversed       pLeftSegment   Pointer to segment to the left of Segment (below)       pSegment   Pointer to current Segment       C   Cell index                  
 
         [0124]     Based on simple one-dimensional intersections, there are a handful of possible cases for the intersection of IS and CS. These are shown in TABLE 10 below.  
                                             TABLE 10                           Merge Segment Intersection Cases and Operations           (In the table below, segment A is the Current       Segment, segment B in the Incoming Segment,       Segment C is a newly synthesized segment from a       raster-op, and the Next segment will be the       Current Segment in the next merge.)            Merge                           Segment       Intersection   Opaque   Opaque   Raster-op   Raster-op       Case   Operations   Example   Operations   Example               Left   Shrink A;       BBBBBBBBBB   Shrink A;       BBBBBBBBBB           Segment   Delete all under B;   AAAAAAAA   Insert C = (B rop A);   AAAAAAAA       fragment   Insert B;   AAAABBBBBBBBBB   Insert B;   AAAACCCCBBBBBB           Next = B-&gt;Right;       Next = B-&gt;Right;               Right   Shrink A;   BBBBBBBBBB   Shrink A;   BBBBBBBBBB       fragment   Insert B;       AAAAAAAAAA   Insert B;       AAAAAAAAAA           Next = A;   BBBBBBBBBBAAAA   Insert C = (B rop A);   BBBBCCCCCAAAA                   Next = A;               Left and   Copy A to A′;       BBBBB   Copy A to A′;       BBBBB       Right   Shrink A;   AAAAAAAAAAAAAA   Shrink A;   AAAAAAAAAAAAAA       fragment   Insert B;   AAAABBBBBAAAAA   Insert C = (B rop A);   AAAACCCCCAAAAA           Shrink A′; Insert A′;       Shrink A′; Insert A′;           Next = A′;       Next = A′;               Invisible   Delete A;   BBBBBBBBBB   Copy B to B′;   BBBBBBBBBB           Delete all under B;      AAAA   Shrink B      AAAA           Insert B;   BBBBBBBBBB   Insert C = (B rop A);   BBBCCCCBBB           Next = B-&gt;Right;       Shrink B′; Insert B′;                   Next = B′-&gt;Right;               Nothing   Insert B;   BBBBBBBBBB   Insert C = (B rop   BBBBBBBBBB       below   Next = B-&gt;Right;       Background color);   *Background*               BBBBBBBBBB   Next = C-&gt;Right;   CCCCCCCCCC                  
 
         [0125]     At step S 250 , each intersection case requires one or more operations to fully merge the Incoming Segments and keep the non-overlapping row order intact. These operations include:  
         [0126]     Shrink: takes a segment and shrinks its position (x1,x2) on the row by either increasing x1 or decreasing x2. For example, in the Left Fragment case, the intersecting Current Segment (CS) must shrink such that its new x2 value is decreased to (IS.x1−1).  
         [0127]     Copy: takes a segment and copies its attributes while assigning a new position (x1,x2). For example, in the Left And Right Fragment case, the Current Segment A in effect splits into two pieces: the first can be achieved just by shrinking the original segment (as in the Left Fragment case). However, the right piece is copied from the first, and its new position assigned (IS.x2+1, CS.x2).  
         [0128]     Delete: removes a segment from the Row links and from memory. For example, in the Invisible case, the Incoming Segment B entirely overlaps the Current Segment A. In the normal opaque drawing model, this means that A is no longer visible, so it may be deleted. It is as if it never existed.  
         [0129]     Insert: adds a segment to the Row links; by traversal convention the new segment is inserted after the Current Segment (TRAVERSE.pSegment).  
         [0130]     A few notes on the Raster-op drawing model: while the current embodiment employs the 256 “ternary” rop model of Microsoft Windows, the operations could involve any logical combination (or function) of the pixel values in CS A and IS B. For example, an XOR (exclusive-or) raster-op would take the A color XOR the B color, with the resulting color being assigned to new segment C.  
         [0131]     See also TABLE 13 for a matrix of different segment type combinations that illustrates the efficient handling of raster-ops while preserving, where possible, the inherent compression of the segment types.  
         [0132]     Another Page Element attribute that requires special handling for the intersection of current and incoming segments is Opacity. Normally the incoming Page Element by default has Opacity 100%, meaning everything below is obscured. However, with Opacity 50%, for example, the colors below are averaged with the incoming colors. In general, with Opacity level of O, then the Destination colors (D) are computed with the Source colors (S) as follows: S*(O/100)+D*((100−O)/100). Even more complex combinations are possible, but it should be apparent that Opacity can be handled in an efficient manner, similar to the Raster-op handling described below.  
         [0133]     The various copy, shrink, delete, and insert operations adjust the linked list of segments, preserving the left-to-right ordering.  
         [0134]     Since the shrink, delete, and insert merge operations may alter the current leftmost and rightmost segments in a cell, corrections to the cells often need to be made, as shown below in TABLE 11.  
                         TABLE 11                           Cell Corrections during Merge Operations            Merge Operation   Possible Cell Corrections               Shrink   If the shrinking segment changes its cell, a correction is typically           performed. Since the cell index is based on x2 (rightmost segment           point), in this example, any cell change is leftward. If the segment was           already the rightmost segment, the cell is vacated (no segments)           and the segment becomes the rightmost in the new cell. If the           segment was the leftmost, then if the next segment to the right is           within the old cell, that right segment is now leftmost, otherwise the           cell is vacated.       Delete   If the segment was already the rightmost segment, then if the segment           to the left is in the cell, it becomes rightmost, otherwise the cell is           vacated (empty). If the segment was the leftmost, then if the segment           to the right is within the old cell, the right link is now leftmost,           otherwise the cell is vacated.       Insert   Compare the newly inserted segment against current Leftmost and           Rightmost segments in cell, and change cell segment pointers if           necessary.                  
 
         [0135]     Once an Incoming Segment is merged, if there are more Incoming Segments (S 260 ) we return to S 250 .  
         [0136]     If there are no more Incoming Segments, then the Tests variable is compared to the row&#39;s CellOverload parameter (S 270 ). If there has been excessive testing, then the cells may need to be refined further (S 280 ).  
         [0137]      FIG. 5  shows this evaluation in more detail. If Tests exceeds the CellOverload (S 510 ), and if the Refinement Mode is FULL (S 520 ), then in this example, all cells are refined (S 530 ), thus creating narrower cells with fewer segments per cell.  
         [0138]     If the Refinement mode is just a single cell c, then it is possible that the cell is already as narrow as can be, based on the cell granularity. Nothing further is done in this case.  
         [0139]     However, if the cell c width is larger than the granularity, there is room for improvement, and the refinement process (S 550 ) attacks cell c.  
         [0140]      FIG. 6  shows the cell refinement process both for multiple cells and for just a single cell c.  
         [0141]     The overall process scans either a cell or a row, and in one embodiment produces the minimum number of cells in that span that either (a) do not have too many segments (based on CellOverload), or (b) are already the minimum cell width.  
         [0142]     The segment range to consider is either the entire row (S 310 ), or the leftmost and rightmost segments in the cell c (S 300 ). An array Counts is initialized to zero, with the width of Counts equal to the maximum number of cells in the span.  
         [0143]     At step S 320 , for each segment in the range, the segment.x2 value is indexed (right shifted based on granularity) to Counts, which is incremented. After the segments are considered, the array Counts now has the count of the segments in each of minimum width (granularity) cells.  
         [0144]     At step S 330 , a unit array (Units) is set to 1 for all possible cells in the span. The Units array indicates the number of granular units in the cell.  
         [0145]     At step S 340 , all granular cells are considered, and from left to right the cells are coalesced if the total segments in two adjacent cells remain less than CellOverload. This process repeats recursively until no cells can be further coalesced. At the end, we now have the number of cells in the span, the array Counts has the segments per cell, and the Units array has the number of granular cell units per cell.  
         [0146]     At step S 350 , for single cell c, the cell information to the left and right of cell c are combined with the new results for c.  
         [0147]     At step S 360 , for the full row refinement, the full row cell count and Units per cell are ready for a new row creation.  
         [0148]     At step S 370 , a new row is created, and for each cell in the range (either full row or cell c) the Rightmost and Leftmost segment pointers are set.  
         [0149]     At step S 380 , the cell structures to the left and right of cell c are copied into the new row.  
         [0150]     At step S 390 , the old row is deleted, and the new row added to the page.  
         [0151]     Returning to the complex problem of handling raster-ops without resorting to rasterization, TABLE 13 shows that special handling for many of the segment combinations (IS is Incoming Segment, CS is Current Segment) means that overall compression and efficiency can often be preserved.  
         [0152]     When a complex (non-opaque model) raster-op is performed, the multitude of segment types are first converted to a subset for easier resolution. TABLE 12 shows the conversions by segment type.  
                             TABLE 12                           Segment Conversions prior to Raster-op Resolution                Extended Segment Type   Segment Type for Raster-op Resolution                       Color   Color           Pattern   Pattern Extended           Pattern Extended   Pattern Extended           Bitmap   Bitmap           Source Bitmap   Compressed Bitmap           Compressed Bitmap   Compressed Bitmap           Palette Color   Color           Palette Pattern   Pattern Extended           Palette Pattern Extended   Pattern Extended           Palette Bitmap   Bitmap                      
 
         [0153]     An empty cell in TABLE 13 implies that no special handling is implemented in the current embodiment, and conventional rasterization with raster-ops is performed with the result stored as a Bitmap segment.  
         [0154]     Note: the Compressed Bitmap segment type is abbreviated in TABLE 13 as “CBits”. “Anything” refers to any segment type. “PatternX” refers to a Pattern Extended segment.  
                                     TABLE 13                           Raster Op Handling by Segment Types            Current       IS Pattern       IS Compressed       Segment (CS)   IS Color   Extended   IS Bitmap   Bitmap               Color   New Color = (IS.Color   New PatternX = (IS.PatternX   New Bitmap = (IS.Bitmap   Enumerate           rop   rop   rop   compressed           CS.Color)   CS.Color)   CS.Color)   segments;                       recompress New                       CBits = (IS.CBits                       rop CS.Color)       PatternX   New PatternX = (IS.Color   New PatternX = (IS.PatternX       Enumerate           rop   rop       compressed           CS.PatternX)   CS.PatternX) if       segments;               PatternWidths are       recompress New               equal       CBits = (IS.CBits                       rop CS.Pattern)       Bitmap   New Bitmap = (IS.Color           rop           CS.Bitmap)       Compressed   Enumerate   Enumerate       Segments   compressed   compressed           segment;   segment;           recompress New   recompress New           CBits = (IS.Color   CBits = (IS.PatternX           rop CS. CBits)   rop               CS. CBits)       Any Segment           New Bitmap = (IS.Anything       Type           rop                   CS.Bitmap)                  
 
         [0155]     Returning to  FIG. 1 , step S 30  is invoked when no more Page Elements arrive, that is, the page description is complete. Unlike a conventional raster system in which the raw pixels are compressed into a final 2D raster output target format (for example, JPEG (ITU T.81) or JBIG (ITU T.82)), the current embodiment translates the compressed segments into a stream such that the inherent compression is preserved. For example, on a given line a solid color segment from x1 to x2 generates a run-length encoding equivalent to (x2−x1+1) followed by the segment color.  
         [0156]     For each row in the page, the segments are translated into stream form and sent along for further processing. That processing could include further image-processing, and the stream could be sent directly to an embedded controller in a printer.  
         [0157]     In the current embodiment, Step S 30  can alternatively pass control to a lower-level driver that requests, via random access to any row, an enumeration of that line&#39;s segments to process, draw, send, translate, etc.  
         [0158]     While certain embodiments of the inventions have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel methods and systems described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the methods and systems described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.