Image processing apparatus

Abstract: An image processing apparatus for drawing the inside of an image area which is expressed by vector data has reversal & painting means for sequentially reversing write dots (data) along the storage direction in correspondence to one outline which is specified by vector data, for writing the reversed write dots into an image memory, and for painting the inside of an image area like a closed figure in the image memory. Thus, the area in a closed figure can be painted at a high speed by a simple construction. The optimum reversal & painting method can be selective­ ly switched in accordance with the attribute data of an image area to be painted, so that the optimum painting process can be executed at a high precision and at a high speed.

Description: BACKGROUND OF THE INVENTION Field of the Invention The present invention relates to an image processing apparatus for drawing the inside of an image area which is expressed on the basis of vector data. Related Background Art Hitherto, as an image processing system according to an internal drawing of an area, as shown in JP-A-60-132271 or the like, there has been proposed a typical method in the case of writing into a memory on the basis of the exclusive OR process of boundary line data and a predetermined painted pattern. As shown in JP-A-50-14230, there has been proposed a typical method in the case of painting a pixel into a memory corresponding to an interval between 1 and 1 of the dots on a scanning line which are obtained by scanning outline data. As shown in "COMPUTER GRAPHICS", The Society of Japan Computer, pages 466 to 472, July 15, 1984, there has been proposed a typical method in the case of painting a pixel into a memory on the basis of an outline table or the like which was formed. Figs. 15(a) to 15(e) are diagrams for explaining an example of a closed figure painting process. In Fig. 15(a), a closed figure 50 is constructed by four boundary lines 51 to 54. Reference numeral 55 denotes a painted pattern. Painting is executed by the exclusive OR processes of the painted pattern 55 and the boundary lines 51 to 54. The boundary lines 51 to 54 constructing the closed figure 50 are expressed by three or more vector data in which a start point 61 and an end point 62 are used as parameters. A painting range (in the area surrounded by alternate long and short dash line in the diagram) is specified on the basis of the parameters of the start point and end point of the vector data. According to the above system, the painted pattern is also written simultaneously with that of the boundary lines 51 to 54 which are sequentially directly written into a full dot memory (not shown). Fig. 15(b) shows a state in which only the boundary line 51 is written into the full dot memory and, at the same time, the painted pattern 55 was also written from the boundary line data. The boundary line 51 is drawn by generating dots one by one for the interval from the start point 61 to the end point 62. At this time, the painted pattern 55 of one raster in the lateral direction (direction of an x axis) is written in the specified painting range from the adjacent dot position on the right side every generation of one dot. At this time, the exclusive OR of the writing pattern and the data which has already been written in the memory is calculated and written into the full dot memory. Therefore, if the writing pattern is set to "1" and the data stored in the memory is set to "1", data "0" is written into the memory. When dots are generated for the interval from the start point 61 to the end point 62 of the boundary lines 51 to 54, the dot data is sequentially written into the closed figure 50 by the exclusive OR processes as shown in Figs. 15(b) to 15(e). Fig. 16 is a diagram for explaining the closed figure painting principle. Reference numeral 65 denotes a memory and this diagram corresponds to the state in which a closed figure 66 is stored. Reference numeral 77 denotes a scanning line. The data "0" between the crossing positions between the scanning line 77 and the closed figure 66, that is, the "0" signals for the intervals of 1 ○ - 2 ○ , 3 ○ - 4 ○ , and 5 ○ - 6 ○ in Fig. 16 are converted into the "1" signals and the painting process on one line is executed. The area in the closed figure 66 is painted out by sequentially executing the above painting processes in the scanning direction. However, the above conventional painting process has the following problems. In the painting process for converting the "0" signals between the "1" signals on the scanning line into the "1" signals, the processes and a hardware construction are simple. However, in the case where the scanning line and the vertexes of the outline cross, that is, if the number of crossing points with the outline is the odd number, painting is not correctly executed. Therefore, an exceptional process must be performed at such points and a processing time depending on a shape of figure is needed. On the other hand, in the case of executing the painting process by the exclusive OR process, since a logic arithmetic operating time per unit dot is long, in many cases, the whole processing speed becomes slow. In addition, it is troublesome to deal with the painted pattern. Further, in the painting process by the outline table, as the figure shape becomes complicated, the number of outline points also increases. However. if the number of outline points exceeds the set outline table capacity, a predetermined process to thin out the number of outline points is executed. Thus, there are problems such that an approximate figure shape different from the original figure shape is painted and the print quality is deteriorated and the like. Fig. 17 is a diagram for explaining the painting process by the outline table. Fig. 18 is an explanatory diagram showing a polygonal outline table which is defined by vectors shown in Fig. 17. As will be understood from the diagrams, in the case of painting a figure 80 surrounded by vectors e₁ to e₆, all of the vectors e₁ to e₆ are first set into the downward directions as shown in Fig. 17. Next, an outline table 81 as shown in, Fig. 18 is formed. After sorting by the y coordinate having a smaller vector for each y coordinate, the vectors starting from such a y coordinate are linked, thereby forming the outline table 81. Data of a vector to be linked includes: the maximum value of the y coordinate values of the vector; the minimum value of the x coordinate values and its change amount; a pointer of the next vector; and the like. For the outline table 81 formed as mentioned above, evaluation is sequentially executed in accordance with the order from the small y coordinate. The portion sandwiched by two vectors, for instance, the intervals on the scanning line shown in Fig. 17 (the interval from 2 to 4 and the interval from 7 to 13 as x coordinate values) are painted out. However, the above conventional painting process has the following problems. In the printing process to convert the "0" signals between the "1" signals on the scanning line into the "1" signals, the processes and a hardware construction are simple. However, it is necessary to use a memory to previously store the outline for its process, so that a memory of a large capacity is needed to paint a large closed figure. In addition, as a result of the necessity of such a memory, the costs of the hardware circuits fairly rise. Further, in the case where the scanning line and the vertexes of the outline cross, that is, if the number of crossing points with the outline is an odd number, an exceptional process must be executed at such points. On the other hand, in the case of executing the painting process by the exclusive OR process, since the process is simple, the processing speed is fast. However, since the exclusive OR is also calculated until the portion which does not need to be painted, although a problem hardly occurs in the case of a small figure, if a size of figure enlarges, the reversal area increases in proportion to the square, so that the processing time becomes extremely long. On the other hand, if a figure becomes complicated, the number of reversal times increases and the processing time becomes long. Further, in the painting process by the outline table, although a figure of a large size can be painted by using a memory of a relatively small capacity, it takes a long time for processing. Moreover, as the figure shape becomes complicated, the number of outline points, that is, the number of vectors constructing a polygon increases. If the number of outline points exceeds the set outline table capacity, a predetermined process to thin out the number of outline points is executed, so that there are problems such that an approximate figure shape different from the original figure shape is painted, the print quality is deteriorated, and the like. In consideration of the above problems, it is a concern of the present invention to provide an image processing apparatus having reversal and painting means for writing while sequentially reversing write dots in a pattern memory along a storage direction in correspondence to one outline which is specified by vector data and for painting the area in a closed figure. An article by B.D. Ackland et al. entitled "The Edge Flag Algorithm - A fill method for raster scan displays" and found in IEEE Transactions on Computers , vol. C-30, no. 12, January 1981, New York, US, pages 41-48, discloses a number of algorithms for use in contour filling in raster scan graphics. In accordance with one aspect of the present invention there is provided image processing apparatus as set out in claim 1. In accordance with a second aspect of the invention there is provided a method of image processing as set out in claim 10. In order that the present invention may be more readily understood embodiments thereof will now be described by way of example and with reference to the accompanying drawings, in which: Fig. 1 is a constructional block diagram for painting an image area by executing a reversal process; Fig. 2 is a diagram showing an image area to be painted; Fig. 3 is a diagram showing a state of the painting process; Fig. 4 is a diagram for explaining a paint blank phenomenon in the painting process. Fig. 5 is a diagram showing an example of a document apparatus for generating a vector font based on outline data. Fig. 6 is a diagram showing the relation between the vector font data which is stored into a vector font memory 21e and the output pattern; Fig. 7 is a flowchart for painting an image area by executing a reversal process based on vector font data 31; Fig. 8 is a diagram showing the case where the reversal process is executed until a certain storage line and a process to paint an image area is executed; Fig. 9 is a constructional block diagram for executing the process shown in Fig. 8; Fig. 10 is a diagram showing a reversal process using a storage line; Fig. 11 is a flowchart for a reversal process using a storage line; Fig. 12 is a block diagram for executing an example in the case of switching the painting process in accordance with the kind of image area; Fig. 13 is a block diagram of a document processing apparatus based on Fig. 12; Fig. 14 is a flowchart showing a painting process in accordance with the kind of image area; Fig. 15 is a diagram showing an example of a painting process of a closed figure; Fig. 16 is a diagram for explaining the principle of the painting process of a closed figure; Fig. 17 is a diagram for explaining a painting process by an outline table; and Fig. 18 is an explanatory diagram showing an outline table. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described in detail hereinbelow with reference to the drawings. [Reversal and Painting] Fig. 1 is a block diagram for explaining a construction of an image processing apparatus showing an embodiment of the invention. Reference numeral 1 denotes designation means for designating a closed figure to be painted by a code or designating a closed figure drawn on a display 5. Reference numeral 2 indicates an outline data memory. A plurality of outline data constructing a closed figure are previously stored as vector data into the memory 2. Or, vector data of a closed figure drawn on the display 5 is stored into the memory 2. In response to a code input from the designation means 1 or a figure instruction by a cursor or the like, the vector data of a closed figure to be painted is output to reversal & painting means 3. The reversal & painting means 3 sequentially reverses and writes write dots in the pattern memory 4 which face one outline which is specified by vector data along the storage direction and stores black dots into the closed figure in a pattern memory 4, thereby executing the painting process. The reversal & painting process denotes that each dot data A in the pattern memory 4 is reversed (1 → 0, 0 → 1) and rewritten into the pattern memory 4. A printer 6 prints dot data stored as a bit map in the pattern memory 4 as a dot image. The first reversal & painting process according to the invention will now be described with reference to Figs. 2 and 3. Fig. 2 is a diagram showing outlines of a figure to be painted. A closed figure 11 is constructed by outlines 11a to 11d. Vector data which specifies the outlines 11a to 11d is stored in the outline data memory 2. Fig. 3 is a diagram showing a state of the reversal & painting process by the reversal & painting means 3 shown in Fig. 1. (a) in Fig. 3 shows a state before writing and corresponds to the state in which the initialization (all "0") was executed by the reversal & painting means 3. (b) in Fig. 3 shows a reversal & painting processing state at the first time and corresponds to the state in which each dot was reversed and stored with respect to an x direction (writing direction) for the outline 11a. (c) in Fig. 3 shows a reversal & painting processing state at the second time and corresponds to the state in which each dot was reversed and stored with respect to the x direction (writing direction) for the outline 11b. (d) in Fig. 3 shows a reversal & painting processing state at the third time and corresponds to the state in which each dot was reversed and stored with respect to the x direction (writing direction) for the outline 11c. (e) in Fig. 3 shows a reversal & painting processing state at the fourth time and corresponds to the state in which each dot was reversed and stored with respect to the x direction (writing direction) for the outline 11d. Thus, a painted figure 12 is formed and stored. First, when an instruction for the closed figure 11 is given by the designation means 1 by a code or a pick, the vector data which specifies the outlines 11a to 11d is transmitted from the outline data memory 2 to the reversal & painting means 3. The reversal & painting means 3 initializes the pattern memory 4 as shown in (a) in Fig. 3 and executes the reversal & painting process for the outline 11a (refer to (b) in Fig. 3). Next, the reversal & painting process for the outline 11b is executed. However, since the dot data shown in (b) in Fig. 3 has already been written in the pattern memory 4, if the reversal & painting process is executed for the outline 11b, the dots on the side of the writing direction of the outline 11b are reversed to "0" as shown in (c) in Fig. 3. Next when the reversal & writing process for the outline 11c is executed, as shown in (d) in Fig. 3, the dots on the side of the writing direction of the outline 11c are reversed to "1". Further, when the reverse & writing process for the outline 11d is executed, as shown in (e) in Fig. 3, the dots on the writing direction side of the outline 11d are reversed from "1" to "0" or from "0" to "1". The painted figure 12 is stored into the pattern memory 4. When a display or print request for the painted figure 12 stored is generated by the designation means 1, the painted figure 12 is displayed by the display 5 (however, it is thinned out in accordance with the resolution and is displayed) or is output as a dot image by the printer 6. In the above reversal & painting process, there is a case where blank dots as shown in (a) to (c) in Fig. 4 are generated at each vertex or on the outline on the end side of the painting when the reversal & painting process is finished. Therefore, the painted figure 12 is written by shifting one dot in the painting scanning direction. (a) to (c) in Fig. 4 are diagrams for explaining a paint blank phenomenon in the painting process.  indicates a painted (black) dot and ○ represents a paint blank dot. As shown in (a) to (c) in Fig. 4, when the above reversing process is executed while tracing the outlines in the direction of an arrow, the outline on the end side of the painting is extinguished. Therefore to execute the painting process at a further high quality, it is necessary to draw the outline through OR after completion of the painting process. Or, upon tracing the end side, it is necessary to start the reversing process from the position which was shifted in the scanning direction by one dot. However, if such a painting process is executed, the vertex is not eventually painted. Therefore, it is necessary to paint from the original position with respect to the vertex. On the other hand, although the above embodiment has been described with respect to the case of executing the painting process for a simple figure to be painted, the above reversal & painting process can be also executed to the painting process of an outline font which is specified by vector data. Fig. 5 is a block diagram showing an example of a document apparatus for generating and outputting a vector font based on outline data. Reference numeral 21 denotes a controller having a CPU 21a such as a microcomputer or the like; an ROM 21b in which a control program for the CPU 21a, various data, and the like have been stored; an RAM 21c for temporarily storing various data as a work area of the CPU 21a; a vector font memory (outline data memory) 21e; an address table 21d; and the like. The vector font data (vector data indicative of outlines of characters) of characters or the like corresponding to character codes have been stored together with attribute data in the vector font memory (outline data memory) 21e. Addresses of the font data corresponding to codes of character patterns have been stored in the address table 21d. Reference numeral 22 denotes an image memory which is constructed by a bit map. After outline character data comprising vectors were converted into dots by a character generator 26, the dot image of the character is stored. Thereafter, the dot image is sent to a printer 25a through an interface 25b and printed. On the other hand, the character generator 26 has a bit map memory RAM 26a. The RAM 26a functions as a work memory when developing from vectors to dots. Reference numeral 24a denotes a keyboard and 24b indicates a pointing device which functions as a data input source of the document apparatus in cooperation with the keyboard 24a. A CRT 23 displayes the bit image stored in a video memory 27 at a high accuracy. For instance, the vector data are stored as dots and transferred to the video memory 27. The printer 25a prints the dot image received through the interface 25b. Reference numeral 28 indicates a bus. Fig. 6 is a diagram showing the corresponding relation between vector font data stored in the vector font memory (outline data memory) 21e shown in Fig. 5 and the print pattern. For instance, Fig. 6 shows the case where the character code indicates a character (which reads "ai" and means "love") of "3026" in the JIS-C = 6226 code system. Reference numeral 31 denotes vector font data and outline points ( · in the diagram) of the character are stored as coordinate data. Reference numeral 32 denotes a print output character corresponding to the character which was output by executing the foregoing painting process to the outline specified by the vector font data 31. A painting & outputting process based on the vector font data 31 will now be described with reference to Fig. 7. Fig. 7 is a flowchart for explaining an example of the painting & outputting processing procedure based on the vector font data 31 according to the invention. Reference numerals (1) to (9) show processing steps, respectively. First, in response to a command from the CPU 21a, the character generator 26 initializes the bit map memory RAM 26a (1) and waits until the document data of one page has completely been input (2). After completion of the initialization, the character code stored in the RAM 21c is analyzed (3). With reference to the address table 21d on the basis of the analyzed character code (4), a plurality of outline data are read out of the vector font memory 21e (5) and reversed and stored into the bit map memory RAM 26a and transferred to the image memory 22 (6). A check is then made to see if the reversing and storing processes have been completed for all of the outline data corresponding to all of the character codes or not (7). If NO, the processing routine is returned to step (3). If YES, the apparatus waits until a command to print the bit map data in the image memory 22 is input (8). If the print command has been input, the vector font data is transferred to the printer 25a and printed (9). Due to this, as compared with the painting process by the conventional exclusive OR process, the processing performance can be extremely improved. The vector font can be displayed in the bit map or can be printed and output as a dot image at a high speed. As shown in Fig. 8, when the character data of the outline font comprising vectors is stored as dots by the character generator 26, a middle point address is arithmetically operated from a head storage address and an end storage address in the storage direction in the bit map memory RAM 26a as a work memory. For the middle point address or an intermediate bit in the bit map area of, for instance, about 128 points which is set in the work memory, the painting process is executed in the direction of the middle point address or intermediate bit from the head storage address. The painting process is executed in the direction opposite to the direction of the middle point address or the intermediate bit from the end storage address. (Refer to Fig. 8) Due to this, the painting process to the surplus address can be limited. Therefore, the painting process can be completed at a further higher speed than that in the above embodiment. The printing speed and display speed can be fairly improved. As described above, the invention comprises: a pattern memory to store a dot pattern; a vector data memory for storing vector data corresponding to a plurality of outlines which construct a closed figure on a figure unit basis; and reversal & painting means for writing while sequentially reversing write dots in a pattern memory which faces one outline which is specified by the vector data read out of the vector data memory along the storage direction and for painting the area in the closed figure. Therefore, as compared with the conventional closed figure painting processes, the painting process can be executed at a high speed by a fairly simple circuit. Thus, the process to paint a closed geometrical figure or the area in the vector font which is specified by a plurality of outlines can be executed at an extremely high speed. [Reversing process + storage line + painting process] Fig. 9 shows a constructional block diagram for executing the process shown in Fig. 8 mentioned above. Fig. 9 is a block diagram for explaining a construction of an image processing apparatus showing an embodiment of the invention, in which the similar parts and components as those shown in Fig. 1 are designated by the same reference numerals. Reference numeral 1 denotes the designation means for designating a closed figure to be painted by a code or for designating a closed figure drawn by the display 5. Reference numeral 2 indicates the outline data memory. A plurality of outline data constructing a closed figure are stored as vector data in the memory 2. Or, the vector data of a closed figure drawn by the display 5 is stored in the memory 2. The vector data of a closed figure to be painted is output to the reversal & painting means 3 by a code input from the designation means 1 or by an instruction of a figure by a cursor or the like. The reversal & painting means 3 sequentially reverses write dots in the pattern memory 4 which faces one outline which is specified by the vector data along the storage direction and writes the reversed dots through storage control means 8 and stores the black dots into the area in the closed figure in the pattern memory 4, thereby executing the painting process. Deriving means 7 is used to obtain a storage axis to determine the reversing direction from the outline data in the outline data memory 2. The coordinate data of the storage axis (reference storage line data) is transferred to the storage control means 8. The storage control means 8 stores from both directions the reversed write dot data of each line which is output from the reversal & painting means 3 so as to face the storage axis which is presumed by the reference storage line data derived. Then, the storage control means 8 stores the black dots into the closed figure in the pattern memory 4, thereby executing the printing process. The reversal & painting process denotes that each dot data A in the pattern memory 4 is reversed (1 → 0, 0 → 1) and rewrites the reversed dot data into the pattern memory 4. The printer 6 prints the dot data stored in a bit map in the pattern memory 4 as a dot image. Practically speaking, W(width) and H(height) of a storage area based on a size of figure to be painted are set into the bit map memory RAM 26a as a storage work memory in the character generator 26. For instance, in the case where a character pattern having the frame of 128 x 128 dots is formed from the vector font data, W = 128 and H = 128. At this time, the deriving means 7 is used to calculate a position MID (refer to Fig. 10) of W/2 for instance, 128/2) from the width of each scanning line. In the actual reversing process, when the reversal & painting means 3 executes the reversing process while tracing the outline, if the outline points are located on the left side than the position MID, the reversing direction is determined to the right direction, and if the outline points are located on the right side than the position MID, the reversing direction is decided to the left direction by the storage control means 8. The reversal & painting means 3 executes the reversing process until the position MID. Assuming that the process which is executed in the right direction is called a first reversing process, it is similar to that shown in Fig. 3 and its description is omitted. Another embodiment of the invention will be further described hereinbelow with reference to (a) to (f) in Fig. 10 and Fig. 11. (a) in Fig. 10 is a diagram for explaining an example of a closed figure to be reversed and painted. Reference numeral 81 denotes a closed figure which is constructed by outlines 81a to 81d. (b) to (f) in Fig. 10 are diagrams for explaining the second reversal & painting processing state according to the invention. (b) in Fig. 10 shows a state before writing and corresponds to the state in which the initialization was executed and all "0" was set. On the other hand, at this time point, the position MID (middle line in the embodiment) of the storage area is derived by the deriving means 7. (c) in Fig. 10 shows a reversal & painting state at the first time and corresponds to the state in which the data was reversed and stored until the position MID from the right direction of x with respect to the outline 81a. (d) in Fig. 10 shows a reversal & painting state at the second time and corresponds to the state in which the data was reversed and stored with respect to the outline 81b. In this case, since the outline 81b rides over the position MID (the outline 81b crosses on both sides of the position MID), the reversing direction is changed to the left direction of x from this time point. (e) in Fig. 10 shows a reversal & painting state at the third time and corresponds to the state in which the data was reversed and stored with respect to the outline 81c. (f) in Fig. 10 shows a reversal & painting state at the fourth time and corresponds to the state in which the data was reversed and stored with respect to the outline 81d. Fig. 11 is a flowchart for explaining an example of the second reversal & painting processing procedure according to the invention. Reference numerals (1) to (10) denote processing steps, respectively. First, the apparatus waits until the reversal & painting means 3 receives the character size and outline data (1). If the reversal & painting means 3 has received them, the width and height of a storage area are set into the bit map memory RAM 26a (2) and the inside of the storage area is all set to "0" (3). Next, the position MID is derived by the deriving means 7 (4) and informed to the storage control means 8. Then, the storage control means 8 discriminates whether an objective outline is located on the right side than the position MID or not (5). If YES, the processing routine advances to step (8) and subsequent steps. If NO, the reversal & painting means 3 starts the reversal & painting process for one outline to be painted in the x direction and the right direction (6). The apparatus waits until the reversal & painting process is executed until the position MID (7). If the reversal & painting process has been completely executed until the position MID, the reversal & painting means 3 starts the reversal & painting process for one objective outline in the x direction and left direction (8). The apparatus waits until the reversal & painting process is executed until the position MID and to the first dot (9). If the reversal & painting process has completely been performed until the position MID and to the first dot, a check is made to see if the reversal & painting process has been completed for all of the outlines or not (10). If YES, the processing routine is finished. If NO, the processing routine is returned to step (6) and the reversal & painting process of the closed figure is continued. As compared with the reversal & painting method (the first reversing process) shown in Fig. 3, even in the same reversing method, by setting the position MID and reversing the area from the outline point to the position MID (in this case, the middle point), the number of reversing times is extremely reduced and the processing speed can be remarkable improved. Therefore the painting process can be completed at a further higher speed than the case of the embodiment shown in Figs. 2 and 3. The printing speed and display speed can be extremely improved. However, if the data is reversed twice on the middle line, that is, on the virtual axis, the portion on the axis is blanked. Therefore, the reversing process on the virtual axis is executed only in the case of scanning from the left side. The position of the middle line is not limited to the 1/2 position but can be set at any position in the bit map memory RAM 26a. For instance, if the minimum and maximum values in the x direction of the painting data of the vector data are obtained and the line which passes through the points between the minimum and maximum values and is parallel with the y axis is set to the middle line (position MID), a possibility in which the area out of the painting area is reversed can be reduced, so that the processing speed can be generally raised. As described above, the present invention comprises: a pattern memory to store a dot pattern; reversal & painting means for sequentially reversing dots in the pattern memory on the basis of vector data corresponding to outlines which construct a closed figure, for writing the reversed dots, and for painting the area in the closed figure; deriving means for deriving reference storage line data in the pattern memory; and storage control means for storing from both directions the reversed write dot data of each line which is output from the reversal & painting means so as to face a storage axis which is presumed by the reference storage line data derived by the deriving means. Therefore, as compared with the conventional closed figure painting process, painting can be executed at a high speed by an extremely simple circuit. On the other hand, since the area into which the reversed write dot data is stored can be limited into the closed figure range, the vain reversal & writing process can be omitted. Therefore, the painting process of a closed geometrical figure or the area in the vector font which is specified by a plurality of outlines can be executed at an extremely high speed and the painting process of the inside area can be completed in a short time. [Example in which the reversing process is switched in accordance with the kind of image area] Fig. 12 is a block diagram for explaining a construction of an image processing apparatus showing an embodiment of the invention. Reference numeral 101 denotes a designation means for inputting a code of a figure to be painted to a standard figure (closed polygonal figure) memory 102. To construct the closed polygonal figure, outline data and its attribute data (for instance, the number of outline points and the like) have been stored in the standard figure (closed polygonal figure) memory 102. Reference numeral 103 denotes a discrimination means for extracting the attribute data of the closed polygonal figure selected from the standard figure memory 102 and outputting painting processing means selection data to selection means 105. Reference numeral 104 denotes a painting processing section comprising first painting means 104a, second painting means 104b, and third painting means 104c. In a work memory 104d, the first painting means 104a calculates the exclusive OR of a painting pattern which has previously been stored and the outline data, thereby executing the painting process. Then, the first painting means 104a outputs the painted figure data to the selection means 105. The work memory 104d to store the dot image of at least one character exists in the painting processing section 104. The work memory 104d is divided and used as necessary for storage of the dot image of one character which was painted and formed by the first to third painting means 104a to 104c, an outline table, storage of a painting pattern, and the like. The selection means 105 transfers the transmitted dot image or outline table to storage means 106 or a pattern memory 107, which will be explained hereinlater. The second painting means 104b stores the outline data which was read out of the standard figure memory 102 as a bit map into the work memory 104d. Further, the second painting means 104b converts the "0" bits between the "1" bit and the "1" bit which were detected by line processing the readout outline data into the "1" bits and executes the painting process and outputs the painted figure data to the selection means 105. The third painting means 104c makes an outline table in the work memory 104d on the basis of the outline data which was read out of the standard figure memory 102 and outputs the painting data corresponding to the outline table to the selection means 105. Reference numeral 106 denotes the storage means. The selection means 105 selects either one of the painted figure data which are output from the first to third painting means 104a to 104c on the basis of the painting means selection data which is output from the discrimination means 103 and outputs the selected painted figure data to the storage means 106. The storage means 106 stores the output painting figure data into the pattern memory 107 as a bit map in accordance with the painting system. Reference numeral 108 denotes a display for displaying the figure pattern stored in the pattern memory 107 to a bit map. A printer 109 prints the figure pattern which was stored as a bit map in the pattern memory 107 onto a recording medium as a dot image. The operation will now be described. When the painting process of a closed figure is executed and the code of the figure stored in the standard figure memory 102 is input from the designation means 101, the discrimination means 103 discriminates the attribute of the closed figure. On the basis of the result of the discrimination, the selection means 105 selects either one of the outputs of the first to third painting means 104a to 104c. The selecting conditions include the degree of difficulty of the shape of the outline data, size (figure area), the number of pointed vertexes, and the like. In general, when the figure area is sufficiently large, the third painting means 104c is selected. When the figure area is relatively small or the number of pointed vertexes is large (in the case where the number of outline points which cross the scanning line is a large odd number), the first painting means 104a is selected. When the figure area size is medium or when the degree of difficulty of the shape of the outline data is high, the second painting means 104b is selected. The closed figure pattern which is output from the selected painting means is stored as a dot pattern into the pattern memory 107 by the storage means 106. The stored dot pattern is displayed as a bit map on the display 108 or printed as a dot image by the printer 109. On the other hand, as selecting conditions, in the case of the vector font (the outline of a character is defined by vectors), if the radical of the vector font is complicated like the second standard of the JIS code, the first painting lines 104a is selected. If the vector font is simple like a symbol or parentheses, the second painting means 104b is selected. Further, if a change request to enlarge the character size is generated, the third painting means 104c is preferentially selected. Fig. 13 is a block diagram showing an example of a document apparatus for generating the vector font based on the outline data in a manner similar to Fig. 5. Reference numeral 21 denotes the controller comprising: the CPU 21a such as a microcomputer or the like; the ROM 21b in which a control program (a flowchart of Fig. 14 or the like which will be explained hereinlater) for the CPU 21a, various data, and the like have been stored; the RAM 21c to temporarily store various data as a work area of the CPU 21a; the font memory (outline data memory) 21e; and the like. The font data of characters and the like corresponding to the character codes and vector fonts (vector data indicative of the outlines of characters) have been stored in the font memory 21e together with the attribute data. A work area (work memory 104d in Fig. 12) to store the dot image of one character of the 128 point size is always provided in the RAM 21c. A desired character is generated to the work memory 104d by the first to third painting means 104a to 104c. Reference numeral 22 denotes the image memory which is constructed as a bit map. A dot image of a character is stored into the image memory 22. The CRT 23 displays the bit image stored in the video memory 27 at a high accuracy. The printer 25a prints the dot image received through the interface 25b. The keyboard 24a and pointing device 24b construct the designation means of the document processing apparatus and functions as a data input source. The process to switch and select the painting means according to the invention will now be described with reference to Fig. 14. Fig. 14 is a flowchart for explaining an example of a processing procedure to switch and select the painting means from the character size data by applying the invention. Reference numerals (1) to (20) show processing steps, respectively. First, the apparatus waits until a character code is input from the keyboard 24a, an external memory (not shown), or a host unit shown) (1). If the character code has been input, an outline data memory 21f is accessed (2) and the attribute data and outline data are output to the discrimination means 103 and painting processing section 104 (3). Next, a check is made to see if the attribute data has been received or not (4). If YES, the analysis of the attribute data is started (5). A check is made to see if the character size is equal to or smaller than, for instance, the 64 point size or not (6). If NO, a check is made to see if the character size is equal to or smaller than, for instance the 128 point size or not (7). If NO, this means that the character size is larger than the 128 point size, so that the third painting means 104c is selected and an outline table is formed in the work memory 104d (9). Then, the data is stored into the pattern memory 107 in accordance with the outline table (10). The vector font data formed is then displayed as a bit map by the CRT 23 (11). A check is then made to see if a print command has been input or not (12). If YES, the printing process is executed (13) and the processing routine is finished. On the other hand, if YES in step (7), this means that the character size is larger than the 64 point size and is equal to or smaller than the 128 point size. Therefore, the second painting means 104b is selected (14) and dots of the outline are stored into the work memory 104d (15). The "0" bits between the "1" bit and the "1" bit of the line output among the bits of the outline are reversed to the "1" bits (16) and stored into the pattern memory 107. Then, the processing routine is returned to step (11). On the other hand, if YES in step (6), since the character size is the small size, the first painting means 104a is selected (17). The outline data of one character is loaded into the work memory No. 1 (18). The painting pattern is stored into the work memory No.2 in the RAM 21c (19). Then, the exclusive OR (EXOR) of the pattern in the work memory No. 2 and the data in the work memory No. 3 is calculated while tracing the outline by using the data in the work memory No. 1 and stored into the work memory No. 3 in the RAM 21c (20). The resultant data is stored into the image memory 22 as the pattern memory 107 or into the video memory 27. The processing routine is returned to step (11). Thus, the optimum painting means painting means corresponding to the object to be painted and the attribute of the closed figure (including the vector font) can be selected. The painting process which is difficult to be executed by only single painting means can be always executed by the optimum painting system. Although the embodiment has been described with respect to an example in the case of the processes of the apparatus for processing a character comprising vector fonts, if a closed figure is defined as vector data, the invention can be also applied to even a character or a pure polygonal figure. As described above, the invention comprises: a plurality of painting means for executing the painting process of the area in a closed figure on the basis of the outline data of the closed figure; a pattern memory to store either one of closed figure patterns which are painted by the plurality of painting means; discrimination means for discriminating the figure attribute of the closed figure; selection means for selecting either one of the painting means on the basis of the figure attribute data discriminated by the discrimination means; and storage means for storing into the pattern memory the closed figure pattern which is output from the painting means selected by the selection means. Therefore, the optimum painting process based on the figure attribute can be selected and a figure pattern which is difficult to be processed by the single painting means can be also painted and output at a high speed. As described in detail above, according to the invention, it is possible to provide an image processing apparatus having reversal & painting means for sequentially reversing write dots in a pattern memory along a storage direction in correspondence to one outline which is specified by vector data, for writing the reversed write dots, and for painting the area in a closed figure. According to the invention, it is possible to provide an image processing apparatus in which by sequentially reversing write dots (data) in a pattern memory until a predetermined storage line in correspondence to one outline which is specified by vector data, the area in a closed figure can be painted at a high speed by a simple construction. According to the invention, it is possible to provide an image processing apparatus in which the attribute of an image to be painted is discriminated, and a method of a painting process can be selectively switched.

