Image processing method and system

Abstract: An image processing method and system in which data representing an image is stored on a block basis as data blocks corresponding to image strips in a virtual image, in a first storage means, having a plurality of storage blocks, corresponding to a virtual storage, and the data blocks to be processed are fetched from said first storage means into a second working storage means, having a smaller number of storage blocks than said plurality of storage blocks in said first storage means, corresponding to a real storage, to perform an image processing.

Description: The present invention relates to an image processing method and system and, more particularly, to an image processing method and system using the technique of virtual storage in the management of image data. In image processing, image data representing characters, patterns, etc., is processed at the basic picture element (pixel) level. This requires an enormous amount of data to be processed and is quite time-consuming. Japanese Patent Unexamined Published Application No. 59-212,971 discloses an image data generator wherein the processing time for generating image data may be reduced by re-using image data which has been generated and retained as much as possible in an external store. Newly generated image data is stored in the external store by replacing image data already stored therein but which has been less frequently accessed than other stored data. Japanese Patent Unexamined Published Application No. 58-4,470 discloses an arrangement in which necessary portions of image data in a memory are fetched sequentially from the top into a buffer or a CPU in the form of blocks. In processing image data with a data processing system of a small storage capacity, such as a personal computer, the size of a program which could co-exist therein is limited by the amount of image data. The restriction would be removed by storing and retaining the image data in an external storage. However, in a system such as that disclosed in the above Application No. 59-212,971, the time required to access and transfer the image data occupies most of the image processing time, and it is desirable to reduce such time in the interests of processing efficiency. As disclosed in the above Application No. 58-4,470, it has been proposed to reduce the time required to transfer image data by transferring the image data in the form of blocks. However, in this system, data blocks are fetched only sequentially from the top, and such a procedure could not be adapted to complex image processing, such as is required by COPY and ROTATE operations. Other techniques for handling image data in block form are disclosed in EP-A-0 166 304 and in the paper by B.T. Wada entitled "A virtual memory system for picture processing" in the journal COMMUNICATIONS OF THE ASSOCIATION OF COMPUTING MACHINERY" vol.27 no. 5 May 1994 pages 444 - 454. The latter reference proposes a paging mechanism to reduce access time, a technique developed in the operating system described in Notes: "Advanced UNIX operating system workshop", November 1984, The Instruction Set Ltd., London, pages 22 and 70 - 74 with particular reference to the identification of data blocks for replacement in a caching system. There nevertheless remains a requirement to improve the processing speed of image data further and it is accordingly an object of the present invention to provide an image processing method and system which facilitates the performance of operations such as COPY and ROTATE while permitting effective use of the virtual storage technique. According to the invention there are provided an image processing method and system as claimed in claims 1 and 5 respectively. In order that the invention may be fully understood it will now be described by way of example with reference to the accompanying drawings in which: Figures 1 and 2 show flow charts for explaining the method according to the present invention. Figures 3 and 4 show functional block diagrams for explaining the system according to the present invention. Figures 5 and 6 show block diagrams for explaining an embodiment of the present invention. Referring now more particularly to the flow chart of Figure 1, in Step 1, the position of a source area in an image is specified together with the processing operation to be performed on the source area and the position of a destination area in said image which the image data resulting from the operation is to occupy. In Step 2, the data blocks associated with the source and destination areas are found, and, depending on the nature of the processing operation, a first order in which said data blocks associated with the source area are to be used in the operation and a second order in which the data blocks associated with the destination area are used are determined. In Step 3, first control data associating particular storage blocks with the source area and including bits representing the first order is set in tables, one associated with each of first or second storage means storing the image data. Each table has an entry for each data block in the corresponding storage means. Second control data associating other storage blocks with the destination area and including bits representing the second order is set in those entries in the tables which correspond to the storage blocks in the first or second storage means storing data blocks associated with the destination area. In Step 4, data blocks associated with the source and destination areas are prepared in the second storage means, using a "necessity value" for data stored in each block in the second storage means obtained from the table entry corresponding to that block. As shown in Figure 2 the data blocks are prepared as follows:- In Step 21, it is checked whether or not a data block to be used exists in the second storage means. If so, it is used to perform the image processing. If not, proceeding to Step 22, a storage block having the lowest necessity value in its associated control data is found. When such a data block is to be used in association with the source area, a storage block associated with the source area by its control data is used, whereas when the data block is to be used in association with the destination area, a storage block similarly associated with the destination area is used. In Step 23, it is checked whether or not the selected data block has been changed. If not, the data block need not be retained, and, proceeding to Step 25, the data block to be used is fetched from the first storage means into the selected storage block, and at the same time, the control data for said data block to be used is written into the entry in the table corresponding to the selected block. If the data in the selected block has been changed, it is to be retained. Thus, proceeding to Step 24, the data block is written back into the first storage means, and on Step 25, the fetching of the data block to be used and writing of said control data for this data block are performed. Then, in Step 5 following Step 4, the data blocks prepared in the second storage means are used to perform the processing operation. In Step 6, the control data for data blocks used in the operation are updated. In Step 7, it is checked whether or not the processing operation has been completed, by determining whether all the data blocks associated with the source and destination areas have been processed. Until it is completed, the Steps 4 through 6 are repeated. Next, an image processing system embodying the present invention will be described. As shown in Figure 3, the system comprises a specifying means 33, a determining means 34, a table means 35, a table control means 36, a first storage means 37, a second storage means 38, and a storage control means 39. A conventional computer includes application program 30, a process control unit 31, and an executing means 32. The first storage means 37 stores data representing an image on a block basis in a plurality of storage blocks. The second storage means 38, having a smaller number of storage blocks than said plurality of storage blocks in said first storage means 37, stores the data blocks to be processed. The specifying means 33 specifies the position of the source area in the image, the image processing operation to be performed on the source area, and the position of the destination area in said image. The determining means 34 finds the data blocks associated with the source and destination areas and determines orders in which said data blocks are used in said image processing, depending on the processing operation to be performed. The table means 35 provides a table for each of the two storage means, each table having an entry for each storage block in the associated storage means. Table control means 36, connected between said determining means 34 and said table means 35, sets control data in the entries in said table means 35, updates the control data in the entries in said table means each corresponding to each storage block in said second storage means 38, and checks the contents of the entries. Particularly, as shown in Figure 4, the table control means 36 is provided with a reference data generating means 40, which generates data concerning associated data blocks from the position data of reference points in said image, and a pointer means 41, which receives outputs of said reference data generating means 40 and indicates the data blocks to be referenced, thereby facilitating the management of the data blocks by the table control means 36. A counter 42 is provided to count the number of data blocks. Further the pointer means 41 comprises a current reference pointer 43, which indicates the data blocks referenced currently, a previous reference pointer 44, which indicates the data blocks referenced previously, and a comparator 45, which compares the contents of said current reference pointer 43 and those of said previous reference pointer 44 and outputs the contents of one of said pointers, thereby permitting proper identification of the data blocks to be referenced in performing the image processing operation. The storage control means 39 receives outputs of said table control means 36 and controls the writing and reading of data into and out of said first and second storage means 37 and 38 on a block basis, and receives the outputs of said table control means 36 to cause said data blocks to be written from said first storage means 37 into said second storage means 38. Further, the storage control means 39 generates real addresses of the data in said first and second storage means 37 and 38. In operation, the application program 30 shown in Figure 3 may, for example, perform a MOVE operation, wherein a source area or the whole area of an image of a certain size, e.g. an image of one page, is to be moved into another area on the same page with the original area erased; a COPY operation, wherein a source area is copied into another area with the source area retained; an ERASE operation, wherein a specified area is erased; or a ROTATE operation, wherein a specified area is rotated and moved into another area. The source area and destination area may be overlapped with each other or separated from each other. The image of one page is hereinafter referred to as a virtual image and shown in Figure 5 with the reference number 50. The virtual image 50 consists of a plurality of image strips #0 - #9, as shown in Figure 5 each strip being represented by an associated image data block. The source area and destination area are shown in Figure 5 with the reference numbers 51 and 52, respectively. The image data of the virtual image 50 has been stored in storage blocks #0 - #9 of the first storage means 37, such as an external storage, as data blocks 60 - 69. The writing and reading of image data into and out of the first storage means 37 are performed on a block basis. Therefore, as shown in Figure 5, the virtual image 50 is divided into the image strips. Although the virtual image 50 may be stored into the storage blocks of the first storage means 37 sequentially from the top, the virtual image 50 is generally stored therein in any sequence as shown in Figure 5, since the first storage means 37 can be accessed on a block basis as stated above. To assemble the virtual image 50 sequentially from the top, the data blocks in the first storage means 37 would be accessed in the sequence of the data blocks 67, 63, 61, ..., 66, and 68. Now, the operations of the present invention will be explained below with reference to a COPY operation wherein the image in the source area 51 in the virtual image 50 is copied into the destination area 52, as shown in Figure 5. The application program 30 supplies commands and data to the processing control unit 31. The processing control unit 31 supplies the output to the specifying means 33, and the specifying means 33 specifies the positions of reference area in the virtual image 50, namely the source area 51 and the destination area 52, and the COPY operation. The reference areas, if they are rectangular areas, are specified with the X - Y coordinates of the upper left corners and the lower right corners thereof, for example (Xi , Yi) through (X4 , Y4), as shown in Figure 5. With the COPY operation specified, the executing means 32 selects the COPY processing algorithm. Upon receipt of the output of the specifying means 33, the determining means 34 finds the data blocks 63, 61, 65, 69, 62, 64 and 60 associated with the source area 51 and the destination area 52, and determines the orders in which the data blocks are used in the COPY operation, namely the referencing directions, as shown with big arrows in Figure 5. The referencing directions are important in a case where the source and destination areas are overlapped with each other, as shown in Figure 5. If the image in the source area is copied into the destination area from top to bottom in the direction opposite to the referencing directions shown in Figure 5, the image in the portion of the source area overlapping with the destination area would be destroyed. Therefore, the image in the source area should be copied into the destination area from bottom to top. Figure 5 also illustrates the correspondence between the virtual image 50 and the first storage means 37. When the virtual image 50 is set as a document of one page, as stated before, for example, the first storage means 37 stores the data blocks corresponding to the image strips, which are the partial images of the document, in a random sequence. Upon receipt of the output of the determining means 34, the table control means 36 sets control data reflecting the referencing directions in those entries in the table means 35 which correspond to the storage blocks in the first storage means 37 or the second storage means 38 storing the data blocks associated with the source and destination areas 51 and 52. The table control means 36 is used especially to determine the storage blocks of the second storage means 38 wherein data blocks fetched from the first storage means 37 are to be stored. Figure 6 illustrates the table means 35 together with the first and second storage means 37 and 38. The table means 35 consists of a table 71 for the first storage means 37 and a table 72 for the second storage means 38. The table 71 has ten entries #0 #9, for example. Each of the entries corresponds to each of the ten storage blocks #0 - #9 of the first storage means 37, and can store the control data for the data block stored in the corresponding storage block. The table 72 has four entries, for example. Each of the entries corresponds to each of the four storage blocks #0 - #3 of the second storage means 38, and stores the control data which represents the control value of the data block existing in the corresponding storage block. Each of the entries of the tables 71 and 72 stores the control data consisting of 24 bits, for example. When a data block has been fetched from the first storage means 37 into the second storage means 38, the control data for the data block is transferred from the entry of the table 71 storing the control data into the entry of the table 72 corresponding to the storage block in the second storage means 38 into which the data block has been fetched. Figure 6 also illustrates a format of the control data consisting of 24 bits. The control data consists of two parts. 12 bits on the left side are the control data for the corresponding data block when used in association with the source area, and 12 bits on the right side are the control data for the corresponding data block when used in association with the destination area. Accordingly, in this case, the 12 bits on the left side constitute the control data for the source area, namely the source control data, and the 12 bits on the right side constitute the control data for the destination area, namely the destination control data. The contents of the source and destination control data will be described below. At each of the most significant 0 bit positions of the control data for both areas, a FIX flag bit F is provided. Both of the FIX flag bits F are set or reset simultaneously. The FIX flag bits F are used when the corresponding data block is retained in the second storage means 38 to be used repeatedly. For that purpose, the FIX flag bits F are set to 1. As the result, the maximum control value, namely bit value, is obtained. Especially, in case of a ROTATE processing such as a rotation of 90° or 270°, there may exist data blocks which would be referenced frequently. In such a case, according to the ROTATE processing algorithm, the data blocks to be referenced are specified and, when the data blocks are desired to be fixedly stored in the second storage means 38, the FIX flag bits F are set to 1, and when they are desired to be released, the FIX flag bits F associated with the data blocks are reset to 0. Thus, by controlling the fetching of the data blocks with the FIX flag bits F, the frequency of fetching may be reduced, thereby increasing the performance of the image processing. The 1, 2, and 3 bit positions of the source control data represent a DESTINATION flag bit D, a SOURCE flag bit S, and a CHANGE flag bit C, respectively, while the 1, 2, and 3 bit positions of the destination control data represent a SOURCE flag bit S, a DESTINATION flag bit D, and a CHANGE flag bit C, respectively. The same type of flag bits provided in the respective source and destination control data are set or reset simultaneously. If a data block stores the image of the source area in the virtual image, both of the SOURCE flag bits S in the control data for the the data block are set to 1. If a data block acts as a destination area in the virtual image, both of the DESTINATION flag bits D in the control data for the data block are set to 1. Further, when the image, namely the storage data, in the data block has been changed while in the second storage means 38, both of the CHANGE flag bits C in the control data for the data block are set to 1. Accordingly, when the CHANGE flag bits C are set to 1, the data block is written back into the first storage means 37, since the contents have been changed. The remaining 8 bits, namely the 4 through 11 bit positions, of the respective source and destination control data are priority specifying bits for both of the source and destination areas which represent the priority of the data block. As stated before, the determining means 34 finds the data blocks associated with the reference areas in accordance with the contents specified by the specifying means 33, and the table control means 36 sets predetermined values as the control data from the FIX flag bit F through the CHANGE flag bit C into the corresponding entries in the table means 35. Further, the table control means 36 sets priorities sequentially from the highest value as the control data into the priority specifying bits in the control data according to the referencing direction. Thus, the control data from the FIX flag bit F through the priority specifying bits represent the necessity value of the data block. The control data is updated after the data block has been used in the image processing. In the source control data, the DESTINATION flag bit D is located at a more significant position than the SOURCE flag bit S for the following reason. Namely, when the data block is used in association with the source area and later used in association with the destination area in the second storage means 38, the data block is thereby caused to be left in the second storage means 38 after it has been used therein in association with the source area, in order to reduce the frequency of fetching. In that case, the source control data is updated; i.e., the SOURCE flag bit S and the priority specifying bits are reset in the source control data, because the DESTINATION flag bit D, located at a more significant position than the SOURCE flag bit and the priority specifying bits, has been set to 1 and, therefore, control data of a larger control value, namely bit value, exists in the source control data. (It is premised that the data blocks are erased from the second storage means 38 in an ascending order of control values.) It is for the same reason that, in the destination control data, the SOURCE flag bit S is located at a more significant position than the DESTINATION flag bit D. In each of the source and destination control data, the CHANGE flag bit C is located at a less significant position than any of the FIX flag bit F, the SOURCE flag bit S, and the DESTINATION flag bit D. This is because the CHANGE flag bit C, which only indicates whether the data stored in the data block has been changed or not, would not thereby substantially decide the amount of the control value, namely bit value. If the CHANGE flag bit C were defined otherwise, the data block would be judged to have a larger control value and left in the second storage means 38, although the CHANGE flat bit C had been set to 1 in order to indicate only that the data stored in the data block had been changed. This would prevent the effective use of the storage means. Next, an explanation will be made as to how a COPY operation, wherein the source area 51 in the virtual image 50 shown in Fig. 5 is copied to the destination area 52, is performed. At the beginning, it is assumed that all the entries of the tables 71 and 72 and all the storage blocks of the second storage means 38 have been cleared. The application program 30 causes the specifying moans 33 to specify the COPY operation and also the coordinate data of the upper left and down right corners (X1 , Y1) and (X2 , Y2) of the source area 51 in the virtual image 50 and the coordinate data of the upper left and down right corners (X3, Y3) and (X4 , Y4) of the destination area 52. In response to the specification of the COPY operation by the specifying means 33, the determining means 34 causes the executing means 32 to select the COPY processing algorithm out of already stored algorithms such as the "MOVE, COPY, ERASE, ROTATE and other processing algorithms. Based on the given coordinate data, the determining means 34 recognizes that the bottom portion of the source area 51 and the top portion of the destination area 52 are overlapped with each other, and determines that the processing of the source areas 51 and the destination area 52 should be performed in the bottom to top direction. Further, based on the coordinate data (X1 , Y1) and (X2 , Y2) of the source area 51, the determining means 34 finds in which data blocks the image of the source area 51 is stored. Since the image of the source area 51 is stored as the data blocks 63, 61, 65, and 69 into the storage blocks #3, #1, #5, and #9 of the first storage means 37, as shown in Fig. 5, it is necessary to read these data blocks out of the first storage means 37. The direction of the processing is the order of the data blocks 69, 65, 61, and 63, as shown with a big arrow in Fig. 5, such an order called the priority. Then, the table control means 36 sets the source control data for these four data blocks into the entries #9, #5, #1, and #3 of the table 71 corresponding to said four data blocks as stated below. (Now, it is assumed that no data block has been stored in the second storage means 38. However, if any of the data blocks 69, 65, 61, and 63 exists in the second storage means 38 as by a preceding image processing, the control data for the data block would be set in the corresponding entry of the table 72 by the table control means 36.) As shown in the following Table 1, the SOURCE flag bit S in the source control data in each of the entries #9, #5, #1, and #3 of the table 71 is set to 1. At this time, the SOURCE flag bit S in the destination control data in each of the entries is also set to 1. Further, the priority is set in the priority specifying bits in the source control data, as shown in Table 1. The determining means 34 determines the direction of the processing based on the coordinate data (X3 , Y3) and (X4 , Y4) of the destination area 52, and finds in which storage blocks and as which data blocks the image of the destination area 52 is stored based on the coordinate data of the destination area 52. Since the image of the destination area 52 is stored as the data blocks 69, 62, 64, and 60 into the storage blocks #9, #2, #4, and #10 in the first storage means 37 as shown in Fig. 5, it is necessary to read these data blocks out of the first storage means 37. The determined direction of the processing is the order of the data blocks 60, 64, 62, and 69, which is the priority, as shown by the big arrow in Fig. 5. The table control means 36 sets the destination control data for these four data blocks into the entries #0, #4, #2, and #9 of the table 71 corresponding to said four data blocks as stated below. The DESTINATION flag bit D in the destination control data in each of the entries #0, #4, #2, and #9 of the table 21 is set to 1. At this time, the DESTINATION flag bit D in the source control data in each of the entries is also set to 1. Further, the priority is set in the priority specifying bits in the destination control data, as shown in Table 1. As shown in Table 1, in the control data in the entry #9 of the table 21 corresponding to the data block 69 which is associated with both of the source area 51 and the destination area 52, both of the SOURCE flag bit S and the DESTINATION flag bit D in both of the source control data and the destination control data have been set to 1. The executing means 32 requests the storage control means 39 to provide thereto the real address RPS in the data block 69 corresponding to the starting point PS of the bottom line of the source area 51. The storage control means 39 provides the real address RPS to the COPY processing algorithm. The executing means 32 selects one data block to be processed in the source area 51, namely the data block 69 including the starting point PS in this case. All the data in the data block 69 is transferred into a vacant storage block or a storage block including an already used data block in the second storage means 38. At this time, assuming that all of the storage blocks #0, #1, #2, and #3 have not stored any data block, all the data in the data block 69 is transferred into the storage block #0. The source control data and the destination control data, consisting of 24 bits, in the entry #9 of the table 71 are transferred into the entry #0 of the table 72. Thus, the data block 69 storing the bottom portion of the source area 51 shown in Fig. 5 has been transferred into the storage block #0 in the second storage means 38, and the control data, consisting of 24 bits, for the data block 69 has been transferred into the entry #0 of the table 72. Next, an explanation will be made as to the operation of transferring the data block 60, which stores the bottom portion of the destination area 52 to which the bottom portion of the source area 51 is to be copied, from the first storage means 37 into the second storage means 38. This operation is performed in the same manner as that described above as to the data block 69. The executing means 32 requests the storage control means 39 to provide thereto the real address RPD in the data block 60 corresponding to the starting point PD of the bottom line of the destination area 52. The storage control means 39 provides the real address RPD to the COPY processing algorithm. The executing means 32 selects one data block to be processed in the destination area 52, namely the data block 60 including the starting point PD in this case. The storage control means 39 transfers all the data in the data block 60 into a vacant storage block in the second storage means 38. Since the storage block #0 has been stored with the data in the data block 69, all the data in the data block 60 is stored into the next storage block #1. The source control data and the destination control data, consisting of 24 bits, for the data block 60, existing in the entry #0 of the table 71, are transferred into the entry #1 of the table 72 corresponding to the storage block #1 in the second storage means 38. At this time, all the data in the data blocks 69 and 60 have been transferred into the storage blocks #0 and #1 in the second storage means 38. Then, the COPY processing algorithm directly accesses the storage blocks #0 and #1 in the second storage means 38 to perform the COPY processing. The COPY processing algorithm calculates the lateral lengths of the source and destination areas based on the coordinate data (X1 , Y1), (X2 , Y2), (X3 , Y3), and (X4 , Y4). Also, the COPY processing algorithm is provided with the real addresses RPS and RPD by the storage control means 39 in the above stated operation. Based on these real addresses and the lateral lengths, the COPY processing algorithm accesses the second storage means 38 directly and writes the image in the bottom line of the source area into the bottom line of the destination area. The COPY processing algorithm requests the storage control means 39 to provide thereto two real addresses which indicate the starting points of the next data lines in the source and destination areas. The storage control means 39 provides the COPY processing algorithm with said two real addresses. Based on said two real addresses, the COPY processing algorithm accesses the second storage means 38 directly and writes the image in said next data line of the source area into said next data line of the destination area. The operations from the requesting of said real addresses to the writing of the image data are repeated. During these operations, the executing means 32 checks whether or not the COPY processing operations have reached the top data line in the data block 69 of the source area. If so, the executing means 32 does not perform said writing operation, and the table control means 36 resets the SOURCE flag bit S in each of the source control data and the destination control data in the entry #0 of the table 72 from 1 to 0 and resets the priority of the source control data to 0. Also, the executing means 32 checks whether or not the COPY processing operations have reached the top data line in the data block 60 of the destination area. If so, the executing means 32 does not perform said writing operation, and the table control means 36 resets the DESTINATION flag bit D in each of the source control data and the destination control data in the entry #1 of the table 72 from 1 to 0 and resets the priority of the destination control data to 0. By the COPY processing operations from said requesting of the real addresses to said writing of the image data, new data has been written from the source area into the portion of the destination area in the data block 60. The datablock 60 is to be written back into the first storage means 37 from the second storage means 38. To indicate the status, the table control means 36 sets the CHANGE flag bit to 1 in each of the source control data and the destination control data in the entry #1 of the table 72. When the data block 60 has been written back into the first storage means 37, the CHANGE flag bit is reset to 0. The following Table 2 shows the control data in the entries #0 and #1 of the table 72 at this time. At this time, the portion of the source area in the data block 69 in the second storage means 38 (Fig. 5) has been copied into the portion of the destination area in the data block 60. In the same way, the executing means 32 processes the data blocks 65 and 64. Namely, the executing means 32 selects the data block 65 as a data block to be processed in the source area, and as stated before, the storage control means 39 stores the data block 65 into a vacant storage block, namely the storage block #2, in the second storage means 38. Further, the table control means 36 transfers the control data for the data block 65 (Table 1) from the table 71 into the entry #2 of the table 72. Next, the executing means 32 selects the data block 64 as a data block to be processed in the destination area, and the storage control means 39 stores the data block 64 into a vacant storage block, namely the storage block #3, in the second storage means 38. Then, the control data for the data block 64 is transferred from the table 71 into the table 72. Then, as in the case of the data blocks 69 and 60 stated before, in the second storage means 38, the portion of the source area in the data block 65 is copied into the portion of the destination area in the data block 64. When the copying has been finished, the table control means 36 resets the SOURCE flag bit in the control data for the data block 65 from 0 to 1 and resets the priority X'FE' to 0, and then resets the DESTINATION flag bit in the data block 64from 1 to 0 and resets the priority X'FE' to 0. At this time, the data in the data block 64 has been updated with the new image written from the data block 65. The data block 64 is to be written back into the first storage means 37. To indicate this status, the table control means 36 sets the CHANGE flag bit in the control data for the data block 64 to 1. The following Table 3 shows the contents of the table 72 at this time. In the above Table 3, the [Corresponding Data Block] is shown in the rightmost column. This is shown only to facilitate the explanation of the present invention and the table 72 does not always include them. Next, the executing means 32 selects the data blocks 61 and 62 out of the data blocks remaining in the first storage means 37 to be transferred into the second storage means 38. However, as shown in the following Table 4, the storage blocks #0 - #3 in the second storage means 38 have already been stored with the data blocks 69, 60, 65, and 64, and the entries #0 - #3 of the table 72 have already been stored with the control data for said data blocks 69 - 64. Two storage blocks into which the data blocks 61 and 62 are to be stored should be selected. Second Storage Means 38 Storage Block Storage Contents #0 Data Block 69 #1 Data Block 60 #2 Data Block 65 #3 Data Block 64 First, a storage block, into which the data block 61 including a portion of the source area is to be stored, will be selected. To the end, the table control means 36 checks the source control data, consisting of 12 bits, in each of the entries of the table 72 (Table 3), finds the control data of the lowest value indicated by the 12 bits, and selects the storage block in the second storage means 38 storing the data block corresponding to the control data. Since the control word for the data block 65 (the entry #2 of the table 72) is of the lowest value, the storage block #2 is selected and the data block 61 is stored therein, and the control data for the data block 61 (Table 1) is stored from the table 71 into the entry #2 of the table 72. The following Table 5 shows the contents of the table 72 at this time. Next, a storage block, into which the data block 62 including a portion of the destination area is to be stored, will be selected. To the end, the table control means 36 checks the destination control data, consisting of 12 bits, in each of the entries of the table 72 (Table 5), and finds the control data of the lowest value indicated by the 12 bits. As the results, it is found that only the CHANGE flag bit is 1 in the control data for the data blocks 60 and 64. Therefore, the storage block #1 storing the data block 60 is selected. However, since the CHANGE flag bit in the control data is 1, namely the contents of the data block 60 have been changed and the data block 60 is required to be written back into the first storage means 37, the data block 60 in the storage block #1 in the second storage means 38 is written back into the first storage means 37 and the CHANGE flag bit is reset to 0. Thereafter, the storage control means 39 stores the data block 62 into the storage block #1 in the second storage means 38 and the control data (Table 1) is fetched into the entry #1 of the table 72. In the second storage means 38, the portion of the source area in the data block 61 in the storage block #2 is copied into the portion of the destination area in the data block 62 in the storage block #1. The table control means 36 resets the SOURCE flag bit in the control data for the data block 61 from 1 to 0 and resets the priority X'FD' to 0, and then resets the DESTINATION flag bit in the control data for the data block 62 from 1 to 0 and resets the priority X'FD' to 0, and further resets the CHANGE flag bit to 1. The contents of the table 72 and the second storage means 38 at this time are shown in the following Tables 6 and 7. Second Storage Means 38 Storage Block Storage Contents #0 Data Block 69 #1 Data Block 62 #2 Data Block 61 #3 Data Block 64 Next, a storage block, into which the data block 63 is to be stored, will be selected. To the end, the table control means 36 checks the source control data, consisting of 12 bits, in each of the entries #0 - #3 of the table 72 (Table 6) and finds the control data of the lowest value. In this case, the value of the control data in the entry #2 is 0, and therefore, the storage block #2 is selected. The storage control means 39 stores the data block 63 from the first storage means 37 into the storage block #2 of the second storage means 38, and the control data therefor (Table 1) is fetched into the entry #2 of the table 72. To explain next as to the data block 69, the data block 69 need not be fetched from the first storage means 37,since it has already been stored into the storage block #0 in the second storage means 38 (Table 7). The image of the portion of the source area in the data block 63 in the storage block #2 is copied into the portion of the destination area in the data block 69 in the storage block #0, one data line at a time, by the COPY processing algorithm. When the copying has been finished, the table control means 36 resets the SOURCE flag bit in the control data for the data block 63 in the entry #2 of the table 72 from 1 to 0 and resets the priority X'FC' to 0. Then, the table control means 36 resets the DESTINATION flag bit in the control data for the data block 69 (the entry #0 of the table 72) from 1 to 0 and resets the priority X'FC' to 0, and further sets the CHANGE flag bit to 1. The contents of the table 72 and the second storage means 38 at this time are shown in the following Tables 8 and 9. Second Storage Means 38 Storage Block Storage Contents #0 Data Block 69 #1 Data Block 62 #2 Data Block 63 #3 Data Block 64 As stated above, it is clear that all the image in the source area 51 shown in Fig. 5 has been copied into the destination area 52. However, at this time, as indicated by "1" in the CHANGE flag bit in Table 8, the updated data blocks 69, 62, and 64 exist in the storage blocks #0, #1, and #3, respectively, and they may be written back into the first storage means 37. The storage control means 39 writes back these data blocks into the first storage means 37 and the table control means 36 resets their CHANGE flag bits to 0. Finally, the table control means 36 resets all the control data in the tables 71 and 72 and completes the COPY processing operations. As seen from the above explanation, the COPY processing, wherein the source area 51 is copied into the destination area 52 in the virtual image 50 shown in Fig. 5, has been performed by fetching the predetermined data blocks from the first storage means 37 into the second storage means 38 with the lowest frequency of fetching. In the above explanation of the COPY processing, it has been assumed that all of the storage blocks of the second working storage means 38 have been cleared at the beginning, some data blocks may exist in the second storage means 38 at that time. In that case, the control data for these data blocks will be set first in the table 72 before the operations as explained above are performed. Further, although the above explanation has been made assuming that the size of the portion of the source area in a data block associated with the source area and the size of the portion of the destination area in another data block associated with the destination area are equal, these sizes may be different from each other. In that case, by the request for the reference points for such portions of different sizes, it will be found that another data block different from the currently used data block is required. At that time, the control data for the currently used data block will be updated and such a different data block will be fetched into the second storage means 38 (in case such a different data block does not exist in the second storage means 38). While the present invention has been described with respect to an embodiment in connection with the COPY processing, it is to be understood that the present invention may be applied to the image processing in general including the MOVE, ERASE, ROTATE and other processings without being limited thereto.

