[0001] This invention relates to the rotation of image data of a source rectangle area of
a document. Particularly, the invention relates to the rotation of the image data
of the source rectangle area by 90 degrees or 270 degrees wherein the rotated image
data is stored into a destination rectangle area in an image storage means which is
partitioned by boundary lines separated from each other by K bits, with the K bits
between the boundary lines being handled as a group of bits, such as a byte or a word
during read/write operations of the image storage means.
[0002] Many efforts have been developed which rotate image data stored in a memory area
by an angle of 90 degrees, 180 degrees or 270 degrees and store the rotated image
data in a separate memory area. In traditional image rotation processes, image data
to be rotated was rotated in bit by bit process. That is, the first bit of the image
data in a source memory area was fetched and stored in a destination memory area to
perform the desired image rotation. Next, the second bit was fetched and stored in
the destination memory area, and so on. This bit by bit process required a long processing
time. To improve the processing time, an approach disclosed in the Japanese published
unexamined patent application 57-130144 was suggested in which the original image
data stored in an image data memory is fetched on the word by word basis and the fetched
words are stored in a rotation memory. The word consists of N bits, and the rotation
memory stores M words. The image data stored in the image data memory, i.e. source
memory area is stored in the rotation memory on the word by word basis, and the stored
image data is read from the rotation memory in a direction determined by a rotation
angle +90 degrees or -90 degrees. And, the U.S. Patent 4084195, assigned to the assignee
of the present invention, discloses an image rotation system for a dot printer wherein
an image data of a document is stored in a page buffer from which plural pel lines
of the image data are stored in a horizontal stripe buffer which has data lines equal
to the number of ink jet nozzles of the printer and is partitioned into plural byte
columns. Alternate byte included in the byte column is rotated by a 90 degree rotation
means and is stored in one of vertical stripe buffers.
[0003] These schemes are effective in the case that the read/write operations of the image
data memory and a memory area, into which the rotated image data from the rotation
memory is stored, are performed on the bit by bit basis, wherein the addresses of
the rotated image data of the M bits are freely assigned in the memory area. However,
if both the image data memory and the memory area have the byte boundary or the word
boundary wherein the read/write operations are performed on the byte by byte basis
or the word by word basis, a problem shown in Fig. 2 is encountered. In the Fig. 2,
it is assumed that an image 13 is rotated by 90 degrees and stored in an area 16 of
a memory area 11, and a memory area 11 has byte boundaries 14. To perform the rotation
of the image 13, one byte 12 of the image 13 must be stored into a byte position 15
of the area 16. In this case, the one byte position 15 does not align with the byte
boundaries 14, and hence two write cycles 17 are required to store the one byte, hence
complicated mask. Shift operations and a store operation of the remaining bits for
each byte are required, resulting in time consuming complicated operations.
[0004] In accordance with the present invention, a host processor sends a display terminal
image data of one page document, command information or image orders and control data.
In the case of 90° rotation in a clockwise direction, the command information or image
order include Extract Source Rectangle Area, Rotate 90° Destination Rectangle Area.
Image orders coordinate position and size of a source rectangle area in one page document,
and coordinate position of a destination rectangle area in the image storage means
into which the image data of the source rectangle area rotated by one of rotation
angles 90 degrees, 180 degrees or 270 degrees is stored. The image storage means operates
as a storage buffer of a display unit, which displays the image data of the destination
rectangle area in the image storage means.
[0005] The image storage means is partitioned by boundary lines separated from each other
by K bits. The K bits between the two boundary lines are handled as a group of bits,
such as a byte, a word, etc. during the read/write operations of the image storage
means, that is, the read/write operations are made on the byte basis or the word basis.
[0006] The image data of the source rectangle area is stored in a first buffer which has
horizontal bits corresponding to the total horizontal pels of the document and a vertical
K bits or K pel lines. The first buffer is divided into plural square blocks each
of which has the K×K bits. The image data in the first buffer is rotated and stored
in the image storage means, as described hereinafter.
[0007] The control means, such as a microprocessor of the display terminal decodes the coordinate
position and the size of the source rectangle area and the coordinate position of
the destination rectangle area, and finds or detects a space, which is represented
by M bits, between a byte or word boundary of the image storage means and an edge
area of the destination rectangle area into which an edge area, such as a top edge
area of the source rectangle area is stored after rotated by the rotation angle, such
as 90 degree rotation in the clockwise direction. The microprocessor stores the image
data of the top edge area of the source rectangle area into the first buffer wherein
the space which is equal to M bits is provided above the image data of the top edge
area. The microprocessor fetches the K×K bits of one of blocks storing the top edge
area in the first buffer and stores the fetched K×K bits into a rotation buffer of
the K×K bits. To perform the selected rotation, the microprocessor sequentially fetches
each of K bit group from the rotation buffer in a direction in accordance with the
selected rotation angle, and stores the fetched each K bit group into a second buffer
of the K×K bits. Before storing the K bit group into the image storage means, the
bits in the space are converted to the O bits. And, the microprocessor stores each
K bit group including the image bits and the O bits and store it in the image storage
means.
[0008] In accordance with another aspect of the present invention, the image orders, the
control data and the image data of the one page document in a compressed form are
sent from the host processor to a communication interface from which both the image
orders and the control data re initially sent to the display terminal. The microprocessor
of the display terminal decodes the image orders and performs the calculations of
the control data for generating the parameters which are used in the subsequent image
process operations. After the display terminal has generated the parameters, the display
terminal starts the image process operations from the top of the document. That is,
the display terminal does not start the image process operations of the one page document
until the display terminal has made preparations for the image process.
[0009] The microprocessor starts the image process operations by decompressing the compressed
image data from top edge of the document. As the image of the document is being reproduced,
the microprocessor counts the pel lines of the reproduced document image. Until the
microprocessor detects that the number of pel lines of the reproduced document image.
Untilt he microprocessor detects that the number of pel lines of the reproduced document
image becomes equal to one parameter, the microprocessor does not write the reproduced
document image into the first buffer which has the K pel lines. When the microprocessor
detects the number of pel lines of the reproduced document image becomes equal to
one parameters, the microprocessor writes the image data of the top edge portion of
the source rectangle of the document area into the first buffer. And, the operations
for each of the K × K bit groups, and stores the resultant data into the image storage
means for displaying them on the display surface. When these image data, i.e. first
K pel line group has been processed, the microprocessor writes the second K pel line
group document image into the first buffer, and performs the image process operations
of the second K pel line group and stores the resultant data into the image storage
means for displaying them on the display surface. In this manner, the subsequent K
pel line groups are sequentially written into the first buffer and the processed image
data are stored into the image storage means.
[0010] In the case that a resolution of the document is 100 per/inch, the page buffer of
128K bytes is required for each display terminals, which stores the decompressed or
reproduced image data of the full page, such as A4 size document; but, by this function,
it is not necessary for the display terminal to have the page buffer of the large
memory capacity.
[0011] According to the invention there is provided a method for rotating image data of
a source rectangle area of a document by a specified rotation angle and storing said
rotated image data in a destination rectangle area of a storage means, said storage
means being partitioned by boundaries separated from each other by K bits, comprising
steps of: detecting a space between an edge of said destination rectangle area and
said boundary in said storage means; storing said image data of said source rectangle
area corresponding to an area of said edge into a line buffer which is partitioned
into plural blocks each of which has a size of K×K bits by adding a space which corresponds
to said space in said storage means; storing said K×K bits of one of said blocks of
said line buffer into a rotation buffer of K×K bits; and fetching each of the K bit
groups including said image data from said rotation buffer in a direction in accordance
with said rotation angle and storing said K bit groups in said destination rectangle
area of said storage means.
[0012] 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:-
Figure 1 is an illustration of the block diagram constructed in accordance with the
present invention.
Figure 2 is an illustration of the rotation scheme in the prior art.
Figure 3 is an illustration of the source rectangle area of the one page document
and the destination rectangle area of an image storage means.
Figure 4 is an illustration of the operations for rotating the image data of the source
rectangle area and storing the rotated image data into the destination rectangle area
of the image storage means.
Figure 5 is an illustration of the flow chart showing the entire process of the present
invention, and
Figure 6 is an illustration of the detailed flow chart showing the image process between
an eight line buffer and the image storage means.
[0013] Fig. 1 shows the block diagram in accordance with the present invention. A host processor
21 is a central processing unit and controls plural display terminals 22 connected
to the host processor 21 through communication lines. The display terminal 22 includes
a register 23, a calculation unit 24, a register 25, a data decompress unit 26, a
microprocessor 27, the first buffer or an eight line buffers 28, a rotation buffer
29, the second buffer or a working buffer 31, an image storage means 30, and a display
unit (not shown). The image storage means 30 operates as a buffer of the display unit,
which displays the rotated image data in the rectangle area stored in the image storage
means 30.
[0014] The microprocessor 27 performs the various control operations of the above components
of the display terminal 22 through control lines connected to the components. These
control lines, however, are not shown in the Fig. 1 to simplify the drawing.
[0015] A communication buffer 34 of 7 K bytes is shown between the host processor 21 and
the display terminal 22. The communication buffer 34 is located in a communication
interface, not shown in the Fig. 1, which operates as an interface between the host
processor 21 and the display terminal 22. Both the image orders and the image data
of the one page document 36 in a compressed form are supplied to the communication
interface, from which the image orders are immediately supplied to the display terminal
22, and the compressed image data is held in the communication buffer 34.
[0016] After the calculation unit 24 has generated parameters used for controlling the image
rotation process by calculating the data in the register 23; and the parameters have
been stored in the register 25, so that the display terminal 22 has made preparations
for the image rotation process, the microprocessor 27 controls the decompression unit
26 to perform the decompression of the compressed image data stored in the communication
buffer 34.
[0017] The Fig. 3 shows the source rectangle area 35 in the one page document 36 and the
destination rectangle area 35ʹ in the image presentation space 30. The image storage
means 30 is partitioned by the boundary lines 301 which are separated from each other
by K bits. In the embodiment being described, the eight bits are used as the exemplary
number of K bits. That is, the boundary lines 301 in the image storage means 30 means
the byte boundaries, and the read/write operations of the image storage means 30 are
made on the byte basis. The eight line buffer 28 shown in the Fig. 1 has the horizontal
bits, for example 256 × 8 bits, for storing the total horizontal pels of the document
36 and the eight bits in the vertical direction. The eight line buffer 28 is divided
to plural square blocks, each of which has 8×8 bits. The first pel positions of the
pel lines of the document 36 which includes the source rectangle area 35 are aligned
with the first bit positions of the horizontal data lines of the eight line buffer
28, and each of eight pel line group of the image data is sequentially stored in the
eight line buffer 28, whereby the document 36 is virtually partitioned by the boundary
lines 301. Therefore, virtual bit boundary lines 301 are superimposingly shown on
the documents 36. The Fig. 3 also shows that the image data of the source rectangle
area 35 of the width W and the height H located at the address (X
s, Y
s) is rotated by 90 degrees or 270 degrees in the clockwise direction and stored in
the destination rectangle area 35ʹ located at the address (X
D, Y
D).
[0018] The upper left corner of the image data of the document shown in the Fig. 3 is assigned
with a coordinate position (0, 0) from which the document is partitioned by the eight
bit boundary lines. That is, the first pel of the pel line of the document 36 is aligned
with the first bit position of the eight line buffer 28.
[0019] Referring to the Fig. 1, again, the host processor 21 sends the display terminal
22 the image orders, in advance. The image orders instruct the display terminal 22
to extract the image data of the source rectangle area 35 from the data stream in
the compressed form which represents the one page document 36, to rotate the image
data of the source rectangle area 35 by the rotation angle 90 degrees, 180 degrees
or 270 degrees, and to store the rotated image data into the destination rectangle
area 35 of the image storage means 30.
[0020] The image orders also specify the followings (Fig. 3):
Coordinate position (X
s, Y
s), width W and height H of the source rectangle area 35 on the one page document 36;
Coordinate position (X
D, Y
D) of the destination rectangle area 35ʹ in the image storage means 30 into which the
rotated image data of the source rectangle area 35 is stored; and
Rotation angle, i.e. 90 degrees, 180 degrees or 270 degrees.
[0021] These data is stored in the register 23 shown in the Fig. 1. The calculation unit
24 shown in the Fig. 1 calculates the above data to generate the following parameters
for the process of the top edge area of the source rectangle area 35, which are stored
in the register 25:
(a) Pel line number of the source rectangle area 35 counted from the top pel line
of the document.
The pel line number is called as pointer 1 hereinafter. Initially, the pointer 1 specifies
the first pel line of the source rectangle area 35, and is incremented to specify
the next pel line as the process proceeds.
(b) Pel line number in the eight line buffer 28 into which the decompressed image
data of one pel line is written.
The pel line number in the buffer 28 is called as pointer 2 hereinafter. In the 90
degree rotation in the clockwise direction, the initial value of the pointer 2 is
equal to M+1 (bits), shown in the Fig. 4. The pointer 2 is also incremented as the
process proceeds.
(c) Bit line number in the working buffer 31 from which the bit line or one byte is
fetched. This bit line number is called as pointer 3 hereinafter. In the 90 degree
rotation in the clockwise direction, the initial value of the pointer 3 is equal to
N+1 (bits), shown in the Fig. 4. The pointer 3 is also incremented as the process
proceeds.
(d) Block number of the eight line buffer 28 from which 8×8 bits, i.e. one block image
data, is fetched to the rotation buffer 29. The block number is called as pointer
4 hereinafter. The pointer 4 is also incremented as the process proceeds, and
(e) Count values representing the width W and the height H of the source rectangle
area 35 for controlling the fetch operation which sequentially fetches the blocks
[0022] These parameters (a) through (e) are stored in the register 25. The microprocessor
27 refers to the parameters and increments the pointers to perform the image rotation
process ordered by the host processor 21. After the parameters have been stored in
the register 25, that is, the display terminal 22 has made preparations for the image
rotation process, the display terminal 22 starts to process the image data in the
compressed form of the one page document 36 stored in the communication buffer 34.
The data compression and decompression scheme could be one of one-dimensional or two-dimensional
compression and decompression scheme which is well known in the art. Accordingly,
the details of the data compression and decompression scheme are not described in
the specification.
[0023] Describing in detail the operations in accordance with the invention with referring
to the Figs. 1, 3, 4, 5 and 6. The microprocessor 27 starts the operations in a block
501 of the Fig. 5. In a block 502, under the control of the microprocessor 27, the
calculation unit 24 calculates the data stored in the register 23 and generates the
next parameters (a) through (e).
[0024] The parameters stored in the register 25 in the exemplary case shown in the Fig.
4 are as follows:
(a) The initial value of the pointer 1 = Ys
(b) The initial value of the pointer 2 = M+1
(c) The initial value of the pointer 3 = N+1
(d) The initial value of the pointer 4 = 2
(e) The count value in the horizontal direction = W
The count value in the vertical direction = H
[0025] As shown in the Fig. 4, the M bits represent the space, i.e. the number of bits between
the right edge of the destination rectangle area 35ʹ and the boundary line 301 in
the image storage means 30, and the N bits represent the number of bits between the
left edge of the source rectangle area 35 and the boundary line 301. The microprocessor
27 generates the values M and N by calculating the data Xs, Ys, W, H, X
D and Y
D and the address of the boundary lines 301 in the calculation unit 24. The M bits
in the image storage means 30 means the M lines in the rotation buffer 29, and the
N bits in the rotation buffer 29 means the N lines in the working buffer 31.
[0026] More particularly, the first pel positions of the pel lines of the document 36 which
includes the source rectangle area 35 are aligned with the first bit positions of
the horizontal data line of the eight line buffer 28, and each of eight pel lines
group of the image data is sequentially stored in the eight line buffer 28, whereby
the document 36 is virtually partitioned by the boundary lines 301, as stated hereinbefore.
The write operations of the top edge area of the document 36 into the eight line buffer
28 is made to provide the space, i.e. M lines. The N bits in a block #2, which will
be described as a sub-block 33 hereinafter, are the bits to be ignored after rotated.
[0027] The microprocessor 27 starts to decompress the compressed image data in the communication
buffer 34 from the top pel line of the document 36. The microprocessor 27 counts the
pel lines being decompressed, as the decompress operations proceed. The microprocessor
27 does not store the decompressed image data in the eight line buffer 28 until the
count value becomes equal to the value of the pointer 1, i.e. Ys. When count value
becomes equal to the value Ys of the pointer 1, the image data from the left edge
to the right edge of the document of the pel line Ys is written in the line of the
eight line buffer 28 pointed by the value M+1 of the pointer 2, and the microprocessor
27 increments the value Ys of the pointer 1 to the value Ys+1, and increments the
count value. And, the microprocessor also increments the pointer 2 to value M+2. Since
the incremented values of the pointer 1 and the count are equal, the entire image
data of the pel line Ys+1 is written in the M+2 line of the eight line buffer 28 pointed
by the pointer 2. In this manner, the decompressed image data of the pel line starting
at the pel line Ys is sequentially stored in the eight line buffer 28 until it is
fulled.
[0028] This operations are shown in blocks 503 through 508 in the Fig. 5. In block 503,
the microprocessor 27 determines if the process of the source rectangle area 35 has
been ended. If no, the compressed image data corresponding to one pel line is decompressed
in a block 505. The microprocessor 27 determines if the count value of the decompressed
pel line becomes equal to the value of the pointer 1 in a block 506. If no, the operations
return to the block 503. If yes, the decompressed image data of the one pel line is
written in the eight line buffer 28, in the block 507. The microprocessor 27 determines
if the eight line buffer 28 is fulled, in a block 508. If no, the operations return
to the block 503. If yes, the microprocessor 27 starts to perform the rotation process
of the image data, in a block 509. If the output of the block 503 is yes, the microprocessor
27 determines if the eight line buffer 28 is emptied, in a block 504. If yes, the
operations are ended in a block 510. If no, the operations proceed to the block 509.
[0029] Detail operations of the block 509 is shown in the Fig. 6. The operations start in
a block 600. In a block 601, the microprocessor 27 fetches the all 8×8 bits in the
block #2 of the eight line buffer 28 pointed by the pointer 4 and writes the all 8×8
bits into the rotation buffer 29, as shown in the Fig. 4. In a block 602, the microprocessor
27 fetches the 8×8 bits in the rotation buffer 29 in a direction specified by the
rotation angle, and writes them in the working buffer 31. In the case of the 90 degree
rotation in the clockwise direction, the left-most vertical eight bits of the rotation
buffer 29 are initially fetched. Among the fetched eight bits, the bits in the sub-block
32 are converted to O bits. And, the left-most vertical eight bits including the converted
O bits are written into the first horizontal bit line of the working buffer 31 of
8×8 bits, and the next vertical eight bits are fetched from the rotation buffer 29
and the bits included in the sub-block 32 are converted to the O bits and these eight
bits are written in the second horizontal bit line of the working buffer 31.
[0030] As a result, the 8×8 bits including the image data in the rotation buffer 29 are
rotated by the rotation angle of 90 degrees and stored in the working buffer 31, as
shown in the Fig. 4. It is noted that the bits in the sub-block 32 have been converted
to the O bits, as described above. In a block 603, the microprocessor 27 increments
the pointer 4 to a value 3 which points the next block #3 of the eight line buffer
28.
[0031] Next, the microprocessor 27 fetches the image data stored in the working buffer 31
and writes the image data into the image storage means 30, in blocks 604 through 609.
More particularly, the microprocessor 27 has generated the address or coordinate position
(X
D1, Y
D1) of one byte into which the first byte of the image data of the source rectangle
area 35 stored in the working buffer 31 is written. The address (X
D1, Y
D1) has been generated based upon the address (X
D, Y
D) of the destination rectangle area 35ʹ and the data H representing the height of
the source rectangle area 35 included in the image orders sent from the host processor
21. In the block 604, the microprocessor 27 refers to the pointer 3, the initial value
of which is N+1, and fetches first one byte at the N+1 data line of the working buffer
31, as shown in the Fig. 4. That is, the microprocessor 27 starts the fetch and write
operations of the bytes at the N+1 byte, in a block 604.
[0032] The microprocessor 27 also converts the 8-M bits of the first one byte at the address
(X
D1, Y
D1) of the image storage means 30 to the O bits and performs the write operations of
the first one byte pointed by the pointer 3 into the byte position (X
D1, Y
D1) by performing the logical OR operations of the fetched first one byte of the buffer
31 and the first one byte at the address (X
D1, Y
D1).
[0033] It is noted that the background data in the image storage means 30 surrounding the
destination rectangle area 35ʹ is not destroyed since the M bits of each byte are
O bits, which overlap on the background data in the image storage means 30.
[0034] The microprocessor 27, in a block 605 decrements the count value (W) by one to the
value W-1 in this case. And, in a block 606, the microprocessor 27 determines if the
decremented count value is equal to zero. If yes, the operations are terminated in
a block 607. If no, the microprocessor 27 increments the pointer 3 by one and the
byte address of the image storage means 30 by one, in a block 608. In a block 609,
the microprocessor 27 determines if the working buffer 31 is emptied. If no, the process
is returned to the block 604. If yes, the microprocessor 27 sets the pointer 3 to
point the top byte line of the working buffer 31, in a block 610. And, the process
is returned to the block 601, wherein the 8×8 bits in the next block pointed by the
pointer 4 are written into the rotation buffer 29.
[0035] Describing in detail the loop of the blocks 604 - 609, second one byte in the working
buffer 31 which is pointed by the incremented pointer 3 (N+2) is fetched in the block
604 in response to the NO output of the block 609. And, the 8-M bits of the second
one byte of the image storage means 30 are converted to the O bits, and the logical
OR operations of both the second one bytes are performed, so that the second one byte
in the working buffer 31 is stored in the second byte of the image storage means 30.
The operational loop through the blocks 604 - 609 is repeated until the eight bytes
in the working buffer 31 have been stored in the image storage means 30. When the
eight bytes in the working buffer 31 have been stored in the image storage means,
which is indicated by the output YES of the block 609, the process is returned to
the block 601 in which the 8×8 bits of the next block (block #3 through #6) of the
eight line buffer 28 are sequentially written into the rotation buffer 29. During
the process of the last block #6 of the eight line buffer 28, the block 606 in the
Fig. 6 finds that the count value representing the number of remaining or unprocessed
bits in the width W of the document 36 becomes equal to 0, in other words all bits
in the width W have been processed. And, the process of the first eight pel lines
is terminated in the block 607 of the Fig. 6, and the operations are returned to the
block 503 of the Fig. 5. In the block 503, the microprocessor 27 determines if the
process of the source rectangle area 35 has been ended. Since the output of the block
503 is "No" in this case, the second eight pel lines are decompressed from the compressed
image data in the communication buffer 34 and written into the eight line buffer 28,
and the image rotation process of the second eight pel lines is performed in the manner
as already described. Similarly, the subsequent eight pel lines of the source rectangle
area 35 of the document 36 are processed. For each eight pel lines, the block 503
of the Fig. 5 determines if the process of the source rectangle area 35 is ended.
The determination is made by comparing the total number of processed pel lines of
the source rectangle area 35 with the count value H which represents the height of
the source rectangle area 35. If the block 503 produces the output YES and the block
504 produces the output YES, the process of the source rectangle area 35 is ended
in the block 510.
[0036] In this manner, the first eight pel lines of the decompressed image data of the source
rectangle area 35 are stored in the eight line buffer 28, and rotated and stored in
the destination rectangle area 35ʹ in the image storage means 30, and the second next
eight pel lines of the decompressed image data of the source rectangle area 35 are
stored in the eight line buffer 28 from the communication buffer 34, and rotated and
stored in the image storage means 30. Although only parameters for the process of
the top edge area, i.e. the first eight pel lines of the source rectangle area 35
were described in the specification, the microprocessor 27 updates the parameters
in the register 25 for the process of the subsequent eight pel lines. And, the microprocessor
27 uses them for processing the subsequent, i.e. second, third ..., eight pel lines
of the source rectangle area 35, in the manner similar to that described for the process
of the first eight pel lines. It is considered that the values of the parameters for
the subsequent eight pel lines are easily reached by those skilled in the art based
upon the description already described. Therefore, the parameters are not described
herein.
[0037] After the microprocessor 27 has processed the source rectangle area 35, the microprocessor
27 terminates the image rotation process, that is, the microprocessor 27 ignores the
image data between the last pel line of the source rectangle area 35 and the end of
the document 36.
[0038] The microprocessor 27 displays the image data of the destination rectangle area 35ʹ
stored in the storage means 30 on the display surface of the display unit, as the
rotated image data of each 8×8 bit block is written in the image storage means 30.
[0039] Although the rotated output data of the rotation buffer 29 was written into the image
storage means 30 through the working buffer 31, the output data of the rotation buffer
29 would be directly written into the image storage means 30. In this case, the value
N+1 of the pointer 3 is controlled to point the N+1 bit position of the rotation buffer
29.
[0040] As described hereinbefore, it is necessary to convert the M bits in each byte to
the O bits before storing them into the image storage means to prevent the background
data surrounding the destination rectangle area 35ʹ in the image storage means 30
from being destroyed. In the explained embodiment, the M bits are converted to the
O bits when the eight bits are written into the working buffer 31 from the rotation
buffer 29, as described with respect to the block 602 of the Fig. 6. However, the
M bits could be converted to the O bits in other processing steps in place of the
block 602.
[0041] The conversion could be made in the write operations of the eight pel lines into
the eight line buffer 28 from the decompression unit 26. Before the eight pel lines
are written, the all bits in the eight line buffer 28 are reset to the O bits. Then,
the one pel line is written into the eight line buffer 28 in the block 507 of the
Fig. 5.
[0042] Alternatively, the conversion could be made during the write operations in the block
602 of the Fig. 6 which writes the 8×8 bits of the one block of the eight line buffer
28 in the rotation buffer 29. At the first, all bits in the rotation buffer 29 are
reset to the O bits. And, during the write operations of the M lines from the one
block of the eight line buffer 28 to the rotation buffer 29, the M lines are mashed
so that the M lines are not written into the sub-block 32 of the rotation buffer 29.
Then, the remaining bits including the image bits are written into the rotation buffer
29 without being mashed, whereby the sub-block 32 includes the O bits.
[0043] Alternatively, the conversion could be made in the write operations in the block
604 of the Fig. 6 which writes the byte of the working buffer 31 into the image storage
means 30. After fetching one byte from the working buffer 31, the M bits of the fetched
one byte are converted to the O bits.
[0044] As stated hereinbefore, the 8×8 bits in the rotation buffer 29 are fetched in a direction
determined by the rotation angle. In the case of the 180 degree rotation, the fetch
operations from the rotation buffer 29 is made from the bottom horizontal eight bits
towards the upper horizontal eight bits, and the write operations into the working
buffer 31 is made to write the bottom horizontal eight bits into the top horizontal
bit line of the working buffer 31 and the upper most horizontal eight bits into the
last horizontal bit line. In the case of the 270 degree rotation in the clockwise
direction, the fetch and write operations are made so that the right-most vertical
eight bits in the rotation buffer 29 are stored in the top horizontal bit line of
the working buffer 31 and the left-most vertical eight bits are stored in the bottom
horizontal bit line. Although the byte boundary is used in the specific embodiment,
that is K=8, other boundaries such as 16 bits, 32 bits boundaries, etc. could be used.
[0045] Although the areas 35 and 35ʹ were described as the rectangle area, the areas could
be the square area.
[0046] Although the invention has been described with reference to this specific embodiment,
this description is not meant to be construed in a limiting sense. Various modification
of the disclosed embodiment, as well as other embodiment of the invention, will become
apparent to those persons skilled in the art upon reference to the description of
this invention.
1. In a method for rotating image data of a source rectangle area of a document by
a specified rotation angle and storing said rotated image data in a destination rectangle
area of a storage means, said storage means being partitioned by boundaries separated
from each other by K bits, comprising steps of:
detecting a space between an edge of said destination rectangle area and said boundary
in said storage means;
storing said image data of said source rectangle area corresponding to an area of
said edge into a line buffer which is partitioned into plural blocks each of which
has a size of K×K bits by adding a space which corresponds to said space in said storage
means;
storing said K×K bits of one of said blocks of said line buffer into a rotation buffer
of K×K bits; and
fetching each of the K bit groups including said image data from said rotation buffer
in a direction in accordance with said rotation angle and storing said K bit groups
in said destination rectangle area of said storage means.
2. A method according to Claim 1, wherein said rotation angle is one of 90 degrees
and 270 degrees.
3. A method according to Claim 1, wherein said space between said edge of said destination
rectangle area and said boundary in said storage means is detected based upon a width
and a height of said source rectangle area and a position of said destination rectangle
area in said storage means.
4. A method according to Claim 1, wherein said space between said edge of said destination
rectangle area and said boundary in said storage means is represented as M bits, a
first pel line of said image data of said source rectangle area is stored in M+1 line
of said line buffer, and said added space includes M pel lines.
5. A method according to Claim 3, wherein bits in said added M pel lines are converted
to O bits, before each of said K bit groups is stored in said storage means.
6. A method according to Claim 4, wherein the bits included in said added M pel lines
in said line buffer are the O bits.
7. A method according to Claim 4 includes steps of resetting all bits in said rotation
buffer, sequentially fetching said K bit groups from said M+1 line of said block of
said line buffer, and sequentially storing said fetched K bit groups at a line starting
from M+1 line of said rotation buffer.
8. A method according to Claim 1 includes steps of sequentially storing said each
of said fetched K bit groups from said rotation buffer into a working buffer of K×K
bits, sequentially fetching said K bit groups including said image data from said
working buffer, and sequentially storing said fetched K bit groups into said destination
rectangle area of said storage means.
9. A method according to Claim 8, wherein the bits in said space of each of said fetched
K bit groups from said rotation buffer are converted to the O bits.
10. A method according to Claim 8, wherein the bits in said space of each of said
fetched K bit groups from said working buffer are converted to the O bits.