|
|
Home | Alpha Telephone | Domain Names | Web Hosting | Get Traffic | xrEvidence | xrSoccer United States Patent
Method and apparatus for up-interpolating a bayer image A method for interpolating a Bayer image of red, green and blue pixels from an input space to an output space, the method including the steps of: receiving the Bayer image; and mapping each of the colors to the output space in accordance with the following: ##EQU1## where: x,y is the coordinate in the output space, x'y' is the coordinate in the input space; mps is the number of pixels in the output space per input space sample, and k.sub.1,2 are either 0 or -0.5 depending on the color and the desired relative rotational orientation of the image. An apparatus for interpolating a Bayer image of red, green and blue pixels from an input space to an output space, the method including the steps of: receiving the Bayer image; and mapping each of the colors to the output space in accordance with the following: ##EQU2## where: x,y is the coordinate in the output space, x'y' is the coordinate in the input space; mps is the number of pixels in the output space per input space sample, and k.sub.1,2 are either 0 or -0.5 depending on the color and the desired relative rotational orientation of the image.
Primary Examiner: Tran; Phuoc CO-PENDING APPLICATIONS Reference may be had to co-pending applications claiming priority from Australian Provisional Patent Application No. PQ2890 dated 16 Sep. 1999. The co-pending applications describe related modules and methods for implementing the compact printer system. The co-pending applications, filed simultaneously to the present application, are as follows: We claim: 1. A method for interpolating a Bayer image of red, green and blue pixels from an input space to an output space, the method including the steps of: receiving the Bayer image; and mapping each of the colors to the output space in accordance with the following: ##EQU12## where: x,y is the coordinate in the output space, x'y'is the coordinate in the input space; mps is the number of pixels in the output space per input space sample, and k.sub.1,2 are either 0 or -0.5 depending on the color and the desired relative rotational orientation of the image. 2. A method according to claim 1 wherein, for the green pixels in the input space, each ordinate of the input space is multiplied by 1/2. 3. A method according to claim 1 or claim 2 wherein, for the green pixels in the input space, each coordinate of the input space is multiplied by 1/2. 4. An apparatus for interpolating a Bayer image of red, green and blue pixels from an input space to an output space, the method including the steps of: receiving the Bayer image; and mapping each of the colors to the output space in accordance with the following: ##EQU13## where: x,y is the coordinate in the output space, x'y'is the coordinate in the input space; mps is the number of pixels in the output space per input space sample, and k.sub.1,2 are either 0 or -0.5 depending on the color and the desired relative rotational orientation of the image. 5. An apparatus according to claim 4 wherein, for the green pixels in the input space, each ordinate of the input space is multiplied by 1/2. 6. A method for sampling a Bayer image having two dimensional planes of red, green and blue pixels, the method including the steps of: rotating the green plane by 45 degrees; sequentially sampling an m.times.m pixel block of the rotated image, where m is an integer greater than 1; providing an address for the m.sup.2 samples by determining a starting address for a first of the samples and thereafter applying a predetermined fixed sequence of offsets to obtain the addresses of the remaining samples. 7. A method according to claim 6 wherein the step of determining the starting address is responsive to the relative rotational orientation of the image. 8. A method according to claim 6 or claim 7, wherein m=4 and there are sixteen offsets. FIELD OF INVENTION The present invention relates to a method and apparatus for up-interpolating a Bayer image. The invention has been developed primarily for a digital camera including an integral printer for providing a paper print of an image captured by the camera and will be described hereinafter with reference to that application. However, it will be appreciated that the invention is not limited to that particular field of use. SUMMARY OF INVENTION According to a first aspect of the invention there is provided a method for interpolating a Bayer image of red, green and blue pixels from an input space to an output space, the method including the steps of: receiving the Bayer image; and mapping each of the colors to the output space in accordance with the following: ##EQU3## where: x,y is the coordinate in the output space, x'y' is the coordinate in the input space; mps is the number of pixels in the output space per input space sample, and k.sub.1,2 are either 0 or -0.5 depending on the color and the desired relative rotational orientation of the image. Preferably, for the green pixels in the input space, each ordinate of the input space is multiplied by 1/2. More preferably, for the green pixels in the input space, each coordinate of the input space is multiplied by 1/2. According to a second aspect of the invention there is provided an apparatus for interpolating a Bayer image of red, green and blue pixels from an input space to an output space, the method including the steps of: receiving the Bayer image; and mapping each of the colors to the output space in accordance with the following: ##EQU4## where: x,y is the coordinate in the output space, x'y' is the coordinate in the input space; mps is the number of pixels in the output space per input space sample, and k.sub.1,2 are either 0 or -0.5 depending on the color and the desired relative rotational orientation of the image. Preferably, for the green pixels in the input space, each ordinate of the input space is multiplied by 1/2. More preferably, for the green pixels in the input space, each coordinate of the input space is multiplied by 1/2. BRIEF DESCRIPTION OF THE DRAWINGS Preferred embodiments of the invention will now be described, by way of example only, with reference to the following description and Figures. FIG. 1 shows a high level image flow of the PCP. FIG. 2 shows a block diagram of the PCP in isolation. FIG. 3 shows a block diagram of the PCP connected to Printcam hardware. FIG. 4 shows a 4-inch Memjet printhead. FIG. 5 shows the arrangement of segments in a 4-inch printhead. FIG. 6 shows the arrangement of nozzles in a pod, numbered by fixing order. FIG. 7 shows the arrangement of nozzles in a pod, numbered by loading order. FIG. 8 shows a chromopod. FIG. 9 shows a podgroup. FIG. 10 shows a phasegroup. FIG. 11 shows the relationship between segments, firegroups, phasegroups, podgroups and chromopods. FIG. 12 shows AEnable and BEnable pulse profiles during the printing of an odd and even dot. FIG. 13 shows the orientation of print formats based on the CFA image. FIG. 14 shows a block diagram of the image capture chain. FIG. 15 shows the arrangement of pixels in a Bayer CFA 2G mosaic. FIG. 16 shows the linearize RGB process. FIG. 17 shows the planarize RGB process. FIG. 18 shows a block diagram of the image print chain. FIG. 19 shows a sample color range for a single color plane. FIG. 20 shows the steps involved in white balance and range expansion. FIG. 21 shows a block diagram of apparatus capable of performing white balance and range expansion. FIG. 22 shows the various color plane pixels in relation to CFA resolution. FIG. 23 shows the effect of rotating the green plane by 45 degrees. FIG. 24 shows the distance between rotated pixels for the green plane. FIG. 25 shows the process of mapping movement in unrotated CFA space to rotated CFA space. FIG. 26 shows a block diagram of the sharpen process. FIG. 27 shows the process involved in high-pass filtering a single luminance pixel with a 3.times.3 kernel. FIG. 28 shows the transformation in conversion from RGB to CMY. FIG. 29 shows conversion from RGB to CMY by trilinear interpolation. FIG. 30 shows pixel replication of a single pixel to a 5.times.5 block. FIG. 31 shows a block diagram of the half-toning process. FIG. 32 shows the process of reformatting dots for the printer. FIG. 33 shows a block diagram of the image capture unit. FIG. 35 shows a block diagram of the image access unit. FIG. 36 shows a block diagram of the image histogram unit. FIG. 37 shows a block diagram of the printed interface. FIG. 38 shows the block diagram of the Memjet interface. FIG. 39 shows the generation of AEnable and BEnable pulse widths. FIG. 40 shows a block diagram of dot count logic. FIG. 41 shows the interface of the print generator unit. FIG. 42 shows a block diagram of the print generator unit. FIG. 43 shows a block diagram of the test pattern access unit. FIG. 44 shows a block diagram of Buffer 5. FIG. 45 shows a block diagram of Buffer 4. FIG. 46 shows a block diagram of the Upinterpolate, Halftone and Reformat process. FIG. 47 shows how to map from a standard dither cell and a staggered dither cell. FIG. 48 shows a block diagram of the Convert RGB to CMY process/ FIG. 49 shows a block diagram of Buffer 2. FIG. 50 shows a basic high-pass spatial filter using a 3.times.3 kernel. FIG. 51 shows a block diagram of the sharpen unit. FIG. 52 shows the structure of Buffer 1 FIG. 53 shows a block diagram of the Resample and Create Luminance Channel process. FIG. 54 shows a block diagram of the Convolve Unit. FIG. 55 shows the order of pixels generated from the receptor. FIG. 56 shows movement in x or y in rotated and unrotated space. FIG. 57 shows the address of entries in Buffer 1's green sub-buffer. FIG. 58 shows the relationship between green entries dependent on rotation. FIG. 59 shows 4.times.4 sampling of the green channel. FIG. 60 shows 4.times.4 green sampling type 1. FIG. 61 shows 4.times.4 green sampling type 2. FIG. 62 shows the two types of row addressing for green. FIG. 63 shows the addressing of entries in buffer 1's red and blue sub-buffers. FIG. 64 shows the first 16 samples read for calculating first pixel. FIG. 65 shows the overlapping worst case 4.times.4 reading from blue and red buffers. FIG. 66 shows a block diagram of the rotate, white balance and range expansion unit. FIG. 67 shows the active image area within the generated coordinate space. 1 OVERVIEW OF THE PCP 1.1 High Level Functional Overview The Printcam Central Processor (PCP) possesses all the processing power for a Printcam and is specifically designed to be used in the Printcam digital still camera system. The PCP 3 connects to an image sensor 1 (for image capture), and a Memjet printer 2 for image printout. In terms of image processing, the PCP can be thought of as being the translator of images from capture to printout, as shown in FIG. 1: The Image Sensor 1 is a CMOS image sensor, which captures a 1500.times.1000 RGB image. The Image Sensor is the image input device. The Printhead 2 is a 4 inch long 1600 dpi Memjet printer capable of printing in three colors: cyan, magenta and yellow. The Printhead is the image output device. The PCP 3 takes an image from the Image Sensor 1, processes it, and sends the final form of the image to the Printhead 2 for printing. Since the Image Sensor 1 captures in RGB and the Printhead 2 prints in CMY, the PCP 3 must translate from the RGB color space to the CMY color space. The PCP 3 contains all of the requirements for the intermediate image processing, including white balance, color correction and gamut mapping, image sharpening, and half toning. In addition, the PCP 3 controls the user interface and entire print process, providing support for a variety of image formats. The PCP 3 also contains interfaces to allow export and import of photos, complying with the DPOF (Digital Print Order Format) standard. 1.2 High Level Internal Overview The PCP 3 is designed to be fabricated using a 0.25 micron CMOS process, with approximately 10 million transistors, almost half of which are flash memory or static RAM. This leads to an estimated area of 16 mm.sup.2. The estimated manufacturing cost is $4 in the year 2001. The PCP 3 is a relatively straightforward design, and design effort can be reduced by the use of datapath compilation techniques, macrocells, and IP cores. The PCP 3 contains: A low speed CPU/microcontroller core 10 1.5 MBytes of multi-level Flash memory (2-bits per cell) 11 A CMOS Image Sensor Interface 98 inside an Image Capture Unit 12 16 KByte Flash memory for program storage 13 4 KByte RAM for program variable storage 14 The PCP 3 is intended to run at a clock speed of approximately 100 MHz on 3V externally and 1.5V internally to minimize power consumption. The actual operating frequency will be an integer multiple of the Printhead operating frequency. The CPU 10 is intended to be a simple micro-controller style CPU, running at about 1 MHz. Both the CPU 10 and CMOS sensor interface 12 can be vendor supplied cores. FIG. 2 shows a block diagram of the PCP 3 in isolation. The PCP 3 is designed for use in Printcam systems. FIG. 3 shows a block diagram of the PCP 3 connected to the rest of the Printcam hardware. 2 Printhead Background The PCP 3 is specifically designed to connect to a 4-inch (10-cm) Memjet printhead 2. The printhead 2 is used as a page-width printer, producing a 4-inch wide printed image without having to be moved. Instead, paper 20 is printed on as it moves past the printhead 2, as shown in FIG. 4 2.1 Composition of 4-inch Printhead Each 4-inch printhead 2 consists of 8 segments, each segment 1/2 an inch in length. Each of the segments 21 prints bi-level cyan, magenta and yellow dots over a different part of the page to produce the final image. The positions of the segments are shown in FIG. 5. Since the printhead 2 prints dots at 1600 dpi, each dot is 22.5 .mu.m in diameter, and spaced 15.875 .mu.m apart. Thus each half-inch segment prints 800 dots, with the 8 segments corresponding to positions: TABLE 1 Final Image Dots Addressed by Each Segment Segment First dot Last dot 0 0 799 1 800 1,599 2 1,600 2,399 3 2,400 3,199 4 3,200 3,999 5 4,000 4,799 6 4,800 5,599 7 5,600 6,399 Although each segment 21 produces 800 dots of the final image, each dot is represented by a combination of bi-level cyan, magenta, and yellow ink. Because the printing is bi-level, the input image should be dithered or error-diffused for best results. Each segment 21 then contains 2400 nozzles: 800 each of cyan, magenta, and yellow. A four-inch printhead 2 contains 8 such segments 21 for a total of 19,200 nozzles. 2.1.1 Grouping of Nozzles Within a Segment The nozzles 22 within a single segment 21 are grouped for reasons of physical stability as well as minimization of power consumption during printing. In terms of physical stability, a total of 10 nozzles share the same ink reservoir. In terms of power consumption, groupings are made to enable a low-speed and a high-speed printing mode. The printhead 2 supports two printing speeds to allow different speed/power trade-offs to be made in different product configurations. In the low-speed printing mode, 96 nozzles 22 are fired simultaneously from each 4-inch printhead 2. The fired nozzles should be maximally distant, so 12 nozzles 22 are fired from each segment. To fire all 19,200 nozzles, 200 different sets of 96 nozzles must be fired. In the high-speed printing mode, 192 nozzles 22 are fired simultaneously from each 4-inch printhead 2. The fired nozzles 22 should be maximally distant, so 24 nozzles are fired from each segment. To fire all 19,200 nozzles, 100 different sets of 192 nozzles must be fired. The power consumption in the low-speed mode is half that of the high-speed mode. Note however, that the energy consumed to print a line, and hence a page, is the same in both cases. In a scenario such as a battery powered Printcam, the power consumption requirements dictate the use of low-speed printing. 2.1.1.1 10 Nozzles Make a Pod A single pod 23 consists of 10 nozzles 22 sharing a common ink reservoir. 5 nozzles 22 are in one row, and 5 are in another. Each nozzle 22 produces dots approximately 22.5 .mu.m in diameter spaced on a 15.875 .mu.m grid. FIG. 6 shows the arrangement of a single pod, with the nozzles 22 numbered according to the order in which they must be fired. Although the nozzles 22 are fired in this order, the relationship of nozzles 22 and physical placement of dots on the printed page is different. The nozzles 22 from one row represent the even dots from one line on the page, and the nozzles on the other row represent the odd dots from the adjacent line on the page. FIG. 7 shows the same pod 23 with the nozzles 22 numbered according to the order in which they must be loaded. The nozzles 22 within a pod 23 are therefore logically separated by the width of 1 dot. The exact distance between the nozzles 22 will depend on the properties of the Memjet firing mechanism. The printhead 2 is designed with staggered nozzles designed to match the flow of paper 20. 2.1.1.2 3 Pods Make a Chromapod One pod 23 of each color (cyan, magenta, and yellow) are grouped into a chromapod 24. A chromapod 24 represents different color components of the same horizontal set of 10 dots, on different lines. The exact distance between different color pods 23 depends on the Memjet operating parameters, and may vary from one Memjet design to another. The distance is considered to be a constant number of dot-widths, and must therefore be taken into account when printing: the dots printed by the cyan nozzles will be for different lines than those printed by the magenta or yellow nozzles. The printing algorithm must allow for a variable distance up to about 8 dot-widths between colors (see Table 3 for more details). FIG. 8 illustrates a single chromapod 24. 2.1.1.3 5 Chromapods make a Podgroup 5 chromapods 24 are organized into a single podgroup 25. Since each chromapod contains 30 nozzles 22, each podgroup contains 150 nozzles 22: 50 cyan, 50 magenta, and 50 yellow nozzles. The arrangement is shown in FIG. 9, with chromapods numbered 0-4. Note that the distance between adjacent chromapods is exaggerated for clarity. 2.1.1.4 2 Podgroups make a Phasegroup 2 podgroups 25 are organized into a single phasegroup 26. The phasegroup 26 is so named because groups of nozzles 23 within a phasegroup are fired simultaneously during a given firing phase (this is explained in more detail below). The formation of a phasegroup from 2 podgroups 25 is entirely for the purposes of low-speed and high-speed printing via 2 PodgroupEnable lines. During low-speed printing, only one of the two PodgroupEnable lines is set in a given firing pulse, so only one podgroup of the two fires nozzles. During high-speed printing, both PodgroupEnable lines are set, so both podgroups fire nozzles. Consequently a low-speed print takes twice as long as a high-speed print, since the high-speed print fires twice as many nozzles at once. FIG. 10 illustrates the composition of a phasegroup. The distance between adjacent podgroups is exaggerated for clarity. 2.1.1.5 2 Phasegroups make a Firegroup Two phasegroups (PhasegroupA and PhasegroupB) are organized into a single firegroup 27, with 4 firegroups in each segment. Firegroups 27 are so named because they all fire the same nozzles 27 simultaneously. Two enable lines, AEnable and BEnable, allow the firing of PhasegroupA nozzles and PhasegroupB nozzles independently as different firing phases. The arrangement is shown in FIG. 11. The distance between adjacent groupings is exaggerated for clarity. 2.1.1.6 Nozzle Grouping Summary Table 2 is a summary of the nozzle groupings in a printhead. TABLE 2 Nozzle Groupings for a single 4-inch printhead Replication Nozzle Name of Grouping Composition Ratio Count Nozzle 22 Base unit 1:1 1 Pod 23 Nozzles per pod 10:1 10 Chromapod 24 Pods per CMY 3:1 30 chromapod Podgroup 25 Chromapods per 5:1 150 podgroup Phasegroup 26 Podgroups per 2:1 300 phasegroup Firegroup 27 Phasegroups per 2:1 600 firegroup Segment 21 Firegroups per segment 4:1 2,400 4-inch printhead 2 Segments per 4-inch 8:1 19,200 printhead 2.2 Load and Print Cycles A single 4-inch printhead 2 contains a total of 19,200 nozzles 22. A Print Cycle involves the firing of up to all of these nozzles, dependent on the information to be printed. A Load Cycle involves the loading up of the printhead with the information to be printed during the subsequent Print Cycle. Each nozzle 22 has an associated NozzleEnable bit that determines whether or not the nozzle will fire during the Print Cycle. The NozzleEnable bits (one per nozzle) are loaded via a set of shift registers. Logically there are 3 shift registers per segment (one per color), each 800 long. As bits are shifted into the shift register for a given color they are directed to the lower and upper nozzles on alternate pulses. Internally, each 800-deep shift register is comprised of two 400-deep shift registers: one for the upper nozzles, and one for the lower nozzles. Alternate bits are shifted into the alternate internal registers. As far as the external interface is concerned however, there is a single 800 deep shift register. Once all the shift registers have been fully loaded (800 load pulses), all of the bits are transferred in parallel to the appropriate NozzleEnable bits. This equates to a single parallel transfer of 19,200 bits. Once the transfer has taken place, the Print Cycle can begin. The Print Cycle and the Load Cycle can occur simultaneously as long as the parallel load of all NozzleEnable bits occurs at the end of the Print Cycle. 2.2.1 Load Cycle The Load Cycle is concerned with loading the printhead's shift registers with the next Print Cycle's NozzleEnable bits. Each segment 21 has 3 inputs directly related to the cyan, magenta, and yellow shift registers. These inputs are called CDataln, MDataln and YDataln. Since there are 8 segments, there are a total of 24 color input lines per 4-inch printhead. A single pulse on the SRClock line (shared between all 8 segments) transfers the 24 bits into the appropriate shift registers. Alternate pulses transfer bits to the lower and upper nozzles respectively. Since there are 19,200 nozzles, a total of 800 pulses are required for the transfer. Once all 19,200 bits have been transferred, a single pulse on the shared PTransfer line causes the parallel transfer of data from the shift registers to the appropriate NozzleEnable bits. The parallel transfer via a pulse on PTransfer must take place after the Print Cycle has finished. Otherwise the NozzleEnable bits for the line being printed will be incorrect. Since all 8 segments 21 are loaded with a single SRClock pulse, any printing process must produce the data in the correct sequence for the printhead. As an example, the first SRClock pulse will transfer the CMY bits for the next Print Cycle's dot 0, 800, 1600, 2400, 3200, 4000, 4800, and 5600. The second SRClock pulse will transfer the CMY bits for the next Print Cycle's dot 1, 801, 1601, 2401, 3201, 4001, 4801 and 5601. After 800 SRClock pulses, the PTransfer pulse can be given. It is important to note that the odd and even CMY outputs, although printed during the same Print Cycle, do not appear on the same physical output line. The physical separation of odd and even nozzles within the printhead, as well as separation between nozzles of different colors ensures that they will produce dots on different lines of the page. This relative difference must be accounted for when loading the data into the printhead. The actual difference in lines depends on the characteristics of the inkjet mechanism used in the printhead. The differences can be defined by variables D.sub.1, and D.sub.2 where D.sub.1, is the distance between nozzles of different colors, and D.sub.2 is the distance between nozzles of the same color. Table 3 shows the dots transferred to segment n of a printhead on the first 4 pulses. TABLE 3 Order of Dots Transferred to a 4-inch Printhead Pulse Dot Yellow Line Magenta Line Cyan Line 1 800 S.sup.a N N + D.sub.1.sup.b N + 2D.sub.1 2 800 S + 1 N + D.sub.2.sup.c N + D.sub.1 + D.sub.2 N + 2D.sub.1 + D.sub.2 3 800 S + 2 N N + D.sub.1 N + 2D.sub.1 4 800 S + 3 N + D.sub.2 N + D.sub.1 + D.sub.2 N + 2D.sub.1 + D.sub.2 .sup.a S = segment number (0-7) .sup.b D.sub.1 = number of lines between the nozzles of one color and the next (likely = 4-8) .sup.c D.sub.2 = number of lines between two rows of nozzles of the same color (likely = 1) And so on for all 800 pulses. Data can be clocked into the printhead at a maximum rate of 20 MHz, which will load the entire data for the next line in 40 .mu.s. 2.2.2 Print Cycle A 4-inch printhead 2 contains 19,200 nozzles 22. To fire them all at once would consume too much power and be problematic in terms of ink refill and nozzle interference. Consequently two firing modes are defined: a low-speed print mode and a high-speed print mode: In the low-speed print mode, there are 200 phases, with each phase firing 96 nozzles. This equates to 12 nozzles per segment, or 3 per firegroup. In the high-speed print mode, there are 100 phases, with each phase firing 192 nozzles. This equates to 24 nozzles per segment, or 6 per firegroup. The nozzles to be fired in a given firing pulse are determined by 3 bits ChromapodSelect (select 1 of 5 chromapods 24 from a firegroup 27) 4 bits NozzleSelect (select 1 of 10 nozzles 22 from a pod 23) 2 bits of PodgroupEnable lines (select 0, 1, or 2 podgroups 25 to fire) When one of the PodgroupEnable lines is set, only the specified Podgroup's 4 nozzles will fire as determined by ChromapodSelect and NozzleSelect. When both of the PodgroupEnable lines are set, both of the podgroups will fire their nozzles. For the low-speed mode, two fire pulses are required, with PodgroupEnable=10 and 01 respectively. For the high-speed mode, only one fire pulse is required, with PodgroupEnable=11. The duration of the firing pulse is given by the AEnable and BEnable lines, which fire the PhasegroupA and PhasegroupB nozzles from all firegroups respectively. The typical duration of a firing pulse is 1.3-1.8 .mu.s. The duration of a pulse depends on the viscosity of the ink (dependent on temperature and ink characteristics) and the amount of power available to the printhead. See Section 2.3 on page 18 for details on feedback from the printhead in order to compensate for temperature change. The AEnable and BEnable are separate lines in order that the firing pulses can overlap. Thus the 200 phases of a low-speed Print Cycle consist of 100 A phases and 100 B phases, effectively giving 100 sets of Phase A and Phase B. Likewise, the 100 phases of a high-speed print cycle consist of 50 A phases and 50 B phases, effectively giving 50 phases of phase A and phase B. FIG. 12 shows the AEnable and BEnable lines during a typical Print Cycle. In a high-speed print there are 50 2 .mu.s cycles, while in a low-speed print there are 100 2 .mu.s cycles. For the high-speed printing mode, the firing order is: ChromapodSelect 0, NozzleSelect 0, PodgroupEnable 11 (Phases A and B) ChromapodSelect 1, NozzleSelect 0, PodgroupEnable 11 (Phases A and B) ChromapodSelect 2, NozzleSelect 0, PodgroupEnable 11 (Phases A and B) ChromapodSelect 3, NozzleSelect 0, PodgroupEnable 11 (Phases A and B) ChromapodSelect 4, NozzleSelect 0, PodgroupEnable 11 (Phases A and B) ChromapodSelect 0, NozzleSelect 1, PodgroupEnable 11 (Phases A and B) . . . ChromapodSelect 3, NozzleSelect 9, PodgroupEnable 11 (Phases A and B) ChromapodSelect 4, NozzleSelect 9, PodgroupEnable 11 (Phases A and B) For the low-speed printing mode, the firing order is similar. For each phase of the high speed mode where PodgroupEnable was 11, two phases of PodgroupEnable=01 and 10 are substituted as follows: ChromapodSelect 0, NozzleSelect 0, PodgroupEnable 01 (Phases A and B) ChromapodSelect 0, NozzleSelect 0, PodgroupEnable 10 (Phases A and B) ChromapodSelect 1, NozzleSelect 0, PodgroupEnable 01 (Phases A and B) ChromapodSelect 1, NozzleSelect 0, PodgroupEnable 10 (Phases A and B) ChromapodSelect 3, NozzleSelect 9, PodgroupEnable 01 (Phases A and B) ChromapodSelect 3, NozzleSelect 9, PodgroupEnable 10 (Phases A and B) ChromapodSelect 4, NozzleSelect 9, PodgroupEnable 01 (Phases A and B) ChromapodSelect 4, NozzleSelect 9, PodgroupEnable 10 (Phases A and B) When a nozzle 22 fires, it takes approximately 100 .mu.s to refill. The nozzle 22 cannot be fired before this refill time has elapsed. This limits the fastest printing speed to 100 .mu.s per line. In the high-speed print mode, the time to print a line is 100 .mu.s, so the time between firing a nozzle from one line to the next matches the refill time, making the high-speed print mode acceptable. The low-speed print mode is slower than this, so is also acceptable. The firing of a nozzle 22 also causes acoustic perturbations for a limited time within the common ink reservoir of that nozzle's pod 23. The perturbations can interfere with the firing of another nozzle within the same pod 23. Consequently, the firing of nozzles within a pod should be offset from each other as long as possible. We therefore fire three nozzles from a chromapod 24 (one nozzle 22 per color) and then move onto the next chromapod 24 within the podgroup 25. In the low-speed printing mode the podgroups 25 are fired separately. Thus the 5 chromapods 24 within both podgroups must all fire before the first chromapod fires again, totalling 10.times.2 .mu.s cycles. Consequently each pod 23 is fired once per 20 .mu.s. In the high-speed printing mode, the podgroups 25 are fired together. Thus the 5 Chromapods 24 within a single podgroup must all fire before the first chromapod fires again, totalling 5.times.2 .mu.s cycles. Consequently each pod 23 is fired once per 10 .mu.s. As the ink channel is 300 .mu.m long and the velocity of sound in the ink is around 1500 .mu.s, the resonant frequency of the ink channel is 2.5 MHz, thus the low speed mode allows 50 resonant cycles for the acoustic pulse to dampen, and the high speed mode allows 25 resonant cycles. Thus any acoustic interference is minimal in both cases. 2.2.3 Sample Timing As an example, consider the timing of printing an 4".times.6" photo in 2 seconds, as is required by Printcam. In order to print a photo in 2 seconds, the 4-inch printhead must print 9600 lines (6.times.1600). Rounding up to 10,000 lines in 2 seconds yields a line time of 200 .mu.s. A single Print Cycle and a single Load Cycle must both finish within this time. In addition, a physical process external to the printhead must move the paper an appropriate amount. From the printing point of view, the low-speed print mode allows a 4-inch printhead to print an entire line in 200 .mu.s. In the low-speed print mode, 96 nozzles 22 fire per firing pulse, thereby enabling the printing of an entire line within the specified time. The 800 SRClock pulses to the printhead 2 (each clock pulse transferring 24 bits) must also take place within the 200 .mu.s line time. The length of an SRClock pulse cannot exceed 200 .mu.s/800=250 ns, indicating that the printhead must be clocked at 4 MHz. In addition, the average time to calculate each bit value (for each of the 19,200 nozzles) must not exceed 200 .mu.s/19,200=10 ns. This requires a dot generator running at one of the following speeds: 100 MHz generating 1 bit (dot) per cycle 50 MHz generating 2 bits (dots) per cycle 25 MHz generating 4 bits (dots) per cycle 2.3 Feedback from the Printhead The printhead 2 produces several lines of feedback (accumulated from the 8 segments). The feedback lines are used to adjust the timing of the firing pulses. Although each segment 21 produces the same feedback, the feedback from all segments share the same tri-state bus lines. Consequently only one segment 21 at a time can provide feedback. A pulse on the SenseSegSelect line ANDed with data on Cyan enables the sense lines for that segment. The feedback sense lines will come from the selected segment until the next SenseSegSelect pulse. The feedback sense lines are as follows: Tsenseinforms the controller how hot the printhead is. This allows the controller to adjust timing of firing pulses, since temperature affects the viscosity of the ink. Vsenseinforms the controller how much voltage is available to the actuator. This allows the controller to compensate for a flat battery or high voltage source by adjusting the pulse width. Rsenseinforms the controller of the resistivity (Ohms per square) of the actuator heater. This allows the controller to adjust the pulse widths to maintain a constant energy irrespective of the heater resistivity. Wsenseinforms the controller of the width of the critical part of the heater, which may vary up to .+-.5% due to lithographic and etching variations. This allows the controller to adjust the pulse width appropriately. 2.4 Special Cycles 2.4.1 Preheat Cycle The printing process has a strong tendency to stay at the equilibrium temperature. To ensure that the first section of the printed photograph has a consistent dot size, the equilibrium temperature must be met before printing any dots. This is accomplished via a preheat cycle. The Preheat cycle involves a single Load Cycle to all nozzles with 1s (i.e. setting all nozzles to fire), and a number of short firing pulses to each nozzle. The duration of the pulse must be insufficient to fire the drops, but enough to heat up the ink. Altogether about 200 pulses for each nozzle are required, cycling through in the same sequence as a standard Print Cycle. Feedback during the Preheat mode is provided by Tsense, and continues until equilibrium temperature is reached (about 30.degree. C. above ambient). The duration of the Preheat mode is around 50 milliseconds, and depends on the ink composition. Preheat is performed before each print job. This does not affect printer performance, as it is done while the page data is transferred to the printer. 2.4.2 Cleaning Cycle In order to reduce the chances of nozzles becoming clogged, a cleaning cycle can be undertaken before each print job. Each nozzle is be fired a number of times into an absorbent sponge. The cleaning cycle involves a single Load Cycle to all nozzles with 1s (i.e. setting all nozzles to fire), and a number of firing pulses to each nozzle. The nozzles are cleaned via the same nozzle firing sequence as a standard Print Cycle. The number of times that each nozzle 22 is fired depends upon the ink composition and the time that the printer has been idle, as with preheat, the cleaning cycle has no effect on printer performance. 2.5 Printhead Interface Summary A single 4-inch printhead 2 has the following connections: TABLE 4 Four-Inch Printhead Connections # Name Pins Description ChromapodSelect 3 Select which chromapod will fire (0-4) NozzleSelect 4 Select which nozzle from the pod will fire (0-9) PodgroupEnable 2 Enable the podgroups to fire (choice of: 01, 10, 11) AEnable 1 Firing pulse for phasegroup A BEnable 1 Firing pulse for phasegroup B CDataIn[0-7] 8 Cyan input to cyan shift register of segments 0-7 MDataIn[0-7] 8 Magenta input to magenta shift register of segments 0-7 YDataIn[0-7] 8 Yellow input to yellow shift register of segments 0-7 SRClock 1 A pulse on SRClock (ShiftRegisterClock) loads the current values from CDataIn[0-7], MDataIn[0-7] and YDataIn[0-7] into the 24 shift registers. PTransfer 1 Parallel transfer of data from the shift registers to the internal NozzleEnable bits (one per nozzle). SenseSegSelect 1 A pulse on SenseSegSelect ANDed with data on CDataIn[n] selects the sense lines for segment n. Tsense 1 Temperature sense Vsense 1 Voltage sense Rsense 1 Resistivity sense Wsense 1 Width sense Logic GND 1 Logic ground Logic PWR 1 Logic power V- Bus Actuator Ground V+ bars Actuator Power TOTAL 44 Internal to the 4-inch printhead, each segment has the following connections to the bond pads: TABLE 5 Four-Inch Printhead Internal Segment Connections # Name Pins Description Chromapod- 3 Select which chromapod will fire (0-4) Select NozzleSelect 4 Select which nozzle from the pod will fire (0-9) PodgroupEnable 2 Enable the podgroups to fire (choice of: 01, 10, 11) AEnable 1 Firing pulse for phasegroup A BEnable 1 Firing pulse for phasegroup B CDataIn 1 Cyan input to cyan shift register MDataIn 1 Magenta input to magenta shift register YDataIn 1 Yellow input to yellow shift register SRClock 1 A pulse on SRClock (ShiftRegisterClock) loads the current values from CDataIn, MDataIn and YDataIn into the 3 shift registers. PTransfer 1 Parallel transfer of data from the shift registers to the internal NozzleEnable bits (one per nozzle). SenseSegSelect 1 A pulse on SenseSegSelect ANDed with data on CDataIn selects the sense lines for this segment. Tsense 1 Temperature sense Vsense 1 Voltage sense Rsense 1 Resistivity sense Wsense 1 Width sense Logic GND 1 Logic ground Logic PWR 1 Logic power V- 21 Actuator Ground V+ 21 Actuator Power TOTAL 65 (65 .times. 8 segments = 520 for all segments) 3 Image Processing Chains The previous sections have dealt only with the highest level overview of the PCP functionality--that of mapping CFA images to a variety of output print formats. In fact, there are a number of steps involved in taking an image from the image sensor, and producing a high quality output print. We can break the high level process into two image processing chains, each with a number of steps: Image Capture Chain Print Chain The Image Capture Chain is concerned with capturing the image from the Image Sensor and storing it locally within the Printcam. The Print Chain is concerned with taking the stored image and printing it. These two chains map onto the basic Printcam functionality as follows: Take&Print=Image Capture Chain followed by Print Chain Reprint=Print Chain For example, a user may print a thumbnail image (Take&Print), and if happy with the results, print several standard copies (Reprint). This chapter describes an implementation independent image processing chain that meets the quality requirements of Printcam. At this stage, we are not considering exactly how the processing is performed in terms of hardware, but rather what must be done. These functions must be mapped onto the various units within the PCP. Regardless of the PCP implementation, there are a number of constraints: The input image is a CFA based contone RGB image. The output image is for a Memjet printhead (bi-level dots at 1600 dpi) in CMY color space, and is always the same output width (4 inches wide). 3.0.1 Supported Print Formats The PCP 3 supports a variety of output print formats, as shown in Table 6. In all cases, the width of the image is 4 inches (matching the printhead width). Only the length of the print out varies. TABLE 6 Supported Image Formats Output Output Size resolution Format Name Aspect Ratio (inches) (at 1600 dpi) Rotation Standard 30 2:3 4" .times. 6" 6400 .times. 9600 90 Passport 31 2:3 4" .times. 6" 6400 .times. 9600 90 Panoramic 33 4:6 4" .times. 12" 6400 .times. 19200 90 Thumbnail 32 2:3 4" .times. 2.67" 6400 .times. 4267 0 The image sensor does not provide orientation information. All input images are captured at the same resolution (1500.times.1000), and may need to be rotated 90 degrees before printout. FIG. 13 illustrates the mapping between the captured CFA image and the various supported print formats. Note that although the image is shown rotated 90 degrees anti-clockwise, the image can be rotated clockwise or anti-clockwise. 3.1 Image Capture Chain The Image Capture Chain is responsible for taking an image from the Image Sensor and storing it locally within the Printcam. The Image Capture Chain involves a number of processes that only need to be performed during image capture. The Image Capture Chain is illustrated in FIG. 14, with subsequent sections detailing the sub-components. 3.1.1 Image Sensor 1 The input image comes from an image sensor 1. Although a variety of image sensors are available, we only consider the Bayer color filter array (CFA). The Bayer CFA has a number of attributes which are defined here. The image captured by the CMOS sensor 1 (via a taking lens) is assumed to have been sufficiently filtered so as to remove any aliasing artifacts. The sensor itself has an aspect ratio of 3:2, with a resolution of 1500.times.1000 samples. The most likely pixel arrangement is the Bayer color filter array (CFA), with each 2.times.2 pixel block arranged in a 2G mosaic as shown in FIG. 15: Each contone sample of R, G, or B (corresponding to red, green, and blue respectively) is 10-bits. Note that each pixel of the mosaic contains information about only one of R, G, or B. Estimates of the missing color information must be made before the image can be printed out. The CFA is considered to perform adequate fixed pattern noise (FPN) suppression. 3.1.2 Linearize RGB 40 The image sensor 40 is unlikely to have a completely linear response. Therefore the 10-bit RGB samples from the CFA must be considered to be non-linear. These non-linear samples are translated into 8-bit linear samples by means of lookup tables (one table per color). Pixels from the CFA lines 0, 2, 4 etc. index into the R and G tables, while pixels from the CFA lines 1, 3, 5 etc. index into the G and B tables. This is completely independent of the orientation of the camera. The process is shown in FIG. 16. The total amount of memory required for each lookup table is 2.sup.10.times.8-bits. The 3 lookup tables 45 therefore require a total of 3 KBytes (3.times.2.sup.10 bytes). 3.1.3 Planarize RGB 41 The pixels obtained from the CFA have their color planes interleaved due to the nature of the Bayer mosaic of pixels. By this we mean that on even horizontal lines, one red pixel is followed by a green pixel and then by another red pixel--the different color planes are interleaved with each other. In some image processing systems, an interleaved format is highly useful. However in the Printcam processing system, the algorithms are more efficient if working on planar RGB. A planarized image is one that has been separated into its component colors. In the case of the CFA RGB image, there are 3 separate images: one image containing only the red pixels, one image containing only the blue pixels, and one image containing only the green pixels. Note that each plane only represents the pixels of that color which were actually sampled. No resampling is performed during the planarizing process. As a result, the R, G and B planes are not registered with each other, and the G plane is twice as large as either the R or B planes. The process is shown in FIG. 17. The actual process is quite simple--depending on the color of the pixels read in, the output pixels are sent to the next position in the appropriate color plane's image (therefore in the same orientation as the CFA). The red 45 and blue 47 planar images are exactly one quarter of the size of the original CFA image. They are exactly half the resolution in each dimension. The red and blue images are therefore 750.times.500 pixels each, with the red image implicitly offset from the blue image by one pixel in CFA space (1500.times.1000) in both the x and y dimensions. Although the green planar image 46 is half of the size of the original CFA image, it is not set out as straightforwardly as the red or blue planes. The reason is due to the checkerboard layout of green. On one line the green is every odd pixel, and on the next line the green is every even pixel. Thus alternate lines of the green plane represent odd and even pixels within the CFA image. Thus the green planar image is 750.times.1000 pixels. This has ramifications for the resampling process (see "Resample 64" on page 28 below). 3.1.4 Stored Image 42 Each color plane of the linearized RGB image is written to memory for temporary storage. The memory should be Flash 11 so that the image is retained after the power has been shut off. The total amount of memory required for the planarized linear RGB image is 1,500,000 bytes (approximately 1.5 MB) arranged as follows: R: 750.times.500=375,000 bytes B: 750.times.500=375,000 bytes G: 750.times.1000=750,000 bytes 3.2 Print Chain The Print Chain is concerned with taking an existing image from memory 42 and printing it to a Memjet printer 2. An image is typically printed as soon as it has been captured, although it can also be reprinted (i.e. without recapture). There are a number of steps required in the image processing chain in order to produce high quality prints from CFA captured images. FIG. 18 illustrates the Print Chain. The chain is divided into 3 working resolutions. The first is the original image capture space 50 (the same space as the CFA), the second is an intermediate resolution 51 (lines of 1280 continuous tone pixels), and the final resolution is the printer resolution 52, with lines of 6400 bi-level dots. 3.2.1 Input Image The input image is a linearized RGB image 42 stored in planar form, as stored by the Image Capture Chain described in Section 3.1.4. 3.2.2 Gather Statistics 60 A number of statistics regarding the entire image need to be gathered before processes like white balance and range expansion can be performed. These statistics only need to be gathered once for all prints of a particular captured image 42, and can be gathered separately from the red, green, and blue planar images. 3.2.2.1 Build Histogram The first step is to build a histogram for each 8-bit value of the color plane. Each 1500.times.1000 CFA image contains a total of: 375,000 red pixels (min 19-bit counter required) 375,000 blue pixels (min 19-bit counter required) 750,000 green pixels (min 20-bit counter required) Therefore a single 256.times.20 bit table is required to hold the histogram. The process of building the histogram is straightforward, as illustrated by the following pseudocode: For I=0 to 255 Entry[I]=0 EndFor For Pixel=ImageStart to ImageEnd p=Image[Pixel] Entry[p]=Entry[p]+1 EndFor 3.2.2.2 Determine High and Low Thresholds Once the histogram has been constructed for the color plane, it can be used to determine a high and low threshold. These thresholds can be used for automating later white balance and range expansion during the print process. Basing the thresholds on the number of pixels from the histogram, we consider the n % darkest pixels to be expendable and therefore equal. In the same way, we consider the n % lightest pixels to be expendable and therefore equal. The exact value for n is expected to be about 5%, but will depend on the CFA response characteristics. The process of determining the n % darkest values is straightforward. It involves stepping through the color plane's histogram from the count for 0 upwards (i.e. 0, 1, 2, 3 etc.) until the n % total is reached or we have travelled further than a set amount from 0. The highest of these values is considered the low threshold of the color plane. Although there is a difference between these darkest values, the difference can be considered expendable for the purposes of range expansion and color balancing. The process of determining the n % lightest values is similar. It involves stepping through the color plane's histogram from the count for 255 downwards (i.e. 255, 254, 253 etc.) until the n % total is reached or until we have travelled further than a set amount from 255. The lowest of these values is considered the high threshold of the color plane. Although there is a difference between these lightest values, the difference can be considered expendable for the purposes of range expansion and color balancing. The reason for stopping after a set distance from 0 or 255 is to compensate for two types of images: where the original dynamic range is low, or where there is no white or black in an image In these two cases, we don't want to consider the entire n % of upper and lower values to be expendable since we have a low range to begin with. We can safely set the high 73 and low 72 thresholds to be outside the range of pixel values actually sampled. The exact distance will depend on the CFA, but will be two constants. A sample color range for a color plane is shown in FIG. 19. Note that although the entire 0-255 range is possible for an image color plane's pixels, this particular image has a smaller range. Note also that the same n % histogram range 70, 71 is represented by a larger range in the low end 70 than in the high end 71. This is because the histogram must contain more pixels with high values closer together compared to the low end. The high 73 and low 72 thresholds must be determined for each color plane individually. This information will be used to calculate range scale and offset factors to be used in the later white balance and range expansion process. The following pseudocode illustrates the process of determining either of the two thresholds (to find the low threshold, StartPosition=255, and Delta=1. To find the high threshold, StartPosition=0 and Delta=-1). The pseudocode assumes that Threshold is an 8-bit value that wraps during addition. Threshold=StartPosition Total=0 TotalDelta=0 While ((TotalDelta<MaxDelta) AND (Total<MaxPixels)) Threshold=Threshold+Delta Total=Total+Entry[Threshold] TotalDelta=TotalDelta+1 EndWhile Return Threshold 3.2.3 Rotate Image 61 Rotation of the image 61 is an optional step on both the Capture and Print and Reprint processes. Different print formats require the image to be rotated either 0 or 90 degrees relative to the CFA orientation, as shown in FIG. 13. The rotation amount depends on the currently selected print format. Although the direction of rotation is unimportant (it can be clockwise or counter-clockwise since the new orientation is only facilitating the printhead width), the rotation direction will affect the relative registration of the 3 color planes. Table 7 summarizes the rotation required for each print format from the original CFA orientation. TABLE 7 Rotations from CFA orientation for Print Formats Print Format Rotation Standard 30 90 Passport 31 90 Panoramic 33 90 Thumbnail 32 0 Since we are rotating only by 0 or 90 degrees, no information is lost during the rotation process. For a rotation of 0, the image can be read row by row, and for a rotation of 90, the image can be read column by column. Registration of the 3 color planes must take the rotation direction into account. 3.2.4 White Balance 62 and Range Expansion 63 A photograph is seldom taken in ideal lighting conditions. Even the very notion of "perfect lighting conditions" is fraught with subjectivity, both in terms of photographer and subject matter. However, in all cases, the subject matter of a photograph is illuminated by light either from a light source (such as the sun or indoor lighting), or its own light (such as a neon sign). In most lighting conditions, what may appear to the photographer as "white" light, is usually far from white. Indoor lighting for example, typically has a yellow cast, and this yellow cast will appear on an uncorrected photograph. To most people, the yellow cast on the final uncorrected photograph is wrong. Although it may match the viewing conditions at the time the photograph was taken, it does not match the perceived color of the object. It is therefore crucial to perform white balance on a photograph before printing it out. In the same way, an image can be perceived to be of higher quality when the dynamic range of the colors is expanded to match the full range in each color plane. This is particularly useful to do before an image is resampled to a higher resolution. If the dynamic range is higher, intermediate values can be used in interpolated pixel positions, avoiding a stepped or blocky image. Range expansion is designed to give the full 256 value range to those values actually sampled. In the best case, the lowest value is mapped to 0, and the highest value is mapped to 255. All the intermediate values are mapped to proportionally intermediate values between 0 and 255. Mathematically, the operation performed is a translation of LowThreshold 72 to 0 followed by a scale. The formula is shown here: ##EQU5## RangeScaleFactor should be limited to a maximum value to reduce the risk of expanding the range too far. For details on calculating LowThreshold, 72 see Section 3.2.2 "Gather Statistics". These values (LowThreshold and RangeScaleFactor) will be different for each color plane, and only need to be calculated once per image. Both tasks can be undertaken simultaneously, as shown in FIG. 20: Since this step involves a scaling process, we can be left with some fractional component in the mapped value e.g. the value 12 may map to 5.25. Rather than discard the fractional component, we pass a 10 bit result (8 bits of integer, 2 of fraction) on to the next stage of the image processing chain. We cannot afford the memory to store the entire image at more than 8-bits, but we can make good use of the higher resolution in the resampling stage. Consequently the input image is 8-bits, and the output image has 10-bits per color component. The logical process is shown in FIG. 21. It is important to have a floor of 0 during the subtraction so that all values below LowThreshold 72 to be mapped to 0. Likewise, the multiplication must have a ceiling of 255 for the integer portion of the result so that input values higher than HighThreshold 73 will be mapped to 255. 3.2.5 Resample 64 The CFA only provides a single color component per pixel (x,y) coordinate. To produce the final printed image we need to have the other color component values at each pixel. Ultimately we need cyan, magenta, and yellow color components at each pixel, but to arrive at cyan, magenta, and yellow we need red, green and blue. With our one-color-per-pixel, we may have the red component for a particular position, but we need to estimate blue and green. Or we may have green, and need to estimate red and blue. Even if we did have the full red, green, and blue color components for each CFA resolution pixel, the CFA resolution image is not the final output resolution. In addition, although the output format varies, the physical width of the printed image is constant (4 inches at 1600 dpi). The constant width of the printhead is therefore 6400 dots. There are two extreme cases to consider: Interpolate to CFA resolution (minimal interpolation), and then perform sharpening, color conversion. Finally scale up to the print resolution. This has the advantage of a constant sharpening kernel and color conversion at the low resolution. However it has the disadvantage of requiring more than 8-bits per color component to be stored for the interpolated image or intermediate values will be incorrectly interpolated during the final scale-up to print resolution. It also has the disadvantage of requiring a scale-up unit that is capable of producing 1 print-res interpolated value per cycle. Interpolate to the print resolution, then perform sharpening and color conversion. This has the advantage of only one resampling process, providing maximum accuracy. However it has the disadvantage of requiring a scale-up unit that is capable of producing 1 bi-cubic interpolated value per cycle as well as performing sharpening and color conversion, all on an average of a single cycle. The sharpening kernel must be large enough to apply the CFA-res kernel to the high-res image. Worse still, for sharpening, there must be at least 3 windows kept onto the output image (each containing a number of 6400 entry lines) since on a single print cycle, the cyan, magenta, and yellow dots represent dots from 6 different lines. Neither of these cases take into account the fact that the final print output is bilevel rather than contone. Consequently we can strike a middle ground with regards to resampling, and achieve the best from both methods. The solution is to interpolate to an intermediate resolution. Sharpening and color conversion occur at the intermediate resolution, followed by a scale-up to print resolution. The intermediate resolution must be low enough to allow the advantages of small sharpening kernel size and color conversion timing. But the intermediate resolution must be high enough so that there is no loss of quality scaling up to the print resolution bi-level image. The effect must be the same as if there was a single interpolation to the print resolution (rather than two). Since the print image is printed as 1600 dpi dithered bi-level dots, it can be safely represented by a 320 dpi contone image. Consequently an intermediate resolution of 1280 contone pixels provides no perceived loss of quality over 6400 bi-level dots. The later scaling from 1280 to 6400 is therefore an exact scaling ratio of 1:5. To decide how best to resample, it is best to consider each color plane in relation to the CFA resolution. This is shown in FIG. 22 for a rotation of 0. 3.2.5.1 Red 45 and Blue 47 Looking at the red 45 and blue 47 planes, the full CFA resolution version of the color plane can be created by scaling up the number of sampled pixels in each dimension by 2. The intermediate pixels can be generated by means of a reconstruction filter (such as a Lanczos or Exponential filter). Only one dimension in the kernel is required, since the kernel is symmetric. Since red and blue have different offsets in terms of their initial representation within the CFA sample space, the initial positions in the kernel will be different. The mapping of output coordinates (in 1280 space) to input coordinates depends on the current rotation of the image, since the registration of pixels changes with rotation (either 0 or 90 degrees depending on print format). For red and blue then, the following relationship holds: ##EQU6## where x,y=coordinate in medium res space x'y'=coordinate in input space mps=medium res pixels per input space sample k.sub.1,2 ={0, -0.5} depending on rotation This means that given a starting position in input space, we can generate a new line of medium resolution pixels by adding a .DELTA.x and .DELTA.y of 1/mps and 0 respectively 1279 times. The fractional part of x and y in input space can be directly used for looking up the kernel coefficients for image reconstruction and resampling. Note that k.sub.1 and k.sub.2 are 0 and -0.5 depending on whether the image has been rotated by 0 or 90 degrees. Table 8 shows the values for k.sub.1 and k2 in the red and blue planes, assuming that the rotation of 90 degrees is anti-clockwise. TABLE 8 Effect of Rotation on k1 and k2 (rotation is anti-clockwise) Rotation From Red Blue Format Original CFA k.sub.1 k.sub.2 k.sub.1 k.sub.2 Standard 30 90 0 -0.5 -0.5 0 Passport 31 90 0 -0.5 -0.5 0 Panoramic 33 90 0 -0.5 -0.5 0 Thumbnail 32 0 0 0 -0.5 -0.5 The number of medium res pixels per sample, mps, depends on the print format. Given that the planarized RGB image has the following red and blue planar resolutions when unrotated: R: 750.times.500, B: 750.times.500, the scale factors for the different output formats (see FIG. 13 on page 17) are shown in Table 9. Note that with the Passport image format, the entire image is resampled into 1/4 of the output space. TABLE 9 Red and Blue Scale Factors for Image Formats Format Mapping mps 1/mps Standard 30 500 {character pullout} 1280 2.56 0.390625 Passport 31 500 {character pullout} 640 1.28 0.78125 Panoramic 33 250 {character pullout} 1280 5.12 0.1953125 Thumbnail 32 750 {character pullout} 1280 1.71 0.5848 As can be seen in Table 9, the red and blue images are scaled up for all image formats. Consequently there will not be any aliasing artifacts introduced by the resampling process. 3.2.5.2 Green 46 The green plane 46 cannot be simply scaled up in the same way as red or blue, since each line of the green plane represents different pixels--either the odd or even pixels on alternate lines. Although in terms of the number of pixels it is representative to say the green image is 750.times.1000, the image could equally be said to be 1500.times.500. This confusion arises because of the checkerboard nature of the green pixels, where the distance between pixels is not equal in x and y dimensions, and does not map well to image reconstruction or resampling. The number of interpolation methods used by other systems for green plane reconstruction is testimony to this--from nearest neighbor replication to linear interpolation to bi-linear interpolation and heuristic reconstruction. The mapping of output coordinates (in 1280 space) to input coordinates is conceptually the same for green as it is for red and blue. The mapping depends on the current rotation of the image, since the registration of pixels changes with rotation (either 0 or 90 degrees depending on print format). For the green plane the following relationship holds: ##EQU7## where x,y=coordinate in medium res space x'y'=coordinate in input space mps=medium res pixels per input space sample k.sub.1,2 ={0, -0.5} depending on rotation As with the red 45 and blue 47 planes, the number of medium res pixels per sample, mps, depends on the print format. Given that the planarized RGB image has the following planar resolutions when unrotated: R: 750.times.500, B: 750.times.500, G: 750.times.1000, the scale factors for the different output formats (see FIG. 13) are shown in Table 10. Note that with the Passport image format, the entire image is resampled into 1/4 of the output space. TABLE 10 Green Plane Scale Factors for Image Formats Format Mapping mps 1/mps Standard 30 1000 {character pullout} 1280 1.28 0.78125 Passport 31 1000 {character pullout} 640 0.64 1.5625 Panoramic 33 500 {character pullout} 1280 2.56 0.390625 Thumbnail 32 1500 {character pullout} 1280 0.85 1.17648 These scale factors allow the mapping of coordinates between CFA resolution input space and medium res space. However, once we have a coordinate in CFA resolution input space, we cannot perform image reconstruction and resampling on the samples in the same way as red or blue due to the checkerboard nature of the green plane 46. Instead, for the purposes of high quality image reconstruction and resampling, we can consider the green channel to be an image rotated by 45 degrees. When we look at the pixels in this light, as shown in FIG. 23, a high quality image reconstruction and resampling method becomes clear. Looking at FIG. 23, the distance between the sampled pixels in the X and Y directions is now equal. The actual distance between sampled pixels is 2, as illustrated in FIG. 24. The solution for the green channel then, is to perform image reconstruction and resampling in rotated space. Although the same reconstruction filter is used as for resampling red and blue, the kernel should be different. This is because the relationship between the sampling rate for green and the highest frequency in the signal is different to the relationship for the red and blue planes. In addition, the kernel should be normalized so that the 2 distance between samples becomes 1 as far as kernel coordinates go (the unnormalized distances between resampling coordinates must still be used to determine whether aliasing will occur however). Therefore we require two transformations: The first is to map unrotated CFA space into rotated CFA space. This can be accomplished by multiplying each ordinate by 1/2, since we are rotating by 45 degrees (cos 45=sin 45=1/2). The second is to scale the coordinates to match the normalized kernel, which can be accomplished by multiplying each ordinate by 1/2. These two transformations combine to create a multiplication factor of 1/2. Consequently, as we advance in unrotated CFA space x by k, we increase by k/2 in kernel x, and decrease by k/2 in kernel y. Similarly, as we advance in y by k, we increase by k/2 in kernel x and increase by k/2 in kernel y. The relationships between these different coordinate systems can be illustrated by considering what occurs as we generate a line of medium resolution pixels from a CFA space input image. Given a starting y ordinate in CFA input space, we begin at x=0, and advance 1280 times by 1/mps, generating a new pixel at each new location. The movement in unrotated CFA space by 1/mps can be decomposed into a movement in x and a movement in y in rotated CFA space. The process is shown in FIG. 25. Since cos 45=sin 45=1/2), movement in unrotated CFA space by 1/mps equates to equal movement in x and y by 1/(mps2). This amount must now be scaled to match the normalized kernel. The scaling equates to another multiplication by 1/2. Consequently, a movement of 1/mps in unrotated CFA space equates to a movement of 1/2 mps in kernel x and kernel y. Table 11 lists the relationship between the three coordinate systems for the different formats: TABLE 11 Green Plane Kernel .DELTA. Values for Image Formats Unrotated Rotated Scale Factor CFA space .DELTA. CFA Space .DELTA. Kernel .DELTA. Format (mps) 1/mps 1/mps2 1/2 mps Standard 1.28 0.78125 0.552 0.391 Passport 0.64 1.5625 1.105 0.781 Panoramic 2.56 0.391 0.276 0.195 Thumbnail 0.85 1.17648 0.832 0.601 Table 11 shows that movement in kernel space is always by a number less than 1, but in rotated CFA space, only the Passport image has a .DELTA. value of greater than 1. As a result, aliasing will occur for the Passport print format, but not for any of the others. However, given that the .DELTA. is almost 1, and that each of the 4 images is only 1/4 size, aliasing will not be noticeable, especially since we assume ideal low pass filtering on the green during image capture. 3.2.5.3 Reconstruction Filter for Red, Blue and Green The exact reconstruction filter to be used will depend on a number of issues. There is always a trade off between the number of samples used in constructing the original signal, the time taken for signal reconstruction, and quality of the resampled image. A satisfactory trade-off in this case is 5 pixel samples from the dimension being reconstructed, centered around the estimated position X i.e. X-2, X-1, X, X+1, X+2. Due to the nature of reconstructing with 5 sample points, we only require 4 coefficients for the entry in the convolution kernel. We create a kernel coefficient lookup table with n entries for each color component. Each entry has 4 coefficients. As we advance in output space, we map the changes in output space to changes in input space and kernel space. The most significant bits of the fractional component in the current kernel space are used to index into the kernel coefficients table. If there are 64 entries in the kernel table, the first 6 fraction bits are used to look up the coefficients. 64 entries is quite sufficient for the resampling in Printcam. 3.2.6 Sharpen 65 The image captured by the CFA must be sharpened before being printed. Ideally, the sharpening filter should be applied in the CFA resolution domain. However, at the image capture resolution we do not have the full color information at each pixel. Instead we only have red, blue or green at a given pixel position. Sharpening each color plane independently gives rise to color shifts. Sharpening should instead be applied to the luminance channel of an image, so that the hue and saturation of a given pixel will be unchanged. Sharpening then, involves the translation of an RGB image into a color space where the luminance is separated from the remainder of the color information (such as HLS or Lab) 80. The luminance channel 81 can then be sharpened 82 (by adding in a proportion of the high-pass-filtered version of the luminance). Finally, the entire image should be converted back to RGB 83 (or to CMY since we are going to print out in CMY). The process is shown in FIG. 26. However we can avoid much of the color conversion steps if we consider the effect of adding a high-passed-filtered L back into the image--the effect is a change in the luminance of the image. A change in the luminance of a given pixel can be well-approximated by an equal change in linear R, G, and B. Therefore we simply generate L, high-pass-filter L, and apply a proportion of the result equally to R, G, and B. 3.2.6.1 Convert RGB to L 80 We consider the CIE 1976 L*a*b* color space, where L is perceptually uniform. To convert from RGB to L (the luminance channel) we average the minimum and maximum of R, G, and B as follows: ##EQU8## 3.2.6.2 High Pass Filter L 84 A high pass filter 84 can then be applied to the luminance information. Since we are filtering in med-res space rather than CFA resolution space, the size of the sharpening kernel can be scaled up or the high pass result can be scaled appropriately. The exact amount of sharpening will depend on the CFA, but a 3.times.3 convolution kernel 85 will be sufficient to produce good results. If we were to increase the size of the kernel, Table 12 shows the effective scaling 86 required for a 3.times.3 convolution in CFA space as applied to 1280 resolution space, using the green channel as the basis for scaling the kernel. From this table it is clear that a 7.times.7 sized kernel applied to the medium resolution space will be adequate for all sharpening. TABLE 12 Scale Factors for Convolution Filter Format Scale 3 .times. 3 Kernel in Med-res (1280) Space Standard 30 1.28 3.84 3 .times. 3 or 5 .times. 5 Passport 31 0.64 1.92 none, or 3 .times. 3 Panoramic 33 2.56 7.68 7 .times. 7 Thumbnail 32 0.85 2.55 none, or 3 .times. 3 If a 3.times.3 filter 85 were applied on the med-res image, the result will be scaled 86 according to the scale factor used in the general image scale operation. Given the amounts in Table 12 (particularly the Standard print format), we can use a 3.times.3 filter 85, and then scale the results. The process of producing a single filtered L pixel is shown in FIG. 27. The actual kernel used can be any one of a set of standard highpass filter kernels. A basic but satisfactory highpass filter is shown in this implementation of the PCP in FIG. 50. 3.2.6.3 Add Filtered L to RGB The next thing to do is to add some proportion of the resultant high pass filtered luminance values back to the luminance channel. The image can then be converted back to RGB (or instead, to CMY). However, a change in luminance can be reasonably approximated by an equal change in R, G, and B (as long as the color space is linear). Consequently we can avoid the color conversions altogether by adding an equal proportion of the high pass filtered luminance value to R, G, and B. The exact proportion of the high-pass-filtered image can be defined by means of a scale factor. If L is the high-pass-filtered luminance pixel, and k is the constant scale factor, we can define the transformation of sharpening R, G, and B as follows: ##EQU9## Of course, the scale factor applied to L can be combined with the scale factor in the highpass filter process (see Section 3.2.6.2) for a single scale factor. Once the sharpening has been applied to the RGB pixel, the image can be converted to CMY 83 in order to be printed out. 3.2.7 Convert to CMY 83 In theoretical terms, the conversion from RGB to CMY is simply: However this conversion assumes that the CMY space has a linear response, which is definitely not true of pigmented inks, and only partially true for dye-based inks. The individual color profile of a particular device (input and output) can vary considerably. Consequently, to allow for accurate conversion, as well as to allow for future sensors, inks, and printers, a more accurate model is required for Printcam. The transformations required are shown in FIG. 28. Lab is chosen because it is perceptually uniform (unlike XYZ). With regards to the mapping from the image sensor gamut to the printer gamut, the printer gamut is typically contained wholly within the sensor gamut. Rather than perform these transformations exhaustively, excellent results can be obtained via a tri-linear conversion based on 3 sets of 3D lookup tables. The lookup tables contain the resultant transformations for the specific entry as indexed by RGB. Three tables are required: one table 90 mapping RGB to C, one table 91 mapping RGB to M, and one table 92 mapping RGB to Y. Tri-linear interpolation can be used to give the final result for those entries not included in the tables. The process is shown in FIG. 29. Tri-linear interpolation requires reading 8 values from the lookup table, and performing 7 linear interpolations (4 in the first dimension, 2 in the second, and 1 in the third). High precision can be used for the intermediate values, although the output value is only 8 bits. The size of the lookup table required depends on the linearity of the transformation. The recommended size for each table in this application is 17.times.17.times.17.sup.1, with each entry 8 bits. A 17.times.17.times.17 table is 4913 bytes (less than 5KB). To index into the 17-per-dimension tables, the 8-bit input color components are treated as fixed-point numbers (4:4). The 4 bits of integer give the index, and the 4 bits of fraction are used for interpolation. 3.2.8 Up Interpolate 67 The medium resolution (1280 wide) CMY image must now be up-interpolated to the final print resolution (6400 wide). The ratio is exactly 1:5 in both dimensions. Although it is certainly possible to bi-linearly interpolate the 25 values (1:5 in both X and Y dimensions), the resultant values will not be printed contone. The results will be dithered and printed bi-level. Given that the contone 1600 dpi results will be turned into dithered bi-level dots, the accuracy of bi-linear interpolation from 320 dpi to 1600 dpi will not be visible (the medium resolution was chosen for this very reason). Pixel replication will therefore produce good results. Pixel replication simply involves taking a single pixel, and using it as the value for a larger area. In this case, we replicate a single pixel to 25 pixels (a 5.times.5 block). If each pixel were contone, the result may appear blocky, but since the pixels are to be dithered, the effect is that the 25 resultant bi-level dots take on the contone value. The process is shown in FIG. 30. 3.2.9 Halftone 68 The printhead 2 is only capable of printing dots in a bi-level fashion. We must therefore convert from the contone CMY to a dithered CMY image. More specifically, we produce a dispersed dot ordered dither using a stochastic dither cell, converting a contone CMY image into a dithered bi-level CMY image. The 8-bit 1600 dpi contone value is compared to the current position in the dither cell 93. If the 80-bit contone value is greater than the dither cell value, an output bit of 1 is generated. Otherwise an output bit of 0 is generated. This output bit will eventually be sent to the printhead and control a single nozzle to produce a single C, M, or Y dot. The bit represents whether or not a particular nozzle will fire for a given color and position. The same position in the dither cell 93 can be used for C, M, and Y. This is because the actual printhead 2 produces the C, M, and Y dots for different lines in the same print cycle. The staggering of the different colored dots effectively gives us staggering in the dither cell. The half-toning process can be seen in FIG. 31. The size of the dither cell 93 depends on the resolution of the output dots. Since we are producing 1600 dpi dots, the cell size should be larger than 32.times.32. In addition, to allow the dot processing order to match the printhead segments, the size of the dither cell should ideally divide evenly into 800 (since there are 800 dots in each segment of the printhead). A dither cell size of 50.times.50 is large enough to produce high quality results, and divides evenly into 800 (16 times). Each entry of the dither cell is 8 bits, for a total of 2500 bytes (approximately 1.5 KB). 3.2.10 Reformat for Printer 69 The final process before being sent to the printer is for the dots to be formatted into the correct order for being sent to the printhead. The dots must be sent to the printhead in the correct order--24 dots at a time as defined in Section 2.2.1. If the dots can be produced in the correct order for printing (i.e. the up-interpolate and dither functions generate their data in the correct order), then those dot values (each value is 1 bit) can simply be collected, and sent off in groups of 24. The process is shown in FIG. 32. The 24 bit groups can then be sent to the printhead 2 by the Memjet Interface 15. 4 CPU Core and Memory 4.1 CPU Core 10 The PCP 3 incorporates a simple micro-controller CPU core 10 to synchronize the image capture and printing image processing chains and to perform Printcam's general operating system duties including the user-interface. A wide variety of CPU cores are suitable: it can be any processor core with sufficient processing power to perform the required calculations and control functions fast enough to met consumer expectations. Since all of the image processing is performed by dedicated hardware, the CPU does not have to process pixels. As a result, the CPU can be extremely simple. However it must be fast enough to run the stepper motor during a print (the stepper motor requires a 5 KHz process). An example of a suitable core is a Philips 8051 micro-controller running at about 1 MHz. There is no need to maintain instruction set continuity between different Printcam models. Different PCP chip designs may be fabricated by different manufacturers, without requiring to license or port the CPU core. This device independence avoids the chip vendor lock-in such as has occurred in the PC market with Intel. Associated with the CPU Core is a Program ROM 13 and a small Program Scratch RAM 14. The CPU 10 communicates with the other units within the PCP 3 via memory-mapped I/O. Particular address ranges map to particular units, and within each range, to particular registers within that particular unit. This includes the serial and parallel interfaces. 4.2 Program ROM 13 A small Program Flash ROM 13 is incorporated into the PCP 3. The ROM size depends on the CPU chosen, but should not be more than 16-32 KB. 4.3 Program RAM 14 Likewise, a small scratch RAM area 14 is incorporated into the PCP 3. Since the program code does not have to manipulate images, there is no need for a large scratch area. The RAM size depends on the CPU chosen (e.g. stack mechanisms, subroutine calling conventions, register sizes etc.), but should not be more than about 4 KB. 4.4 CPU Memory Decoder 16 The CPU Memory Decoder 16 is a simple decoder for satisfying CPU data accesses. The Decoder translates data addresses into internal PCP register accesses over the internal low speed bus, and therefore allows for memory mapped I/O of PCP registers. 5 Communication Interfaces 5.1 USB Serial Port Interface 17 This is a standard USB serial port, connected to the internal chip low-speed bus 18. The USB serial port is controlled by the CPU 10. The serial port allows the transfer of images to and from the Printcam, and allows DPOF (Digital Print Order Format) printing of transferred photos under external control. 5.2 QA Chip Serial Interface 19 This is two standard low-speed serial ports, connected to the internal chip low-speed bus 18. The CPU-mediated protocol between the two is used to authenticate the print roll [1,2] and for the following functions: Acquire ink characteristics Acquire the recommended drop volume Track the amount of paper printed and request new print roll when there is insufficient paper to print the requested print format. The reason for having two ports is to connect to both the on-camera QA Chip 4 and to the print roll's QA Chip 5 using separate lines. The two QA chips are implemented as Authentication Chips [2]. If only a single line is used, a clone print roll manufacturer could usurp the authentication mechanism [1]. 5.2.1 Print Roll's QA Chip 5 Each print roll consumable contains its own QA chip 5. The QA chip contains information required for maintaining the best possible print quality, and is implemented using an Authentication Chip[2]. The 256 bits of data are allocated as follows: TABLE 13 Print roll's 256 bits (16 M[n] Access Description 0 RO.sup.a Basic Header, Flags etc. (16 bits) 1 RO Serial number (16 bits) 2 RO Batch number (16 bits) 3 .sup. DO.sup.b Paper remaining in mm (16 bits) 4 RO Cyan ink properties (32 bits) 5 RO 6 RO Magenta ink properties (32 bits) 7 RO 8 RO Yellow ink properties (32 bits) 9 RO 10-12 RO For future expansion = 0 (48 bits) 13-15 RO Random bits, different in each chip (48 bits) .sup.a Read Only .sup.b Decrement Only Before each print, the amount of paper remaining is checked by the CPU to ensure that there for the currently specified print format. After each print has started, the amount of paper must be decremented in the print roll's QA chip by the CPU. 5.3 Parallel Interfaces 6 The parallel interface 6 connects the PCP 3 to individual static electrical signals. The CPU is able to control each of these connections as memory-mapped I/O via the low-speed bus. (See Section 4.4 for more details on memory-mapped I/O). Table 14 shows the connections to the parallel interface. TABLE 14 Connections to Parallel Interface Connection Direction Pins Paper transport stepper motor Out 4 Guillotine motor Out 1 Focus Motor Out 1 Capping solenoid Out 1 Flash trigger Out 1 Status LCD segment drivers Out 7 Status LCD common drivers Out 4 Paper pull sensor In 1 Buttons In 4 TOTAL 24 5.4 JTAG Interface 7 A standard JTAG (Joint Test Action Group) Interface 7 is included in the PCP 3 for testing purposes. Due to the complexity of the chip, a variety of testing techniques are required, including BIST (Built In Self Test) and functional block isolation. An overhead of 10% in chip area is assumed for overall chip testing circuitry. 6 Image RAM 11 The Image RAM 11 is used to store the captured image 42. The Image RAM is multi-level Flash (2-bits per cell) so that the image is retained after the power has been shut off. The total amount of memory required for the planarized linear RGB image is 1,500,000 bytes (approximately 1.5 MB) arranged as follows: R: 750.times.500=375,000 bytes B: 750.times.500=375,000 bytes G: 750.times.1000=750,000 bytes The image is written by the Image Capture Unit, and read by both the Image Histogram Unit 8 and the Print Generator Unit 99. The CPU 10 does not have direct random access to this image memory. It must access the image pixels via the Image Access Unit. 7 Image Capture Unit 12 The Image Capture Unit contains all the functionality required by the Image Capture Chain, as described in Section 3.1. The Image Capture Unit accepts pixel data via the Image Sensor Interface 98, linearizes the RGB data via a lookup table 96, and finally writes the linearized RGB image out to RAM in planar format. The process is shown in FIG. 33. 7.1 Image Sensor Interface 98 The Image Sensor Interface (ISI) 98 is a state machine that sends control information to the CMOS Image Sensor, including frame sync pulses and pixel clock pulses in order to read the image. Most of the ISI is likely to be a sourced cell from the image sensor manufacturer. The ISI is itself controlled by the Image Capture Unit State Machine 97. 7.1.1 Image Sensor Format Although a variety of image sensors are available, we only consider the Bayer color filter array (CFA). The Bayer CFA has a number of attributes which are defined here. The image captured by the CMOS sensor (via a taking lens) is assumed to have been sufficiently filtered so as to remove any aliasing artifacts. The sensor itself has an aspect ratio of 3:2, with a resolution of 1500.times.1000 samples. The most likely pixel arrangement is the Bayer color filter array (CFA), with each 2.times.2 pixel block arranged in a 2G mosaic as shown in FIG. 15: Each contone sample of R, G, or B (corresponding to red, green, and blue respectively) is 10-bits. Note that each pixel of the mosaic contains information about only one of R, G, or B. Estimates of the missing color information must be made before the image can be printed out. The CFA is considered to perform some amount of fixed pattern noise (FPN) suppression. Additional FPN suppression may required. 7.2 Lookup Table 96 The lookup table 96 is a ROM mapping the sensor's RGB to a linear RGB. It matches the Linearize RGB process 40 described in Section 3.1.2. As such, the ROM is 3 KBytes (3.times.1024.times.8-bits). 10 bits of address come from the ISI, while the 2 bits of TableSelect are generated by the Image Capture Unit's State Machine 97. 7.3 State Machine 97 The Image Capture Unit's State Machine 97 generates control signals for the Image Sensor Interface 1, and generates addresses for linearizing the RGB 40 and for planarizing the image data 41. The control signals sent to the ISI 98 inform the ISI to start capturing pixels, stop capturing pixels etc. The 2-bit address sent to the Lookup Table 96 matches the current line being read from the ISI. For even lines (0, 2, 4 etc.), the 2-bit address is Red, Green, Red, Green etc. For odd lines (1, 3, 5 etc.), the 2-bit address is Green, Blue, Green, Blue. This is true regardless of the orientation of the camera. The 21-bit address sent to the Image RAM 11 is the write address for the image. Three registers hold the current address for each of the red, green, and blue planes. The addresses increment as pixels are written to each plane. 7.3.1 Registers The Image Capture Unit contains a number of registers: TABLE 15 Registers in Image Capture Unit Name Bits Description MaxPixels 12 Number of pixels each row MaxRows 12 Number of rows of pixels in image CurrentPixel 12 Pixel currently being fetched CurrentRow 12 Row currently being processed NextR 21 The address in Image RAM to store the next Red pixel. Set to start address of red plane before image capture. After image capture, this register will point to the byte after the red plane. NextG 21 The address in Image RAM to store the next Green pixel. Set to start address of green plane before image capture. After image capture, this register will point to the byte after the green plane. NextB 21 The address in Image RAM to store the next Blue pixel. Set to start address of blue plane before image capture. After image capture, this register will point to the byte after the blue plane. EvenEven 2 Address to use for even rows/even pixels EvenOdd 2 Address to use for even rows/odd pixels OddEven 2 Address to use for odd rows/even pixels OddOdd 2 Address to use for odd rows/odd pixels Go 1 Writing a 1 here starts the capture. Writing a 0 here stops the image capture. A 0 is written here automatically by the state machine after MaxRows of MaxPixels have ben captured. In addition, the Image Sensor Interface 98 contains a number of registers. The exact registers will depend on the Image Sensor 1 chosen. 8 Image Access Unit 9 The Image Access Unit 9 produces the means for the CPU 10 to access the image in ImageRAM 11. The CPU 10 can read pixels from the image in ImageRAM 11 and write pixels back. Pixels could be read for the purpose of image storage (e.g. via the USB) 17, or for simple image processing. Pixels could be written to ImageRAM 11 after the image processing, as a previously saved image (loaded via USB), or images for test pattern purposes. Test patterns could be synthetic images, specific test images (loaded via the USB) or could be 24-bit nozzle firing values to be directly loaded into the printhead via the test mode of the Print Generator Unit 99. The Image Access Unit 9 is a straightforward access mechanism to ImageRAM 11, and operates quite simply in terms of 3 registers as shown in Table 16. TABLE 16 IAU Registers Name Bits Description ImageAddress 21 Address to read or write in ImageRAM Mode 3 0 = Read from ImageAddress into Value. 1 = Write Value to ImageAddress. Value 8 Value stored at ImageAddress (if Mode = Read) Value to store at ImageAddress (if Mode = Write) The structure of the Image Access Unit is very simple, as shown in FIG. 35. The State Machine 101 simply performs the read/write from/to ImageRAM 11 whenever the CPU 10 writes to the Mode register. 9 Image Historian Unit 8 The Image Histogram Unit (IHU) 8 is designed to generate histograms of images as required by the Print Image Processing Chain described in Section 3.2.2. The IHU only generates histograms for planar format images with samples of 8 bits each. The Image Histogram Unit 8 is typically used three times per print. Three different histograms are gathered, one per color plane. Each time a histogram is gathered, the results are analyzed in order to determine the low and high thresholds, scaling factors etc. for use in the remainder of the print process. For more information on how the histogram should be used, see Section 3.2.2.2 and Section 3.2.4. 9.1 Histogram RAM 102 The histogram itself is stored in a 256-entry RAM 102, each entry being 20 bits. The histogram RAM is only accessed from within the IHU. Individual entries are read from and written to as 20-bit quantities. 9.2 State Machine and Registers 103 The State Machine 103 follows the pseudocode described in Section 3.2.2.1. It is controlled by the registers shown in Table 17. TABLE 17 Registers in Image Histogram Unit Name Bits Description TotalPixels 20 The number of pixels to count (decrements until 0) StartAddress 21 Where to start counting from PixelsRemaining 20 How many pixels remain to be counted PixelValue 8 A write to this register loads PixelCount with the PixelValue entry from the histogram. PixelCount 20 The number of PixelValue pixels counted in the current histogram. It is valid after a write to PixelValue. ClearCount 1 Determines whether the histogram count will be cleared at the start of the histogram process. A 1 causes the counts to be cleared, and a 0 causes the counts to remain untouched (i.e. the next histogram adds to the existing counts). Go 1 Writing a 1 here starts the histogram process. Writing a 0 here stops the histogram process. A 0 is written here automatically by the state machine after TotalPixels has counted down to 0. The typical usage of the registers is to set up TotalPixels with the total number of pixels to include in the count (e.g. 375,000 for red), StartAddress with the address of the red plane, ClearCount with 1, and write a 1 to the Go register. Once the count has finished, the individual values in the histogram can be determined by writing 0-255 to PixelValue and reading the corresponding PixelCount. 10 Printhead Interface 105 The Printhead Interface (PHI) 105 is the means by which the PCP 3 loads the Memjet printhead 2 with the dots to be printed, and controls the actual dot printing process. The PHI is a logical wrapper for a number of units, namely: a Memjet Interface (MJI) 15, which transfers data to the Memjet printhead, and controls the nozzle firing sequences during a print. a Print Generator Unit (PGU) 99 is an implementation of most of the Print Chain described in Section 3.2 on page 24, as well as providing a means of producing test patterns. The PGU takes a planarized linear RGB obtained from a CFA format captured image from the ImageRAM 11, and produces a 1600 dpi dithered CMY image in real time as required by the Memjet Interface 15. In addition, the PGU has a Test Pattern mode, which enables the CPU 10 to specify precisely which nozzles are fired during a print. The units within the PHI are controlled by a number of registers that are programmed by the CPU. The internal structure of the Printhead Interface is shown in FIG. 37. 10.1 Memjet Interface 15 The Memjet Interface (MJI) 15 connects the PCP to the external Memjet printhead, providing both data and appropriate signals to control the nozzle loading and firing sequences during a print. The Memjet Interface 15 is simply a State Machine 106 (see FIG. 38) which follows the printhead loading and firing order described in Section 2.2, and includes the functionality of the Preheat cycle and Cleaning cycle as described in Section 2.4.1 and Section 2.4.2. The MJI 15 loads data into the printhead from a choice of 2 data sources: All 1s. This means that all nozzles will fire during a subsequent Print cycle, and is the standard mechanism for loading the printhead for a Preheat or Cleaning cycle. From the 24-bit input held in the Transfer register of the PGU 99. This is the standard means of printing an image, whether it be a captured photo or test pattern. The 24-bit value from the PGU is directly sent to the printhead and a 1-bit 'Advance' control pulse is sent to the PGU. At the end of each line, a 1-bit 'AdvanceLine' pulse is also sent to the PGU. The MJI 15 must be started after the PGU 99 has already prepared the first 24-bit transfer value. This is so the 24-bit data input will be valid for the first transfer to the printhead. The MJI 15 is therefore directly connected to the Print Generator Unit 99 and the external printhead 2. The basic structure is shown in FIG. 38. 10.1.1 Connections to Printhead The MJI 15 has the following connections to the printhead 2, with the sense of input and output with respect to the MJI 15. The names match the pin connections on the printhead (see Section 2). TABLE 18 Printhead Connections Name # Pins I/O Description ChromapodSelect 4 O Select which chromapod will fire (0-9) NozzleSelect 4 O Select which nozzle from the pod will fire (0-9) AEnable 1 O Firing pulse for phasegroup A BEnable 1 O Firing pulse for phasegroup B CDataIn[0-7] 8 O Cyan output to cyan shift register of segments 0-7 MDataIn[0-7] 8 O Magenta input to magenta shift register of segments 0-7 YDataIn[0-7] 8 O Yellow input to yellow shift register of segments 0-7 SRClock 1 O A pulse on SRClock (ShiftRegisterClock) loads the current values from CDataIn[0-7], MDataIn[0-7] and YDataIn[0-7] into the 24 shift registers of the printhead PTransfer 1 O Parallel transfer of data from the shift registers to the printhead's internal NozzleEnable bits (one per nozzle). SenseSegEnable 1 O A pulse on SenseSegEnable ANDed with data on CDataIn[n] selects the sense lines for segment n. Tsense 1 I Temperature sense Vsense 1 I Voltage sense Rsense 1 I Resistivity sense Wsense 1 I Width sense TOTAL 41 10.1.2 Firing Pulse Duration The duration of firing pulses on the AEnable and BEnable lines depend on the viscosity of the ink (which is dependent on temperature and ink characteristics) and the amount of power available to the printhead. The typical pulse duration range is 1.3 to 1.8 .mu.s. The MJI therefore contains a programmable pulse duration table, indexed by feedback from the printhead. The table of pulse durations allows the use of a lower cost power supply, and aids in maintaining more accurate drop ejection. The Pulse Duration table has 256 entries, and is indexed by the current Vsense and Tsense settings. The upper 4-bits of address come from Vsense, and the lower 4-bits of address come from Tsense. Each entry is 8 bits, and represents a fixed point value in the range of 0-4 .mu.s. The process of generating the AEnable and BEnable lines is shown in FIG. 39. The 256-byte table is written by the CPU 10 before printing the photo. Each 8-bit pulse duration entry in the table combines: Brightness settings Viscosity curve of ink (from the QA Chip) 5 Rsense Wsense Tsense Vsense 10.1.3 Dot Counts The MJI 15 maintains a count of the number of dots of each color fired from the printhead 2. The dot count for each color is a 32-bit value, individually cleared under processor control. Each dot count can hold a maximum coverage dot count of 69 6-inch prints, although in typical usage, the dot count will be read and cleared after each print. While in the initial Printcam product, the consumable contains both paper and ink, it is conceivable that a different Printcam model has a replaceable ink-only consumable. The initial Printcam product can countdown the amount of millimeters remaining of paper (stored in the QA chip 5--see Section 5.2) to know whether there is enough paper available to print the desired format. There is enough ink for full coverage of all supplied paper. In the alternative Printcam product, the dot counts can be used by the CPU 10 to update the QA chip 5 in order to predict when the ink cartridge runs out of ink. The processor knows the volume of ink in the cartridge for each of C, M, and Y from the QA chip 5. Counting the number of drops eliminates the need for ink sensors, and prevents the ink channels from running dry. An updated drop count is written to the QA chip 5 after each print. A new photo will not be printed unless there is enough ink left, and allows the user to change the ink without getting a dud photo which must be reprinted. The layout of the dot counter for cyan is shown in FIG. 40. The remaining 2 dot counters (MDotCount and YDotCount, for magenta and yellow respectively) are identical in structure. 10.1.4 Registers The CPU 10 communicates with the MJI 15 via a register set. The registers allow the CPU to parameterize a print as well as receive feedback about print progress. The following registers are contained in the MJI: TABLE 19 Memjet Interface Registers RegisterName Description Print Parameters NumTransfers The number of transfers required to load the printhead (usually 800). This is the number of pulses on the SRClock and the number of 24-bit data values to transfer for a given line. PulseDuration Fixed point number to determine the duration of a single pulse on the ColorEnable lines. Duration range = 0-6 .mu.s. NumLines The number of Load/Print cycles to perform. Monitoring the Print Status The Memjet Interface's Status Register LinesRemaining The number of lines remaining to be printed. Only valid while Go=1. Starting value is NumLines. TransfersRemaining The number of transfers remaining before the Printhead is considered loaded for the current line. Only valid while Go=1. SenseSegment The 8-bit value to place on the Cyan data lines during a subsequent feedback SenseSegSelect pulse. Only 1 of the 8 bits should be set, corresponding to one of the 8 segments. SetAllNozzles If non-zero, the 24-bit value written to the printhead during the LoadDots process is all 1s, so that all nozzles will be fired during the subsequent PrintDots process. This is used during the preheat and cleaning cycles. If 0, the 24-bit value written to the printhead comes from the Print Generator Unit. This is the case during the actual printing of the photo and any test images. Actions Reset A write to this register resets the MJI, stops any loading or printing processes, and loads all registers with 0. SenseSegSelect A write to this register with any value clears the Feedback bit of the Status register, and sends a pulse on the SenseSegSelect line if the LoadingDots and PrintingDots status bits are all 0. If any of the status bits are set, the Feedback bit is cleared and nothing more is done. Once the various sense lines have been tested, the values are placed in the Tsense, Vsense. Rsense, and Wsense registers, and then the Feedback bit of the Status register is set. The feedback continues during any subsequent print operations. Go A write of 1 to this bit starts the LoadDots/PrintDots cycles. A total of NumLines lines are printed, each containing NumTransfers 24-bit transfers. As each line is printed, LinesRemaining decrements, and TransfersRemaining is reloaded with NumTransfers again. The status register contains print status information. Upon completion of NumLines, the loading/printing process stops and the Go bit is cleared. During the final print cycle, nothing is loaded into the printhead. A write of 0 to this bit stops the print process, but does not clear any other registers. ClearCounts A write to this register clears the CDotCount, MDotCount, and YDotCount, registers if bits 0, 1, or 2 respectively are set. Consequently a write of 0 has no effect. Feedback Tsense Read only feedback of Tsense from the last SenseSegSelect pulse sent to segment SenseSegment. Is only valid if the FeedbackValid bit of the Status register is set. Vsense Read only feedback of Vsense from the last SenseSegSelect pulse sent to segment SenseSegment. Is only valid if the FeedbackValid bit of the Status register is set. Rsense Read only feedback of Rsense from the last SenseSegSelect pulse sent to segment SenseSegment. Is only valid if the FeedbackValid bit of the Status register is set. Wsense Read only feedback of Wsense from the last SenseSegSelect pulse sent to segment SenseSegment. Is only valid if the FeedbackValid bit of the Status register is set. CDotCount Read only 32-bit count of cyan dots sent to the printhead. MDotCount Read only 32-bit count of magenta dots sent to the printhead. YDotCount Read only 32-bit count of yellow dots sent to the printhead. The MJI's Status Register is a 16-bit register with bit interpretations as follows: TABLE 20 MJI Status Register Name Bits Description LoadingDots 1 If set, the MJI is currently loading dots, with the number of dots remaining to be transferred in TransfersRemaining. If clear, the MJI is not currently loading dots PrintingDots 1 If set, the MJI is currently printing dots. If clear, the MJI is not currentiy printing dots. PrintingA 1 This bit is set while there is a pulse on the AEnable line PrintingB 1 This bit is set while there is a pulse on the BEnable line FeedbackValid 1 This bit is set while the feedback values Tsense, Vsense, Rsense, and Wsense are valid. Reserved 3 -- PrintingChromapod 4 This holds the current chromapod being fired while the PrintingDots status bit is set. PrintingNozzles 4 This holds the current nozzle being fired while the PrintingDots status bit is set. 10.1.5 Preheat and Cleaning Cycles The Cleaning and Preheat cycles are simply accomplished by setting appropriate registers: SetAllNozzles=1 Set the PulseDuration register to either a low duration (in the case of the preheat mode) or to an appropriate drop ejection duration for cleaning mode. Set NumLines to be the number of times the nozzles should be fired Set the Go bit and then wait for the Go bit to be cleared when the print cycles have completed. 10.2 Print Generator Unit 99 The Print Generator Unit (PGU) 99 is an implementation of most of the Print Chain described in Section 3.2, as well as providing a means of producing test patters. From the simplest point of view, the PGU provides the interface between the Image RAM 11 and the Memjet Interface 15, as shown in FIG. 41. The PGU takes a planarized linear RGB obtained from a CFA format captured image from the ImageRAM, and produces a 1600 dpi dithered CMY image in real time as required by the Memjet Interface. In addition, the PGU 99 has a Test Pattern mode, which enables the CPU 10 to specify precisely which nozzles are fired during a print. The MJI 15 provides the PGU 99 with an Advance pulse once the 24-bits have been used, and an AdvanceLine pulse at the end of the line. The PGU 99 has 2 image processing chains. The first, the Test Pattern mode, simply reads data directly from Image RAM 11, and formats it in a buffer ready for output to the MJI. The second contains the majority of Print Chain functions (see Section 3.2). The Print Chain shown in FIG. 18 contains the functions: Gather Statistics 60 Rotate Image 61 White Balance 62 Range Expansion 63 Resample 64 Sharpen 65 Convert to CMY 66 Up-lnterpolate 67 Halftone 68 Reformat for Printer 69 The PGU 99 contains all of these functions with the exception of Gather Statistics 60. To perform the Gather Statistics step, the CPU 10 calls the Image Histogram Unit 8 three times (once per color channel), and applies some simple algorithms. The remainder of the functions are the domain of the PGU 99 for reasons of accuracy and speed: accuracy, because there would be too much memory required to hold the entire image at high accuracy, and speed, because a simple CPU 10 cannot keep up with the real-time high-speed demands of the Memjet printhead 2. The PGU 99 takes as input a variety of parameters, including RGB to CMY conversion tables, constants for performing white balance and range expansion, scale factors for resampling, and image access parameters that allow for rotation. The two process chains can be seen in FIG. 20. The most direct chain goes from the Image RAM 11 to Buffer 5 via the Test Pattern Access process 110. The other chain consists of 5 processes, all running in parallel. The first process 111 performs Image Rotation, White Balance and Range Expansion. The second process 112 performs Resampling. The third process 65 performs sharpening, the fourth process 66 performs color conversion. The final process 113 performs the up-interpolation, halftoning, and reformatting for the printer. The processes are connected via buffers, only a few bytes between some processes, and a few kilobytes for others. We look at these processes and buffers in a primarily reverse order, since the timing for the printhead drives the entire process. Timings for particular processes and buffer size requirements are then more apparent. In summary however, the buffer sizes are shown in Table 21. TABLE 21 Buffer sizes for Print Generator Unit Size Buffer (bytes) Composition of Buffer Buffer 1 188 Red Buffer = 6 lines of 6 entries @ 10-bits each = 45 bytes Blue Buffer = 6 lines of 6 entries @ 10-bits each = 45 bytes Green Buffer = 13 lines of 6 entries @ 10-bits each = 97.5 bytes Buffer 2 24 6 .times. 4 RAM 3 lines of 4 entries of L @ 8-bits each = 12 bytes 3 colors .times. 4 entries @ 8-bits each = 12 bytes Buffer 3 3 3 colors (RGB) @ 8-bits each Buffer 4 23,040 3 colors (CMY) .times. 6 lines .times. 1280 contone pixels @ 8-bits each Buffer 5 9 3 .times. 24 bits TOTAL 23,264 Apart from a number of registers, some of the processes have significant lookup tables or memory components. These are summarized in Table 22. TABLE 22 Memory requirements within PGU Processes Size Unit (bytes) Composition of Requirements Rotate/White Balance/ 0 Range Expand Resample/Convert to L 1,152 3 kernels, each 64 .times. 4 .times. 12-bits Sharpen 0 Convert to CMY 14,739 3 conversion tables, each 17 .times. 17 .times. 17 .times. 8-bits UpInterpolate/Halftone/ 2,500 Dither Cell, 50 .times. 50 .times. 8-bits Reformat Test Pattern Access 0 TOTAL 18,391 10.2.1 Test Pattern Access The Test Pattern Access process 110 is the means by which test patterns are produced. Under normal user circumstances, this process will not be used. It is primarily for diagnostic purposes. The Test Pattern Access 110 reads the Image RAM 11 and passes the 8-bit values directly to Buffer 5118 for output to the Memjet Interface. It does not modify the 8-bit values in any way. The data in the Image RAM 11 would be produced by the CPU 10 using the Image Access Unit 9. The data read from Image RAM 11 is read in a very simple wraparound fashion. Two registers are used to describe the test data: the start address of the first byte, and the number of bytes. When the end of the data is reached, the data is read again from the beginning. The structure of the Test Pattern Access Unit 110 is shown in FIG. 43. As can be seen in FIG. 43, the Test Pattern Access Unit 110 is little more than an Address Generator 119. When started, and with every AdvanceLine signal, the generator reads 3 bytes, produces a TransferWriteEnable pulse, reads the next 3 bytes, and then waits for an Advance pulse. At the Advance pulse, the TransferWriteEnable pulse is given, the next 3 bytes are read, and the wait occurs again. This continues until the AdvanceLine pulse, whereupon the process begins again from the current address. In terms of reading 3 bytes, the Address Generator 119 simply reads three 8-bit values from ImageRAM 11 and writes them to Buffer 5118. The first 8-bit value is written to Buffer 5's 8-bit address 0, the next is written to Buffer 5's 8-bit address 1, and the third is written to Buffer 5's 8-bit address The Address Generator 119 then waits for an Advance pulse before doing the same thing again. The addresses generated for the Image RAM 11 are based on a start address and a byte count as shown in Table 23. TABLE 23 Test Pattern Access Registers Register Name Description TestModeEnabled If 1, TestMode is enabled. If 0, TestMode is not enabled. DataStart Start Address of test data in Image RAM DataLength Number of 3 bytes in test data The following pseudocode illustrates the address generation. The AdvanceLine and Advance pulses are not shown. Do Forever Adr=DataStart Remaining=DataLength Read Adr into Buffer 5 (0), Adr=Adr+1 Read Adr into Buffer 5 (1), Adr=Adr+1 Read Adr into Buffer 5 (2), Adr=Adr+1 Remaining=Remaining-1 if (Remaining=0) Remaining=DataLength EndDo It is the responsibility of the CPU 10 to ensure that the data is meaningful for the printhead 2. Byte 0 is the nozzle-fire data for the 8 segments of cyan (bit 0=segment 0 etc.), Byte 1 is the same for magenta, and Byte 2 for yellow. Alternate sets of 24 bits are for odd/even pixels separated by 1 horizontal dot line. 10.2.2 Buffer 5118 Buffer 5118 holds the generated dots from the entire Print Generation process. Buffer 5 consists of a 24-bit shift register to hold dots generated one at a time from the UHRU 113 (Upinterpolate-Halftone and Reformat Unit), 3 8-bit registers to hold the data generated from the TPAU (Test Pattern AccessUnit), and a 24-bit register used as the buffer for data transfer to the MJI (Memjet Interface). The Advance pulse from the MJI loads the 24-bit Transfer register with all 24-bits, either from the 3 8-bit registers or the single 24-bit shift register. Buffer 5 therefore acts as a double buffering mechanism for the generated dots, and has a structure as shown in FIG. 44. 10.2.3 Buffer 4117 Buffer 4117 holds the calculated CMY intermediate resolution (1280-res) contone image. Buffer 4 is generated by the Color Conversion process 66, and accessed by the Up-interpolate, Halftone and Reformat process 113 in order to generate output dots for the printer. The size of the Contone Buffer is dependent on the physical distance between the nozzles on the printhead. As dots for one color are being generated for one physical line, dots for a different color on a different line are being generated. The net effect is that 6 different physical lines are printed at the one time from the printer--odd and even dots from different output lines, and different lines per color. This concept is explained and the distances are defined in Section 2.1.1. The practical upshot is that there is a given distance in high-res dots from the even cyan dots through the magenta dots to the odd yellow dots. In order to minimize generation of RGB and hence CMY, the medium res contone pixels that generate those high-res dots are buffered in Buffer 4. Since the ratio of medium-res lines to high-res lines is 1:5, each medium res line is sampled 5 times in each dimension. For the purposes of buffer lines, we are only concerned with 1 dimension, so only consider 5 dot lines coming from a single pixel line. The distance between nozzles of different colors is 4-8 dots (depending on Memjet parameters). We therefore assume 8, which gives a separation distance of 16 dots, or 17 dots in inclusive distance. The worst case scenario is that the 17 dot lines includes the last dot line from a given pixel line. This implies 5 pixel lines, with dot lines generated as 1, 5, 5, 5, 1, and allows an increase of nozzle separation to 10. To ensure that the contone generation process writing to the buffer does not interfere with the dot generation process reading from the buffer, we add an extra medium-res line per color, for a total of 6 lines per color. The contone buffer is therefore 3 colors of 6 lines, each line containing 1280 8-bit contone values. The total memory required is 3.times.6.times.1280=23040 bytes (22.5 KBytes). The memory only requires a single 8-bit read per cycle, and a single 8-bit write every 25 cycles (each contone pixel is read 25 times). The structure of Buffer 4 is shown in FIG. 45. Buffer 4 can be implemented as single cycle double access (read and write) RAM running at the nominal speed of the printhead dot generation process, or can be implemented as RAM running 4% faster with only a single read or write access per cycle. Buffer 4 is set to white (all 0) before the start of the print process. 10.2.4 Upinterpolate, Halftone, and Reformat for Printer Although the Up-Interpolate, Halftone, and Reformat For Printer tasks 113 are defined as separate tasks by Section 3.2.8, Section 3.2.9 and Section 3.2.10 respectively, they are implemented as a single process in the hardware implementation of the PCP 13. The input to the Up-interpolate, Halftone and Reformat Unit (UHRU) 113 is the contone buffer (Buffer 4) 117 containing the pre-calculated CMY 1280-res (intermediate resolution) image. The output is a set of 24-bit values in the correct order to be sent to the Memjet Interface 15 for subsequent output to the printhead via Buffer 5118. The 24 output bits are generated 1 bit at a time, and sent to the 24-bit shift register in Buffer 5118. The control of this process occurs from the Advance and AdvanceLine signals from the MJI 15. When the UHRU 113 starts up, and after each AdvanceLine pulse, 24 bits are produced, and are clocked into the 24-bit shift register of Buffer 5 by a ShiftWriteEnable signal. After the 24th bit has been clocked in, a TransferWriteEnable pulse is given, and the next 24 bits are generated. After this, the UHRU 113 waits for the Advance pulse from the MJI. When the Advance pulse arrives, the TransferWriteEnable pulse is given to Buffer 5118, and the next 24 bits are calculated before waiting again. In practice, once the first Advance pulse is given, synchronization has occurred and future Advance pulses will occur every 24 cycles thereafter. The Upinterpolate, Halftone and Reformat process can be seen in FIG. 46. The Halftone task is undertaken by the simple 8-bit unsigned comparator 120. The two inputs to the comparator come from the Staggered Dither Cell 121 and Buffer 4117. The order that these values are presented to the Unsigned Comparator 120 is determined by the Address Generator State Machine 122, which ensures that the addresses into the 1280-res image match the segment-oriented order required for the printhead. The Address Generator State Machine 122 therefore undertakes the Up-Interpolation and Reformatting for Printer tasks. Rather than simply access an entire line at a time at high resolution, and then reformat the line according to the printer lookup requirements (as described in Section 3.2.10), the reformatting is achieved by the appropriate addressing of the contone buffer (Buffer 4) 117, and ensuring that the comparator 120 uses the correct lookup from the dither cell 121 to match the staggered addresses. The Halftoning task is the same as described by Section 3.2.9. However, since the dot outputs are generated in the correct order for the printhead, the size of the Dither Cell 121 is chosen so that it divides evenly into 800. Consequently a given position in the dither cell for one segment will be the same for the remaining 7 segments. A 50.times.50 dither cell provides a satisfactory result. As described in Section 3.2.9, the same position in the dither cell can be used for different colors due to the fact that different lines are being generated at the same time for each of the colors. The addressing for the dither cell is therefo |