Claims: An image processing method wherein data representing an image is stored on a block basis as data blocks (60 - 69) in a first storage means (37) having a plurality of storage blocks (0 - 9), and data blocks to be processed are fetched from said first storage means into a second working storage means (38) having a smaller number of storage blocks (0 - 3) than said first storage means, comprising the steps of: (a) specifying the position of a source area (51) in said image, the processing operation to be performed and the position of a destination area (52) in said image which is a destination of said source area in said image processing; (b) identifying (1) the data blocks associated with said source and destination areas and determining (2), in accordance with the specified operation, a first order in which the data blocks associated with said source area are used in said image processing and a second order in which the data blocks associated with said destination area are used in said image processing; (c) establishing (4), for each storage means, a control data table (71, 72) having an entry for each data block in the associated storage means, setting first control data including data representing whether the block is associated with said source area, whether the block is associated with said destination area, and data representing its place in said first order, and second control data including data representing whether the block is associated with said source area, whether the block is associated with said destination area and data representing its place in said second order, respectively, in those entries of the table associated with the storage blocks in said first or second storage means storing said data blocks associated with said source and destination areas, (d) assembling (21 - 25) data blocks associated with said source and destination areas in locations in said second storage means replacing if necessary blocks already stored in said second storage means in accordance with necessity values derived from said first and second control data respectively as contained in the entries in the table associated with said second storage means; (e) initiating (5) an image processing operation using the data blocks assembled in said second storage means; (f) updating (6) said control data to indicate that a given data block has been used in performing said image processing operation; and (g) repeating steps (d) through (f) until the image processing operation is completed. A method as claimed in Claim 1, wherein said step of assembling in said second storage means said data blocks associated with said source and destination areas comprises: checking (21) whether or not a data block to be used exists in said second storage means; if not, finding (22) a storage block which has the lowest necessity value, fetching (25) said data block to be used from said first storage means into said storage block of said lowest necessity value; and at he same time writing (24) the control data for said data block to be used into the entry in said table means corresponding to said storage block of said lowest necessity value. A method as claimed in claim 2, wherein the step of finding said storage block of said lowest necessity value comprises: finding said storage block of said lowest necessity value in association with said source area when said data block is to be used in association with said specified area; and finding said storage block of said lowest necessity value in association with said destination area when said data block is to be used in association with said destination area. A method as claimed in Claim 2, wherein the step of fetching said data block to be used from said first storage means into said storage block of said lowest necessity value comprises: fetching said data block to be used from said first storage means into said storage block of said lowest necessity value after writing the data block existing in said storage block of said lowest necessity value back into aid first storage means when said data block existing in said storage block of said lowest necessity value has been changed. An image processing system comprising: a first storage means (37), having a plurality of storage blocks (0 - 9), which stores data representing an image on a block basis as data blocks (60 - 69) into said storage blocks; a second working storage means (38), having a smaller number of storage blocks (0 - 3) than said plurality of storage blocks in said first storage means, which stores the data blocks to be processed into said storage blocks; a specifying means (33) which specifies the position of a source area (51) in said image, the image processing operation to be performed on said source area, and the position of a destination area (52) in said image to which data blocks from said source are to be directed in said image processing operation, determining means (34) which identifies the data blocks associated with said source and destination areas and determines a first order in which the data blocks associated with said source area are used in said image processing and a second order in which the data blocks associated with said destination area are used in said image processing, in accordance with the contents specified by said specifying means; control data tables (71, 72), one for each of said storage means, each table having an entry for each storage block in the associated storage means; a table control means (36), connected between said determining means and said tables, which sets first control data including data representing whether the block is associated with said source area, whether the block is associated with said destination area, and data representing its place in said first order, and second control data including data representing whether the block is associated with said source area, whether the block is associated with said destination area, and data representing its place in said second order, respectively, in those entries of the table associated with the storage blocks in said first or second storage means storing said data blocks associated with said source and destination areas, updates the control data in the entries in the table associated with said second storage means to indicate use of storage blocks therein in an image processing operation, and checks the contents of said entries each corresponding to each of said storage blocks in said second storage means; and a storage control means (39) which receives outputs of said table control means and controls said first and second storage means to assemble data blocks associated with said source and destination areas to be processed in said second storage means replacing if necessary blocks already stored in locations selected in accordance with necessity values derived from said first and second control data respectively in the control data table associated with such locations. A system as claimed in Claim 5, wherein said table control means comprises: a reference data generating means (40) which generates data concerning associated data blocks from the position data of reference points in said image; and a pointer means (41) which receives outputs of said reference data generating means and indicates the data blocks to be referenced. A system as claimed in Claim 6, wherein said pointer means comprises: a current reference pointer (43) which indicates the data blocks referenced currently; a previous reference pointer (44) which indicates the data blocks referenced previously; and a comparator (45) which compares the contents of said current reference pointer and those of said previous reference pointer and outputs the contents of one of said pointers. An image processing system as claimed in Claim 5 or Claim 6, wherein said storage control means generates real addresses of the data in said first and second storage means.

Inventors: HASHIHARA HIDERHARA GOH YOKOHA, KITAYAMA YU, HASHIHARA, HIDERHARA 505GOH YOKOHAMAYAMATEGARDENIA, KITAYAMA, YU
Applicants: IBM, INTERNATIONAL BUSINESS MACHINES CORPORATION
Application year: 1987
Main classification: G06F15
IPC codes: G06T1, G06F12, G06T3