This application is directed generally to the field of rendering bitmapped images from encoded descriptions of electronic document files, and more particularly to efficient rendering of complex electronic documents that may include plural or varied image types.
A typical document output device, such as a laser printer, inkjet printer, or other bitmapped output device typically generates a bitmapped output image from rendering completed by raster image processing (“RIP”). A higher level description language is typically associated with an electronic document. This is often referred to as a page description language or PDL. There are many page description language formats. They may emanate from an application, such as a word processing package, drawing package, computer aided design (“CAD”) package, image processing package, or the like. Such files may also emanate from document inputs, such as from electronic mail, scanners, digitizers, rasterizers, vector generators, data storage and the like.
A raster image processor typically decodes a higher level description language into a series of scanlines or bitmap portions that are communicated to a bitmapped output such as noted above. While an entire sheet (or more) of bitmapped image data is suitably prepared at one time into a page buffer and subsequently communicated to an engine, this requires a substantial amount of memory. Earlier raster image processors would therefor employ a scheme by which one band of pixels were extracted at a time from a page description, and this band would be buffered and communicated to an engine for generation of graphical output. A series of bands were thus generated and output to complete one or more pages of output. It is often difficult to extract accurate band information, particularly when an input page description includes multiple images or mixed data types, such as graphics, text, overlays, and the like. In some earlier systems, generation of bands directly from a higher level, page description also requires that conversion to bands be completed at a timing that corresponds to a rate at which input is expected by a downstream engine.
It would therefore be desirable to have an image rendering system and method that allows for efficient use of memory, accommodates page description language input inclusive of multiple input data types and accommodates image generation with timing independent of capabilities of a graphics output engine. The subject invention addresses these concerns, and others, and teaches a raster image processing system and method that allows for accurate, memory efficient renditions from complex page description files.
In accordance with the subject invention, there is provided an image rendering system and method that allows efficient use of memory that accommodates page description language input inclusive of multiple input data types and accommodates image generation with timing independent of capabilities of a graphics output engine.
Further, in accordance with the subject invention there is provided a raster image processing system and method that allows for accurate, memory efficient renditions from complex page description files.
Still further, in accordance with the subject invention, there is provided a system for rendering output from electronic documents that includes a memory allocation unit including a scanline memory allocation means adapted for allocating a plurality of scanline memory locations, each scanline memory location corresponding to a scanline of a document to be rendered, and an instruction memory allocation means for allocating at least one instruction memory location corresponding to each scanline memory location. A receiving means receives an electronic document inclusive of at least one encoded visual output primitive. A conversion means converts each visual output primitive of a received electronic document into a series of instructions and an association means associates each instruction with at least one scanline memory location. Each instruction is stored in an instruction memory location allocated by the memory allocation unit and corresponds to a selected scanline memory location. An encoded scanline output file, inclusive of content of each instruction memory location corresponding to each scanline memory location, is output to an associated document rendering device.
In accordance with a more limited aspect of the subject invention, an encoded scanline output file is communicated to a decoding means adapted for sequentially decoding instructions of each scanline memory location and a bitmap band output is generated that corresponds to decoded instructions of each scanline memory location.
In accordance with another aspect of the present invention, each instruction specifies at least one of color, opacity, pattern, and raster operation code.
In accordance with still another aspect of the present invention, included is means adapted for receiving the electronic document inclusive of a plurality of encoded visual output primitives, such that at least one scanline memory location includes instructions corresponding to each of the plurality of encoded visual output primitives.
In accordance with another aspect of the present invention, there is provided a method for accomplishing rendering of electronic documents corresponding to the above-summarized structure.
An advantage of the present invention is the provision of a document rendering system and method that enjoys a load reduction on associated memory management subsystems caused by typical page buffering operations.
Another advantage of the present invention is the provision of a document rendering system and method that allows for lower usage of memory during page rendering.
Still another advantage of the present invention is the provision of a document rendering system and method that implements a simplified, write-only display list system and allows for bypassing any need to read from an intermediate representation format prior to time of rendering.
Still another advantage of the present invention is the provision of a document rendering system and method that facilitates simplified transparency and raster operations.
Yet another advantage of the present invention is the provision of a document rendering system and method that optimizes performance and intermediate representation memory size.
Yet another advantage of the present invention is the provision of a document rendering system and method that promotes graceful performance degradation when confronted with difficult document output jobs.
Yet another advantage of the present invention is the provision of a document rendering system and method that allows for high rendering performance by exploitation of processor caches.
Yet another advantage of the present invention is the provision of a document rendering system and method that is advantageously implemented via software, via hardware or via a combination thereof.
Still other objects and aspects of the present invention will become readily apparent to those skilled in this art from the following description wherein there is shown and described a preferred embodiment of this invention, simply by way of illustration of one of the best modes suited for to carry out the invention. As it will be realized, the invention is capable of other different embodiments and its several details are capable of modifications in various obvious aspects all without departing from the invention. Accordingly, the drawing and descriptions will be regarded as illustrative in nature and not as restrictive.
The subject invention will be described in connection with a series of figures, which are used to disclose the preferred embodiment of the invention, and not for the purposes of limiting the same, wherein:
Turning now to the drawings wherein the illustrations are for the purpose of describing the preferred and alternative embodiments only, and not for the purpose of limiting the same,
The system of
In the overall system description of
Turning now to
The subject system treats a page as an array of scanlines. As used herein, a scanline is a complete row of pixels on an output page. Each scanline is suitably represented by a sequence of encoded instructions that will result in a rendering of that scanline. Scanline rendering instructions are stored in one or more instruction blocks, which instruction blocks are suitably fixed-size blocks of memory, allocated from an associated memory pool.
From the illustration of
Turning to a representative scanline 32, it is noted that this scanline is completed at y=0 on the page 30. The scanline y=0 is represented as a series of instructions 33, a number of which corresponds to a depiction evident from the scanline 32 as will be appreciated from an understanding of the description below. In the representation of
During a RIP process, instructions are added to or appended to a scanline following a previous instruction associated with a particular instruction block. In the event a scanline is empty, such as illustrated at scanline 36 where y=6 in
In the preferred embodiment, memory associated with each scanline functions to store graphic state information. This state information is suitably used both during a process of adding instructions to a scanline, as well as during a final rendering process. However, it is to be appreciated that in certain situations, it may be advantageous for performance reasons to create a localized cache of selected information. Suitable information for this graphic state includes a current color associated with the scanline. A suitable default color is suitably black.
Graphic state information also suitably includes current opacity associated with a scanline. In a preferred embodiment, the default opacity is fully opaque. Graphic state information also suitably includes a current raster operator (“ROP”), such as is used in connection with a printer control language (“PCL”). Any suitable printer control language is appropriate. However, a preferred embodiment employs PCL/XL formerly known as PCL 6, as propagated by Hewlett-Packard. A suitable default ROP is 0. An additional state entry is suitably a current pattern, with a suitable default being no pattern. As will be appreciated below, the subject system teaches modification and usage of such graphic state elements.
In the subject system, a byte-code style instruction format is suitably employed. This consists of an opCode which is typically one byte. An opCode is suitably followed by one or more parameter bytes, as well as optional embedded data. Selected opCodes suitably include selected state information. Such opCode types suitably effect changes that affect all following instructions, such as opCodes that modify a scanline graphics state.
The subject system advantageously uses four opCodes. General band rendering is suitable for representations, such as line art. A graphic state is suitable for setting a current color, ROP, ternary ROP (“TROP”), pattern, and the like. An opCode is suitably provided for batch pixel rendering and caching. This facilitates image rendering, patterns, PostScript shading, portable document format (“PDF”) shading, and the like. Additionally, opCodes are suitably provided to correspond to a text rendering. It will be appreciated that many such opCodes are available in published and updated regularly for use in connection with PDF, PCL, PostScript, and any other suitable document language.
Turning now to
In
Turning first to the image of Neil Armstrong 42, a suitable mechanism for accomplishing a description will be described. A pictorial image, such as that 42, is suitably represented in a left to right format. Cases of pure image rendering are frequently encountered during raster image processing operations. For the description herein, it is assumed that a source image is at the same resolution as that of a document output device, such as a printer. By way of an example only, such a resolution is suitably 600 dots per inch. However, it is appreciated that any resolution is suitably utilized, both for an input and output resolution level. It will also be appreciated that translation between resolutions in an input and output is contemplated, and is suitably accomplished with scaling instructions as appreciated from the subject description. Also, for purposes of illustrating the example, suitable 8-bit gray image is allocated. It is to be further appreciated that any suitable palette representation such as CMY, CMY(K), RGB, or any additive or subtractive primary color set, is suitably used. As a general rule, additive primary color sets are advantageously used in active display generators such as video display devices, and subtractive color sets are advantageously used in passive displays, such as printouts.
A build process for the image is detailed with additional review of the flowchart of
In summary, processing for a source image, such as a representative picture, proceeds for each row of source image pixels. Scaling is completed, if needed. In the example, both an image input and output are fixed at a corresponding 600 dots per inch. Thus, in such a situation, scaling would be unnecessary. Color values and a corresponding run length are buffered. These values are converted into a color space of an associated output, such as CYMK in a typical output. The system calculates which scanlines are affected by a row being rendered. A corresponding instruction to render that source image row is appended to an instruction block associated with that scanline. This process is completed for each row.
In the representative image of
Turning to representative scanline at y=600, an image will have been retrieved from a source, such as a gray image row, from an input that is to be rendered. Since both input and output are set in the example at 600 dpi, no scaling is required. A good portion of the scanline at y=600 will be black and featureless. This would be followed by some detail for the top of the helmet, followed by more black space and moon detail at the far right. Once this line is completed, a suitable representation will be generated which is depicted at
Next, turning to
x0,y0
x1,y1
defined as page coordinates of an associated image run. Thus, a first image run of a black value, suitably 255 in an 8-bit representation, is from x=100 to 2499, which is one pixel high at y=600. Values of x1 and y1 are non-inclusive, such that a height of a corresponding run is y1−y0 with a width of y1−y0.
Turning to
Rendering of a vector rectangle is straightforward. A scan conversion will result in a request to render one band per output scanline with each band having a same starting x coordinate and width w. The subject system need not be concerned whether a rectangle overlaps with an image portion, such as that 42 described above. For composite images that include, for example, image data and vector data, vector data, such as a rectangle description, will be appended after image data and instruction block for that scanline. In the subject description, it is unnecessary to determine or specify whether a drawing appears above or below an underlying object once rendered.
In the example of rectangle 44, a conversion will eventually result in a series of requests to draw one pixel high bands. For each request, determination is made to see whether an effective scanline has an instruction block allocated to it. One is allocated if this has not yet been completed. Next, a determination is made as to whether a current color for a scanline matches that which is to be rendered. If not, appropriate opCodes are set to select a required color. Next, opCodes associated with rendering are appended to each affected line associated with a starting x coordinate and a length of the corresponding band. In the rectangle portion 44, processing will eventually lead to a scanline, such as y=7000, wherein memory has already been allocated and therefore it is unnecessary to allocate such memory again. As with the image portion 42, described above, default color is selected, such as black, and instructions will be appended as necessary to set an appropriate color. By way of example, a gray rectangle will set values suitably to 0, 0, 0, 128 which defines an 8-bit component level CYMK gray defined by 4 bytes. Continuing on scanline 7000, a byte code for an opCode to render a band, (“opRenderBand”) is suitably appended to an instruction block, followed by a starting x coordinates, suitably 2 bytes and a width value w, also suitably 2 bytes.
It will be appreciated from the foregoing that the subject representation has therefore includes information both as to a picture portion 42, as well as a rectangle portion 44. Next, construction of text space elements will be described.
In the sample image 40 of
Turning to
Once rendering is complete, the system has sufficient recorded information to reproduce the corresponding row of glyph data.
Remaining characters in each text string are handled as described above. It will be appreciated that subsequent letters in the same text string need not have the color set insofar as that has been done so relative to previous character, unless a next character has been chosen to have a different color to that of its predecessor.
Once a complete description for an image, including one or more image portions has been completed, the system proceeds to banding of the image to allow for output. At this stage, the system suitably provides sufficient memory for a full, uncompressed band which is typically 128 scanlines in length in current embodiments. A band is populated by finding each regular scanline that contains a band and the opCodes instructions associated with those bands have been representatively detailed above.
In the illustrated example, at this point a destination memory block contains a scanline with a one pixel high slice of the moon below Neil Armstrong's feet. Next, opSetColor is then retrieved to set color. In the example, this is the 0, 0, 0, 128 value specifying a gray of the rectangle noted above. The next opCode defined is opRenderBand which retrieves a starting x coordinate and a band width, which will result in a procedure to render a band of the rectangle in gray overtop the previously rendered pictorial image. Next, an opCode is retrieved to render glyph data, which is a slice of the code “O” character, in a selected color, which is white. This rendering is communicated to the destination memory block. Lastly, rendering of text characters is completed for all remaining characters affecting that band. Once all rendering for an associated band is completed, it is ready to be printed onto a final page or otherwise output to a document output device. In the example, once rendering is completed for y=7000, progress is made to the scanline at y=7,001, and so forth, until a page is fully rendered and completely passed to a system for final output.
The invention extends to computer programs in the form of source code, object code, code intermediate sources and object code (such as in a partially compiled form), or in any other form suitable for use in the implementation of the invention. Computer programs are suitably standalone applications, software components, scripts or plug-ins to other applications. Computer programs embedding the invention are advantageously embodied on a carrier, being any entity or device capable of carrying the computer program: for example, a storage medium such as ROM or RAM, optical recording media such as CD-ROM or magnetic recording media such as floppy discs. The carrier is any transmissible carrier such as an electrical or optical signal conveyed by electrical or optical cable, or by radio or other means. Computer programs are suitably downloaded across the Internet from a server. Computer programs are also capable of being embedded in an integrated circuit. Any and all such embodiments containing code that will cause a computer to perform substantially the invention principles as described, will fall within the scope of the invention.
The foregoing description of a preferred embodiment of the invention has been presented for purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. Obvious modifications or variations are possible in light of the above teachings. The embodiment was chosen and described to provide the best illustration of the principles of the invention and its practical application to thereby enable one of ordinary skill in the art to use the invention in various embodiments and with various modifications as are suited to the particular use contemplated. All such modifications and variations are within the scope of the invention as determined by the appended claims when interpreted in accordance with the breadth to which they are fairly, legally and equitably entitled.