Painting-out pattern reference system

Abstract: A painting-out pattern reference system comprises a graphic data memory for storing a drawn graphic data to be displayed on a display screen, in the form of a bit image, the graphic data memory having a horizontal size of 2 n × m words (where "n" and "m" are natural numbers); a pattern data memory storing a unitary painting-out pattern in the form of a bit image for defining the unitary painting-out pattern, the pattern data memory having a horizontal size of 2 n words; a drawing address memory storing a memory address for performing a painting-out drawing, the drawing address memory supplying the stored memory address to the graphic data memory; a pattern address memory storing a pattern head memory address of any line in the pattern data memory; and a pattern data selector receiving a lower place n bits of an address output of the drawing address memory and the pattern head memory address from the pattern address memory for generating an address to the pattern data memory so as to cause at least one word of pattern to be selected among 2 n words of pattern stored in the pattern data memory so that the selected one word of pattern is supplied to the graphic data memory.

Description: Background of the Invention Field of the invention The present invention relates to a painting-out system for graphic systems, and more specifically to a painting-out pattern reference system for painting an inside area surrounded by a contour of a graphic pattern stored in a memory and to be indicated on a screen of a display, by repeating a pattern defined in another area. Description of related art Hitherto, an inside of a graphic pattern stored in a memory and to be indicated on a screen of a display system has been painted out not only by a mono-color but also be using a pattern defined in another area. For the latter purpose, conventional systems have been such that a painting-out pattern is defined in a memory in the form of a pattern having a width of one word and a height of any length. Ordinarily, one word is composed of 8 bits, 16 bits or 32 bits, so as to correspond to a bus structure being used in a hardware. In addition, the painting-out pattern is developed in the overall memory, as painting-out tiles being laid over an overall area defined in the memory by matching a boundary of words with each other. In the case of painting-out an inside of a given graphic pattern drawn in a memory, the painting-out pattern is drawn in only the inside of the graphic pattern. From EP-A-174809 a graphics display system providing rapid filling of predetermined areas of the display screen is known. In this system a predefined pattern is loaded into the undisplayed portion of the frame buffer memory. A display control unit fills the predetermined areas of the image to be displayed with the patterns loaded into the frame buffer memory by copying sections of the scan lines of the replicated pattern up into the displayed section of the frame buffer. For example, assuming a pattern shown in Figure 1A, this pattern is developed in a memory as an imaginary pattern shown in Figure 1B. If an inside of a rectangle ABCD shown in Figure 1C is painted out by the pattern shown in Figure 1A, the pattern shown in Figure 1A is drawn within only the inside of the rectangle ABCD. Here, the imaginary pattern shown in Figure 1B is not actually stored over the whole of the memory. When the painting-out processing shown in Figure 1C is performed, the painting-out processing is realized by controlling an address referring to the pattern shown in Figure 1A, as if the pattern shown in Figure 1A is repeated to extend over the whole of the memory. Now, considering the case of painting out the inside of the rectangle ABCD, the painting-out processing is executed for the rectangle ABCD from an uppermost side AD, line by line. When an uppermost line is painted, an address of the pattern shown in Figure 1A corresponding to the uppermost line is previously calculated. For this calculation, various methods have been known. However, it has been the most ordinary method to perform the calculation on the basis of a Y-coordinate of an apex A of the rectangle. For example, assuming that the Y-coordinate of the apex A of the rectangle is Ya, the address PAD of the pattern firstly referred to can be expressed as follows: PAD = PTNP + {PTNC - (Ya mod PTNC)} where PTNP is a starting address for defining the pattern; PTNC is the number of the patterns defined in the vertical direction; and "mod" indicates a reminder when Ya is divided by PTNC; and therefore, (Ya mod PTNC) indicates the number of words from PAD to the lowermost line of the pattern and will be called "PC" hereinafter. For the purpose of painting out the uppermost line of the rectangle ABCD, the pattern of the address PAD is read out and repeated to paint out the uppermost line. When the painting-out processing is moved to a next line just below the uppermost line, a following calculation is performed for a reference address PAD of the pattern: PAD = PAD + 1 The painting-out processing is performed by reading a pattern on the address thus obtained. At this time, however, the following calculation is simultaneously performed: PC = PC - 1 As a result, if PC becomes negative, the following processing is performed: PAD = PTNP PC = PTNC Thereafter, the pattern at the address PAD is read out and the painting-out processing is performed. Thus, continuity of the pattern in a vertical direction is ensured. Accordingly, if the above mentioned processing is downwardly repeated line by line, the inside of the rectangle ABCD is painted out with the pattern shown in Figure 1A. As seen from the above, the conventional system has been such that it is allowed to define only the width or horizontal length of the pattern. Therefore, when the painting-out processing is performed in a horizontal direction, it is sufficient if the same pattern is repeatedly used without necessity of controlling the reference address of the pattern. In other words, it is sufficient if the reference address is controlled only when the vertical painting-out processing is performed. However, a high degree of display has been recently desired, and in this case, the one word width of the painting-out unitary pattern is no longer sufficient. In addition, the resolution of the display has been increased, and therefore, the width of one word has already become very minute size on the display screen. Accordingly, in order to comply with various painting-out pattern, it has become necessary to define a wider pattern. As one means for extending or spreading the width of the pattern, it is considered to elongate the bit length of one word. However, this method requires modification of a hardware including expansion of the bus width, and therefore, an increased amount of hardware is needed. In addition, in order to realize a variable bit length of word, a very complicated hardware becomes necessary. As another means for extending or spreading the width of the pattern, it is considered to define a painting-out unitary pattern over a few words and to control the repetition of the unitary pattern when the painting-out processing is executed. In this method, however, in order to freely define the width of the unitary pattern, a pattern reference address control is required not only in the vertical direction but also in a horizontal direction. For simultaneously realizing this pattern referring address controls in both the directions, a very complicated software is required. In addition, for this control, not only a comparison processing for the uppermost limit and the lowermost limit but also a comparison processing the rightmost limit and the leftmost limit are required. In the conventional system which does not require the control of the repetition of the unitary pattern in the horizontal direction, it is sufficient if the comparison in the vertical direction is performed at every time one line has been painted out. On the other hand, in order to control the repetition of the unitary pattern in the horizontal direction, the comparison processing must be performed at each time one word in a horizontal direction is painted out. As a result, the processing speed remarkably decreases. Summary of the Invention Accordingly, it is an object of the present invention to provide a painting-out pattern reference system which has overcome the above mentioned defect of the conventional one. Another object of the present invention is to provide a painting-out pattern reference system which can set the width of a unitary pattern with some extent of freedom with a simple control but without requiring modification of hardware such as extension of a bus width. The above and other objects of the present invention are achieved in accordance with the present invention by a painting-out pattern reference system comprising a graphic data memory for storing a drawn graphic data to be displayed on a display screen, in the form of a bit image, the graphic data memory having a horizontal size of 2 n × m words (where "n" and "m" are natural numbers); a pattern data memory storing a unitary painting-out pattern in the form of a bit image for defining the unitary painting-out pattern, the pattern data memory having a horizontal size of 2 n words; a drawing address memory storing a memory address for performing a painting-out drawing, the drawing address memory supplying the stored memory address to the graphic data memory; a pattern address memory storing a pattern head memory address of any line in the pattern data memory; and a pattern data selector receiving a lower place n bits of an address output of the drawing address memory and the pattern head memory address from the pattern address memory for generating an address to the pattern data memory so as to cause at least one word of pattern to be selected among 2 n words of pattern stored in the pattern data memory so that the selected one word of pattern is supplied to the graphic data memory. The above and other objects, features and advantages of the present invention will be apparent from the following description of preferred embodiments of the invention with reference to the accompanying drawings. Brief Description of the Drawings Figures 1A, 1B and 1C illustrate the principle of a conventional painting-out method; Figure 2 is a block diagram of an embodiment of the painting-out pattern reference system in accordance with the present invention; Figure 3 is a block diagram of one example of the pattern data selector used in the system in Figure 2; Figure 4 is a block diagram of another example of the pattern data selector used in the system shown in Figure 2; and Figure 5A and 5B illustrate the processing performed in the painting-out pattern reference system in accordance with the present invention. Description of the Preferred embodiments Referring to Figure 2, there is shown a block diagram of an embodiment of the painting-out pattern reference system in accordance with the present invention. The shown system includes a drawing address memory 10 coupled to a bus 100 so as to receive an address signal. The drawing address memory 10 is coupled through a bus 102 to a graphic data memory 12 so as to supply a drawing address to the graphic data memory 12. In addition, the drawing address memory 10 is coupled through a bus 104 to a pattern data selector 14 to supply a pattern selection signal to the pattern data selector 14. The shown system also includes a pattern address memory 16 coupled to the bus 100 so as to receive the address signal. The pattern address memory 16 is also coupled through a bus 106 to the pattern data selector 14 to supply a pattern head address signal to the pattern data selector 14. The pattern data selector 14 is coupled through a bus 108 to the graphic data memory 12 so as to supply a drawing pattern data to the graphic data memory 12. In addition, the pattern selector 14 is coupled through a bus 110 to a pattern data memory 18 so as to supply a pattern address signal to the pattern data memory 18, and also coupled through a bus 112 to the pattern data memory 18 so as to receive a pattern data signal from the pattern data memory 18. The graphic data memory 12 is provided to store a graphic data to be displayed on the display screen, and has a memory size having a horizontal width (length of one line) of 2 n × m words (where "n" and "m" are natural numbers). Accordingly, if the address of the memory is looked from a column direction, a lower place n bits of each column are consistent with each other. The pattern data memory 18 is provided to store a unitary pattern data, and has a size having a horizontal width (length of one line) of 2 n words where "n" is equal to "n" defined in connection with the graphic data memory 12. Accordingly, lower place n bits of a head address of each row is all zero. The drawing address memory 10 stores a drawing address when a painting-out drawing is actually performed for the graphic data memory 12, and outputs the drawing address 102 to the graphic data memory 12. In addition, the drawing address memory 10 outputs lower place n bits of the drawing address as the pattern selection signal 104 to the pattern data selector 14. The pattern address memory 16 stores a head address of a specific one line stored in the pattern data memory 18 referred to when the painting-out is performed for the graphic data memory 12 (namely one of the addresses having the lower place n bits of all zero, as mentioned above). The pattern address memory 16 outputs the stored address as the pattern head address 106 to the pattern data selector 14. Turning to Figure 3, there is shown a block diagram of one example of the pattern data selector 14 used in the system shown in Figure 2. The shown pattern data selector 14 includes an address adder 20 coupled to receive the pattern selection signal 104 from the drawing address memory 10 and the pattern head address signal 106 from the pattern address memory 16. The address adder 20 outputs the result of addition as the pattern address 110 to the pattern data memory 18. In addition, the bus 112 is directly coupled to the bus 108 so that the pattern data from the pattern data memory is outputted as the drawing pattern data to the graphic data memory 12. Figures 5A and 5B illustrate a processing executed in the shown system. Specifically, Figure 5A shows a pattern storing example in the pattern data memory 18, and Figure 5B indicates the result of the painting-out processing performed within a rectangle on the graphic data memory 12. Now, an operation of the first embodiment will be explained with reference to the drawings. Assume that, by referring to a unitary pattern defined to have a horizontal length (width) of "2 n " words and a vertical length (height) of "4" as shown in Figure 5A, an inside of a rectangle drawn in the graphic data memory 12 as shown in Figure 5B is painted out. For explanation, respective words of the unitary pattern are assigned the address numbers (0, 0), ....., and (3, 3) in the order of address. Firstly, a drawing start address for the graphic data memory 12 is supplied through the address signal bus 100 to the drawing address memory 10, and an address PAD of a leftmost end of one line including the data where the reference to the pattern stored in the patter data memory 18 is started, is set to the pattern address memory 16. This processing can be executed, similarly to the conventional method, on the basis of the Y-coordinate of the drawing starting point, and therefore, a detailed description thereof will be omitted. For example, as shown in Figure 5A, if PAD = 0100 B (the suffix "B" indicates a binary notation hereinafter), and if a upper left apex A of the rectangle to be painted out stored in the graphic data memory 12 has a lower place 2 bits of "01 B ", "0100 B " is firstly set to the pattern address memory 16 and "XXXX01 B " is set to the graphic address memory 10 as the address of the apex A. As a result, the lower place 2 bits "01 B " of the drawing address memory 10 are outputted as the pattern selection signal 104, so that the adder 20 of the pattern data selector 14 adds this data "01 B " and "0100 B " which is outputted as the pattern head address signal 106, and outputs "0101 B " as the pattern address signal 110. As a result, the address "0101 B " is outputted to the pattern data memory 18, so that data at that address (the data of the number (1, 1)) is read out from the pattern data memory 18, and written to the address "XXXX01 B " of the graphic data memory 12. Thereafter, if the painting-out processing is advanced rightward from the point A, a similar processing is repeated while incrementing the value of the drawing address memory 10 by +1. Accordingly, only the lower place 2 bits of the pattern address are cyclicly changed in such a manner of "01 B ", "10 B ", "11 B " "00 B ", "01 B ", ..... . Therefore, the reference data changes in the order of (1, 2), (1, 3), (1, 0), (1, 1), (1, 2), (1, 3), ..... . In this processing, since the higher place of the address pattern will not change, the content of the pattern address memory 16 is never allowed to change until the precessing for one line has been completed. After the precessing for one line has been completed, when the operation is moved to the processing for a next line, the content of the pattern address memory 16 is incremented by +2 n , so that the reference point of the pattern is shifted to the next line. At this time, similarly to the conventional method, there is discriminated whether or not the content of the pattern address memory 16 reaches the lower limit of the defined unitary pattern, and if it reaches the lower limit, the content of the pattern address memory is changed to the upper limit of the defined unitary pattern. Thus, the repetition control of the unitary pattern in the vertical direction is achieved. As seen from the above explanation, by giving some degree of limitation to the horizontal length (width) of each of the graphic data memory and the pattern data memory, an automatic pattern repetition control in the horizontal direction can be realized only by using, as the painting-out pattern reference address, the address obtained by adding the lower place 2 bits for the graphic data memory 12 to the address for the pattern data memory 18. Next, a second embodiment will be explained. This second embodiment has the same basic construction as that shown in Figure 2, but uses the pattern data selector shown in Figure 4. The shown pattern data selector includes a pattern data buffer register 30, an address incrementer 32, a data selector 34, an address memory 36 and a buffer address memory 38, as shown. Assuming that an address stored in the address memory 36 is PAD, the address incrementer 32 operates to increment the address stored in the address memory from PAD to (PAD + 2 n - 1). At the same time, the address incrementer 32 also operates to increment the content of the buffer address memory 38. The address memory 36 is connected to the pattern address memory 16 so as to firstly store the address stored in the patter address memory 16. However, the address memory 36 stores the address sequentially incremented by the address incrementer 32, and outputs the incremented address as the pattern address signal 110 to the pattern data memory 18. The buffer address memory 38 is composed of a n-bit register and initialized to zero. The content of the buffer address memory 38 is incremented from zero to (2 n - 1) by the address incrementer 32. Since the address buffer memory 36 has only the capacity of n bits, when the content of the memory 38 exceeds (2 n - 1), the content returns to zero, again. An output of the buffer address memory 38 is supplied to the pattern data selection signal 104. The pattern data buffer register 30 is composed of 2 n registers so as to store 2 n items of pattern data outputted from the pattern data memory 18 to the pattern data bus 112. One register of the 2 n registers is selected by the data selector 34, so that the selected register is written with the pattern data when the pattern data signal 112 is read out from the pattern data memory 18. On the other hand, when a drawing processing is performed for the graphic data memory 12, the content of the selected register is outputted as the drawing pattern data 108 to the graphic data memory 12. The data selector 34 receives the pattern data selection signal 104 of n bits, and selectively activates one of 2 n output lines connected to the 2 n registers of the pattern data buffer register 30, respectively, so that a corresponding one of the 2 n registers of the pattern data buffer register 30 is selected. Now, an operation of the second embodiment will be described with reference to Figures 2, 4 and 5. Firstly, similarly to the first embodiment, the drawing address and the reference address of the pattern are set to the drawing address memory 10 and the pattern address memory 16, respectively. Thereafter, however, before the painting-out processing is performed for each line, the content of the address memory 36 is sequentially incremented one by one from PAD to (PAD + 2 n - 1), and the 2 n items of pattern data are sequentially read from the pattern data memory 18 to the pattern data buffer register 30. At this time, since the content of the buffer address memory 38 is incremented one by one from zero to (2 n - 1), the 2 n items of pattern data sequentially read from the pattern data memory 18 are sequentially stored into the pattern data buffer register 30 in the read-out order. Namely, in the example shown in Figure 5A, the four items of data (1, 0) to (1, 3) corresponding to one line designated by the address PAD is stored in the pattern data buffer register 30. After the above mentioned pre-processing has been completed, the painting-out processing is started. A basic operation of the painting-out processing in the second embodiment is similar to those of the first embodiment. Namely, while the content of the drawing address memory is incremented by +1, one pattern data is selected among the 2 n items of pattern data by using the lower place n bits of the drawing address. A main difference is that, in the second embodiment, the pattern data is not read out from the pattern data memory 18 at each time the painting-out processing for one word is performed. Namely, as mentioned above, since the 2 n items of pattern data corresponding to one line are previously stored in the pattern data buffer register 30, one item of pattern data is selected among the items of pattern data stored in the pattern data buffer register 30 in response to the pattern data selection signal 104, and the selected item of pattern data is outputted to the graphic data memory 12. When the processing is moved to a next line, the content of the pattern address memory 16 is incremented by +2 n , similarly to the first embodiment, and then, the above mentioned processing is repeated. As a result, the second embodiment can perform the painting-out processing, similarly to the first embodiment. In general, the painting-out drawing operation can be executed at a high speed if the number of accessing the graphic data memory 12 and the pattern data memory 18 is decreased to a possible extent. Ordinarily, the number of the accesses to the graphic data memory 12 is determined by the size of an area to which the painting-out processing is performed, and therefore, it should be considered to reduce the number of the accesses to the pattern data memory 18. In the first embodiment, the pattern must be read before the painting-out drawing operation for one word is performed. In the second embodiment, on the other hand, before the painting-out drawing operation for one line is performed, the pattern corresponding to one line is read, and the pattern is not read until the painting-out drawing operation for one line is completed. Therefore, in the case that the horizontal size (width) of the area to which the painting-out processing should be performed is large, the second embodiment can execute the painting-out processing at a speed higher than that of the first embodiment, since the second embodiment is smaller than the first embodiment in the number of the pattern readings. As will be apparent from the above description, the painting-out pattern reference system in accordance with the present invention is characterized by limiting the horizontal size of a graphic data storing area to 2 n × m words (where "n" and "m" are natural numbers) and also by limiting the horizontal size of a unitary pattern data storing area to 2 n words With this feature, the painting-out pattern reference system in accordance with the present invention can set the width of a unitary pattern with some extent of freedom (by units of 2 n words) with a simple control but without requiring modification of hardware such as extension of a bas width. Therefore, a high degree of drawing expression can be realized, and it is possible to paint out a graphics on a high resolution display screen by various patterns.

