PATTERN DATA PROCESSING APPARATUS

Abstract: A pattern data processing apparatus processes pattern data, based on which a predetermined pattern is displayed in a display area. The pattern data has data corresponding to both the display area and a data calculating area outside of the display area, the display area being divided into a plurality of pixels. The pattern data processing apparatus comprises a flag data generator (4) for generating first flag data, indicating whether each of the pixels is located within a closed area of the pattern, from the pattern data, a flag data memory (3; Figure 2) having a memory area substantially corresponding to the display area for storing the flag data, read-out means (4) for reading out the flag data from the flag data memory (3) in a predetermined scanning direction, means for processing the pattern data inside of the closed area of the pattern by using the flag data read out of the flag data memory (3), and means for successively mapping the pattern data from the data cal­ culating area into an outermost peripheral portion of the flag memory and for storing second flag data representing flags of the data in the data calculating area.

Description: This invention relates to pattern data processing apparatus. Apparatus embodying the invention may, for example, be incorporated in integrated services of a digital network (a so-called "Information Network System") for displaying desired graphics patterns on a monitor image display based on data transmitted via a digital communication line. When it is desired to display a graphics pattern based on pattern information (such as vertex information relating to a polygon) transmitted via a digital communication line, and to shade an internal portion of the pattern, it is necessary to detect a closed area in the pattern. Two processes are known for detecting such a closed area. The first process requires a memory for storing all information on the shape of a given graphics pattern. The second process needs no memory and searches for a closed area based on information as to the intersections of a given pattern. With the first process, since information on the closed area is stored in the memory, the process can employ various types of shading (shading over the full surface, vertical hatching, horizontal hatching, cross-hatching, slant hatching) and various processing directions (downward, rightward, etc). However, the memory is required to have quite a large capacity as it has to store all the pattern information given. According to the second process, received vertex information items are sequentially connected to find a straight line, and then an intersection of the straight line and a scanning direction, and the closed area is shaded using the intersection information. Although the second process requires no memory, a program for performing the process is complex and the time required for effecting the process is long. Since complicated processing such as crosshatching is difficult to achieve, the types of processing that can be accomplished are limited. An article entitled "The Edge Flag Algorithm - A Fill Method for Raster Scan Displays" by B D Ackland et al, appearing in IEEE TRANSACTIONS ON COMPUTERS, Vol. C-30, No. 1, January 1981, New York, USA, discloses a pattern data processing apparatus for processing pattern data, based on which a predetermined pattern is displayed in a display area, the pattern data including data corresponding to both the display area and a data calculating area outside of the display area, and the display area being divided into a plurality of pixels, the pattern data processing apparatus comprising: a flag data generator for generating first flag data, indicating whether each of said pixels in said display area is located on a contour of the pattern, from the pattern data; a flag data memory having a memory area substantially corresponding to the display area for storing the first flag data; read-out means for reading out the first flag data from the flag data memory in a predetermined scanning direction; and processing means for processing the pattern data inside of any closed area of the pattern, in order to modify the closed area, for example by shading it, by using the first flag data read out of the flag data memory. The present invention provides a pattern data processing apparatus as just set forth, the apparatus being characterised in that: mapping means is provided for successively mapping pattern data corresponding to contours of the pattern lying in the data calculating area into an outermost peripheral portion of the flag data memory lying outside the display area, in order to define which pixels of the display area lie within a closed area of the pattern, by generating second flag data and storing said second flag data in said outermost peripheral portion of the flag data memory, the contents of each such second flag having one of two values, said contents alternating each time a point of a contour of said pattern is mapped onto the location of the second flag; the read-out means is operative to read out the first and the second flag data from the flag data memory in said predetermined scanning direction; and the processing means is operative to process the pattern data inside of any closed area of the pattern by using the first and second flag data read out of the flag data memory. A preferred pattern data processing apparatus embodying the invention and described hereinbelow is capable of detecting a closed area with a memory of small capacity, is capable of coping with various methods of processing a closed area and of processing the closed area in a short period of time, and can properly determine a shaded area. The invention will now be further described, by way of illustrative and non-limiting example, with reference to the accompanying drawings, in which: Figure 1 is a block diagram of a pattern data processing apparatus embodying the present invention; Figure 2 is a diagram for use in describing a flag memory of the apparatus; Figure 3 is a diagram for use in describing a process for detecting a closed area in apparatus embodying the present invention; Figure 4 is a diagram for use in describing a process for generating flags in a data calculating area in apparatus embodying the present invention; Figure 5 is a diagram illustrative of a manner in which singular points are processed; and Figures 6 and 7 are diagrams showing generated flags. Figure 1 shows the overall arrangement of a pattern data processing apparatus embodying the present invention. The pattern data processing apparatus includes data buffers 1, 2 for storing received data, a flag data memory 3, and a processor 4 comprising a microcomputer. In this embodiment of the present invention, a language called PDI ( P icture D escription I nstruction) is employed for expressing graphics patterns. The language expresses a graphics pattern through a combination of five basic pattern display elements: point, line, arc, rectangle, and polygon. Received data written in this language is composed of common control commands, a picture desciption command, and vertex data. The common control commands include a command for instructing the display of a character or a graphics pattern, a command for setting a parameter such as the size of a logic pixel, and others, and are stored in the data buffer 1. The picture description command serves to designate a display area, an image colour, a contour line, and a processing type for a closed area. The vertex data includes vertex data as defined by a coordinate system for a data calculating area and a command for indicating whether the vertex data forms a straight line, an arc, or a polygon and whether a closed area is to be processed. The picture description command and the vertex data are stored in the data buffer 2. The processor 4 generates flags (described later) using the data stored in the data buffers 1, 2 and writes the flags into the flag memory 3. The processor 4 also reads the flags out of the flag memory 3 and writes desired picture data from the processor 4 into a raster memory 5 at predetermined addresses therein. The raster memory 5 has a memory area corresponding to a display area (one frame, for example). The picture data as read out of the raster memory 5 is supplied through a display control circuit 6 to a monitor display 7. The raster memory 5 is scanned in synchronism with beam scanning in the monitor display 7. As shown in Figure 2, the flag memory 3 has a memory area corresponding to the display area and composed of horizontal X pixels and vertical Y pixels and outer frames 8A, 8B, 8C and 8D added respectively to four sides of the area and each having a width equal to that of one pixel. The display area corresponds to an entire screen, or a portion thereof, of the monitor display 7. The flag memory 3 also comprises a data calculating area which is composed of an area obtained by removing the display area from an area having a size determined by bit numbers in a two-dimensional plane. By the way of example, the data calculating area and the display area may jointly form four frames. For reducing necessary calculations, a closed area is detected and processed with a logic pixel composed of a plurality of physical pixels that are handled as a unit. Flags are generated in the display area and in the data calculating area, respectively. As illustrated in Figure 3, the contour of a closed area 9 and a straight line 10 intersect each other at an odd number of points. Assuming that the straight line 10 is indicative of a processing direction, therefore, a shading process is effected from the first intersection point to the next intersection point, and no shading is performed between that next intersection point and the next succeeding intersection point since the closed area 9 is not interposed between the points. Then, the areas sandwiched between two adjacent intersection points are alternately shaded. The detection of a closed area will be described with reference to an example in which vertex data in received data indicates a polygon. A prescribed initial flag (expressed by "0") is set in each of the pixels of the flag memory 3. Then, one straight line constituting a contour of the polygon is calculated from the received data. Whether a plurality of pixels corresponding to the calculated straight line are contained in a display area is determined. Thereafter, prescribed flags different from the initial flags are written in addresses corresponding to the pixels that are contained in the display area. The flags related to the pixels contained in the display area are composed of a plurality of bits having first, second, and third items of identifying information, as described hereinbelow. The pixels outside of the display area, that is, pixels contained in the data calculating area, are successively mapped into the outer frames 8A to 8D. As shown in Figure 4, a straight line contained in an area 11A having a width X and extending vertically upwardly in the data calculating area is mapped into the outer frame 8A, a straight line contained in an area 11B having the width X and extending vertically downwardly is mapped into the outer frame 8B, a straight line contained in an area 11C having a width Y and extending horizontally in one direction is mapped into the outer frame 8C, and a straight line contained in an area 11D having the width Y and extending horizontally in the opposite direction is mapped into the outer frame 8D. The flags written in the outer frames 8A to 8D are each in the form of one bit which is either in an initial state (expressed as "0") or in a set state (expressed as "1"). When they are mapped, they are in a state different from that prior to mapping. Accordingly, when odd straight lines are contained in each of the areas 11A to 11D, the flags become "1" as a result of successive mapping. Conversely, when even straight lines are contained in each of the areas 11A to 11D, the flag become "0" as a result of successive mapping. A process for mapping singular points contained in the areas 11A to 11D will now be described with reference to Figure 5. The mapping is to be performed in a horizontal direction in Figure 5. A singular point Pa comprising a vertex where two oppositely slanting straight lines intersect will not be mapped. Singular points Pb, Pc comprising intersections of two oppositely slanting straight lines and a horizontal line will not be mapped with the points interconnected and regarded as the same as the singular point Pa. Singular points Pd, Pe comprising intersections of two similarly slanting straight lines and a horizontal line will be mapped with the points interconnected and regarded as the same as a singular point Pf. The foregoing processing operation for singular points is basically the same in the display area and the data calculating area. Whether a point is a singular point or not can be determined by checking address information on successive pixels for a straight line sought to be processed. Each of the straight lines of a polygon contained in the areas 11A to 11D of the data calculating area is mapped into the outer frames 8A to 8D. The outer frames 8A to 8D and the display area (flag memory 3) are scanned in a predetermined direction and sequence to read the flags. The areas between the flags in the set state are alternately shaded. The type and direction of shading, and whether the shading should contain the contour line, are determined by the received data. A specific example, wherein flags are generated when received data is representative of a polygon, will now be described with reference to Figure 6. When a given polygon extends over a display area and a data calculating area, as illustrated in Figure 6, flags are generated as shown in Figure 6B for the pixels in the memory area and the outer frames 8A to 8D in the flag memory 3. The flags in the initial state are omitted from the illustration given in Figure 6B. A flag indicated by "2" in the flag memory 3 is indicative of a singular point (same as the singular point Pa in Figure 5). Since a point P₁ in Figure 6A corresponds to the singular point Pa, the flag at the corresponding address in the outer frame 8C is "0" as illustrated in Figure 6B. Three points P₂, P₃, P₄ in the same horizontal position are successively mapped into the corresponding addresses in the outer frame 8C. As a result, the flags at these addresses are "1", as shown in Figure 6B. The flag corresponding to a singular point P₅ in the display area is "2". Since no polygonal straight line is present in the area 11A, the flags in the outer frame 8A are all "0". The flags in the outer frame 8B are all "1" as there is a straight line extending throughout the outer area 11B. Pixels can be shaded vertically, horizontally, or obliquely by using the flags in the outer frames 8A to 8D and the flag memory 3. More specifically, the shading process is started from a flag "1" of the flags in the outer frames 8A to 8D, and the pixels sandwiched between the flags "1" are alternately shaded such that a pixel or pixels positioned up to the next flag "1" will not be shaded. Such shading processing is performed by the processor 4, which receives the flags read out of the flag memory 3 and writes processed picture data into addresses in the raster memory 5 based on the received flags. Shading processing for a circular or arcuate pattern will now be described. When a circle is to be processed, two pieces of vertex data and a picture description command indicative of a circle are received. The receiving means determines data on a circle, with the two vertex data serving as a diameter, through calculations. When an arc is to be processed, three pieces of vertex data and a picture description command indicative of an arc are received. The receiving means then determines data on an arc. The arcuate pattern can be formed by shading the data on the arc. A circle intersects a straight line at two points at most. Based on this property, where circle portions are displaced off the display area, flags may be set at all times in the corresponding frames. Figure 7 illustrates, by way of example, the flags set when displaying a shaded quarter of a circle. With the above-described arrangement, a closed area can be detected and flags can be generated for shading the closed area by employing a memory having a size corresponding to a display area or a combination of a display area and outer frames each having a width equal to that of a pixel. Since all flags for shading a closed area in a given graphics pattern are written in the memory, various types of shading can be carried out and the time required for pattern data processing can be shortened. A flag corresponding to each logic pixel in the display area has an amount of information necessary for shading the closed area in the given pattern, so that the closed area can be shaded accurately and easily. With the flags for shading the closed area being written in the memory, it is possible to perform various types of shading as compared with a process which determines whether an area is to be shaded successively on the basis of intersection information. According to the above-described arrangement, the contour of a graphics pattern can be drawn, and it is possible to effect hatching or crosshatching with horizontal and vertical lines and shading in a horizontal or vertical direction by using contour information.

