JPH0731727B2 - Image 90 degree rotation method - Google Patents
Image 90 degree rotation methodInfo
- Publication number
- JPH0731727B2 JPH0731727B2 JP61112891A JP11289186A JPH0731727B2 JP H0731727 B2 JPH0731727 B2 JP H0731727B2 JP 61112891 A JP61112891 A JP 61112891A JP 11289186 A JP11289186 A JP 11289186A JP H0731727 B2 JPH0731727 B2 JP H0731727B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- bits
- bit
- image
- word
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
- 238000000034 method Methods 0.000 title claims description 15
- 230000010365 information processing Effects 0.000 claims description 4
- 238000013500 data storage Methods 0.000 claims 2
- 238000010586 diagram Methods 0.000 description 10
- 238000007796 conventional method Methods 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
Landscapes
- Image Processing (AREA)
- Digital Computer Display Output (AREA)
- Editing Of Facsimile Originals (AREA)
- Controls And Circuits For Display Device (AREA)
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、語構成のメモリにパックされた2進画像の画
像90゜回転方法に関する。Description: FIELD OF THE INVENTION The present invention relates to an image 90 ° rotation method for a binary image packed in word organization memory.
従来1語NビットからなるメモリN語にパックして格納
されているN×Nの2進画像の転置画像を得るための方
法として、転置された1語N画素を作るため元の画像を
構成する語のあるビット位置に注目し、1語から1ビッ
トずつ抽出し、N語繰り返す処理が用いられていた。N
=8の場合の例を第6図に示す。同図(a)の画像を90
゜回転するために、同図(a)の画像から1ワードずつ
よみ出しaビット目の画素を1ビットずつとり出し、同
図(b)のa行目の1ワードを作る。したがって同図
(b)の画像を得るためにはメモリをN2回リードしN回
ライトする必要がある。As a method for obtaining a transposed image of an N × N binary image which is conventionally packed and stored in a memory N word consisting of 1 word N bits, the original image is constructed to produce transposed 1 word N pixels. Focusing on a certain bit position of a word to be extracted, one bit is extracted from each word, and N words are repeated. N
An example of the case of = 8 is shown in FIG. 90 of the image in FIG.
In order to rotate by .degree., One word is read out from the image of FIG. 10A one by one, and the pixel of the a-th bit is taken out bit by bit, and one word of the a-th row of FIG. Therefore, it is necessary to read the memory N 2 times and write N times in order to obtain the image of FIG.
従来の方法ではメモリをN×N回リードしN回ライトす
るためN×N+N回のアクセスが必要であり処理時間が
遅くなるという問題があった。The conventional method has a problem in that since the memory is read N × N times and written N times, N × N + N accesses are required and the processing time is delayed.
[問題点を解決するための手段] 第1の発明によれば、N=2nビットで構成される語単位
にアクセスできるメモリをもつ情報処理装置における画
像90度回転方法において、N×Nの2値画像がN語に格
納されている時、Nビットの語のビット位置の2進数表
現でのn−j+1ビット目が1であれば、Nビットのデ
ータMの同一ビット位置に1を与えることによりできる
NビットのマスクデータMを出力する操作と、i≫j,
(i+1)≫jで得られる2つのアドレスのデータA,B
を読み出し、B∩を2n-jビット左シフトしたデータと
A∩との論理和をとったデータと、A∩Mを2n-jビッ
ト右シフトしたデータとB∩Mとの論理和をとったデー
タとを、それぞれ(i+1)≫jとi≫jに格納する操
作を備え、(但し、記号の上のバーは論理否定、∩は論
理積、i≫jにおける≫はiをjビット右へローテート
シフト(nビットローテーション)することを示す記号
である。)前記マスクデータM出力操作をj=1,…,nと
してn回繰り返し操作し、更に前記各マスクデータM出
力操作の各回について前記データ格納操作をi=0,2,4,
…N−2としてN/2回繰り返し操作することにより右へ9
0度回転されたN×N2値画像を得ることを特徴とする画
像90度回転方法が得られる。[Means for Solving the Problems] According to the first invention, in an image 90-degree rotation method in an information processing apparatus having a memory capable of accessing word units composed of N = 2n bits, N × N of 2 is used. When the value image is stored in N words, if the n-j + 1 bit in the binary representation of the bit position of the N-bit word is 1, give 1 to the same bit position of the N-bit data M. And an operation of outputting N-bit mask data M by
(I + 1) >> Data A and B of two addresses obtained by j
Is read, and the data obtained by logically ORing the data obtained by shifting B∩ 2n - j bits to the left and A ∩ and the data obtained by shifting A ∩ M to the right by 2n - j bits and the B ∩M are obtained. Data is stored in (i + 1) >> j and i >> j, respectively (however, the bar above the symbol is a logical NOT, ∩ is a logical product, and ≫ in i >> j is i to the right by j bits). This is a symbol indicating a rotation shift (n-bit rotation).) The mask data M output operation is repeated n times with j = 1, ..., N, and the mask data M output operation is repeated for each time. Store operation i = 0,2,4,
… By repeating N / 2 times as N-2, 9 to the right
An image 90 degree rotation method is obtained which is characterized by obtaining an N × N binary image rotated 0 degrees.
第2の発明によれば、N=2nビットで構成される語単位
にアクセスできるメモリをもつ情報処理装置における画
像90ど回転方法において、N×Nの2値画像がN語に格
納されている時、Nビットの語のビット位置の2進数表
現でのn−j+1ビット目が1であれば、Nビットのデ
ータMの同一ビット位置に1を与えることによりできる
NビットのマスクデータMを出力する操作と、i≫j,
(i+1)≫jで得られる2つのアドレスのデータA,B
を読み出し、A∩を2n-jビット左シフトしたデータと
B∩との論理和をとったデータと、B∩Mを2n-jビッ
ト右シフトしたデータとA∩Mとの論理和をとったデー
タとを、それぞれi≫jと(i+1)≫jに格納する操
作を備え、(但し、記号の上のバーは論理否定、∩は論
理積、i≫jにおける≫はiをjビット右へローテート
シフト(nビットローテーション)することを示す記号
である。)前記マスクデータM出力操作をj=1,…,nと
してn回繰り返し操作し、更に前記各マスクデータM出
力操作の各回について前記データ格納操作をi=0,2,4,
…,N−2としてN/2回繰り返し操作することにより左へ9
0度回転されたN×N2値画像を得ることを特徴とする画
像90度回転方法が得られる。According to the second aspect of the present invention, in a method of rotating an image 90 in an information processing apparatus having a memory capable of accessing a word unit composed of N = 2n bits, N × N binary images are stored in N words. At this time, if the (n−j + 1) th bit in the binary representation of the bit position of the N-bit word is 1, the N-bit mask data M which is obtained by giving 1 to the same bit position of the N-bit data M is output. Operation, i >> j,
(I + 1) >> Data A and B of two addresses obtained by j
Is read, and the data obtained by logically ORing the data obtained by shifting A∩ 2n - j bits to the left and B ∩ and the data obtained by shifting B ∩ M to the right by 2n - j bits and the A ∩M are obtained. Data is stored in i >> j and (i + 1) >> j, respectively (however, the bar above the symbol is logical negation, ∩ is logical product, >> in i >> j is i to the right by j bits). This is a symbol indicating a rotation shift (n-bit rotation).) The mask data M output operation is repeated n times with j = 1, ..., N, and the mask data M output operation is repeated for each time. Store operation i = 0,2,4,
…, N-2 is repeated N / 2 times, and leftward 9
An image 90 degree rotation method is obtained which is characterized by obtaining an N × N binary image rotated 0 degrees.
[実施例] 図面を参照して本発明について説明する。第1図は第1
の本発明の一実施例を示すブロック図である。この例で
は説明を簡単にするためn=4,すなわちN=16である。[Examples] The present invention will be described with reference to the drawings. Figure 1 is the first
FIG. 3 is a block diagram showing an embodiment of the present invention. In this example, n = 4, that is, N = 16, for simplification of description.
16×16の2値画像が16語としてメモリに格納され、各語
は画像の一水平画素16画素分のデータからなる。この場
合の対応語の部分入れ替えは4つのステージに分かれ
る。第1ステージではペアとなる語、すなわち同図
(a)に示すように、アドレス0とアドレス8,アドレス
1とアドレス9,…,アドレス7とアドレスFの8つのペ
アに格納されている8対のペアデータに対し第1図
(b)のような部分入れ替えを行う。第1図(b)のA,
Bがペアデータを示す。A 16 × 16 binary image is stored in the memory as 16 words, and each word consists of data for 16 horizontal pixels of the image. The partial replacement of the corresponding words in this case is divided into four stages. In the first stage, a pair of words, that is, 8 pairs stored in 8 pairs of address 0 and address 8, address 1 and address 9, ..., Address 7 and address F, as shown in FIG. Partial replacement as shown in FIG. A in Fig. 1 (b),
B indicates paired data.
部分入れ替えは第1ステージではj=1として、16ビッ
トからなるマスクのビット位置を(右端のビットを第0
ビットとして)2進表現した時、第n−j+1ビット目
が1であるビット位置に1を与えたマスクM=(111111
1100000000)を用いて行う。同様に第2ステージではマ
スクデータはM=(1111000011110000)であり、第3ス
テージのマスクデータはM=(1100110011001100)であ
り、第4ステージでのマスクデータはM=(1010101010
101010)である。ペアとなるアドレスは、i≫j,(i+
1)≫j(ただしi≫jはiをjビット右へローテート
シフト(nビットローテーション)することを示す。)
で得られ、j=1,2,3,4、i=0,2,4,…14としたとき第
1ステージのペアとなる語のアドレスが求められる。For partial replacement, j = 1 in the first stage, and the bit position of the mask consisting of 16 bits (the rightmost bit is 0th
When expressed in binary (as a bit), a mask M = (111111) in which 1 is given to a bit position where the n-j + 1th bit is 1.
1100000000). Similarly, the mask data in the second stage is M = (1111000011110000), the mask data in the third stage is M = (1100110011001100), and the mask data in the fourth stage is M = (1010101010).
101010). The paired addresses are i >> j, (i +
1) >> j (where i >> j indicates that i is rotated shifted right by j bits (n-bit rotation))
Then, when j = 1,2,3,4 and i = 0,2,4, ... 14, the address of the word forming a pair in the first stage is obtained.
各ステージでのペアとなる語アドレスは第1図(a),
(c),(e),(g)に示されている。対応語の部分
入れ替えは、第1図(b),(d),(f),(h)に
示される。The word address paired in each stage is shown in FIG.
It is shown in (c), (e) and (g). Partial replacement of corresponding words is shown in FIGS. 1 (b), (d), (f) and (h).
第1ステージについて説明すると、ペアとなる語のアド
レスで読み出したデータA,Bに対し、Bの下8ビットを
Bの上8ビットへ、Bの上8ビットをAの上8ビット
へ、Aの上8ビットをAの下8ビットへ、Aの下8ビッ
トをBの下8ビットヘ、それぞれ置きかえるという操作
を8つのペア語に対して行う。第2,第3,第4ステージも
同様に部分入れ替えを小刻みにして第1図(d),
(f),(h)に示されるように部分入れ替えを行う。Explaining the first stage, for the data A and B read at the address of the word to be paired, the lower 8 bits of B are set to the upper 8 bits of B, the upper 8 bits of B are set to the upper 8 bits of A, and A The operation of replacing the upper 8 bits of A with the lower 8 bits of A and the lower 8 bits of A with the lower 8 bits of B is performed on the eight pair words. Similarly, in the second, third and fourth stages, the partial replacement is made in small increments as shown in FIG. 1 (d),
Partial replacement is performed as shown in (f) and (h).
第1図(b),(d),(f),(h)に示す部分入れ
替えの操作は、マスクデータMと第1図(a),
(c),(e),(g)で示されたペアデータA,Bに対
し、B∩を2n-jビット左シフトしたデータとA∩と
の論理和をとったデータと、A∩Mを2n-jビット右シフ
トしたデータとB∩Mとの論理和をとったデータとを求
める処理に対応する。The operations for partial replacement shown in FIGS. 1 (b), (d), (f), and (h) are performed by using the mask data M and FIG. 1 (a),
For paired data A and B shown in (c), (e), and (g), B∩ is left-shifted by 2n - j bits and data is logically ORed with A∩, and A∩M. 2n - j bits are right-shifted and B∩M is ORed.
各画素の(X,Y)座標を4ビット(x0〜x3,y0〜y3)の2
進表現した座標(x3x2x1x0,y3y2y1y0)で表すと、部分
入れ替え操作とは第1ステージでは(x3x2x1x0,y3y2y1y
0)座標位置の画素を(y3x2x1x0,3y2y1y0)座標位置
へ、第2ステージでは(y3x2x1x0,3y2y1y0)座標位置
の画素を(y3y2x1x0,3 2y1y0)座標位置へ、第3ス
テージでは(y3y2x1x0,3 2y1y0)座標位置の画素を
(y3y2y1x0,3 2 1y0)座標位置へ、第4ステージ
では(y3y2y1x0,3 2 1y0)の座標位置の画素を
(y3y2y1y0,3 2 1 0)座標位置へ移動するこ
とに対応しており、これにより90度回転画像が得られ
る。The (X, Y) coordinates of each pixel are 2 bits of 4 bits (x 0 to x 3 , y 0 to y 3 ).
In terms of the coordinates (x 3 x 2 x 1 x 0 , y 3 y 2 y 1 y 0 ), the partial replacement operation is (x 3 x 2 x 1 x 0 , y 3 y 2 at the first stage. y 1 y
0) pixel coordinate position (y 3 x 2 x 1 x 0, 3 y 2 y 1 y 0 ) to the coordinate position, in the second stage (y 3 x 2 x 1 x 0, 3 y 2 y 1 y 0 ) The pixel at the coordinate position is moved to the (y 3 y 2 x 1 x 0 , 3 2 y 1 y 0 ) coordinate position, and the (y 3 y 2 x 1 x 0 , 3 2 y 1 y 0 ) coordinate position is set on the third stage. pixel to the (y 3 y 2 y 1 x 0, 3 2 1 y 0) coordinates, in the fourth stage the pixel coordinate position (y 3 y 2 y 1 x 0, 3 2 1 y 0) ( It corresponds to moving to the y 3 y 2 y 1 y 0 , 3 2 1 0 ) coordinate position, and thereby a 90-degree rotated image is obtained.
第3図は、第1図の操作によりある特定の画素がいかに
移動していくかを示した図であり、図中〜は第1,第
2,第3,第4ステージで(0011,0010)座標位置の画素
が、(0011,1010),(0011,1110),(0011,1100),
(0010,1100)の順に移動していくことを示している。FIG. 3 is a diagram showing how a particular pixel moves by the operation of FIG.
The pixels at the (0011,0010) coordinate position in the second, third, and fourth stages are (0011,1010), (0011,1110), (0011,1100),
It is shown that it moves in the order of (0010,1100).
更に、16×16より大きい画像の90度回転画像の場合、例
えば64×64の画像を転置する場合、第4図に示すよう
に、縦横4つに分割16コの部分画像は分解し個々の部分
画像に本発明の方法を適用し、その後、部分画像単位に
対象位置の部分画像と入れ替えることにより大きい画像
の90度回転画像処理にも容易に適用できる。Further, in the case of a 90-degree rotated image of an image larger than 16 × 16, for example, when transposing a 64 × 64 image, as shown in FIG. The method of the present invention is applied to a partial image, and then the partial image is replaced with the partial image at the target position, which can be easily applied to the 90-degree rotated image processing of a larger image.
第2図は第2の本発明の一実施例を示すブロック図であ
る。この例では説明を簡単にするためn=4、すなわ
ち、N=16である。FIG. 2 is a block diagram showing an embodiment of the second invention. In this example, n = 4, that is, N = 16, for simplification of description.
16×16の2値画像が16語としてメモリに格納され、各語
は画像の一水平画素1画素分のデータからなる。この場
合の対応語の部分入れ替えは4つのステージに分かれ
る。第1ステージではペアとなる語、すなわち、同図
(a)に示すように、アドレス0とアドレス8、アドレ
ス1とアドレス9、…、アドレス7とアドレスFの8つ
のペアに格納されている8対のペアデータに対し第2図
(b)のような部分入れ替えを行う。第2図(b)のA,
Bがペアデータを示す。A 16 × 16 binary image is stored in the memory as 16 words, each word consisting of data for one horizontal pixel of the image. The partial replacement of the corresponding words in this case is divided into four stages. In the first stage, words to be paired, that is, as shown in FIG. 7A, stored in eight pairs of address 0 and address 8, address 1 and address 9, ..., Address 7 and address F 8 Partial replacement as shown in FIG. 2B is performed on the paired data. A in FIG. 2 (b),
B indicates paired data.
部分入れ替えは第1ステージではj=1として、16ビッ
トからなるマスクのビット位置を(右端のビットを第0
ビットとして)2進表現した時、第n−j+1ビット目
が1であるビット位置に1を与えたマスクM=(111111
1100000000)を用いて行う。同様に第2ステージではマ
スクデータはM=(1111000011110000)であり、第3ス
テージのマスクデータはM=(1100110011001100)であ
り、第4ステージでのマスクデータはM=(1010101010
101010)である。ペアとなるアドレスは、i≫j、(i
+1)≫jで得られ、(ただしi≫jはiをjビット右
へローテートシフト(nビットローテーション)するこ
とを示す。)、j=1,2,3,4、i=0,2,4,…14としたと
き第1図の第1ステージのペアとなる語のアドレスが求
められる。For partial replacement, j = 1 in the first stage, and the bit position of the mask consisting of 16 bits (the rightmost bit is 0th
When expressed in binary (as a bit), a mask M = (111111) in which 1 is given to a bit position where the n-j + 1th bit is 1.
1100000000). Similarly, the mask data in the second stage is M = (1111000011110000), the mask data in the third stage is M = (1100110011001100), and the mask data in the fourth stage is M = (1010101010).
101010). The address to be paired is i >> j, (i
+1) >> j (where i >> j indicates that i is rotated and shifted right by j bits (n-bit rotation)), j = 1,2,3,4, i = 0,2, When 4, ... 14, the address of the word forming the pair in the first stage of FIG. 1 is obtained.
各ステージでのペアとなる語アドレスは第2図(a),
(c),(e),(g)に示されている。対応語の部分
入れ替えは、第2図(b),(d),(f),(h)に
示される。The word address paired in each stage is shown in FIG.
It is shown in (c), (e) and (g). The partial replacement of corresponding words is shown in FIGS. 2 (b), (d), (f) and (h).
第1ステージについて説明すると、ペアとなる語のアド
レスで読み出したデータA,Bに対し、Bの下8ビットを
Aの下8ビットへ、Aの下8ビットをAの上8ビット
へ、Aの上8ビットをBの上8ビットへ、Bの上8ビッ
トをBの下8ビットへ置き換える操作を8つのペア語に
対して行う。第2,第3,第4ステージも同様に部分入れ替
えを小刻みにして第2図(b),(d),(f),
(h)に示されるように部分入れ替えを行う。Explaining the first stage, for the data A and B read at the address of the word to be paired, the lower 8 bits of B are set to the lower 8 bits of A, the lower 8 bits of A are set to the upper 8 bits of A, and A The operation of replacing the upper 8 bits of B with the upper 8 bits of B and the upper 8 bits of B with the lower 8 bits of B is performed on the eight pair words. Similarly, in the second, third, and fourth stages, partial replacement is performed in small increments, and the steps are shown in FIGS. 2 (b), (d), (f),
Partial replacement is performed as shown in (h).
第2図(b),(d),(f),(h)に示す部分入れ
替えの操作はマスクデータMと第2図(a),(c),
(e),(g)で示されたペアデータA,Bに対し、A∩
を2n-jビット左シフトしたデータとB∩との論理和
をとったデータと、B∩Mを2n-jビット右シフトしたデ
ータとA∩Mとの論理和をとったデータとを求める処理
に対応する。The operations for partial replacement shown in FIGS. 2 (b), (d), (f), and (h) are performed with the mask data M and FIGS. 2 (a), (c),
For the paired data A and B shown in (e) and (g), A∩
2n - j bits left-shifted data and B ∩ are ORed, and B ∩ M is 2n - j bits right-shifted data and A ∩ M is ORed. Corresponding to.
各画素の(X,Y)座標を4ビット(x0〜x3,y0〜y3)の2
進表現した座標(x3x2x1x0,y3y2y1y0)で表すと、部分
入れかえ操作とは、第1ステージでは(x3x2x1x0,y3y2y
1y0)座標位置の画素を(3x2x1x0,x3y2y1y0)座標位
置へ、第2ステージでは(3x2x1x0,x3y2y1y0)座標位
置の画素を(3 2x1x0,x3x2y1y0)座標位置へ、第3
ステージでは(3 2x1x0,x3x2y1y0)座標位置の画素
を(3 2 1x0,x3x2x1y0)座標位置へ、第4ステー
ジでは(3 2 1x0,x3x2x1y0)の座標位置の画素を
(3 2 1 0,x3x2x1x0)座標位置へ移動すること
に対応しており、これにより90度回転画像が得られる。The (X, Y) coordinates of each pixel are 2 bits of 4 bits (x 0 to x 3 , y 0 to y 3 ).
In terms of the coordinates expressed in binary (x 3 x 2 x 1 x 0 , y 3 y 2 y 1 y 0 ), the partial replacement operation is (x 3 x 2 x 1 x 0 , y 3 y in the first stage. 2 y
1 y 0) of the pixel at the coordinate position (to 3 x 2 x 1 x 0, x 3 y 2 y 1 y 0) coordinates, in the second stage (3 x 2 x 1 x 0 , x 3 y 2 y 1 The pixel at the y 0 ) coordinate position to the ( 3 2 x 1 x 0 , x 3 x 2 y 1 y 0 ) coordinate position
The pixel at the ( 3 2 x 1 x 0 , x 3 x 2 y 1 y 0 ) coordinate position is moved to the ( 3 2 1 x 0 , x 3 x 2 x 1 y 0 ) coordinate position on the stage, and ( 3 This corresponds to moving the pixel at the coordinate position of 2 1 x 0 , x 3 x 2 x 1 y 0 ) to the ( 3 2 1 0 , x 3 x 2 x 1 x 0 ) coordinate position. A rotated image is obtained.
第5図は、第2図の操作によりある特定の画素がいかに
移動していくかを示した図であり、図中〜は第1,第
2,第3,第4ステージで(0011,0010)座標位置の画素
が、(1011,0010),(1111,0010),(1101,0010),
(1101,0011)の順に移動していくことを示している。FIG. 5 is a diagram showing how a specific pixel moves by the operation of FIG.
In the second, third and fourth stages, the pixel at the (0011,0010) coordinate position is (1011,0010), (1111,0010), (1101,0010),
It is shown that it moves in the order of (1101,0011).
N=16の例では、4ステージの処理で、各ステージでメ
モリには16回リードライトするのでメモリアクセスは16
×2×4となる。一般にはN=2nのときnステージの処
理で各ステージでメモリに2N回アクセスするので、全部
で2Nlog2N回となる。In the example of N = 16, the memory access is 16 because the memory is read and written 16 times in each stage in the process of 4 stages.
It becomes x2x4. Generally, when N = 2n, the memory is accessed 2N times in each stage in the processing of n stages, so that the total is 2Nlog 2 N times.
本発明によれば、N語×N語の2値画像の90゜回転画像
を得るのに、2NlogN回のメモリアクセスで処理ができ、
N+1/2logN倍にメモリアクセス時間を軽減できる。According to the present invention, a 90 ° rotated image of an N × N binary image can be processed with 2NlogN memory accesses.
The memory access time can be reduced by N + 1 / 2logN times.
第1図は第1の本発明の原理を示すブロック図、第2図
は第2の本発明の原理を示すブロック図、第3図は第1
図の方法を用いた時、特定の画素が移動していく様子を
示す図、第4図は第1の本発明の第2の実施例を示す
図、第5図は第2図の方法を用いた時、特定の画素が移
動していく様子を示す図、第6図は従来例のブロック図
である。 A,B……ペアとなるデータ。FIG. 1 is a block diagram showing the principle of the first invention, FIG. 2 is a block diagram showing the principle of the second invention, and FIG.
FIG. 4 is a diagram showing how a specific pixel moves when the method shown in FIG. 4 is used, FIG. 4 is a diagram showing a second embodiment of the present invention, and FIG. 5 is a diagram showing the method shown in FIG. FIG. 6 is a block diagram of a conventional example showing a state in which a specific pixel moves when used. A, B ... Paired data.
Claims (2)
スできるメモリをもつ情報処理装置における画像90度回
転方法において、N×Nの2値画像がN語に格納されて
いる時、Nビットの語のビット位置の2進数表現でのn
−j+1ビット目が1であれば、NビットのデータMの
同一ビット位置に1を与えることによりできるNビット
のマスクデータMを出力する操作と、i≫j,(i+1)
≫jで得られる2つのアドレスのデータA,Bを読み出
し、B∩を2n-jビット左シフトしたデータとA∩と
の論理和をとったデータと、A∩Mを2n-jビット右シフ
トしたデータとB∩Mとの論理和をとったデータとを、
それぞれ(i+1)≫jとi≫jに格納する操作を備
え、(但し、記号の上のバーは論理否定、∩は論理積、
i≫jにおける≫はiをjビット右へローテートシフト
(nビットローテーション)することを示す記号であ
る。)前記マスクデータM出力操作をj=1,…,nとして
n回繰り返し操作し、更に前記各マスクデータM出力操
作の各回について前記データ格納操作をi=0,2,4,…,N
−2としてN/2回繰り返し操作することにより右へ90度
回転されたN×N2値画像を得ることを特徴とする画像90
度回転方法。1. A method of rotating an image by 90 degrees in an information processing apparatus having a memory capable of accessing a word unit composed of N = 2n bits, where N × N binary images are stored in N words. N in the binary representation of the bit position of the word of bits
-If the j + 1th bit is 1, an operation of outputting N-bit mask data M by giving 1 to the same bit position of N-bit data M, i >> j, (i + 1)
>> Read the data A and B at the two addresses obtained at j, and shift the B ∩ by 2n - j bits to the left and the logical OR of the data and A ∩, and shift the A ∩ M to the 2n - j bits to the right. Data and the data obtained by ORing B∩M,
Each has an operation of storing in (i + 1) >> j and i >> j (however, the bar above the symbol is a logical NOT, ∩ is a logical product,
i >> j is a symbol indicating that i is rotated shifted right by j bits (n-bit rotation). ) The mask data M output operation is repeated n times with j = 1, ..., N, and the data storage operation is performed i = 0, 2, 4, ..., N for each mask data M output operation.
Image 90 characterized by obtaining N × N binary image rotated 90 degrees to the right by repeating N / 2 times as -2
Degree rotation method.
スできるメモリをもつ情報処理装置における画像90度回
転方法において、N×Nの2値画像がN語に格納されて
いる時、Nビットの語のビット位置の2進数表現でのn
−j+1ビット目が1であれば、NビットのデータMの
同一ビット位置に1を与えることによりできるNビット
のマスクデータMを出力する操作と、i≫j,(i+1)
≫jで得られる2つのアドレスのデータA,Bを読み出
し、A∩を2n-jビット左シフトしたデータとB∩と
の論理和をとったデータと、B∩Mを2n-jビット右シフ
トしたデータとA∩Mとの論理和をとったデータとを、
それぞれi≫jと(i+1)≫jに格納する操作を備
え、(但し、記号の上のバーは論理否定、∩は論理積、
i≫jにおける≫はiをjビット右へローテートシフト
(nビットローテーション)することを示す記号であ
る。)前記マスクデータM出力操作をj=1,…,nとして
n回繰り返し操作し、更に前記各マスクデータM出力操
作の各回について前記データ格納操作をi=0,2,4,…,N
−2としてN/2回繰り返し操作することにより左へ90度
回転されたN×N2値画像を得ることを特徴とする画像90
度回転方法。2. A method of rotating an image by 90 degrees in an information processing apparatus having a memory capable of accessing a word unit composed of N = 2n bits, where N × N binary images are stored in N words. N in the binary representation of the bit position of the word of bits
-If the j + 1th bit is 1, an operation of outputting N-bit mask data M by giving 1 to the same bit position of N-bit data M, i >> j, (i + 1)
>> Read the data A and B at the two addresses obtained in j and shift the A∩ by 2n - j bits to the left and the logical OR of B∩ and B∩M by the 2n - j bits to the right. Data and the data obtained by the logical sum of A∩M,
Each has an operation of storing in i >> j and (i + 1) >> j, (however, the bar above the symbol is a logical NOT, ∩ is a logical product,
i >> j is a symbol indicating that i is rotated shifted right by j bits (n-bit rotation). ) The mask data M output operation is repeated n times with j = 1, ..., N, and the data storage operation is performed i = 0, 2, 4, ..., N for each mask data M output operation.
Image 90 characterized by obtaining N × N binary image rotated 90 degrees to the left by repeatedly operating N / 2 times as -2
Degree rotation method.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP61112891A JPH0731727B2 (en) | 1986-05-16 | 1986-05-16 | Image 90 degree rotation method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP61112891A JPH0731727B2 (en) | 1986-05-16 | 1986-05-16 | Image 90 degree rotation method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS62269280A JPS62269280A (en) | 1987-11-21 |
| JPH0731727B2 true JPH0731727B2 (en) | 1995-04-10 |
Family
ID=14598099
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP61112891A Expired - Lifetime JPH0731727B2 (en) | 1986-05-16 | 1986-05-16 | Image 90 degree rotation method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0731727B2 (en) |
-
1986
- 1986-05-16 JP JP61112891A patent/JPH0731727B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPS62269280A (en) | 1987-11-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US3995253A (en) | Method and apparatus for accessing horizontal sequences, vertical sequences, and rectangular subarrays from an array stored in a modified word organized random access memory system | |
| JPS62299881A (en) | image display system | |
| JPS6325672B2 (en) | ||
| JPS6247786A (en) | Exclusive memory for adjacent image processing | |
| JPH0323917B2 (en) | ||
| JP3786993B2 (en) | Data storage unit and data storage device using the unit | |
| US5095422A (en) | Information transferring method and apparatus for transferring information from one memory area to another memory area | |
| JPS61103189A (en) | Data transfer | |
| JPH01283676A (en) | Read-out processing system for window image data | |
| JPH0731727B2 (en) | Image 90 degree rotation method | |
| JP3124852B2 (en) | Data transfer circuit and address array | |
| JPS5952291A (en) | Video ram writing controller | |
| JPH07113904B2 (en) | Memory access device | |
| JPH061449B2 (en) | Image memory for image editing | |
| JP2643533B2 (en) | Image information rotation device | |
| JPS58207170A (en) | Picture processing system | |
| JPS6168636A (en) | Data processor | |
| JPS60124785A (en) | Picture processing unit | |
| JPH0687259B2 (en) | Image transposition method and device | |
| JPS607678A (en) | Memory constitution system | |
| JPH0233158B2 (en) | ||
| JPS62269281A (en) | Picture transposing method | |
| JPH0535392B2 (en) | ||
| JPS60100243A (en) | Memory bank selection device | |
| JPS6340972A (en) | Memory control system |