Claims: A painting-out pattern reference system comprising a graphic data memory for storing drawn graphic data to be displayed on a display screen, in the form of a bit image, the graphic data memory having a horizontal size of 2 n × m words, where "n" and "m" are natural numbers; a pattern data memory storing a unitary painting-out pattern in the form of a bit image for defining the unitary painting-out pattern, the pattern data memory having a horizontal size of 2 n words; a drawing address memory storing a memory address for performing a painting-out drawing, the drawing address memory supplying the stored memory address to the graphic data memory; a pattern address memory storing a pattern head memory address of any line in the pattern data memory; and a pattern data selector receiving a lower place n bits of an address output of the drawing address memory and the pattern head memory address from the pattern address memory for generating an address to the pattern data memory so as to cause at least one word of pattern to be selected among 2 n words of pattern stored in the pattern data memory so that the selected one word of pattern is supplied to the graphic data memory. A painting-out pattern reference system according to Claim 1 wherein the pattern data selector includes an adder having a first input connected to receive the lower place n bits of an address output of the drawing address memory, and a second input connected to receive the pattern head memory address from the pattern address memory, an output of the adder being connected to supply the result of addition as the address which is supplied to the pattern data memory. A painting-out pattern reference system according to Claim 2 wherein the pattern data selector also includes a path receiving the selected one word of pattern outputted from the pattern data memory for supplying the received one word of pattern to the graphic data memory as it is. A painting-out pattern reference system according to Claim 1 wherein the pattern data selector includes an address memory connected to receive an initial pattern head memory address from the pattern address memory and for incrementing the received initial pattern head memory address so as to supply the incremented pattern memory address to the pattern data memory, a pattern data buffer register composed of 2 n registers connected to the pattern data memory so as to temporarily store the pattern data corresponding to one line in such a manner that one word of pattern data is stored in a corresponding one register, and a data selector coupled to select one register among the 2 n registers of the pattern data buffer register so that the one word of pattern data temporarily stored in each register is sequentially read out to the graphic data memory.

Inventors: HORIGUCHI RYUJI C O NEC CORPOR, HORIGUCHI, RYUJI C/O NEC CORPORATION
Applicants: NIPPON ELECTRIC CO, NEC CORPORATION
Application year: 1989
Main classification: G06T11
IPC codes: G06T11, G09G5