Claims: A pattern data processing apparatus for processing pattern data, based on which a predetermined pattern is displayed in a display area, the pattern data including data corresponding to both the display area and a data calculating area outside of the display area, and the display area being divided into a plurality of pixels, the pattern data processing apparatus comprising: a flag data generator (4) for generating first flag data, indicating whether each of said pixels in said display area is located on a contour of the pattern, from the pattern data; a flag data memory (3) having a memory area substantially corresponding to the display area for storing the first flag data; read-out means (4) for reading out the first flag data from the flag data memory (3) in a predetermined scanning direction; and processing means for processing the pattern data inside of any closed area (9) of the pattern, in order to modify the closed area, for example by shading it, by using the first flag data read out of the flag data memory (3); the apparatus being characterised in that: mapping means is provided for successively mapping pattern data corresponding to contours of the pattern lying in the data calculating area into an outermost peripheral portion of the flag data memory (3) lying outside the display area, in order to define which pixels of the display area lie within a closed area (9) of the pattern, by generating second flag data and storing said second flag data in said outermost peripheral portion of the flag data memory, the contents of each such second flag having one of two values, said contents alternating each time a point of a contour of said pattern is mapped onto the location of the second flag; the read-out means (4) is operative to read out the first and the second flag data from the flag data memory (3) in said predetermined scanning direction; and the processing means is operative to process the pattern data inside of any closed area (9) of the pattern by using the first and second flag data read out of the flag data memory (3). A pattern data processing apparatus according to claim 1, wherein the flag data memory (3) has a main memory area corresponding to the display area and the outermost peripheral portion thereof comprises an additional frame memory area (8A to 8D) positioned on four sides of the main memory area, and the mapping means is arranged to map the data into the additional frame memory on the side corresponding to the data to be mapped. A pattern data processing apparatus according to claim 1, wherein each item of the second flag data comprises a one-bit code which will alternate its state at every mapping. A pattern data processing apparatus according to claim 1, claim 2 or claim 3, wherein the processing means has a raster memory (5) having a memory area corresponding to the display area, the pattern data being stored in the raster memory (5) after being varied by the flag data read out of the flag data memory (3). A pattern data processing apparatus according to claim 4, wherein the processing means has an adder for adding data corresponding to shading inside of the closed area (9) of the pattern to the pattern data originally stored in the raster memory (5).

Inventors: KANEMAKI, HIROFUMI, TAKIKAWA, KEI NIPPON TELEGRAPH AND TELEPHONE
Applicants: NIPPON TELEGRAPH AND TELEPHONE CORPORATION, SONY CORPORATION
Application year: 1984
Main classification: G06F15
IPC codes: G06T15