Claims: An image processing apparatus comprising: memory means (2) for storing image data in vector form; figure generating means (3) for generating a painted figure by reversing dots within an area defined by an outline of dots generated from the vector data stored in said memory means; and characterised by outline generating means (3) for generating the outline defining the painted figure from the vector form data stored in said memory means; and means (3) for combining the painted figure generated by said figure generating means with the outline generated by said outline generating means utilising an OR-operation. Apparatus according to claim 1, further comprising image memory means (4) for storing an image formed by said combination, and output means (5, 6) for outputting the image stored in said image memory means. Apparatus according to either claim 1 or claim 2, wherein said output means comprises a printer (6). Apparatus according to either claim 1 or claim 2, wherein said output means comprises a display (5). Apparatus according to any one of the preceding claims, wherein the figure includes an outline font. Apparatus according to any one of the preceding claims, wherein said figure generating means reverses the dots in two directions from the figure outline toward a middle line of the figure. Apparatus according to claim 6, wherein the middle line is determined based on the shape of the figure. Apparatus according to any one of the preceding claims, wherein said figure generating means comprises a plurality of processing means (104) and said apparatus further comprises selection means (105) for selecting either one of the plurality of processing means in accordance with a selection condition. Apparatus according to claim 8, wherein the selection condition is determined with respect to the degree of difficulty of the shape of the outline, the size of the figure, the number of pointed vertexes or combination of these features. A method of image processing using a memory which stores image data in vector form, said method comprising: storing (2) image data in vector form; generating (3) a painted figure by reversing dots within an area defined by an outline of dots generated from the vector form data stored in said memory means; and characterised by generating (3) the outline defining the painted figure from the vector form data stored in said memory means; and combining (3) the painted figure generated by said figure generating means with the outline generated by said outline generating means utilising an OR-operation. A method according to claim 10, further comprising storing an image formed by said combination, and outputting the image stored in said image memory means. A method according to either claim 10 or claim 11, wherein said output step comprises printing said image. A method according to either claim 10 or claim 11, wherein said output step comprises displaying said image. A method according to any one of claims 10 to 13, wherein the figure includes an outline font. A method according to any one of claims 10 to 14, wherein the step of generating the figure reverses the dots in two directions from the figure outline toward a middle line of the figure. A method according to claim 15, wherein the location of middle line is determined in accordance with the shape of the figure. A method according to any one of claims 10 to 16, wherein said figure is generated by a plurality of processing means (104), one of the plurality of processing means being selected in accordance with a selection condition. A method according to claim 17, wherein the selection condition is determined with respect to the degree of difficulty of the shape of the outline, the size of the figure, the number of pointed vertexes or combination of these features.

Inventors: HAMADA MASAKI, KATO TAKAHIRO, SETO KUNIO, SHIRASAKA AKIFUMI, TAKAKURA HIROSHI, HAMADA, MASAKI, KATO, TAKAHIRO, SETO, KUNIO, SHIRASAKA, AKIFUMI, TAKAKURA, HIROSHI
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1989
Main classification: G06T11
IPC codes: G06T11