JP3843794B2 - Graphic processing device - Google Patents

Graphic processing device Download PDF

Info

Publication number
JP3843794B2
JP3843794B2 JP2001305729A JP2001305729A JP3843794B2 JP 3843794 B2 JP3843794 B2 JP 3843794B2 JP 2001305729 A JP2001305729 A JP 2001305729A JP 2001305729 A JP2001305729 A JP 2001305729A JP 3843794 B2 JP3843794 B2 JP 3843794B2
Authority
JP
Japan
Prior art keywords
display list
processing
clip
graphic
overlap
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 - Fee Related
Application number
JP2001305729A
Other languages
Japanese (ja)
Other versions
JP2002197473A (en
Inventor
隆 長尾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Fujifilm Business Innovation Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd, Fujifilm Business Innovation Corp filed Critical Fuji Xerox Co Ltd
Priority to JP2001305729A priority Critical patent/JP3843794B2/en
Publication of JP2002197473A publication Critical patent/JP2002197473A/en
Application granted granted Critical
Publication of JP3843794B2 publication Critical patent/JP3843794B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Controls And Circuits For Display Device (AREA)
  • Record Information Processing For Printing (AREA)
  • Image Generation (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、プリンタやディスプレイ装置などへ出力を行なうために、図形やアウトラインデータで表現された文字などの描画を行う図形処理装置に関する。
【0002】
【従来の技術】
図形やアウトラインデータで表現された文字を扱うエディタ、CAD/CAMシステムなどでは、それをプリンタやディスプレイ装置に出力するために、図形の描画処理が行われる。このような描画は、例えば図2に示すようなブロックを使って処理が進められる。
【0003】
図2において、まず、ユーザ指示や外部からの入力により図形や文字の描画命令が入力されると、命令解釈部1により解釈され、ベクターデータ生成部2に入力される。ベクターデータ生成部2は、文字の場合にはフォント管理部3に要求して文字のアウトラインを表現するベクターデータを取得する。ストローク(線)図形は、太さや接続部分の形状をもとに例えば図3に示すようなベクターデータに変換される。このように変換された文字、ストローク図形、フィル(塗りつぶし)図形は、ディスプレイリスト生成部4に入力される。
【0004】
ディスプレイリスト生成部4では、まずベジエ、スプラインなどで表現された曲線部分を微小直線で近似し、図4に示すような多角形のベクターデータに変換する。次に図7に示すようなディスプレイリスト形式の表現に変換する。ディスプレイリストは、多角形を構成するベクターに関するデータの一例として、Dir:方向フラグ(上向きの場合は+1、下向きの場合は−1)、Xs:ベクター開始点のX座標、Ye:ベクター終了点のY座標、Dx:Y座標の+1増加に対するXの変化量(傾き)、の4つの要素データを持つ。多角形からディスプレイリストへの変換については、さらに後段で詳述する。
【0005】
このようにして生成されたディスプレイリストデータは、ディスプレイリスト描画部13に入力される。ディスプレイリスト描画部13では、入力されたディスプレイリストの各辺と出力デバイスの各スキャンラインとの交点座標をDDA(Digital Differential Analyzer)などの手法で計算し、各スキャンライン毎にX座標値でソートして塗りつぶしの始点/終点の対応を求め、その区間に対応した、スキャンラインに平行な線分をメモリ部14上に描画する。このようにして描画されたメモリデータをプリンタやディスプレイ装置などの出力デバイス15に転送することで、印刷や表示が行われる。
【0006】
このような図形描画処理において、ディスプレイリスト描画部13の動作は、各辺毎のDDAやソート、メモリ描画などを含んでいるため重い処理となり、特にグラデーションなど重なりを含む複雑な図形を描画する際には、同じメモリ領域に何度も上書きが発生し、全体の処理速度を落とす大きな要因となる。さらに近年のプリンタ装置のように、描画命令を多角形やディスプレイリスト、エッジリストなどのレベルで蓄積することでページメモリを削減し、プリンタの印字速度に合わせてリアルタイムに画像形成を行いながら出力する場合には、重なりの多い複雑な部分で画像形成が間に合わずに絵抜けが生じる可能性があるという、問題(以下では、第1の問題とも呼ぶ)がある。
【0007】
また、ディスプレイリスト描画部13の動作は重いため、専用ハードウエアによる高速処理が意図される。そして、この処理は、図5(a)のように凸多角形の場合には比較的単純であるが、図5(b)のように凹部を含んでいる場合や図5(c)のように辺の交差を含んでいる場合には、各スキャンラインについて複数の始点/終点の対が存在することになるため、前述のように求められた各交点をソートして対応を見つける処理が必要になる。しかし、入力される図形の複雑さに制約が無い場合、交点の個数にも制限がなく、ハードウエアでソート回路を構成することは非常に困難であるという、問題(以下、第2の問題とも呼ぶ)がある。
【0008】
従来、上記第1の問題を解決する試みとして、描画要素から重なりを除去することで処理の高速化やリアルタイム描画を行う手法が提案されている。このような考え方を用いた従来技術としては、特開平8−279050号公報や特開平9−62851号公報、特開平9−171563号公報、特開平9−281953号公報などがある。
【0009】
また従来、上記第2の問題を解決する試みとして、多角形を、底辺がX軸に平行な台形(四角形や三角形を含む)などのソートが発生しない部分図形に分割し、それぞれを処理する手法がある。そのような考え方を持った従来技術として、特開昭60−74086号公報や特開昭61−248176号公報、特開昭62−271186号公報などがある。
【0010】
【発明が解決しようとする課題】
特開平8−279050号公報や特開平9−62851号公報の手法は、描画要素をエッジリストの形式で蓄積し、同じスキャンラインに対する描画を行うエッジ情報を比較して重なりがある場合にこれを除去するものである。しかし、エッジリストでの描画要素の蓄積は、近年のプリンタ装置のように解像度が高くなると蓄積すべきデータ量が膨大となり、メモリコストが増大するなどの欠点がある。
【0011】
特開平9−171563号公報や特開平9−281953号公報の手法は、描画要素を多角形データの形式で蓄積し、2つの多角形について重なり判定を行い、重なりがある場合にこれを除去するものである。しかし、多角形レベルで重なり除去を行うためには、多角形が単純な凸型になっている必要があり、凹型や辺の交差を含む多角形についてはこれを分割して凸型にするなどの前処理が必要である。また、重なり判定/オーバーレイグラフなどで対象を絞ってはいるものの、基本的に2つの多角形間の重なり除去を行う方式なので、N個の処理対象の重なりを完全に除去するためにはN!回の処理が必要となる。
【0012】
本発明は以上のような従来技術の問題点を考慮してなされたものであり、ディスプレイリスト形式で表現された描画要素間の重なりを除去する重なり除去手段を持ち、エッジリストと比較して高解像度の場合でも少ないメモリ量での蓄積を可能とし、また特別な前処理を行わず、かつ少ない処理で重なり除去が可能な、高速の図形処理装置を実現することを、第1の目的とする。
【0013】
次に、特開昭60−74086号公報や特開昭61−248176号公報では、多角形を底辺がX軸に平行な台形(四角形や三角形を含む)に分割し、各台形を順に処理することで塗りつぶし処理時のソート回路を不要としている。しかしこの方式では、複雑な多角形を分割すると非常に多くの台形が生成されるため、その管理や一時記憶が難しく、また台形毎に処理されるため処理速度が上がらないという問題があった。
【0014】
特開昭62−271186号公報では、入力された曲線を含む図形を、曲線を含んだまま、各スキャンラインでの描画線分が1つとなるような部分図形に分割し、各部分図形を複数のDDA回路と線分描画回路に入力して並列に処理を行っている。しかし、この方式では入力される図形の複雑さに応じて部分図形の個数が変わり、幾つのDDA/線分描画回路が必要かが制限できず、また各部分図形の描画が異なるスキャンラインに対して行われるため、実際にメモリに書き込む部分で競合が発生し、処理速度が上がらないことが予想される。
【0015】
このような問題に対して、本願の発明者は、特願平9−302403号において、2N個(Nは1以上)のDDA手段と、2N個の入力をソート可能なソート手段と、入力された任意のディスプレイリストを各スキャンラインでの描画線分数がN以下となる複数のディスプレイリストに分割する分割手段を持ち、入力された多角形を表現するディスプレイリストをDDA/ソート可能な部分多角形に分割して処理することで、分割図形をなるべく小さな領域で管理/記憶でき、高速に処理可能な図形処理装置を提案した。
【0016】
上記の特願平9−302403号で提案された方式では、ディスプレイリスト描画部に相当する部分は描画要素のみを描画できる構成となっている。しかしながら、描画命令の中には、描画要素がメモリに描画される際の領域を制限するクリップ要素も含まれており、その場合にはディスプレイリスト描画部に入力される前までに描画要素をクリップ要素でクリップ処理する必要が生じ、速度を落とす要因となる場合があった。
【0017】
この対策としては、描画要素とクリップ要素を混在させたディスプレイリスト情報を入力し、クリップしながら描画できるようにディスプレイリスト描画部の構成を変更することが考えられる。しかしながら、特願平9−302403号で提案されたディスプレイリストの分割方式は混在要素には対応できず、辺の本数が2Nよりも多いスキャンラインが存在する場合には、クリップ要素と描画要素を一度分離し、特願平9−302403号で述べた分割処理を別々に行ってから再度混在させるなどの複雑な処理が必要となり、全体のパフォーマンスが低下するという欠点があった。
【0018】
本発明は以上のような点を考慮してなされたものであり、クリップ要素と描画要素とが混在している場合でも、分割図形をなるべく小さな領域で管理/記憶でき、高速に処理可能な図形処理装置を実現することを、第2の目的とする。
【0019】
【課題を解決するための手段】
本発明は、上記の目的を達成するために成された図形処理装置に関するものである。即ち、本発明は、図形の描画処理を行う図形処理装置において:図形の描画要素やクリップ要素を記述するベクター情報(ベクター情報は、例えば描画要素やクリップ要素の形状や描画色、ストローク図形かフィル図形であるかについての指定、ストローク図形である場合の線幅や線種などの属性を表わす)から、前記描画要素やクリップ要素を構成するベクターの形状を多角形近似した直線ベクター情報に変換し、前記直線ベクター情報中に含まれる各直線ベクターをベクター開始スキャンライン座標値に基づいてソートして該各直線ベクターの方向、傾き、および横切るスキャンライン数、またはそれらと等価なデータを含む情報によって構成されるディスプレイリストを生成するディスプレイリスト生成手段と;前記ディスプレイリスト生成手段によって生成された、描画要素を表わすディスプレイリストと、当該描画要素の描画領域を制限するクリップ要素を表わすディスプレイリストとをマージ処理し、描画要素とクリップ要素とが混在したディスプレイリストを生成するマージ処理手段と;前記ディスプレイリストを蓄積するディスプレイリスト格納手段と;前記ディスプレイリストに基づいて、スキャンラインで交差する前記直線ベクター数が全スキャンラインにおいて2N(Nは1以上の整数)以下であるか否かを判定する判定手段と;クリップ要素と描画要素が混在したディスプレイリストについて、クリップ要素による描画要素のクリップ処理を実行し、描画要素のみのディスプレイリストに変換するクリップ処理手段と;前記クリップ処理手段によって変換された描画要素のみのディスプレイリストを全てのスキャンラインで交差する直線ベクター数が2N以下となるように分割し、複数のディスプレイリストを生成する分割処理手段と、描画領域に重なりを有する複数のディスプレイリストから、前記描画領域の重なりを除去した新たなディスプレイリストを生成する重なり除去手段と;前記ディスプレイリストに基づいて、各スキャンラインと前記直線ベクターの交点座標値を算出する2N個のDDA手段と、前記DDA手段からの出力値をソートするソート手段と、前記ソート手段においてソートされたデータから描画線分を構成する始点および終点の位置情報を求めてその間のメモリ領域を塗りつぶすメモリ描画手段とを備えたディスプレイリスト描画手段と;前記ディスプレイリストを前記ディスプレイリスト描画手段で描画処理する際の処理時間を推定し、推定された描画処理時間に基づいて前記重なり除去手段による重なり除去処理の実行効果を判定する重なり除去処理判定手段とを設けることを特徴とする。
【0020】
この構成によれば、ディスプレイリスト形式で表現された描画要素間の重なりを除去する重なり除去手段を持ち、エッジリストと比較して高解像度の場合でも少ないメモリ量での蓄積を可能とし、また特別な前処理を行わずかつ少ない処理で重なり除去が可能な、高速の図形処理装置を実現することができる。さらに、重なり除去処理が必要かどうかを判定する判定手段と、クリップ要素と描画要素が混在したディスプレイリストをクリップ処理して描画要素のみのディスプレイリストに変換するクリップ処理手段とを持つことで、重なり除去処理を必要最小限に抑え、かつクリップ要素と描画要素とが混在している場合でも対応可能な、高速の図形処理装置を実現することができる。さらに、最終的に描画対象の描画要素が2N個(Nは正の整数)を越えた場合には、ディスプレイリストを分割して処理することができ、描画データを小さな領域で管理および記憶が可能となり、かつクリップ要素と描画要素とが混在している場合でも分割図形をなるべく小さな領域で管理/記憶でき、高速に処理可能な図形処理装置を実現することができる。
【0021】
さらに本発明は、図形の描画処理を行う図形処理装置において:図形の描画要素やクリップ要素を記述するベクター情報を、前記描画要素やクリップ要素を構成するベクターの形状を多角形近似した直線ベクター情報に変換し、前記直線ベクター情報中に含まれる各直線ベクターをベクター開始スキャンライン座標値に基づいてソートして該各直線ベクターの方向、傾き、および横切るスキャンライン数、またはそれらと等価なデータを含む情報によって構成されるディスプレイリストを生成するディスプレイリスト生成手段と;前記ディスプレイリスト生成手段によって生成された、描画要素を表わすディスプレイリストと、当該描画要素の描画領域を制限するクリップ要素を表わすディスプレイリストとをマージ処理し、描画要素とクリップ要素とが混在したディスプレイリストを生成するマージ処理手段と;前記ディスプレイリストに基づいて、スキャンラインで交差する前記直線ベクター数が全スキャンラインにおいて2N(Nは1以上の整数)以下であるか否かを判定する判定手段と;クリップ要素と描画要素が混在したディスプレイリストについて、クリップ要素による描画要素のクリップ処理を実行し、描画要素のみのディスプレイリストに変換するクリップ処理手段と;前記クリップ処理手段によって変換された描画要素のみのディスプレイリストを全てのスキャンラインで交差する直線ベクター数が2N以下となるように分割し、複数のディスプレイリストを生成する分割処理手段と;前記ディスプレイリストに基づいて、各スキャンラインと前記直線ベクターの交点座標値を算出する2N個のDDA手段と、前記DDA手段からの出力値をソートするソート手段と、前記ソート手段においてソートされたデータから描画線分を構成する始点および終点の位置情報を求めてその間のメモリ領域を塗りつぶすメモリ描画手段とを備えたディスプレイリスト描画手段とを設けることを特徴とする。
【0022】
この構成でも、クリップ要素と描画要素が混在したディスプレイリストをクリップ処理して描画要素のみのディスプレイリストに変換するクリップ処理手段とを持つことで、クリップ要素と描画要素とが混在している場合でも対応可能な、高速の図形処理装置を実現することができる。さらに、最終的に描画対象の描画要素が2N個(Nは正の整数)を越えた場合には、ディスプレイリストを分割して処理することができ、描画データを小さな領域で管理および記憶が可能となり、かつクリップ要素と描画要素とが混在している場合でも分割図形をなるべく小さな領域で管理/記憶でき、高速に処理可能な図形処理装置を実現することができる。
【0023】
さらに本発明は、図形の描画処理を行う図形処理装置において:図形の描画要素やクリップ要素を記述するベクター情報を、前記描画要素やクリップ要素を構成するベクターの形状を多角形近似した直線ベクター情報に変換し、前記直線ベクター情報中に含まれる各直線ベクターをベクター開始スキャンライン座標値に基づいてソートして該各直線ベクターの方向、傾き、および横切るスキャンライン数、またはそれらと等価なデータを含む情報によって構成されるディスプレイリストを生成するディスプレイリスト生成手段と;前記ディスプレイリスト生成手段によって生成された、描画要素を表わすディスプレイリストと、当該描画要素の描画領域を制限するクリップ要素を表わすディスプレイリストとをマージ処理し、描画要素とクリップ要素とが混在したディスプレイリストを生成するマージ処理手段と;前記ディスプレイリストを蓄積するディスプレイリスト格納手段と;クリップ要素と描画要素が混在したディスプレイリストについて、クリップ要素による描画要素のクリップ処理を実行し、描画要素のみのディスプレイリストに変換するクリップ処理手段と;描画領域に重なりを有する複数のディスプレイリストから、前記描画領域の重なりを除去した新たなディスプレイリストを生成する重なり除去手段と;前記ディスプレイリストの表現する図形を描画するディスプレイリスト描画手段と;前記ディスプレイリストを前記ディスプレイリスト描画手段で描画処理する際の処理時間を推定し、推定された描画処理時間に基づいて前記重なり除去手段による重なり除去処理の実行効果を判定する重なり除去処理判定手段とを設けることを特徴とする。
【0024】
この構成によれば、ディスプレイリスト形式で表現された描画要素間の重なりを除去する重なり除去手段を持ち、エッジリストと比較して高解像度の場合でも少ないメモリ量での蓄積を可能とし、また特別な前処理を行わずかつ少ない処理で重なり除去が可能な、高速の図形処理装置を実現することができる。さらに、重なり除去処理が必要かどうかを判定する判定手段と、クリップ要素と描画要素が混在したディスプレイリストをクリップ処理して描画要素のみのディスプレイリストに変換するクリップ処理手段とを持つことで、重なり除去処理を必要最小限に抑え、かつクリップ要素と描画要素とが混在している場合でも対応可能な、高速の図形処理装置を実現することができる。
【0025】
さらに本発明は、図形の描画処理を行う図形処理装置において:図形の描画要素やクリップ要素を記述するベクター情報を、前記描画要素やクリップ要素を構成するベクターの形状を多角形近似した直線ベクター情報に変換し、前記直線ベクター情報中に含まれる各直線ベクターをベクター開始スキャンライン座標値に基づいてソートして該各直線ベクターの方向、傾き、および横切るスキャンライン数、またはそれらと等価なデータを含む情報によって構成されるディスプレイリストを生成するディスプレイリスト生成手段と;前記ディスプレイリストを蓄積するディスプレイリスト格納手段と;クリップ要素と描画要素を表現するディスプレイリストについて、クリップ要素による描画要素のクリップ処理を実行するクリップ処理手段と;描画領域に重なりを有する複数のディスプレイリストから、前記描画領域の重なりを除去した新たなディスプレイリストを生成する重なり除去手段と;前記ディスプレイリストの表現する図形を描画するディスプレイリスト描画手段とを設けることを特徴とする。
【0026】
この構成でも、ディスプレイリスト形式で表現された描画要素間の重なりを除去する重なり除去手段を持ち、エッジリストと比較して高解像度の場合でも少ないメモリ量での蓄積を可能とし、また特別な前処理を行わずかつ少ない処理で重なり除去が可能な、高速の図形処理装置を実現することができる。さらに、クリップ要素と描画要素が混在したディスプレイリストをクリップ処理して描画要素のみのディスプレイリストに変換するクリップ処理手段とを持つことで、クリップ要素と描画要素とが混在している場合でも対応可能な、高速の図形処理装置を実現することができる。
【0027】
さらに本発明は、図形の描画処理を行う図形処理装置において:図形の描画要素を記述するベクター情報を、前記描画要素を構成するベクターの形状を多角形近似した直線ベクター情報に変換し、前記直線ベクター情報中に含まれる各直線ベクターをベクター開始スキャンライン座標値に基づいてソートして該各直線ベクターの方向、傾き、および横切るスキャンライン数、またはそれらと等価なデータを含む情報によって構成されるディスプレイリストを生成するディスプレイリスト生成手段と;前記ディスプレイリストを蓄積するディスプレイリスト格納手段と;描画領域に重なりを有する複数のディスプレイリストから、前記描画領域の重なりを除去した新たなディスプレイリストを生成する重なり除去手段と;前記ディスプレイリストの表現する図形を描画するディスプレイリスト描画手段とを設けることを特徴とする。
【0028】
この構成によれば、ディスプレイリスト形式で表現された描画要素間の重なりを除去する重なり除去手段を持ち、エッジリストと比較して高解像度の場合でも少ないメモリ量での蓄積を可能とし、また特別な前処理を行わずかつ少ない処理で重なり除去が可能な、高速の図形処理装置を実現することができる。
【0029】
さらに本発明の図形処理装置において、前記ディスプレイリストを前記ディスプレイリスト描画手段で描画処理する際の処理時間を推定し、推定された描画処理時間に基づいて前記重なり除去手段による重なり除去処理の実行効果を判定する重なり除去処理判定手段を備えるようにしてもよい。
【0030】
さらに本発明の図形処理装置において、前記ディスプレイリストを出力領域を分割した各部分領域毎に分割する部分領域分割処理手段を備え、部分領域毎に処理を行うようにしてもよい。
【0031】
さらに本発明の図形処理装置において、前記マージ処理手段は、生成する前記混在したディスプレイリストにおいて、描画要素を構成する直線ベクターに関するディスプレイリスト中のベクター方向を示す値と、クリップ要素を構成する直線ベクターに関するディスプレイリスト中のベクター方向を示す値とを異なる値に設定するようにしてもよい。
【0032】
さらに本発明の図形処理装置において、前記マージ処理手段は、描画要素を表わす前記ディスプレイリストと、クリップ要素を表わす前記ディスプレイリストについて、それぞれの外接矩形から少なくともその共通Y座標範囲と共通X座標範囲のどちらか、または両方を求め、前記共通座標範囲内に制約された直線ベクターにより構成された混在ディスプレイリストを生成するようにしてもよい。
【0033】
さらに本発明の図形処理装置において、前記判定手段は、前記ディスプレイリスト中に含まれる直線ベクターを開始スキャンライン座標値の小さい順に読み出して当該直線ベクターの終了スキャンライン座標値を保持し、読み出した直線ベクターの開始スキャンライン座標値が既に保持している終了スキャンライン座標値より大きい場合には保持している終了スキャンライン座標値を破棄する処理を行い、当該ディスプレイリストについて、保持している終了スキャンライン座標値数が2Nより大きくなった場合にはその時点で2N以下ではないとの判定結果を出力し、未読み出しの直線ベクター数と保持している終了スキャンライン座標値数との和が2N以下となった場合にはその時点で2N以下であるとの判定結果を出力するようにしてもよい。
【0034】
さらに本発明の図形処理装置において、前記クリップ処理手段におけるクリップ処理による描画要素のみのディスプレイリストへの変換処理は、前記重なり除去処理判定手段により重なり除去処理が必要と判定された場合に、重なり除去処理の対象となる前記混在ディスプレイリストに対して実行するようにしてもよい。
【0035】
さらに本発明の図形処理装置において、前記クリップ処理手段におけるクリップ処理による描画要素のみのディスプレイリストへの変換処理は、
a)前記ディスプレイリストが、前記判定手段において、スキャンラインと交差する前記直線ベクター数が2Nより大きいスキャンラインが存在すると判定され、かつ
b)前記ディスプレイリストが、描画要素とクリップ要素とが混在しているディスプレイリストである、ことを条件として実行するようにしてもよい。
【0036】
さらに本発明の図形処理装置において、前記分割処理手段における、全てのスキャンラインで交差する直線ベクター数が2N以下となるようにディスプレイリストを分割し、複数のディスプレイリストを生成する処理は、
c)前記ディスプレイリストが、前記判定手段において、スキャンラインと交差する前記直線ベクター数が2Nより大きいスキャンラインが存在すると判定され、かつ
d)前記ディスプレイリストが、描画要素のみによって構成されたものである、ことを条件として実行するようにしてもよい。
【0037】
さらに本発明の図形処理装置において、前記重なり除去手段は、最前面に表示または印刷出力される上層の描画要素に対応するディスプレイリストから下層の描画要素に対応するディスプレイリストを順次、前記ディスプレイリスト格納手段から取り出して、該取り出した複数の描画要素に対応するディスプレイリストに基づいて重なり除去処理を行うようにしてもよい。
【0038】
さらに本発明の図形処理装置において、前記重なり除去手段は、前記重なり除去処理の対象となった複数の描画要素の描画領域全体を示す併合領域ディスプレイリストを生成して、新たに前記ディスプレイリスト格納手段から取り出されるディスプレイリストとの新たな重なり除去処理を行うようにしてもよい。
【0039】
さらに本発明の図形処理装置において、前記重なり除去処理判定手段での判定は、前記部分領域分割処理手段により分割された部分領域毎に行われ、該部分領域毎に重なり除去処理を行うか否かの切り替えを行うようにしてもよい。
【0040】
さらに本発明の図形処理装置において、前記重なり除去処理判定手段で求められる前記ディスプレイリスト描画手段での描画処理時間推定値は、少なくとも当該ディスプレイリストの描画面積または外接矩形面積、高さのいずれかの情報を用いて求められるようにしてもよい。
【0041】
さらに本発明の図形処理装置において、前記重なり除去処理判定手段で求められる前記ディスプレイリスト描画手段での描画処理時間推定値は、描画要素が文字、図形、画像のいずれであるかを示す情報を含む描画要素属性に応じた描画処理時間推定計算方法により実行するようにしてもよい。
【0042】
さらに本発明の図形処理装置において、前記重なり除去処理判定手段は、前記重なり除去手段による処理結果に基づいて、前記ディスプレイリスト描画手段での描画処理時間推定値を求め、該求められた処理結果に基づく描画処理時間推定値が、予め定められた閾値以下となった場合には、前記重なり除去手段による新たな重なり除去処理を行わないようにしてもよい。
【0043】
さらに本発明の図形処理装置において、前記重なり除去手段による処理は、処理対象となる複数の描画要素に対応するディスプレイリストを複数のグループに分割し、該分割されたグループ毎に実行するようにしてもよい。
【0044】
さらに本発明の図形処理装置において、前記重なり除去手段による処理は、処理対象となる描画領域を複数の部分領域に分割し、該分割された部分領域毎に実行するようにしてもよい。
【0045】
さらに本発明の図形処理装置において、前記メモリ描画手段は、処理対象であるディスプレイリストが、描画要素のみからなるディスプレイリストであるか、描画要素およびクリップ要素の混在する混在ディスプレイリストか、さらに、処理対象であるディスプレイリスト中の描画要素およびクリップ要素の塗りつぶし規則が偶奇規則であるか非零規則であるか、これらの処理対象ディスプレイリスト条件に基づいて、前記ソートデータからの描画線分構成始点および終点の位置情報算出方法を変更するようにしてもよい。
【0046】
さらに本発明の図形処理装置において、前記2N個のDDA手段は、並列処理可能な構成を有し、各スキャンラインと直線ベクターの交点座標値の算出処理は、並列処理によって実行されるようにしてもよい。
【0047】
さらに本発明の図形処理装置において、前記重なり除去手段による処理は、処理対象となる複数の描画要素を描画順の下から順に実際に描画して画像描画要素に変換し、当該画像描画要素と残りの図形要素を前記ディスプレイリスト描画手段で描画する場合の処理時間を前記重なり除去処理判定手段により推定し、重なり除去処理が不要と判定されるまで前記画像描画要素への変換を行うようにしてもよい。
【0048】
さらに本発明の図形処理装置において、前記重なり除去手段による処理は、処理対象となる描画領域を複数の部分領域に分割し、分割された幾つかの部分領域を実際に描画して画像描画要素に変換し、当該画像描画要素と残りの部分領域に含まれる図形要素を前記ディスプレイリスト描画手段で描画する場合の処理時間を前記重なり除去処理判定手段により推定し、重なり除去処理が不要と判定されるまで順次複数の部分領域の前記画像描画要素への変換を行うようにしてもよい。
【0049】
さらに本発明の図形処理装置において、前記重なり除去処理判定手段で求められる前記ディスプレイリスト描画手段での描画処理時間推定値は、ディスプレイリストの描画処理に相当する処理を要求された解像度以下の解像度で行って求められた面積の近似値情報を用いて求められるようにしてもよい。
【0050】
さらに本発明の図形処理装置において、前記ディスプレイリスト生成手段は、図形がストローク図形である場合に、各ベクターのストローク長と線幅、線種などの情報を基に描画面積の近似値を求め、当該ストローク図形から生成された前記ディスプレイリストに前記描画面積の近似値情報を付加するようにしてもよい。
【0051】
さらに本発明の図形処理装置において、前記ディスプレイリスト生成手段は、図形がフィル図形である場合に、少なくとも、自己交差を持つかどうか、分離した複数の図形要素から成り立っているかどうか、を判定し、自己交差を持たずかつ単一の図形要素から成り立っている場合には、当該図形を構成する各直線ベクターを基に描画面積の近似値を求め、当該フィル図形から生成された前記ディスプレイリストに前記描画面積の近似値情報を付加するようにしてもよい。
【0052】
さらに本発明の図形処理装置において、前記クリップ処理手段は、少なくとも図形要素の形状が矩形であるかどうかを判定する手段を有し、前記判定手段での判定結果を基にクリップ処理方法を変更するようにしてもよい。
【0053】
【発明の実施の形態】
以下、図面に基づき本発明に係わる図形処理装置の実施例について説明する。
【0054】
図1は本発明の図形処理装置の実施例を示すブロック図である。同図において、図形処理装置は、命令解釈部1と、ベクターデータ生成部2と、フォント管理部3と、ディスプレイリスト生成部4と、ディスプレイリスト格納部5と、部分領域分割部6と、マージ処理部7と、クリップ処理部8と、重なり除去判定部9と、重なり除去処理部10と、分割判定部11と、分割処理部12と、ディスプレイリスト描画部13と、メモリ部14と、出力デバイス15とを含んで構成されている。さらに、ディスプレイリスト描画部13は、2N個(Nは正の整数)のDDA部131と、ソート部132と、メモリ描画部133とを含んで構成されている。
【0055】
以下、本実施例の各構成要素の概要および動作について説明する。
【0056】
命令解釈部1は、入力された図形または文字の描画命令を解釈し、次のベクターデータ生成部2が理解できる形式に変換するものである。PostScript(米国アドビ・システムズ社商標)やInterpress(米国ゼロックス社商標)などのページ記述言語では、これらの描画命令は文字列やバイナリ列として与えられるので、そのような場合には命令解釈部1はトークンを切り出し、字句解釈などを行って内部の描画命令に変換する。
【0057】
ベクターデータ生成部2は、命令解釈部1からの入力を受けて、ベクターデータを生成する。入力がフィル(塗りつぶし)図形の場合は、命令解釈部1から図形の輪郭を表現するベクターと、偶奇規則/非零規則などの塗りつぶし規則と、曲線を直線近似する場合の精度を指示するフラットネス(flatness)値や、描画色などが与えられるので、その情報をそのまま出力する。入力がストローク(線)図形の場合には、線を表現するベクターと、線幅/線種/終端形状/接続形状などの線属性と、曲線を直線近似する場合の精度を指示するフラットネス値や、描画色などが与えられるので、このうちのベクターと線属性の情報を使って、図3に示すような輪郭ベクターを生成し、残りの情報とともに出力する。入力が文字の場合には、文字コードと、フォントIDと、描画位置や描画色などの情報が与えられるので、このうちの文字コードとフォントID、描画位置の情報をフォント管理部3に送って文字の輪郭ベクターを取得し、残りの情報とともに出力する。
【0058】
フォント管理部3は、各種フォントに対するアウトラインベクターデータを記憶するとともに、与えられた文字コードとフォントIDによって、その文字に対するアウトラインベクターデータを提供する。
【0059】
上記の処理により、入力された図形/文字は全て、輪郭を表現するベクターデータと描画色、フラットネス値、塗りつぶし規則の情報に変換される。ディスプレイリスト生成部4は、これらの入力されたベクターデータ中に曲線が含まれている場合には、まずその曲線部分を、誤差がフラットネス値で指定された精度以下となるように、微小な直線ベクターで近似する処理を行う。例えば曲線のベクターには、図6に示す4つの制御点で表現されるベジエ曲線が使われる。この場合直線ベクター化の処理は、図6に示す通りベジエ曲線を再帰的に分割し、高さ(距離d)がフラットネス値より小さくなった時点で分割を終了する。そして分割された各ベジエ曲線の始点と終点を順番に結ぶことにより、直線ベクター化が完了する。
【0060】
このように直線近似されたベクターデータを基にして、ディスプレイリスト生成部4は、次にこれをディスプレイリスト形式の表現に変換する。ここでディスプレイリストとは、例えば図7に示したようなものである。入力された多角形ベクターは、始めに各頂点のY座標が整数になるように変換される。具体的には、各辺についてY座標の小さい方の頂点は切上げし、大きい方の頂点は切捨てし、各辺の傾きが変わらないように整数化誤差をX座標値で補正する。このようにしてY座標値を整数化した後、同じ開始Y座標を持つ辺が集められてリストで接続される。リストの各要素には、その辺の方向が上向きか下向きかを+1/−1で表す方向フラグDirと、開始点YsにおけるX座標値Xsと、終了点のY座標値Yeと、Y座標値の+1増加に対するX座標値の変化量で表した辺の傾きDxとが格納される。尚、水平に近い辺など、どのスキャンラインも横切らないものについては、ディスプレイリストの要素に登録されない。
【0061】
このようにして生成されたディスプレイリストは、ディスプレイリスト格納部5に蓄積される。
【0062】
これまでの説明は描画要素を対象に行ったが、クリップ領域を表わすクリップ要素についても(色などが含まれないことを除いて)ほぼ同様に処理が行われ、ディスプレイリストが生成される。ディスプレイリスト格納部5には、描画要素に先立って生成されたクリップ要素のディスプレイリストが一時保持されており、そのクリップ領域中に描画される描画要素が入力されてディスプレイリスト化された場合には、マージ処理部7によりクリップ領域のディスプレイリストとマージされ、再度ディスプレイリスト格納部5に出力される。
【0063】
このマージ処理は、図8に示すように、ディスプレイリスト格納部5に一時保持されているクリップ要素(図8における太線)のディスプレイリストの各辺と、描画要素(図8の細線)のディスプレイリストの各辺とを、開始スキャンラインの昇順に混合し、かつその際にクリップ要素に含まれている辺については、Dirを特定の値(図8では±256)に変更する。このDir値は、1つのスキャンラインに交差する最大辺数の2倍以上であればよく、上限がわからない場合には余裕を持って大きな値を使うこともできる。以下では、通常128本以上の辺が同一スキャンライン中にあることはないとして、256で説明を行う。尚、マージ時に、両方の要素が共通に存在する矩形領域やX座標領域またはY座標領域の範囲でディスプレイリストをクリップすれば、処理をやや高速化できる。その一例として、共通Y座標領域でクリップしてマージした例を図9に示す。
【0064】
ここまでの処理で、それぞれの描画要素は、それを表現するディスプレイリストと(もしあれば)その描画要素のクリップ領域を表現するクリップ要素のディスプレイリストとが混在したディスプレイリストに変換される。
【0065】
このようにして生成/蓄積されたディスプレイリストは、部分領域分割部6により、図10に図示するように、ページを所定の幅で分割した部分領域(以下、バンドと称す)毎に分割され、各バンド毎にディスプレイリスト格納部5に蓄積される。
【0066】
バンド分割するのは、ダブルバッファ方式により描画/出力することで、メモリ部14の容量を2バンド分に低減するためである。メモリ部14は、図10に示すようなページを水平の短冊状に分割した領域の2個分の容量を持ち、交互に描画と出力デバイス15への転送が行われる。尚、図10に示す例では、ページを4バンドに分割しているが、分割数はメモリ部14の容量や処理装置の構成などに基づいて、任意に設定することができる。
【0067】
尚、ここまでの説明では、ディスプレイリスト生成→マージ処理→部分領域分割の順で処理を行ったが、ディスプレイリスト生成→部分領域分割→マージ処理の順で行っても全く問題はない。
【0068】
重なり除去判定部9は、ディスプレイリスト格納部5に蓄積されたバンド毎のディスプレイリストを読み出し、そのバンドをディスプレイリスト描画部13で描画処理する際の処理時間を推定し、出力デバイス15の印字速度に間に合うかどうかを判定する。
【0069】
判定の結果、間に合わないと判断されたバンドは、まずそのバンド中に描画要素とクリップ要素がマージされた混在ディスプレイリストを含んでいる場合には、その混在ディスプレイリストをクリップ処理部8により処理し、描画要素のみのディスプレイリストに変換する。次に、重なり除去処理部10により重なり除去処理を行って、再度ディスプレイリスト格納部5に格納する。この重なり判定、クリップ、重なり除去の各処理については、後段で詳述する。
【0070】
分割判定部11は、ディスプレイリスト格納部5に蓄積されたディスプレイリストを順次読み込み、入力されたディスプレイリストについて、スキャンラインに交差する辺の数が2N(DDA部131の個数2Nに等しい)を超える部分が存在しているかどうかを判定する。判定方法の詳細については、後述する。
【0071】
判定の結果として、あるディスプレイリストがあるスキャンラインで2Nを超えている場合には、それが混在ディスプレイリストでない場合には分割処理部12にディスプレイリストを出力して、全てのスキャンラインで交差する辺の数が2N以下である複数のディスプレイリストに分割する。分割処理の詳細は後述する。2Nを超えるスキャンラインがあり、かつ混在ディスプレイリストである場合には、初めに混在ディスプレイリストをクリップ処理部8に出力し、クリップ処理を行って描画要素のみのディスプレイリストに変換する。クリップ処理されたディスプレイリストは分割判定部11に戻され、再度分割判定を行い、2Nを超えるスキャンラインが残っている場合には、これを分割処理部12で分割する。
【0072】
このようにして生成/蓄積されたディスプレイリストは、1個づつディスプレイリスト描画部13に入力される。ディスプレイリスト描画部13は、2N個のDDA部131と、DDA部131から出力される2N個以下のデータをX座標値でソートするソート部132と、ソートされた結果から始点/終点の対を求め、その間を指定の描画色でメモリに描画するメモリ描画133とから構成され、入力されたディスプレイリスト表現された多角形を展開して、メモリ部14中のバンドに対応するメモリ領域に描画する。この処理についても、後で詳細に説明する。
【0073】
メモリ部14にバンド内の全ての描画要素が描画されると、その結果は出力デバイス15に出力され、プリンタまたはデイスプレイ等において印刷または表示される。
【0074】
以上、本発明の図形処理装置の概要について記述した。次に、この図形処理装置の主要部の詳細について説明する。
【0075】
初めに、クリップ処理部8について説明する。
【0076】
クリップ処理部8は、図11に示すように、クリップ処理の全体を制御するクリップ制御部81と、アクティブリスト制御部82と、ディスプレイリストを一時記憶するディスプレイリスト記憶部83とから構成されている。
【0077】
以下、クリップ制御部81の動作を、図12〜15に示すフローチャートに沿って説明する。
【0078】
始めにステップ1において、処理対象スキャンラインを表わすYcをYminに設定する。このYminは、対象ディスプレイリストに含まれる辺の開始スキャンラインY座標の最小値であり、例えば図9に示すディスプレイリストの場合にはYmin=5である。
【0079】
次にステップ2において、アクティブリスト制御部82中の各辺とY=Ycとの交点のX座標値をDDAなどの手法で計算する。尚、Y=Yminの時点ではアクティブリスト制御部82中には何も辺が登録されていないので、何も行われない。
【0080】
ステップ3において、クリップ対象ディスプレイリストから、Ycを開始点とする辺があればこれを抜き出してアクティブリスト制御部82中のアクティブリストに追加する。アクティブリストは、対象スキャンラインに交点を持つ辺のみで構成されたリストであり、例えば図16のように、Dir,Xs,Ye,Dx以外に後述する辺のステータス情報を格納するStatus、現在のスキャンラインとの交点のX座標値Xc、辺の開始スキャンラインYsなどの情報が追加される。尚、追加されたばかりの辺は、Status=INIT,Xc=Xs,Ys=Ycとなる。
【0081】
ステップ4において、アクティブリスト中の辺データを、Xcの昇順になるようにソートする。
【0082】
次にS1(詳細を図13に示す)に移り、図13に示すステップ10で変数cdirとodirをそれぞれ0に設定する。ここでcdirのcは現在(Current)を意味し、odirのo(Old)は旧を意味する。
【0083】
ステップ11で、変数iを1に設定する。ここで変数iは処理対象の辺が第何番目の辺であるかを示す。これらステップ10,11において各初期値の設定が完了する。
【0084】
ステップ12で、アクティブリストからi番目の辺データを読み出す。
【0085】
ステップ13で、odir=cdirと設定することで、odirにcdirを代入し、さらに、cdirに読み出したi番目の辺データのdirの値を加算する。
【0086】
ステップ14で、odir,cdirの値からモード判定を行う。このモード判定は、図17に示す規則で行われる。図17は、odir、cdirの両値に基づいて、モードがどのように決定されるかを示す規則を示した図である。入力描画要素の塗りつぶし規則には非零規則と、偶奇規則があり、処理すべき描画要素がいずれの規則によって示されたデータであるかによってモード判定は異なる。
【0087】
図17の上段に示す判定基準はクリップ要素が偶奇規則の場合、下段が非零規則の場合の判定規準である。それぞれのケースにおいて、描画要素が偶奇規則の場合、非零規則の場合とで判定基準が異なる。図17において、odir、cdirの値のいずれか一方の値のみが実線領域内にあるときに、モード=INと判定され、それ以外の場合はモード=OUTと判定される。点線で示された領域は、その点線領域に記載された特定条件が満足された場合のみモード=INと判定される。図17の点線領域は、「奇数のみ」の条件が記されており、これら点線領域の奇数にodir、cdirの値のいずれか一方のみが該当する場合にのみ、モード=INと判定されることを意味する。また、図17の実線の中央部分の白丸部分は、実線には該当しない部分であることを示し、例えば図17上段のクリップ要素が偶奇、描画要素が非零規則の場合において、256を含む実線部分において、odir、cdirのいずれかの値のみが256以外のこれら領域範囲内にあれば、モード=INであるが、256の場合には、モード=OUTとなる。
【0088】
例えば、描画要素が非零規則/クリップ要素が偶奇規則でodir=0,cdir=1の場合には、いずれも実線、点線領域になく、Mode=OUTとなる。また、描画要素が偶奇規則/クリップ要素が非零規則でodir=257,cdir=256の場合には奇数のみの点線領域にodir、cdirが該当し、odirのみが奇数のみの条件を満足しているので、Mode=INとなる。
【0089】
Mode=INの場合、現在のスキャンライン(Y座標)において、対象の辺(i)からつぎの辺(i+1)の間で塗りつぶしが有効である。逆に、Mode=OUTの場合、現在のスキャンラインにおいて、対象の辺からつぎの辺までの間で塗りつぶしが無効である。Status=INは当該辺が前回のスキャンラインでMode=INであることを示し、Status=OUTは前回のスキャンラインでMode=OUTであることを示す。
【0090】
図13に示すフローの説明を続ける。ステップ14でMode=OUTと判定された場合、S2(詳細を図14に示す)に移ってステップ20(図14)でi番目の辺のステータス情報Statusが読み出され、StatusがINの場合にはステップ21へ、それ以外(OUT,INIT)の場合にはステップ23に移る。
【0091】
辺のステータス情報は、先に説明したように対象スキャンラインに交点を持つ辺のみで構成されたアクティブリスト(図16参照)に、Dir,Xs,Ye,Dx以外に付加されたベクターに関する情報であり、INIT,IN,OUTのいずれかの値を持つ。追加されたばかりの辺は、Status=INITに設定され、その後、フローに従って値の変更が実行される。
【0092】
ステップ21では、i番目の辺データからY=Ys〜Yc−1の部分を、ディスプレイリスト記憶部83に出力する。より具体的には、例えばi番目の辺データが、Ys=10,Ye=20,Xs=3.5,Dx=0.5,Dir=+1であり、Yc=15の場合には、Ys=10,Ye=14,Xs=3.5,Dx=0.5,Dir=+1の辺データが出力される。
【0093】
ステップ22では、ステップ21で出力した部分を削除するため、アクティブリスト中のi番目の辺データを、Ys=Yc,Xs=Xcに変更する。
【0094】
ステップ23では、i番目の辺データのステータスをOUT(Status=OUT)に変更する。
【0095】
ステップ24では、i番目の辺データのYeがYcと等しいかどうかが判定され、等しい場合にはステップ25でその辺をアクティブリストから削除し、等しくない場合にはステップ26でiを1増加させる。以上でS2を終了し、図13に示すステップ15に移る。
【0096】
図13に示すステップ14でMode=INと判定された場合は、S3(詳細を図15に示す)に移って図15に示すステップ30でi番目の辺のステータス情報Statusが読み出され、このStatusがOUTの場合にはステップ31へ、それ以外(IN,INIT)の場合にはステップ32に移る。
【0097】
ステップ31では、アクティブリスト中のi番目の辺データを、Ys=Yc,Xs=Xcに変更する。
【0098】
ステップ32では、i番目の辺データのStatus=INに変更する。
【0099】
ステップ33では、i番目の辺データのYeがYcと等しいかどうかが判定され、等しい場合にはステップ34でその辺をディスプレイリスト記憶部83に出力してアクティブリストから削除し、等しくない場合にはステップ26でiを1増加させる。以上でS3を終了し、ステップ15に移る。
【0100】
図13のステップ15では、アクティブリスト中にi番目の辺があるかどうかをチェックし、あればステップ12に、なければS1を終了して図12に示すステップ5に移る。
【0101】
ステップ5では、YcがYmaxと等しいかどうかが判定され、等しい場合には処理を終了し、そうでない場合にはステップ6でYcを1増加させてステップ2に移る。このYmaxは、対象ディスプレイリストに含まれる辺の終了スキャンラインY座標の最大値であり、例えば図9に示すディスプレイリストの場合にはYmax=14である。
【0102】
以上、フローチャートを用いて説明した処理を行うと、アクティブリストは図16に経過の一部を示すように変更され、その結果としてディスプレイリスト記憶部83に図18に示すクリップ処理された新たなディスプレイリストが格納される。
【0103】
例えば、図9にAで示す描画要素の辺は、Y=9でクリップ要素の辺Bと交差してその前後で塗りつぶしの状態が変化し、ModeがINからOUTとなり、S2(図14)において、辺を分割して、交差点の手前までの分割辺をディスプレイリスト記憶部83に記憶し、残りの分割辺のStatusをOUTの状態とする。辺Bの状態はそれまでOUTであり(図16のY=6参照)、S2においてそのまま状態をOUTに保持したままとなっている。そして、Y=9において、Mode=INとなるのでS3(図15)においてY=8までの辺情報を切り捨てY=9以降のみにし、StatusをINの状態に変更する。
【0104】
このようにしてクリップ処理を加味した新たなディスプレイリストの辺が切り出される。
【0105】
図18は、図9に示すデイスプレイリストから図12〜図15のフローに従って生成された重なり除去後の新たなディスプレイリストである。図9と図18を比較して理解されるように太い実線で囲まれた領域(クリップ領域)内の細実線の辺データ(描画要素)に関するディスプレイリストのみが残り、太い実線の外にある領域のベクターに関するデイスプレイリストが排除された新たなディスプレイリストが図18に示すように生成される。
【0106】
尚、前記フローチャートでの処理の結果、描画要素が非零規則のディスプレイリストであっても、出力は偶奇規則に変換される。また、処理後のディスプレイリストの辺には、dirの値が±256のものも含まれるが、これはそれぞれ±1に変換して出力する。
【0107】
また、ここでは説明を簡単にするため、クリップ処理を全て上記フローで処理するように記述したが、幾つかの条件が成立する場合には、処理をより簡単にすることができる。例えば、描画要素とクリップ要素の外接矩形が共通領域を持たない場合には、クリップ処理結果は何も出力しない状態となるのは自明である。
【0108】
また例えば、描画要素またはクリップ要素のどちらかが矩形であることが分かっており、矩形である図形要素にもう一方の要素の外接矩形が包含されている場合、クリップ処理は矩形でない要素のディスプレイリストを出力するだけで処理できる。また包含されていない場合でも、矩形とのクリップ処理は、Y座標方向には各直線ベクターの範囲を矩形のY座標範囲に制約するだけでよく、残りのX座標方向に関しては矩形の左右辺の間にもう一方の図形要素の辺がすべて入っているかまたはすべて入っていない場合に処理を省略できる。同様の簡略化は、条件がやや異なるが、台形や三角形などの比較的単純な図形の場合にも適用できる。
【0109】
次に、重なり除去判定部9について詳細に説明する。
【0110】
図19は、重なり除去判定部9の実施の一例を表わすブロック図である。同図において、推定処理部91は、入力されたディスプレイリストを基にディスプレイリスト描画部13での処理時間を推定する。判定処理部92は、推定処理部91での推定処理の結果を基に、重なり除去処理が必要かどうかを判定する。パラメータ記憶部93は、推定処理部91や判定処理部92で必要となる処理パラメータを記憶する。
【0111】
前述のように、ディスプレイリスト格納部5には、1ページ分の描画要素のディスプレイリストがバンド毎に分割されて格納されている。ここまでの処理が終了した後に、重なり除去判定部9はディスプレイリストを読み出し、バンド毎に重なり除去処理が必要かどうかを判定し、その結果を重なり除去処理部10に通知する。重なり除去処理部10は、その判定結果に従って、重なり除去が必要と判断されたバンドに含まれているディスプレイリストについて重なり除去処理を行う。
【0112】
推定処理部91にディスプレイリストが入力されると、推定処理部91は、そのディスプレイリストにより描画される図形の外接矩形を求め、その面積と高さから以下の式により描画時間を推定する。尚、下式のa,bは予め求められた係数であり、パラメータ記憶部93に保持され、推定処理部91に供給される。
【0113】
【数1】
(推定描画時間)=a×(外接矩形の面積)+b×(外接矩形の高さ)
......(1)
描画処理をH/Wなどで実行する場合、通常はメモリ部14への書込みが処理のボトルネックとなる。メモリへの書込みは描画面積に比例し、かつスキャンライン毎の書込みでのメモリアクセスモード切換えなどのオーバーヘッドがあるので、(1)式では、描画面積を近似した外接矩形の面積に比例係数を掛け、さらに描画スキャンライン数に相当する外接矩形の高さ(=描画要素の高さ)に比例係数を掛けた項を付加している。
【0114】
尚、(1)式での外接矩形面積および高さは、描画要素とクリップ要素が混在しているディスプレイリストの場合には、描画要素とクリップ要素のそれぞれの外接矩形のAND領域が用いられる。
【0115】
(1)式は、メモリへの書込みがボトルネックとなる構成の図形処理装置での描画処理時間の推定式を示しているが、異なる部分がボトルネックとなる構成の場合は、それに応じた推定式を用いることは当然である。また、(1)式ではディスプレイリストから描画面積を正確に求めることの処理量を勘案して、外接矩形面積で近似を行った。しかし、推定にはメモリへの描画は必要ないため、やや処理時間がかかるものの擬似的な描画処理を行って正確な描画面積を求めることも可能である。さらに、実際の出力解像度以下の解像度で擬似的な描画処理を行い、外接矩形より正確な描画面積を求めることも可能である。
【0116】
また例えば、ディスプレイリスト中の辺の数が多い描画要素は形状が複雑で、外接矩形面積と実際の描画面積との差が大きい可能性がある。そのような場合には、(1)式に辺の数による補正を行って、より近い推定値を求めることができる。
【0117】
また、図形がある条件を満たしている場合には、描画処理を行わなくてもより正確な面積を求めることが可能である。例えば、ディスプレイリスト生成部4に入力された要素がストローク図形である場合には、直線ベクターへの近似処理後に各直線ベクターの長さと幅を乗じたものを積算することで、近似的な描画面積を求めることが可能である。尚、線種が破線などの場合には、もし線の描画部分と空白部分の比が分かればそれを使って補正すればよく、もし分からなくても、外接矩形に比べればより正確な描画面積を求められる。
【0118】
また、ディスプレイリスト生成部4に入力された要素がフィル図形(ストローク図形から図3に示したようにフィル図形に変換されたものを含む)であり、かつ自己交差を持たず(自己交差を持つ例については図5(c)参照)、かつ単一の図形から成り立っている(例えばドーナツのように外側と内側の円が分離している場合はこれに当たらない)、と判定できる場合には、直線ベクターへの近似処理後に、例えば以下の(2)式により面積を計算できる。尚、式中の(Xi,Yi)は多角形の頂点座標を順に表わしたもので、nは多角形の頂点数である。また、abs(x)はxの絶対値の意である。
【0119】
【数2】

Figure 0003843794
この方式は、交差部分で図形を分割すれば自己交差がある場合にも適用可能であり、また分離した複数図形から成り立っている場合でも各分離図形に共通領域が無い場合には適用可能である。
【0120】
このようにして求めた面積やその近似値はメモリ部14での描画面積とは一致しないが、外接矩形面積よりもかなり一致度が高いため、ディスプレイリスト生成時に当該ディスプレイリストに付加情報として付与し、それに合わせて(1)式を変更することで、重なり除去判定部9での判定精度を向上させることが可能である。
【0121】
尚、(1)式は描画要素として文字/図形が入力された場合を示しているが、描画命令に画像が含まれており、ディスプレイリスト描画部13で画像の輪郭を表わすディスプレイリストを処理し、図1に図示されていない画像処理手段などで処理された画像を使って、描画領域内部を1画素毎に異なる画像データで描画する場合には、その画像データの読み込みがボトルネックとなる可能性がある。そのような場合には、各ディスプレイリストに属性情報として画像であるかどうかのフラグをつけ、それに応じて推定式や係数を切り替える必要がある。
【0122】
推定処理部91は、上記の処理により各ディスプレイリスト毎の推定描画時間を求め、その値をバンドについて積算して、バンドの推定描画時間を求め、その結果を判定処理部92に出力する。
【0123】
判定処理部92は、重なり除去処理の効果を判定するものであり、部分領域の推定描画時間と、パラメータ記憶部93に予め記憶された閾値との比較を行い、その結果が閾値以下ならば重なり除去処理が不要、閾値を超える場合には重なり除去処理が必要との判定結果を出力する。重なり除去処理部10は、この判定結果に従って、当該バンドのディスプレイリストの重なり除去を行う。
【0124】
判定処理に用いられる閾値は、出力デバイス15の印字速度や推定式の誤差などから予め決定される。例えば、A4長手方向を30秒で出力するプリンタ装置であり、バンドがA4長手方向を均等に120分割したものである場合、各部分領域は0.25秒以内で展開される必要がある。また、推定誤差が推定値0.25秒付近で最大0.05秒ある場合、閾値は0.20秒に設定される。
【0125】
次に、重なり除去処理部10について詳細に説明する。
【0126】
図20は、重なり除去処理部10の実施の一例を表わすブロック図である。重なり除去処理部10は、重なり除去制御部101と、アクティブリスト制御部102と、ディスプレイリストを一時記憶する第1のディスプレイリスト記憶部103と第2のディスプレイリスト記憶部104とから構成されている。
【0127】
重なり除去制御部101は、初めに、ディスプレイリスト格納部5に格納されたディスプレイリストを描画順の後ろから取り出し、第2のディスプレイリスト記憶部104に一時記憶されたディスプレイリストとマージして新たなディスプレイリストを生成する。
【0128】
描画順の後ろから取り出す、という意味について簡単に説明する。一般的な描画において複数の描画要素を含む場合、例えば三角形Aの上に一部重なりを持って四角形Bを描画し、さらに四角形Bに一部重なりを持って円Cを描画する場合、ディスプレイリスト格納部5に保持される各描画要素A,B、Cのディスプレイリストの各々はA、B、Cの順に並べられる。これは、まず描画要素Aに関するディスプレイリスト処理を先に行って、その後、描画要素Bのディスプレイリストの処理を行うことによってAの描画データの上にBを上書きし、さらに、最後にCのディスプレイリスト処理を行うことで、描画要素Cを描画要素A、Bの上に上書きする処理を行うためである。このようにディスプレイリスト格納部5には、印刷上、あるいは画面上において最下層となる描画要素のディスプレイリストから順に最前面表示される描画要素のディスプレイリストまでを順番に配列して保持している。
【0129】
本発明の図形処理装置においては、このような複数の描画要素に対応する複数のディスプレイリストがディスプレイリスト格納部5に記憶されている場合、後列に位置する、すなわち最前面表示すべき描画要素に関するディスプレイリストから先にディスプレイリスト格納部5から取り出す。例えば上述したように、三角形Aの上に一部重なりを持って四角形Bが描画され、さらに四角形Bに一部重なりを持って、円Cが描画される構成を有する場合、ディスプレイリスト格納部5には、ディスプレイリストA、ディスプレイリストB、ディスプレイリストCの順に並べられて記憶されている。この場合、本発明の図形処理装置では、ディスプレイリストC、ディスプレイリストB、ディスプレイリストAの順に取り出す。
【0130】
ディスプレイリスト格納部5に格納されたディスプレイリストを描画順の後ろから取り出し、第2のディスプレイリスト記憶部104に一時記憶されたディスプレイリストとマージして新たなディスプレイリストを生成する際に、後の処理の必要性から、第2のディスプレイリスト記憶部104に含まれているベクターについては、Dirを特定の値(例えば±256)に変更してマージする。この値は、クリップ処理の場合と同じく、1つのスキャンラインに交差する最大ベクタ数の2倍以上であればよく、上限がわからない場合には余裕を持って大きな値を使うこともできる。以下では、通常128本以上のベクタが同一スキャンライン中にあることはないとして、Dirの値として256を用いた例で説明を行う。尚、マージ時に、第2のディスプレイリスト記憶部104に一時記憶されたディスプレイリストを、ディスプレイリスト格納部5から読み出したディスプレイリストのYの存在範囲でクリップすれば処理をやや高速化できる。図21にマージしたディスプレイリストの例を、図22に第2のディスプレイリスト記憶部104に一時記憶されたディスプレイリストをディスプレイリスト格納部5から読み出したディスプレイリストのYの存在範囲でクリップしてマージした例を示す。
【0131】
マージされたディスプレイリストを作成した後の重なり除去制御部101の動作は、基本的にはクリップ制御部81と同じである。処理フローも図12〜15に示したクリップ処理のフローと同じなので説明を省略する。但し、図13中のステップ14におけるモード判定の条件が異なっており、図23に示した条件で行われる。
【0132】
クリップ処理の場合と異なり、重なり除去処理では、後述のように第2のディスプレイリスト記憶部104には、偶奇規則のディスプレイリストしか格納されない。そのため、モード判定は入力されたディスプレイリストの塗りつぶし規則により、図23の上段または下段の条件が適用される。
【0133】
尚、図14のステップ21、図15のステップ34に相当する処理では、切り出された辺データは、第1のディスプレイリスト記憶部103に対して出力される。
【0134】
以上、図12〜図15のフローチャートに示した処理を行うと、アクティブリストは図25に経過の一部を示すように変更され、その結果として第1のディスプレイリスト記憶部103には、図26に示すような重なりが除去された新たなディスプレイリストが格納される。図26は、図22に示すデイスプレイリストから図12〜図15のフローに従って生成された重なり除去後の新たなディスプレイリストである。図22と図26を比較して理解されるように太い実線で囲まれた領域(例えば描画要素Aを構成する)内の細実線の辺データ(例えば描画要素Bを構成する)に関するディスプレイリストが排除され、太い実線の外にある領域のベクターに関するデイスプレイリストからのみ構成される新たなディスプレイリストが図26に示すように生成される。
【0135】
尚、前記フローチャートでの処理の結果、入力描画要素が非零規則のディスプレイリストであっても、出力は偶奇規則に変換される。
【0136】
ここまで述べた処理により、入力ディスプレイリストの重なり除去は終了したが、重なり除去処理部10は、さらに新たな描画要素に関する次のディスプレイリストとの重なり除去処理を行うために必要となる併合領域を表わす併合領域ディスプレイリストの生成処理を行う。すなわち、上述の処理では描画要素Aと描画要素Bとの重なり除去を行ったが新たに描画要素Cが入力された場合に、さらに、描画要素Cに対する(描画要素A+描画要素B)領域との重なり除去を実行することが必要となる。従って、この新たな重なり除去処理の前に併合領域:(描画要素A+描画要素B)を求めることが必要となる。以下、この処理について説明する。
【0137】
始めに、再度第2のディスプレイリスト記憶部104に一時記憶されているディスプレイリストと入力ディスプレイリストを重なり除去制御部101でマージする。この時には、入力ディスプレイリストのY存在範囲でのクリップは行わない。
【0138】
次に、重なり除去制御部101で先に説明したのと同じ処理を行う。但し、図13のステップ14に示したモード判定は図24に示した条件で行い、また図14のステップ21と図15のステップ34での辺データの出力先を、第2のディスプレイリスト記憶部104に変更する。
【0139】
その結果、第2のディスプレイリスト記憶部104には、入力ディスプレイリストと元々第2のディスプレイリスト記憶部104に一時記憶されていたディスプレイリストとを併合した領域を表わす、図27に示す(偶奇規則の)ディスプレイリストが生成される。
【0140】
以上で1つの描画要素に対する重なり除去処理は終了であり、ディスプレイリスト格納部5にさらに下に描画されるディスプレイリストが保持されている場合には、それを重なり除去処理部10に入力して、これまで述べたと同様の処理を繰り返す。この一連の処理を順次ディスプレイリスト格納部5から取り出した新たなディスプレイリストについて実行すれば、すべての描画要素の重なりが除去されたディスプレイリストが生成される。
【0141】
尚、ここでは第2のディスプレイリスト記憶部104に既にディスプレイリストが記憶されている状態での処理を説明したが、当然ながら描画順が最も後である描画要素の重なり除去を行う際には、第2のディスプレイリスト記憶部104には何も格納されていない。その場合には、重なり除去処理は行わずに入力ディスプレイリストをそのまま第1のディスプレイリスト記憶部103に出力する。併合領域生成処理については、入力ディスプレイリストが偶奇規則の場合にはそのまま第2のディスプレイリスト記憶部104に出力し、非零規則の場合には入力ディスプレイリストのみで処理を行う。
【0142】
また、当然ながら重なり除去処理を必要とする最後の描画要素に対する処理では、併合領域の生成処理は不要である。
【0143】
また、これまでの説明では、説明を簡略化するために全ての描画要素に対応するディスプレイリストについて重なり除去処理を行うとしたが、例えば入力ディスプレイリストと併合ディスプレイリストとの間に重なりがないと判断できる場合には、併合領域生成処理のみを行うなどの処理の簡略化も可能である。重なり判定が複雑な場合には、例えば2つのディスプレイリストの外接矩形領域を比較して重なりがない場合には重なり除去処理を省略するなどの簡易判定も考えられる。
【0144】
本実施例では、部分領域毎のディスプレイリストに対して、判定処理結果を基に重なり除去処理を行う例を示した。しかしながら、本実施例での重なり除去処理の目的が出力デバイス15の印字速度に描画を間に合わせることである場合、重なり除去処理時間を短縮する手法として、次のような変更も考えられる。
【0145】
重なり除去が必要と判定された場合に、描画順が後の描画要素から順に処理を行い、1つの要素の処理が終了する度に先の推定値を更新する。具体的には、重なり除去処理の前と後の外接矩形領域を求め、外接矩形面積と高さが縮小した分に相当する時間を先に求めた推定描画時間から差し引く。その結果として推定時間が閾値以下となった場合には、その時点で重なり除去処理を打ち切る。
【0146】
ディスプレイリスト描画部13の性能として、描画領域のN倍程度の上書きが発生しても出力デバイス15の印字速度に間に合うことが明らかな場合、重なり除去の結果として単層にする必要はない。そこで、処理対象となるディスプレイリストを描画順にM個のグループに分け、各グループ毎に重なり除去処理を行って(単層ではなく)M層に変換する。重なり除去処理は、対象となる描画要素数の増加に対して比例以上の傾きで処理時間が増加する傾向があるので、このようにM個のグループに分けて処理することで、全体としての処理時間を短縮することができる。
【0147】
また別の方法として、処理対象のバンドをさらに細分化し、各細分化された部分領域について前記重なり除去判定部9で描画処理時間を推定し、合計推定描画処理時間が閾値以下となるまで、例えば処理の重い細分化領域から順に重なり除去処理を行う方法も考えられる。
【0148】
さらに、画像の取り扱いが可能な図形処理装置である場合、描画要素の下から順に一部を実際に描画処理して画像要素に変換したり、または処理対象バンドを細分化した部分領域の幾つかを処理して画像要素に変換することで、対象バンドの描画処理時間を閾値以下に低減することも可能である。
【0149】
次に、分割判定部11について詳細に説明する。
【0150】
分割判定部11は、図28に示すように、分割判定の全体を制御する分割判定制御部111と、終点記憶部112とから構成されている。以下、分割判定制御部111の動作を、図29に示すフローチャートに沿って説明する。
【0151】
初めにステップ80において、変数変数iを1に設定する。ここで変数iは処理対象の辺が第何番目の辺であるかを示す。
【0152】
次ににステップ81において、対象ディスプレイリスト中の未読み出しの辺数と終点記憶部112に格納されている終点数との和をチェックし、これが2N以下の場合には分割が不要との判定結果を出力して、判定処理を終了する。尚、当然であるが、処理開始時は終点記憶部112に格納されている終点数は0である。
【0153】
次にステップ82において、対象ディスプレイリストからi番目の辺情報を読み出す。
【0154】
次にステップ83において、変数Ycをi番目の辺の開始スキャンラインを表わすY座標値Ysに設定する。尚、前述のように、ディスプレイリスト中の各辺は、開始スキャンラインの昇順に格納されている。
【0155】
次にステップ84において、終点記憶部112からYc未満の要素を全て削除する。
【0156】
次にステップ85において、終点記憶部112に、ステップ82で読み出したi番目の辺の終了スキャンラインを表わすY座標値Yeを追加する。
【0157】
次にステップ86において、終点記憶部112に格納されている終点の数をチェックし、それが2Nを超えている場合には分割が必要との判定結果を出力して、判定処理を終了する。2Nを超えていない場合にはステップ87に移る。
【0158】
次にステップ87において、対象ディスプレイリスト中に未読み出しの辺が残っているかどうかをチェックし、残っていない場合には分割が不要との判定結果を出力して、判定処理を終了する。残っている場合にはステップ88に移る。
【0159】
次にステップ88において、iを1増加させて、制御をステップ81に戻す。
【0160】
このような処理を行うことで、判定対象ディスプレイリストが全てのスキャンラインで辺数2N以下の場合には分割が不要、そうでない場合には分割が必要との判定結果を得ることができる。尚、ここでは全てのディスプレイリストを判定するように説明を行ったが、例えばディスプレイリスト中の辺の総数が2N以下の場合のように、明らかに分割が不要な場合は処理を省略できる。
【0161】
次に、分割処理部12について説明する。
【0162】
分割処理部12は、図30に示すように、分割処理の全体を制御する分割制御部121と、アクティブリスト制御部122と、ディスプレイリストを一時記憶する第1のディスプレイリスト記憶部123と第2のディスプレイリスト記憶部124とから構成されている。以下、分割制御部121の動作を、非零規則の場合と偶奇規則の場合に分けて、フローチャートに沿って説明する。
【0163】
非零規則の場合、分割制御部121の動作は、図12の部分についてはクリップ制御部81と同じであるのでその部分の説明は省略する。先に説明した、図13〜15のフローの代わりに、図31〜33のフローに従って説明する。
【0164】
ステップ40において、変数cdir,odirとcountをそれぞれ0に設定する。
【0165】
ステップ41で、変数iを1に設定する。
【0166】
ステップ42で、アクティブリストからi番目の辺データを読み出す。
【0167】
ステップ43で、odir=cdirと設定することで、odirにcdirを代入し、さらに、cdirに読み出したi番目の辺データのdirの値を加算する。
【0168】
ステップ44で、odir,cdirの値からモード判定を行う。このモード判定は、odirとcdirのどちらか一方のみが0の場合にIN、それ以外はOUTという規則で行われる。Mode=INの場合にはステップ45に、OUTの場合にはS2に制御を移す。
【0169】
ステップ45では、変数countの値を1増加させる。
【0170】
次にステップ46で、変数countの値が2Nより大きいかどうかをチェックし、大きい場合にはS2に、2N以下の場合にはS3に制御を移す。
【0171】
S2に移り、図32に示すステップ50ではi番目の辺のステータス情報Statusが読み出され、これがINの場合にはステップ51へ、それ以外(OUT,INIT)の場合にはステップ53に移る。
【0172】
ステップ51では、i番目の辺データからY=Ys〜Yc−1の部分を、第1のディスプレイリスト記憶部123に出力する。
【0173】
ステップ52では、ステップ51で出力した部分を削除するため、アクティブリスト中のi番目の辺データを、Ys=Yc,Xs=Xcに変更する。
【0174】
ステップ53では、i番目の辺データのStatus=OUTに変更する。
【0175】
ステップ54では、i番目の辺データのYeがYcと等しいかどうかが判定され、等しい場合にはステップ55でその辺を第2のディスプレイリスト記憶部124に出力してアクティブリストから削除し、等しくない場合にはステップ56でiを1増加させる。以上でS2を終了し、図31のステップ47に移る。
【0176】
図31のステップ46のcount>2Nの判定がNoとなり、S3に移った場合は、図33に示すステップ60に進み、i番目の辺のステータス情報Statusが読み出され、これがOUTの場合にはステップ61へ、それ以外(IN,INIT)の場合にはステップ63に移る。
【0177】
ステップ61では、i番目の辺データからY=Ys〜Yc−1の部分を、第2のディスプレイリスト記憶部124に出力する。
【0178】
ステップ62では、ステップ61で出力した部分を削除するため、アクティブリスト中のi番目の辺データを、Ys=Yc,Xs=Xcに変更する。
【0179】
ステップ63では、i番目の辺データのStatus=INに変更する。
【0180】
ステップ64では、i番目の辺データのYeがYcと等しいかどうかが判定され、等しい場合にはステップ65でその辺を第1のディスプレイリスト記憶部123に出力してアクティブリストから削除し、等しくない場合にはステップ66でiを1増加させる。以上でS3を終了し、図31に示すステップ47に移る。
【0181】
ステップ47では、アクティブリスト中にi番目の辺があるかどうかをチェックし、あればステップ42に、なければS1を終了してステップ5に移る。
【0182】
次に、偶奇規則の場合について説明する。偶奇規則の場合、分割制御部121の動作は、図12,32,33の部分については非零規則と同じであるので説明を省略し、図31の変わりのフローとして図34のフローに従う。図34について説明する。
【0183】
図34のステップ70において、変数countを0に設定する。
【0184】
ステップ71で、変数iを1に設定する。
【0185】
ステップ72で、アクティブリストからi番目の辺データを読み出す。
【0186】
ステップ73で、変数countの値を1増加させる。
【0187】
ステップ74で、変数countの値が2Nより大きいかどうかをチェックし、大きい場合にはS2に、2N以下の場合にはS3に制御を移す。
【0188】
S2,S3では、図32、図33に示すフローに従い、非零規則の場合と同じ処理を行った後、図34のステップ75に制御を戻す。ステップ75では、アクティブリスト中にi番目の辺があるかどうかをチェックし、あればステップ72に、なければS1を終了して図12のステップ5に移る。
【0189】
以上、フローチャートを用いて説明した処理を行うと、その結果として第1のディスプレイリスト記憶部123に図35に示すディスプレイリストが、第2のディスプレイリスト記憶部124に図36に示すディスプレイリストが格納される。図35,36は、図18のディスプレイリストをN=2で分割処理した場合の例である。図35と図36のディスプレイリストを合成すれば図18のディスプレイリストとなる。なお、前記フローチャートでの処理の結果、入力が非零規則のディスプレイリストであっても、出力は偶奇規則に変換される。
【0190】
非零規則が偶奇規則に変換されるため、分割が必要と判定された場合でも、分割処理の結果は第1のディスプレイリスト記憶部123のみとなる場合もある。また、第1のディスプレイリスト記憶部123には必ず2N以下のものが格納されるが、第2のディスプレイリスト記憶部124に格納されるディスプレイリストは2Nより多くなる可能性があるので、第2のディスプレイリスト記憶部124にも出力が生じている場合には、そのディスプレイリストを分割判定部11に戻し、判定/分割を繰り返す必要がある。
【0191】
これまで説明した、クリップ処理、重なり除去処理、分割処理の処理フローについては幾つかの変更も考えられる。例えば図12で説明したフローでは、Ymin〜Ymaxについて毎回Xcを更新してソートするように説明したが、アクティブリスト中の辺データのStatus値は辺の追加/削除/交差が生じた場合しか変更されないことから、予め追加/削除/交差の発生するY座標値を求めておき、そのスキャンラインのみ処理する方法も考えられる。
【0192】
また別の方法として、ソートを全て省略することも可能である。具体的には、ディスプレイリストから辺データをアクティブリストに移動させる際に、既にアクティブリストに登録されている全ての辺データとの交差判定を行い、交差がある場合には辺をそこで分割し、分割された辺データの前半部をアクティブリストに登録、後半部をディスプレイリストに戻す。さらに前半部を登録する際に、Xcの昇順となる位置に挿入する。このようにすれば、アクティブリスト中の辺データは必ずXcの昇順に並んでいることが保証されるので、ソートが不要となる。交差判定はアクティブリスト中に登録されている辺との間でのみ行われるので、対象数がそれほど多くなることはなく、また2つの辺についてXc1<Xc2かつDx1<Dx2などの場合には交差のないことが明らかなので、これらを除けばさらに処理を高速化できる。
【0193】
尚、図11、20、30やその説明からも明らかなように、図中のアクティブリスト制御部やディスプレイリスト記憶部の動作は共通であり、独立に持つ必要はない。また、図20の重なり除去制御部101と、図30の分割制御部121で行っているマージ処理は、前記マージ処理部7の動作と同じであるので、共通に使用しても良い。また、クリップ制御部81、重なり除去制御部101、分割制御部121の処理は、モード判定条件を除いてほぼ同じであるので、異なる部分をパラメータ化して共通に使用しても良い。
【0194】
次に、ディスプレイリスト描画部13の動作について詳細に説明する。
【0195】
上述の処理により、描画要求された図形は、各スキャンラインに交わる辺の数が2N本以下に制約された、混在または描画要素のみのディスプレイリスト形式のデータに変更され、描画色データなどとともにディスプレイリスト描画部13に入力される。ディスプレイリスト描画部13は、この入力をもとにメモリ部14に多角形を描画する。
【0196】
以下、ディスプレイリスト描画部13の動作を、描画要素のみで偶奇規則の場合を例に図37のフローチャートを使って説明し、その後にその他の場合を説明する。
【0197】
初めにステップ90において、処理対象スキャンラインを表す変数Ycを、ディスプレイリストのY座標の最小値Yminに設定する。
【0198】
次にステップ91において、DDA部131を用いて、現スキャンラインと各辺との交点のX座標値を計算してXcを更新する。各辺の交点のX座標値Xcは、1回前のXcを使って{Xc+Dx}で求めることができる。もし、ここでどの辺もDDA部131に設定されていない場合には、ここでは何も行われない。
【0199】
次にステップ92において、入力されたディスプレイリスト中にYcを開始点とする辺があれば、それを空いているDDA部にセットする。DDA部は、現在のスキャンラインとの交点X座標Xcと、辺の終点Y座標Yeと、Y座標の+1増加に対するX座標の変化量Dxと、方向フラグDirとを持ち、Xc=Xs,Ye=Ye,Dx=Dx,Dir=DirとしてDDA部131に代入される。
【0200】
次にステップ93において、辺が設定されているDDA部131からXcの値を全てソート部132に出力し、ソート部132はこれを昇順になるようにソートし、メモリ描画部133に出力する。
【0201】
次にステップ94において、メモリ描画部133でソート済みのX座標値を先頭から2個づつ取り出して対にし、その対間の水平線分に対応するメモリ部14の領域を塗りつぶす。尚、各Xcは小数で出力されるが、メモリ部14への描画は整数座標の必要があるので、実際の塗りつぶしは例えばXcを切捨て/切上げ/四捨五入などした座標値を使って行われる。また塗りつぶしの色は、文字/図形の場合には描画色データで指定された色、画像の場合にはその座標位置に描画されるべき画素値が読み出されて用いられる。
【0202】
次にステップ95において、Y=Ycで終了する辺についてのDDA部131からの削除を行う。
【0203】
次にステップ96において、Ycを1だけ増加させる。次にステップ97において、このYc値が対象ディスプレイリストの存在範囲のY座標最大値Ymaxより大きいかどうかをチェックし、もし大きければ処理を終了し、そうでない場合にはステップ91に戻ってY=Ycの処理を継続する。
【0204】
図38に、このようなフローで図35のディスプレイリストを処理した場合の、Yc=10からYc=11にかけての動作の説明図を示す。図38に示すように、各辺はDDA部131によりスキャンラインとの交点を求められ、ソートされ、各対の間を塗りつぶされる。ここでは、N=2とした例であり、2N個、すなわち4個のDDA部1〜4による処理がなされる。
【0205】
図38の処理について図37の処理フローと関連づけて説明する。図38の上段左側から処理が進行し、まず、Yc=10についての4つのディスプレイリストに対して4(2N)個のDDA部1〜4がX座標値の計算を実行(図37、ステップ91に相当)する。さらに、計算されたX座標値をソート(ステップ93)し、描画処理を実行(ステップ94)する。さらに、Y=10において終了する辺、図38に示す例の場合、DDA部2、DDA部3で処理されたディスプレイリストはいずれもYe=10のデータを有し、現在の処理点Y=10で終了する辺であると判定されるので、これらのディスプレイリストをDDA部から削除する。さらに、次のラインY=11に移動して、同様の処理を実行する。4(=2N)個のDDA部1〜4により、このような処理をYminからYmaxまで行うことで、入力されたディスプレイリストが表現する多角形が、効率よくメモリ部14上に描画される。
【0206】
なお、描画要素とクリップ要素には、それぞれ偶奇/非零の2つの塗りつぶし規則があるので、これらを組み合わせると、ディスプレイリスト描画部13は以下の6つのケースに対応する必要がある。
1.描画要素のみで偶奇規則
2.描画要素のみで非零規則
3.描画要素が偶奇規則で、クリップ要素が偶奇規則
4.描画要素が偶奇規則で、クリップ要素が非零規則
5.描画要素が非零規則で、クリップ要素が偶奇規則
6.描画要素が非零規則で、クリップ要素が非零規則
上記中、2.のケースは、図37に示すステップ94において、ソート後のX座標値データを先頭から2個づつ対にする代わりに、各辺のDirを積算する変数を設けて値が0でなくなる辺と0になる辺とを対にして、そのXcの間を描画するようにフローを変更する。
【0207】
また、上記中3.〜6.のケースでは、各辺のDirを積算する変数を設けて、図17で示した条件で対となる辺を決定し、そのXcの間を描画するようにフローを変更する。
【0208】
尚、ここでは説明を簡単にするため、Dirの値が±1または±256であるとして説明を行ったが、ディスプレイリスト描画部13をハードウエアで構成する場合などビット数削減にメリットがある場合には、クリップ要素を表わす1ビットのフラグを用いて、図17と同じ結果となる判定条件を構成することも可能である。
【0209】
例えば、描画要素とクリップ要素とを区別するフラグを用いたディスプレイリストを図39に示すように構成してもよい。Cf=1がクリップ要素の辺であることを示し、Cf=0が描画要素の辺であることを示す。この場合にも、各辺の状態が変化するかどうかをY座標の増分に応じて検査して描画要素の切り出しを行なうことができる。もちろん、重なり除去についても同様に行なうことができる。
【0210】
図40は、このようなフラグを用いた場合の処理S1(図13に対応する処理)の一例を示しており、この例では、描画およびクリップの双方を偶奇規則で行っている。この図において、ddirは、描画処理の偶奇規則の値であり、真であれば以降の描画が有効である。cdirはクリップ処理の偶奇規則の値であり、真であれば以降のクリップが有効であることを示す。以下、図40のフローを簡単に説明する。
【0211】
[ステップ100]:ddir=cdir=falseに初期化する。同様に、omode=cmode=falseに初期化する。cmodeは、現在の辺(i)について(その辺の右側で)、クリップを加味したうえで描画が有効か無効かを示す。omodeは、直前の辺(i−1)について(直前の辺の右側すなわち現在の辺の左側で)、クリップを加味した描画が有効か無効かを示す。クリップを加味した描画が有効かどうかはddirとcdirの論理積で決定される。
[ステップ101]:辺の番号iを1に初期化する。
[ステップ102]:アクティブリストのi番目の辺データを読み出す。
[ステップ103]:読み出した辺データが描画ベクターのものかどうかをクリップフラグCfで判断する。描画ベクターならステップ104に進み、クリップベクターであればステップ105に進む。
[ステップ104]:ddirを反転する。
[ステップ105]:cdirを反転する。
[ステップ106]:現在のcmodeをomodeに代入して、新たなcmodeをddirとcdirとの論離積から生成する。
[ステップ107]:cmodeとomodeを比較し、一致していればS2(図14)に進み、不一致であればS3(図15)に進む。
[ステップ108]:アクティブリストの辺がなくなるまでステップ102以降の処理を繰り返す。
【0212】
以上は、描画およびクリップに偶奇規則を適用した場合の例であるが、それ以外の態様で処理を行なえることはもちろんである。例えば、図41は、描画に非零規則を適用し、クリップに偶奇規則を適用したものである。また図42は、描画に偶奇規則を適用し、クリップに非零規則を適用したものである。さらに、図43は、描画およびクリップの双方に非零規則を適用したものである。
【0213】
図41においては、ステップ100およびステップ104(図40)に代えてステップ100’およびステップ104’を行なう。この図において、dovalは描画要素の非零規則の直前の値、dcvalは描画要素の非零規則の現在の値を示す。この図の動作は図13および図40とほぼ同様であり、詳細な説明は省略する。
【0214】
図42においては、ステップ101およびステップ105(図40)に代えてステップ100’’およびステップ105’を行なう。この図の動作も図13および図40とほぼ同様であり、詳細な説明は省略する。
【0215】
図43においては、ステップ100(図40)に代えてステップ100’’を行なう。また、ステップ104およびステップ105に代えてステップ104’およびステップ105’を行なう。この図において、covalはクリップ要素の非零規則の直前の値、ccvalはクリップ要素の非零規則の現在の値を示す。この図の動作も図13および図40とほぼ同様であり、詳細な説明は省略する。
【0216】
なお、クリップ処理を行なってどの描画要素あるいはクリップ要素の辺を新たなディスプレイリストの構成要素とするか、あるいは新たな辺として切り出すかは、上述の手順(図13等)以外でも行なうことが可能である。要するに、切り出すための条件を設定し、それを満たすかどうかを判断しながら行なえばよい。
【0217】
また、上述実施例においては、ディスプレイリストの辺(直線ベクター)は昇順に格納され、順次に辺情報を取り出し、並列にDDA演算を行なえるかどうかを判断し、行なえない場合にはディスプレイリストを分割するようにしているが(図29)、スキャンラインごとに順次それを開始点とする辺の情報を取出して、同様に分割が必要かどうかを判断するようにしてもよい。
【0218】
このような判断手順の処理を図44に示す。図44の処理を簡単に説明する。なお、処理の内容は図から容易に理解できるため詳細な説明は省略する。
【0219】
[ステップ81’]:対象スキャンラインを表すYcをYminに設定する。このYminは判定対象のディスプレイリストのYの存在範囲の最小値である。
[ステップ82’]:判定対象のディスプレイリスト中にYcを開始点とする辺があれば、その辺の終了スキャンラインYeを終点記憶部112に格納する。
[ステップ83’]:終点記憶部112ぶ格納されている終点の数をチェックし、それが2Nを越えている場合には分割が必要との判定結果を出力して判定を終了する。2Nを越えていなければステップ84’に進む。
[ステップ84’]:YcがYmaxと等しいかどうかをチェックし、等しい場合には分割が不要との判定結果を出力して判定処理を終了する。このYmaxは判定対象のディスプレイリストのYの存在範囲の最大値である。YcがYmaxと等しくない場合にはステップ85’に進む。
[ステップ85’]:Ye=Ycなる終点記憶部112の要素すべてを削除する。
[ステップ86’]:Ycの値を1増加させて、ステップ82’に戻る。
【0220】
このような処理を行なうことで、判定対象ディスプレイリストがすべてのスキャンラインで辺数2N以下の場合には分割が不要、そうでない場合には分割が必要との判定結果を得ることができる。なお、ここではすべてのディスプレイリストを判定するようにしたが、例えば、ディスプレイリスト中の辺の総数が2N以下の場合のように、明らかに分割が不要な場合には処理を省略できる(図29)。
【0221】
【発明の効果】
以上説明したように本発明では、ディスプレイリスト形式で表現された描画要素間の重なりを除去する重なり除去手段を持ち、エッジリストと比較して高解像度の場合でも少ないメモリ量での蓄積を可能とし、また特別な前処理を行わずかつ少ない処理で重なり除去が可能な、高速の図形処理装置を実現することができる。さらに、重なり除去処理が必要かどうかを判定する判定手段と、クリップ要素と描画要素が混在したディスプレイリストをクリップ処理して描画要素のみのディスプレイリストに変換するクリップ処理手段とを持つことで、重なり除去処理を必要最小限に抑え、かつクリップ要素と描画要素とが混在している場合でも対応可能な、高速の図形処理装置を実現することができる。
【0222】
また本発明では、ディスプレイリストから全てのスキャンラインで交差する辺の数が2N(=DDA手段の数)以下となるかどうかを判定する判定手段と、クリップ要素と描画要素が混在したディスプレイリストをクリップ処理して描画要素のみのディスプレイリストに変換するクリップ処理手段と、描画要素のディスプレイリストを全てのスキャンラインで交差する辺の数が2N以下となる複数のディスプレイリストに分割する分割手段と、2N個(Nは1以上)のDDA手段と、DDA手段から出力された入力をソート可能なソート手段を有する構成としたことにより、描画命令中にクリップ要素と描画要素とが混在している場合でも、描画要素のみのディスプレイリストとする処理、またディスプレイリストをDDA手段の数である2N以下の分割ディスプレイリストに分割する処理を実行した後、並列処理可能な2N個のDDA手段による変換生成されたディスプレイリストに基づく位置情報算出処理を実行するように構成したので、描画データの小さな領域での管理および記憶が可能となり、かつクリップ要素と描画要素とが混在している場合でも分割図形をなるべく小さな領域で管理/記憶でき、高速に処理可能な図形処理装置を実現することができる。
【図面の簡単な説明】
【図1】 本発明の図形処理装置の実施例を示すブロック図である。
【図2】 既存の図形処理装置の一例を示すブロック図である。
【図3】 線図形の塗りつぶし図形への変換を説明する図である。
【図4】 曲線の微小直線での近似を説明する図である。
【図5】 各種の多角形を示す図である。
【図6】 ベジエ曲線の再帰的な分割を説明する図である。
【図7】 ディスプレイリストを説明する図である。
【図8】 描画要素とクリップ要素との混在ディスプレイリストを説明する図である。
【図9】 混在ディスプレイリストのY方向クリップを説明する図である。
【図10】 本発明の図形処理装置における部分領域への分割を説明する図である。
【図11】 本発明の図形処理装置におけるクリップ処理部の一例を示すブロック図である。
【図12】 本発明の図形処理装置におけるクリップ処理の手順を示すフローチャート(その1)である。
【図13】 本発明の図形処理装置におけるクリップ処理の手順を示すフローチャート(その2)である。
【図14】 本発明の図形処理装置におけるクリップ処理の手順を示すフローチャート(その3)である。
【図15】 本発明の図形処理装置におけるクリップ処理の手順を示すフローチャート(その4)である。
【図16】 アクティブリストを説明する図である。
【図17】 本発明の図形処理装置におけるクリップ処理でのモード判定を説明する図である。
【図18】 本発明の図形処理装置におけるクリップ処理後に出力されるディスプレイリストを説明する図である。
【図19】 本発明の図形処理装置における重なり除去判定部の一例を示すブロック図である。
【図20】 本発明の図形処理装置における重なり除去処理部の一例を示すブロック図である。
【図21】 描画要素と併合領域との混在ディスプレイリストを説明する図である。
【図22】 混在ディスプレイリストのY方向クリップを説明する図である。
【図23】 本発明の図形処理装置装置における重なり除去処理でのモード判定を説明する図である。
【図24】 本発明の図形処理装置装置における重なり除去(併合領域生成)処理でのモード判定を説明する図である。
【図25】 アクティブリストを説明する図(その2)である。
【図26】 本発明の図形処理装置における重なり除去処理されたディスプレイリストを説明する図である。
【図27】 本発明の図形処理装置における併合処理されたディスプレイリストを説明する図である。
【図28】 本発明の図形処理装置における分割判定部の一例を示すブロック図である。
【図29】 本発明の図形処理装置における分割判定処理の手順を示すフローチャートである。
【図30】 本発明の図形処理装置における分割処理部の一実施例を示すブロック図である。
【図31】 本発明の図形処理装置における分割処理の手順を示すフローチャート(その1)である。
【図32】 本発明の図形処理装置における分割処理の手順を示すフローチャート(その2)である。
【図33】 本発明の図形処理装置における分割処理の手順を示すフローチャート(その3)である。
【図34】 本発明の図形処理装置における分割処理の手順を示すフローチャート(その4)である。
【図35】 本発明の図形処理装置における分割処理後に出力されるディスプレイリストを説明する図である。
【図36】 本発明の図形処理装置における分割処理後に残されるディスプレイリストを説明する図である。
【図37】 本発明の図形処理装置におけるディスプレイリスト描画処理の手順を示すフローチャートである。
【図38】 本発明の図形処理装置におけるディスプレイリスト描画処理を説明する図である。
【図39】 ディスプレイリストの変形例を説明する図である。
【図40】 変形例におけるクリップ処理および重なり除去処理を説明するフローチャートである。
【図41】 他の変形例におけるクリップ処理および重なり除去処理を説明するフローチャートである。
【図42】 さらに他の変形例におけるクリップ処理および重なり除去処理を説明するフローチャートである。
【図43】 さらに他の変形例におけるクリップ処理および重なり除去処理を説明するフローチャートである。
【図44】 他の変形例における分割判定処理を説明するフローチャートである。
【符号の説明】
1 命令解釈部
2 ベクターデータ生成部
3 フォント管理部
4 ディスプレイリスト生成部
5 ディスプレイリスト格納部
6 部分領域分割部
7 マージ処理部
8 クリップ処理部
9 重なり除去判定部
10 重なり除去処理部
11 分割判定部
12 分割処理部
13 ディスプレイリスト描画部
14 メモリ部
15 出力デバイス
81 クリップ制御部
82 アクティブリスト制御部
83 ディスプレイリスト記憶部
91 推定処理部
92 判定処理部
93 パラメータ記憶部
101 重なり除去制御部
102 アクティブリスト制御部
103 ディスプレイリスト記憶部1
104 ディスプレイリスト記憶部2
111 分割判定制御部
112 終点記憶部
121 分割制御部
122 アクティブリスト制御部
123 ディスプレイリスト記憶部1
124 ディスプレイリスト記憶部2[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a graphic processing apparatus for drawing a graphic or a character represented by outline data for output to a printer or a display device.
[0002]
[Prior art]
In an editor, a CAD / CAM system, or the like that handles characters represented by graphics or outline data, a graphics drawing process is performed in order to output them to a printer or display device. Such drawing is processed using, for example, a block as shown in FIG.
[0003]
In FIG. 2, first, when a graphic or character drawing command is input by a user instruction or an external input, it is interpreted by the command interpreting unit 1 and input to the vector data generating unit 2. In the case of a character, the vector data generation unit 2 requests the font management unit 3 to obtain vector data that represents the outline of the character. The stroke (line) figure is converted into vector data as shown in FIG. 3, for example, based on the thickness and the shape of the connection portion. The characters, stroke figures, and fill (filled) figures thus converted are input to the display list generation unit 4.
[0004]
The display list generation unit 4 first approximates a curved portion expressed by Bezier, spline, etc. with a minute straight line, and converts it into polygonal vector data as shown in FIG. Next, it is converted into a display list format as shown in FIG. The display list includes, as an example of data relating to vectors constituting a polygon, Dir: direction flag (+1 for upward, -1 for downward), Xs: X coordinate of vector start point, Ye: vector end point It has four element data: Y coordinate, Dx: change amount (slope) of X with respect to +1 increase in Y coordinate. The conversion from the polygon to the display list will be described in detail later.
[0005]
The display list data generated in this way is input to the display list drawing unit 13. The display list drawing unit 13 calculates intersection coordinates between each side of the input display list and each scan line of the output device by a method such as DDA (Digital Differential Analyzer), and sorts by X coordinate value for each scan line. Thus, the correspondence between the start point / end point of the fill is obtained, and a line segment corresponding to the section and parallel to the scan line is drawn on the memory unit 14. Printing and display are performed by transferring the memory data thus drawn to the output device 15 such as a printer or a display device.
[0006]
In such graphic drawing processing, the operation of the display list drawing unit 13 is heavy processing because it includes DDA, sorting, memory drawing, etc. for each side, and particularly when drawing complicated graphics including overlapping such as gradations. In this case, the same memory area is overwritten many times, which is a major factor for reducing the overall processing speed. In addition, as with recent printers, drawing commands are stored at the polygon, display list, and edge list levels to reduce page memory, and output while forming images in real time according to the printing speed of the printer. In some cases, there is a problem (hereinafter, also referred to as a first problem) that there is a possibility that image formation may not occur in time for a complicated portion with many overlaps, resulting in missing images.
[0007]
Further, since the operation of the display list drawing unit 13 is heavy, high-speed processing by dedicated hardware is intended. This process is relatively simple in the case of a convex polygon as shown in FIG. 5A, but includes a concave portion as shown in FIG. 5B or as shown in FIG. 5C. If there is a crossing of edges, there will be multiple start / end pairs for each scan line, so it is necessary to sort the obtained intersections to find correspondence as described above. become. However, when there is no restriction on the complexity of the figure to be input, there is no limit on the number of intersections, and it is very difficult to construct a sort circuit by hardware (hereinafter, the second problem is also called). Called).
[0008]
Conventionally, as an attempt to solve the first problem, there has been proposed a technique for performing high-speed processing or real-time drawing by removing overlap from drawing elements. As conventional techniques using such a concept, there are JP-A-8-279050, JP-A-9-62851, JP-A-9-171563, JP-A-9-281953, and the like.
[0009]
Conventionally, as an attempt to solve the second problem, a method of dividing a polygon into sub-graphics such as trapezoids (including quadrangles and triangles) whose base is parallel to the X axis and processing each of them. There is. As conventional techniques having such a concept, there are JP-A-60-74086, JP-A-61-248176, JP-A-62-271186, and the like.
[0010]
[Problems to be solved by the invention]
The methods disclosed in Japanese Patent Application Laid-Open Nos. 8-279050 and 9-62851 store drawing elements in the form of an edge list and compare the edge information for drawing on the same scan line when there is an overlap. To be removed. However, the storage of drawing elements in the edge list has the disadvantage that the amount of data to be stored becomes enormous and the memory cost increases as the resolution increases as in recent printers.
[0011]
The methods disclosed in Japanese Patent Application Laid-Open Nos. 9-171563 and 9-281953 accumulate drawing elements in the form of polygon data, perform overlap determination on two polygons, and remove any overlap. Is. However, in order to remove overlap at the polygon level, the polygon needs to be a simple convex shape, and for polygons that include concave shapes or side intersections, this is divided into convex shapes, etc. Pre-processing is required. In addition, although the target is narrowed down by the overlap determination / overlay graph or the like, it is basically a method of removing the overlap between two polygons, so that N! Processing is required.
[0012]
The present invention has been made in consideration of the above-mentioned problems of the prior art, and has an overlap removal means for removing overlap between drawing elements expressed in a display list format, which is higher than an edge list. A first object is to realize a high-speed graphics processing apparatus that can store with a small amount of memory even in the case of resolution, and that can perform overlap removal with less processing without performing special preprocessing. .
[0013]
Next, in Japanese Patent Laid-Open Nos. 60-74086 and 61-248176, a polygon is divided into trapezoids (including squares and triangles) whose base is parallel to the X axis, and each trapezoid is processed in turn. This eliminates the need for a sort circuit during the filling process. However, this method has a problem in that a very large number of trapezoids are generated when a complex polygon is divided, so that it is difficult to manage and temporarily store them, and processing speed does not increase because each trapezoid is processed.
[0014]
In Japanese Patent Application Laid-Open No. Sho 62-271186, a figure including an input curve is divided into partial figures having a single drawing line segment in each scan line while including the curve, and a plurality of each partial figure is included. The DDA circuit and the line segment drawing circuit are processed in parallel. However, in this method, the number of partial figures changes according to the complexity of the figure to be input, and it is not possible to limit how many DDA / line segment drawing circuits are required. Therefore, it is expected that contention will actually occur in the portion where data is actually written to the memory, and the processing speed will not increase.
[0015]
In order to solve such a problem, the inventor of the present application inputs 2N (N is 1 or more) DDA means and sort means capable of sorting 2N inputs in Japanese Patent Application No. 9-302403. A partial polygon having a dividing means for dividing an arbitrary display list into a plurality of display lists in which the number of drawing lines on each scan line is N or less, and capable of DDA / sorting the display list expressing the input polygon We have proposed a graphics processing device that can manage and store divided graphics in as small an area as possible by dividing them into two and processing them at high speed.
[0016]
In the system proposed in the above Japanese Patent Application No. 9-302403, the portion corresponding to the display list drawing unit is configured to draw only drawing elements. However, the drawing command includes a clip element that limits the area when the drawing element is drawn in the memory. In that case, the drawing element is clipped before being input to the display list drawing unit. In some cases, it was necessary to clip the element, which could be a factor in reducing the speed.
[0017]
As a countermeasure, it is conceivable to input display list information in which drawing elements and clip elements are mixed, and to change the configuration of the display list drawing unit so that drawing can be performed while clipping. However, the display list division method proposed in Japanese Patent Application No. 9-302403 cannot cope with mixed elements, and if there are scan lines with more than 2N sides, clip elements and drawing elements are displayed. There is a drawback that complicated processing such as separation once, division processing described in Japanese Patent Application No. 9-302403 is performed separately and then mixed again is required, and the overall performance is lowered.
[0018]
The present invention has been made in consideration of the above points, and even when clip elements and drawing elements are mixed, divided figures can be managed / stored in as small an area as possible and can be processed at high speed. A second object is to realize a processing apparatus.
[0019]
[Means for Solving the Problems]
The present invention relates to a graphic processing apparatus made to achieve the above object. That is, the present invention relates to a graphic processing apparatus that performs graphic drawing processing: vector information describing graphic drawing elements and clip elements (vector information includes, for example, the shape and drawing color of drawing elements and clip elements, stroke graphic or fill (Representing attributes such as line width and line type when it is a stroke graphic), and converting the shape of the vector constituting the drawing element and clip element into linear vector information approximating a polygon. The linear vectors included in the linear vector information are sorted based on the vector start scan line coordinate values, and the information including the direction, inclination, and the number of scan lines across each linear vector, or data equivalent to them. Display list generating means for generating a configured display list; The display list representing the drawing element generated by the generation unit and the display list representing the clip element that restricts the drawing area of the drawing element are merged to generate a display list in which the drawing element and the clip element are mixed. Merge processing means; display list storage means for accumulating the display list; and based on the display list, the number of the linear vectors intersecting at the scan line is 2N (N is an integer of 1 or more) in all the scan lines. Determination means for determining whether or not; clip processing means for executing drawing processing of a drawing element by a clip element on a display list in which clip elements and drawing elements are mixed, and converting the display list to a display list of only drawing elements; Converted by processing means A display processing unit that divides a display list of only drawing elements so that the number of straight line vectors intersecting at all scan lines is 2N or less, and generates a plurality of display lists, and a plurality of displays having overlapping drawing regions An overlap removing unit that generates a new display list from which the overlapping of the drawing areas is removed from the list; and 2N DDA units that calculate intersection coordinate values of each scan line and the straight line vector based on the display list; Sorting means for sorting the output values from the DDA means, and memory drawing means for obtaining the position information of the start and end points constituting the drawing line segment from the data sorted by the sorting means and filling the memory area between them Display list drawing means comprising: the display list in front There is provided an overlap removal processing determination means for estimating a processing time for drawing processing by the display list drawing means and determining an execution effect of the overlap removal processing by the overlap removal means based on the estimated drawing processing time. Features.
[0020]
According to this configuration, the overlap removal means for removing the overlap between the drawing elements expressed in the display list format is provided, and it is possible to store with a small amount of memory even when the resolution is higher than that of the edge list. It is possible to realize a high-speed graphic processing apparatus that can perform overlap removal with less processing without performing pre-processing. Furthermore, it has a judging means for determining whether or not an overlap removal process is necessary, and a clip processing means for clipping a display list in which a clip element and a drawing element are mixed into a display list having only a drawing element to thereby overlap. It is possible to realize a high-speed graphic processing apparatus that can minimize the removal process and can cope with a case where clip elements and drawing elements are mixed. Furthermore, when the number of drawing elements to be drawn eventually exceeds 2N (N is a positive integer), the display list can be divided and processed, and drawing data can be managed and stored in a small area. In addition, even when clip elements and drawing elements are mixed, it is possible to realize a graphic processing apparatus that can manage / store divided graphics in as small an area as possible and process them at high speed.
[0021]
Furthermore, the present invention relates to a graphic processing apparatus that performs graphic drawing processing: vector information that describes graphic drawing elements and clip elements, and linear vector information that approximates the shape of the vector constituting the drawing elements and clip elements to a polygon. The linear vectors included in the linear vector information are sorted based on the vector start scan line coordinate values, and the direction, inclination, and the number of scan lines crossing each linear vector, or data equivalent thereto are obtained. Display list generating means for generating a display list constituted by the information to be included; a display list representing the drawing elements generated by the display list creating means; and a display list representing clip elements for restricting the drawing area of the drawing elements And the drawing element and the Merge processing means for generating a display list including mixed elements; whether the number of the linear vectors intersecting at the scan line is 2N or less (N is an integer of 1 or more) in all the scan lines based on the display list Determination means for determining whether or not; clip processing means for executing drawing processing of a drawing element by a clip element on a display list in which clip elements and drawing elements are mixed, and converting the display list to a display list of only drawing elements; Division processing means for dividing the display list of only drawing elements converted by the means so that the number of straight line vectors intersecting in all scan lines is 2N or less, and generating a plurality of display lists; and based on the display list , Each scanline and said linear vector 2N DDA means for calculating intersection coordinate values, sorting means for sorting output values from the DDA means, and position information of the start point and the end point constituting the drawing line segment are obtained from the data sorted by the sorting means. And a display list drawing means including a memory drawing means for painting a memory area therebetween.
[0022]
Even in this configuration, by having a clip processing means that clips a display list in which clip elements and drawing elements are mixed and converts them into a display list with only drawing elements, even if clip elements and drawing elements are mixed It is possible to realize a high-speed graphic processing apparatus that can be used. Furthermore, when the number of drawing elements to be drawn eventually exceeds 2N (N is a positive integer), the display list can be divided and processed, and drawing data can be managed and stored in a small area. In addition, even when clip elements and drawing elements are mixed, it is possible to realize a graphic processing apparatus that can manage / store divided graphics in as small an area as possible and process them at high speed.
[0023]
Furthermore, the present invention relates to a graphic processing apparatus that performs graphic drawing processing: vector information that describes graphic drawing elements and clip elements, and linear vector information that approximates the shape of the vector constituting the drawing elements and clip elements to a polygon. The linear vectors included in the linear vector information are sorted based on the vector start scan line coordinate values, and the direction, inclination, and the number of scan lines crossing each linear vector, or data equivalent thereto are obtained. Display list generating means for generating a display list constituted by the information to be included; a display list representing the drawing elements generated by the display list creating means; and a display list representing clip elements for restricting the drawing area of the drawing elements And the drawing element and the Merge processing means for generating a display list in which the display element is mixed; display list storage means for storing the display list; and execution of clip processing of the drawing element by the clip element for the display list in which the clip element and the drawing element are mixed Clip processing means for converting to a display list of only drawing elements; and an overlap removal means for generating a new display list by removing the overlap of the drawing areas from a plurality of display lists having overlapping drawing areas; Display list drawing means for drawing a graphic represented by the list; estimating a processing time when the display list is drawn by the display list drawing means; and overlapping by the overlap removing means based on the estimated drawing processing time Removal And characterized by providing a removal process determination unit overlap determining effects of running the process.
[0024]
According to this configuration, the overlap removal means for removing the overlap between the drawing elements expressed in the display list format is provided, and it is possible to store with a small amount of memory even when the resolution is higher than that of the edge list. It is possible to realize a high-speed graphic processing apparatus that can perform overlap removal with less processing without performing pre-processing. Furthermore, it has a judging means for determining whether or not an overlap removal process is necessary, and a clip processing means for clipping a display list in which a clip element and a drawing element are mixed into a display list having only a drawing element to thereby overlap. It is possible to realize a high-speed graphic processing apparatus that can minimize the removal process and can cope with a case where clip elements and drawing elements are mixed.
[0025]
Furthermore, the present invention relates to a graphic processing apparatus that performs graphic drawing processing: vector information that describes graphic drawing elements and clip elements, and linear vector information that approximates the shape of the vector constituting the drawing elements and clip elements to a polygon. The linear vectors included in the linear vector information are sorted based on the vector start scan line coordinate values, and the direction, inclination, and the number of scan lines crossing each linear vector, or data equivalent thereto are obtained. Display list generating means for generating a display list constituted by information included therein; display list storage means for storing the display list; clip processing of drawing elements by clip elements for display lists expressing clip elements and drawing elements; Clip processing means to execute and Overlap removing means for generating a new display list in which the overlap of the drawing areas is removed from a plurality of display lists having overlapping in the drawing area; and display list drawing means for drawing a graphic represented by the display list are provided. It is characterized by.
[0026]
Even in this configuration, there is an overlap removal means for removing the overlap between drawing elements expressed in the display list format, which enables accumulation with a small amount of memory even in the case of high resolution compared to the edge list. It is possible to realize a high-speed graphic processing apparatus that does not perform processing and can perform overlap removal with less processing. Furthermore, by having a clip processing means that clips a display list that contains both clip elements and drawing elements and converts it to a display list that contains only drawing elements, it is possible to handle even when clip elements and drawing elements are mixed. In addition, a high-speed graphic processing apparatus can be realized.
[0027]
Furthermore, the present invention provides a graphic processing apparatus for performing graphic drawing processing: vector information describing a graphic drawing element is converted into linear vector information approximating a polygon shape of a vector constituting the graphic element, and the straight line Each linear vector included in the vector information is sorted based on the vector start scan line coordinate value, and is configured by information including the direction, inclination, and the number of scan lines across each linear vector, or equivalent data. Display list generating means for generating a display list; display list storing means for storing the display list; and generating a new display list from which the overlapping of the drawing areas is removed from a plurality of display lists having overlapping drawing areas. An overlap removing means; and the display squirrel And characterized by providing a display list drawing means for drawing a figure for expression.
[0028]
According to this configuration, the overlap removal means for removing the overlap between the drawing elements expressed in the display list format is provided, and it is possible to store with a small amount of memory even when the resolution is higher than that of the edge list. It is possible to realize a high-speed graphic processing apparatus that can perform overlap removal with less processing without performing pre-processing.
[0029]
Furthermore, in the graphic processing apparatus of the present invention, the processing time when the display list is drawn by the display list drawing means is estimated, and the execution effect of the overlap removal processing by the overlap removal means based on the estimated drawing processing time There may be provided an overlap removal processing determination means for determining.
[0030]
The graphic processing apparatus of the present invention may further include a partial area division processing unit that divides the display list for each partial area obtained by dividing the output area, and performs processing for each partial area.
[0031]
Furthermore, in the graphic processing apparatus of the present invention, the merge processing means includes a value indicating a vector direction in the display list related to a linear vector constituting the drawing element and a linear vector constituting the clip element in the mixed display list to be generated. The value indicating the vector direction in the display list may be set to a different value.
[0032]
Further, in the graphic processing apparatus of the present invention, the merge processing means is configured to obtain at least a common Y coordinate range and a common X coordinate range from each circumscribed rectangle for the display list representing a drawing element and the display list representing a clip element. Either or both may be obtained, and a mixed display list composed of linear vectors constrained within the common coordinate range may be generated.
[0033]
Further, in the graphic processing apparatus of the present invention, the determination unit reads the linear vectors included in the display list in ascending order of the start scan line coordinate values, holds the end scan line coordinate values of the linear vectors, and reads the read straight lines. If the start scan line coordinate value of the vector is larger than the end scan line coordinate value already held, the held end scan line coordinate value is discarded, and the end scan held for the display list is performed. When the number of line coordinate values is greater than 2N, a determination result indicating that it is not less than 2N is output at that time, and the sum of the number of unread line vectors and the number of end scan line coordinate values held is 2N. If it is less than or equal to, output a determination result that is 2N or less at that time. Good.
[0034]
Further, in the graphic processing apparatus of the present invention, the conversion processing to the display list of only the drawing elements by the clip processing in the clip processing means is performed when the overlap removal processing determination means determines that the overlap removal processing is necessary. You may make it perform with respect to the said mixed display list used as the object of a process.
[0035]
Furthermore, in the graphic processing device of the present invention, the conversion processing to the display list of only the drawing elements by the clip processing in the clip processing means,
a) The display list is determined by the determination means that there is a scan line with the number of linear vectors intersecting the scan line greater than 2N, and
b) The display list may be executed on condition that the display list is a display list in which drawing elements and clip elements are mixed.
[0036]
Furthermore, in the graphic processing apparatus of the present invention, the division processing unit divides the display list so that the number of linear vectors intersecting all the scan lines is 2N or less, and generates a plurality of display lists.
c) The display list is determined by the determining means that there is a scan line with the number of linear vectors crossing the scan line greater than 2N, and
d) The display list may be executed on condition that the display list is constituted only by drawing elements.
[0037]
Further, in the graphic processing apparatus according to the present invention, the overlap removing means sequentially stores the display list corresponding to the lower drawing element from the display list corresponding to the upper drawing element displayed or printed on the forefront, and stores the display list. The overlap removal processing may be performed based on the display list corresponding to the plurality of drawing elements extracted from the means.
[0038]
Furthermore, in the graphic processing apparatus of the present invention, the overlap removing unit generates a merged area display list indicating the entire drawing area of the plurality of drawing elements that are the target of the overlap removing process, and newly displays the display list storing unit. It is also possible to perform a new overlap removal process with the display list taken out from.
[0039]
Further, in the graphic processing apparatus of the present invention, the determination by the overlap removal processing determination unit is performed for each partial region divided by the partial region division processing unit, and whether or not the overlap removal processing is performed for each partial region. May be switched.
[0040]
Further, in the graphic processing apparatus of the present invention, the estimated drawing processing time in the display list drawing means obtained by the overlap removal processing determining means is at least one of a drawing area, a circumscribed rectangular area, and a height of the display list. You may make it require | calculate using information.
[0041]
Furthermore, in the graphic processing apparatus of the present invention, the drawing processing time estimated value in the display list drawing means obtained by the overlap removal processing determining means includes information indicating whether a drawing element is a character, a graphic, or an image. You may make it perform by the drawing processing time estimation calculation method according to a drawing element attribute.
[0042]
Further, in the graphic processing apparatus of the present invention, the overlap removal processing determination means obtains a drawing processing time estimated value in the display list drawing means based on a processing result by the overlap removal means, and the obtained processing result When the estimated drawing processing time estimated value is equal to or less than a predetermined threshold, a new overlap removal process by the overlap removal unit may not be performed.
[0043]
Furthermore, in the graphic processing apparatus according to the present invention, the processing by the overlap removing means is performed by dividing the display list corresponding to a plurality of drawing elements to be processed into a plurality of groups and for each of the divided groups. Also good.
[0044]
Furthermore, in the graphic processing apparatus of the present invention, the processing by the overlap removing unit may be executed for each of the divided partial areas by dividing the drawing area to be processed into a plurality of partial areas.
[0045]
Further, in the graphic processing apparatus of the present invention, the memory drawing means may be configured such that the display list to be processed is a display list including only drawing elements, a mixed display list in which drawing elements and clip elements are mixed, Based on whether the fill rule of the drawing element and the clip element in the target display list is an even-odd rule or a non-zero rule, or based on these processing target display list conditions, the drawing line segment configuration start point from the sorted data and You may make it change the positional infomation calculation method of an end point.
[0046]
Further, in the graphic processing apparatus of the present invention, the 2N DDA means have a configuration capable of parallel processing, and the calculation processing of the intersection coordinate value of each scan line and the straight line vector is executed by parallel processing. Also good.
[0047]
Furthermore, in the graphic processing apparatus of the present invention, the processing by the overlap removing unit is configured to actually draw a plurality of drawing elements to be processed in order from the bottom of the drawing order and convert them into image drawing elements. The processing time when the graphic element is drawn by the display list drawing means is estimated by the overlap removal processing determination means, and conversion to the image drawing element is performed until it is determined that the overlap removal processing is unnecessary. Good.
[0048]
Further, in the graphic processing apparatus of the present invention, the processing by the overlap removing means divides the drawing area to be processed into a plurality of partial areas, and actually draws the divided partial areas to form image drawing elements. The overlap removal processing determination means estimates the processing time when converting and drawing the graphic elements included in the image drawing element and the remaining partial area by the display list drawing means, and it is determined that the overlap removal processing is unnecessary. It is also possible to sequentially convert a plurality of partial areas into the image drawing elements.
[0049]
Furthermore, in the graphic processing apparatus of the present invention, the estimated drawing processing time in the display list drawing means obtained by the overlap removal processing determining means is a resolution equal to or lower than the resolution required for the processing corresponding to the display list drawing processing. You may make it obtain | require using the approximate value information of the area calculated | required by performing.
[0050]
Furthermore, in the graphic processing apparatus of the present invention, when the graphic is a stroke graphic, the display list generating means obtains an approximate value of a drawing area based on information such as stroke length and line width, line type of each vector, You may make it add the approximate value information of the said drawing area to the said display list produced | generated from the said stroke figure.
[0051]
Furthermore, in the graphic processing apparatus of the present invention, when the graphic is a fill graphic, the display list generating means determines at least whether it has a self-intersection or whether it consists of a plurality of separated graphic elements, If it does not have self-intersection and consists of a single graphic element, an approximate value of the drawing area is obtained based on each linear vector constituting the graphic, and the display list generated from the fill graphic contains the display list. You may make it add the approximate value information of a drawing area.
[0052]
Furthermore, in the graphic processing apparatus of the present invention, the clip processing means has means for determining whether or not at least the shape of the graphic element is rectangular, and changes the clip processing method based on the determination result of the determination means. You may do it.
[0053]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of a graphic processing apparatus according to the present invention will be described below with reference to the drawings.
[0054]
FIG. 1 is a block diagram showing an embodiment of a graphic processing apparatus of the present invention. In the figure, the graphic processing apparatus includes an instruction interpretation unit 1, a vector data generation unit 2, a font management unit 3, a display list generation unit 4, a display list storage unit 5, a partial area division unit 6, and a merge. Processing unit 7, clip processing unit 8, overlap removal determination unit 9, overlap removal processing unit 10, division determination unit 11, division processing unit 12, display list drawing unit 13, memory unit 14, and output And the device 15. Further, the display list drawing unit 13 includes 2N (N is a positive integer) DDA units 131, a sorting unit 132, and a memory drawing unit 133.
[0055]
The outline and operation of each component of the present embodiment will be described below.
[0056]
The command interpretation unit 1 interprets an input drawing command of a graphic or character and converts it into a format that can be understood by the next vector data generation unit 2. In a page description language such as PostScript (trademark of Adobe Systems) or Interpress (trademark of Xerox Corporation), these drawing instructions are given as character strings or binary strings. Cut out the token, perform lexical interpretation, and convert it to an internal drawing command.
[0057]
The vector data generation unit 2 receives the input from the instruction interpretation unit 1 and generates vector data. When the input is a fill (filled) figure, the instruction interpreting unit 1 expresses the outline of the figure, the fill rule such as the even / odd rule / non-zero rule, and the flatness indicating the accuracy when the curve is linearly approximated. Since a (flatness) value, a drawing color, and the like are given, the information is output as it is. If the input is a stroke (line) figure, a vector that represents the line, line attributes such as line width / line type / terminal shape / connection shape, and a flatness value that indicates the accuracy when the curve is linearly approximated Further, since a drawing color or the like is given, a contour vector as shown in FIG. 3 is generated using the vector and line attribute information, and is output together with the remaining information. When the input is a character, information such as a character code, a font ID, and a drawing position and a drawing color is given, and the character code, font ID, and drawing position information are sent to the font management unit 3. Get the outline vector of the character and output it with the rest of the information.
[0058]
The font management unit 3 stores outline vector data for various fonts, and provides outline vector data for the character according to a given character code and font ID.
[0059]
As a result of the above processing, all the input figures / characters are converted into vector data expressing the contour, drawing color, flatness value, and information on the fill rule. When a curve is included in the input vector data, the display list generation unit 4 first reduces the curve portion so that the error is less than the accuracy specified by the flatness value. Performs approximation with a linear vector. For example, a Bezier curve represented by four control points shown in FIG. 6 is used as a curve vector. In this case, in the straight line vectorization process, the Bezier curve is recursively divided as shown in FIG. 6, and the division ends when the height (distance d) becomes smaller than the flatness value. Then, by connecting the start point and the end point of each divided Bezier curve in order, the linear vectorization is completed.
[0060]
Based on the vector data that is linearly approximated in this way, the display list generation unit 4 then converts this into a display list format representation. Here, the display list is, for example, as shown in FIG. The input polygon vector is first converted so that the Y coordinate of each vertex is an integer. Specifically, for each side, the smaller vertex of the Y coordinate is rounded up, the larger vertex is discarded, and the integerization error is corrected with the X coordinate value so that the slope of each side does not change. After converting the Y coordinate value into an integer in this way, edges having the same start Y coordinate are collected and connected in a list. Each element of the list includes a direction flag Dir that indicates whether the direction of the side is upward or downward by + 1 / -1, an X coordinate value Xs at the start point Ys, a Y coordinate value Ye at the end point, and a Y coordinate value. Is stored as the slope Dx of the side expressed by the amount of change in the X coordinate value with respect to an increase of +1. Note that those that do not cross any scan line, such as a side close to the horizontal, are not registered in the elements of the display list.
[0061]
The display list generated in this way is accumulated in the display list storage unit 5.
[0062]
Although the description so far has been made on the drawing element, the clip list representing the clip area is processed in substantially the same manner (except that no color or the like is included), and a display list is generated. The display list storage unit 5 temporarily stores a display list of clip elements generated prior to drawing elements, and when a drawing element drawn in the clip area is input and converted into a display list. The merge processing unit 7 merges the clip list with the display list of the clip area and outputs it to the display list storage unit 5 again.
[0063]
As shown in FIG. 8, this merging process is performed by displaying each side of the display list of clip elements (thick lines in FIG. 8) temporarily held in the display list storage unit 5 and the display list of drawing elements (thin lines in FIG. 8). Are mixed in ascending order of the start scan line, and the Dir is changed to a specific value (± 256 in FIG. 8) for the edges included in the clip element at that time. This Dir value only needs to be twice or more the maximum number of sides intersecting one scan line. If the upper limit is unknown, a large value can be used with a margin. In the following description, it is assumed that there are usually no more than 128 sides in the same scan line. If the display list is clipped in a rectangular area, an X coordinate area, or a Y coordinate area in which both elements exist in common at the time of merging, the processing speed can be slightly increased. As an example, FIG. 9 shows an example of clipping and merging in the common Y coordinate area.
[0064]
Through the processing so far, each drawing element is converted into a display list in which a display list representing the drawing element and a display list of clip elements representing the clip area of the drawing element (if any) are mixed.
[0065]
The display list generated / accumulated in this way is divided into partial areas (hereinafter referred to as bands) obtained by dividing the page by a predetermined width, as shown in FIG. The information is stored in the display list storage unit 5 for each band.
[0066]
The reason for performing the band division is to reduce the capacity of the memory unit 14 to two bands by drawing / outputting using the double buffer method. The memory unit 14 has a capacity of two areas obtained by dividing a page as shown in FIG. 10 into horizontal strips, and drawing and transfer to the output device 15 are alternately performed. In the example shown in FIG. 10, the page is divided into four bands, but the number of divisions can be arbitrarily set based on the capacity of the memory unit 14, the configuration of the processing device, and the like.
[0067]
In the description so far, processing is performed in the order of display list generation → merge processing → partial area division, but there is no problem even if display list generation → partial area division → merge processing is performed in this order.
[0068]
The overlap removal determination unit 9 reads the display list for each band accumulated in the display list storage unit 5, estimates the processing time when drawing the band by the display list drawing unit 13, and the printing speed of the output device 15. Determine if you are in time.
[0069]
As a result of the determination, if a band that is determined not to be in time includes a mixed display list in which drawing elements and clip elements are merged, the mixed display list is processed by the clip processing unit 8. , Convert to a display list with only drawing elements. Next, an overlap removal process is performed by the overlap removal processing unit 10 and stored again in the display list storage unit 5. The overlap determination, clip, and overlap removal processes will be described in detail later.
[0070]
The division determination unit 11 sequentially reads the display list accumulated in the display list storage unit 5, and the number of sides intersecting the scan line exceeds 2N (equal to the number 2N of the DDA units 131) for the input display list. Determine if the part exists. Details of the determination method will be described later.
[0071]
As a result of the determination, when a certain display list exceeds 2N in a certain scan line, if it is not a mixed display list, the display list is output to the division processing unit 12 and intersects in all the scan lines. The display list is divided into a plurality of display lists whose number of sides is 2N or less. Details of the division processing will be described later. If there are more than 2N scan lines and the display list is a mixed display list, the mixed display list is first output to the clip processing unit 8 and clip processing is performed to convert it into a display list containing only drawing elements. The display list that has been clipped is returned to the division determination unit 11, and division determination is performed again. If there are scan lines exceeding 2N, the division processing unit 12 divides them.
[0072]
The display lists generated / accumulated in this way are input to the display list drawing unit 13 one by one. The display list drawing unit 13 includes 2N DDA units 131, a sorting unit 132 that sorts 2N or less data output from the DDA unit 131 by the X coordinate value, and a start point / end point pair from the sorted result. And a memory drawing 133 that draws in the memory with a specified drawing color in between, and expands the polygon represented by the input display list and draws it in the memory area corresponding to the band in the memory unit 14. . This process will also be described in detail later.
[0073]
When all the drawing elements in the band are drawn in the memory unit 14, the result is output to the output device 15 and printed or displayed on a printer or a display.
[0074]
The outline of the graphic processing apparatus of the present invention has been described above. Next, details of the main part of the graphic processing apparatus will be described.
[0075]
First, the clip processing unit 8 will be described.
[0076]
As shown in FIG. 11, the clip processing unit 8 includes a clip control unit 81 that controls the entire clip process, an active list control unit 82, and a display list storage unit 83 that temporarily stores a display list. .
[0077]
Hereinafter, the operation of the clip control unit 81 will be described with reference to the flowcharts shown in FIGS.
[0078]
First, in step 1, Yc representing the scan line to be processed is set to Ymin. This Ymin is the minimum value of the start scan line Y coordinate of the side included in the target display list. For example, in the case of the display list shown in FIG. 9, Ymin = 5.
[0079]
Next, in step 2, the X coordinate value of the intersection of each side in the active list control unit 82 and Y = Yc is calculated by a technique such as DDA. At the time of Y = Ymin, no side is registered in the active list control unit 82, so nothing is performed.
[0080]
In step 3, if there is an edge starting from Yc from the clip target display list, it is extracted and added to the active list in the active list control unit 82. The active list is a list composed of only sides having intersections with the target scan line. For example, as shown in FIG. 16, Status for storing status information of sides described later in addition to Dir, Xs, Ye, Dx, Information such as the X coordinate value Xc of the intersection with the scan line and the start scan line Ys of the side is added. Note that the side just added is Status = INIT, Xc = Xs, Ys = Yc.
[0081]
In step 4, the edge data in the active list is sorted in ascending order of Xc.
[0082]
Next, the process proceeds to S1 (details are shown in FIG. 13), and variables cdir and odir are set to 0 in step 10 shown in FIG. Here, c in cdir means the present (Current), and o (Old) in odir means the old.
[0083]
In step 11, the variable i is set to 1. Here, the variable i indicates the number of the side to be processed. In these steps 10 and 11, the setting of each initial value is completed.
[0084]
In step 12, the i-th side data is read from the active list.
[0085]
In step 13, by setting odir = cdir, cdir is substituted into odir, and further, the value of dir of the read i-th side data is added to cdir.
[0086]
In step 14, the mode is determined from the values of odir and cdir. This mode determination is performed according to the rules shown in FIG. FIG. 17 is a diagram showing rules indicating how the mode is determined based on both the values of odir and cdir. There are a non-zero rule and an even / odd rule in the fill rule of the input drawing element, and the mode determination differs depending on which rule represents the drawing element to be processed.
[0087]
The criterion shown in the upper part of FIG. 17 is a criterion when the clip element is an even / odd rule and the lower part is a non-zero rule. In each case, when the drawing element is an even-odd rule, the judgment criteria are different depending on the non-zero rule. In FIG. 17, when only one of the values of odir and cdir is in the solid line region, it is determined that mode = IN, and in other cases, mode = OUT is determined. The area indicated by the dotted line is determined as mode = IN only when the specific condition described in the dotted line area is satisfied. In the dotted line area of FIG. 17, the condition of “odd number only” is described, and only when one of the values of odir and cdir corresponds to the odd number of these dotted line areas, it is determined that mode = IN. Means. In addition, the white circle part at the center of the solid line in FIG. 17 indicates that the part does not correspond to the solid line. For example, when the clip element in the upper part of FIG. 17 is even / odd and the drawing element is a non-zero rule, the solid line including 256 In the portion, if only one of the values of odir and cdir is within these region ranges other than 256, mode = IN, but in the case of 256, mode = OUT.
[0088]
For example, when the drawing element is a non-zero rule / the clip element is an even / odd rule and odir = 0, cdir = 1, neither is a solid line or a dotted line area, and Mode = OUT. Further, when the drawing element is an even / odd rule / the clip element is non-zero rule and odir = 257, cdir = 256, odir and cdir correspond to the odd-numbered dotted line area, and only the oddr satisfies the condition of the odd number. Therefore, Mode = IN.
[0089]
In the case of Mode = IN, in the current scan line (Y coordinate), filling is effective from the target side (i) to the next side (i + 1). On the other hand, when Mode = OUT, the fill is invalid between the target side and the next side in the current scan line. Status = IN indicates that the corresponding side is Mode = IN in the previous scan line, and Status = OUT indicates that Mode = OUT in the previous scan line.
[0090]
The description of the flow shown in FIG. If it is determined in step 14 that Mode = OUT, the process proceeds to S2 (details are shown in FIG. 14), and the status information Status of the i-th side is read out in step 20 (FIG. 14), and the status is IN. Goes to step 21; otherwise (OUT, INIT) moves to step 23.
[0091]
The side status information is information about a vector added to the active list (see FIG. 16) composed only of sides having intersections with the target scan line as described above, in addition to Dir, Xs, Ye, and Dx. Yes, and has one of INIT, IN, and OUT values. The edge just added is set to Status = INIT, and then the value change is performed according to the flow.
[0092]
In step 21, the part of Y = Ys to Yc−1 from the i-th side data is output to the display list storage unit 83. More specifically, for example, when the i-th side data is Ys = 10, Ye = 20, Xs = 3.5, Dx = 0.5, Dir = + 1, and Yc = 15, Ys = The edge data of 10, Ye = 14, Xs = 3.5, Dx = 0.5, Dir = + 1 is output.
[0093]
In step 22, the i-th side data in the active list is changed to Ys = Yc, Xs = Xc in order to delete the portion output in step 21.
[0094]
In step 23, the status of the i-th side data is changed to OUT (Status = OUT).
[0095]
In step 24, it is determined whether Ye of the i-th side data is equal to Yc. If they are equal, the side is deleted from the active list in step 25, and if they are not equal, i is incremented by 1 in step 26. . S2 is complete | finished above and it moves to step 15 shown in FIG.
[0096]
If it is determined in step 14 shown in FIG. 13 that Mode = IN, the process proceeds to S3 (details are shown in FIG. 15), and the status information Status of the i-th side is read out in step 30 shown in FIG. If the status is OUT, the process proceeds to step 31, and otherwise (IN, INIT), the process proceeds to step 32.
[0097]
In step 31, the i-th side data in the active list is changed to Ys = Yc, Xs = Xc.
[0098]
In step 32, the status of the i-th edge data is changed to IN.
[0099]
In step 33, it is determined whether or not Ye of the i-th side data is equal to Yc. If they are equal, in step 34, the side is output to the display list storage unit 83 and deleted from the active list. Increments i by 1 in step 26. Thus, S3 is finished and the routine proceeds to step 15.
[0100]
In step 15 of FIG. 13, it is checked whether or not the i-th side is present in the active list. If there is an i-th side, the process proceeds to step 12, and if not, S1 is terminated and the process proceeds to step 5 shown in FIG.
[0101]
In step 5, it is determined whether or not Yc is equal to Ymax. If equal, the process ends. If not, Yc is incremented by 1 in step 6 and the process proceeds to step 2. This Ymax is the maximum value of the end scan line Y coordinate of the side included in the target display list. For example, in the case of the display list shown in FIG. 9, Ymax = 14.
[0102]
As described above, when the processing described with reference to the flowchart is performed, the active list is changed to show a part of the progress in FIG. 16, and as a result, a new display subjected to the clip processing shown in FIG. A list is stored.
[0103]
For example, the side of the drawing element indicated by A in FIG. 9 intersects the side B of the clip element when Y = 9 and the fill state changes before and after that, Mode changes from IN to OUT, and in S2 (FIG. 14) The sides are divided, and the divided sides up to the intersection are stored in the display list storage unit 83, and the status of the remaining divided sides is set to the OUT state. The state of the side B has been OUT until then (see Y = 6 in FIG. 16), and the state remains as it is at OUT in S2. Then, since Mode = IN at Y = 9, the edge information up to Y = 8 is cut off at S3 (FIG. 15) only after Y = 9, and the status is changed to the state of IN.
[0104]
In this way, a new side of the display list is clipped with clip processing.
[0105]
FIG. 18 shows a new display list after overlap removal generated from the display list shown in FIG. 9 according to the flow of FIGS. As can be understood by comparing FIG. 9 and FIG. 18, only the display list relating to the side data (drawing element) of the thin solid line in the area (clip area) surrounded by the thick solid line remains, and the area outside the thick solid line A new display list is generated as shown in FIG.
[0106]
As a result of the processing in the flowchart, even if the drawing element is a non-zero rule display list, the output is converted to an even / odd rule. Further, the side of the display list after processing includes those with a dir value of ± 256, which are converted into ± 1 and output.
[0107]
In addition, here, in order to simplify the description, it has been described that all the clip processing is performed according to the above flow. However, when some conditions are satisfied, the processing can be further simplified. For example, when the circumscribed rectangle of the drawing element and the clip element does not have a common area, it is obvious that no clip processing result is output.
[0108]
Also, for example, if either a drawing element or a clip element is known to be a rectangle, and a graphic element that is a rectangle contains the bounding rectangle of the other element, clip processing is a display list of non-rectangular elements Can be processed simply by outputting. Even when not included, the clipping process with the rectangle only needs to constrain the range of each linear vector to the Y coordinate range of the rectangle in the Y coordinate direction, and the left and right sides of the rectangle with respect to the remaining X coordinate direction. The process can be omitted when the other graphic element has all or no edges in between. Similar simplification can be applied to relatively simple figures such as trapezoids and triangles, although the conditions are slightly different.
[0109]
Next, the overlap removal determination unit 9 will be described in detail.
[0110]
FIG. 19 is a block diagram illustrating an example of the implementation of the overlap removal determination unit 9. In the figure, an estimation processing unit 91 estimates a processing time in the display list drawing unit 13 based on the input display list. The determination processing unit 92 determines whether or not overlap removal processing is necessary based on the result of the estimation processing in the estimation processing unit 91. The parameter storage unit 93 stores processing parameters necessary for the estimation processing unit 91 and the determination processing unit 92.
[0111]
As described above, the display list storage unit 5 stores the display list of drawing elements for one page divided for each band. After the processing so far is completed, the overlap removal determination unit 9 reads the display list, determines whether or not overlap removal processing is necessary for each band, and notifies the overlap removal processing unit 10 of the result. The overlap removal processing unit 10 performs the overlap removal process on the display list included in the band determined to require overlap removal according to the determination result.
[0112]
When the display list is input to the estimation processing unit 91, the estimation processing unit 91 obtains a circumscribed rectangle of a graphic drawn by the display list, and estimates the drawing time from the area and height according to the following expression. Note that a and b in the following expression are coefficients obtained in advance and are stored in the parameter storage unit 93 and supplied to the estimation processing unit 91.
[0113]
[Expression 1]
(Estimated drawing time) = a × (area of circumscribed rectangle) + b × (height of circumscribed rectangle)
. . . . . . (1)
When the drawing process is executed by H / W or the like, normally, writing to the memory unit 14 becomes a bottleneck of the process. Since writing to the memory is proportional to the drawing area and there is an overhead such as memory access mode switching in writing for each scan line, the equation (1) multiplies the area of the circumscribed rectangle that approximates the drawing area by a proportional coefficient. Further, a term obtained by multiplying the height of the circumscribed rectangle corresponding to the number of drawing scan lines (= the height of the drawing element) by a proportional coefficient is added.
[0114]
In the case of a display list in which drawing elements and clip elements are mixed, the circumscribed rectangle area and height in equation (1) use the circumscribed rectangle AND area of each drawing element and clip element.
[0115]
Formula (1) shows an estimation formula for the drawing processing time in the graphic processing device having a configuration in which writing to the memory becomes a bottleneck. It is natural to use the formula. Further, in the expression (1), approximation is performed with a circumscribed rectangular area in consideration of the processing amount for accurately obtaining the drawing area from the display list. However, since drawing in the memory is not necessary for the estimation, it is possible to obtain an accurate drawing area by performing a pseudo drawing process although it takes a little processing time. Furthermore, it is possible to perform a pseudo drawing process at a resolution lower than the actual output resolution and obtain an accurate drawing area from the circumscribed rectangle.
[0116]
For example, a drawing element having a large number of sides in the display list has a complicated shape, and there is a possibility that a difference between a circumscribed rectangular area and an actual drawing area is large. In such a case, a closer estimated value can be obtained by correcting the equation (1) by the number of sides.
[0117]
Further, when the graphic satisfies a certain condition, it is possible to obtain a more accurate area without performing a drawing process. For example, when the element input to the display list generation unit 4 is a stroke figure, an approximate drawing area is obtained by accumulating the product of the length and width of each linear vector after the approximation processing to the linear vector. Can be obtained. If the line type is a broken line, etc., if the ratio of the line drawing part to the blank part is known, it can be corrected using it. If it is not known, the drawing area is more accurate than the circumscribed rectangle. Is required.
[0118]
The elements input to the display list generation unit 4 are fill figures (including those converted from stroke figures to fill figures as shown in FIG. 3), and have no self-intersection (has self-intersection). For an example, see FIG. 5 (c)), and if it can be determined that it consists of a single figure (for example, this is not the case when the outer and inner circles are separated like a donut) After the approximation processing to the linear vector, the area can be calculated by the following equation (2), for example. Note that (Xi, Yi) in the expression represents the vertex coordinates of the polygon in order, and n is the number of vertices of the polygon. Abs (x) is the absolute value of x.
[0119]
[Expression 2]
Figure 0003843794
This method can be applied even if there is self-intersection if the figure is divided at the intersection, and even if it consists of multiple separated figures, it can be applied if there is no common area in each separated figure. .
[0120]
The area thus obtained and its approximate value do not coincide with the drawing area in the memory unit 14, but the degree of coincidence is considerably higher than the circumscribed rectangular area. Therefore, when the display list is generated, it is given as additional information to the display list. By changing the equation (1) accordingly, it is possible to improve the determination accuracy in the overlap removal determination unit 9.
[0121]
The expression (1) shows a case where a character / graphic is input as a drawing element. However, the drawing command includes an image, and the display list drawing unit 13 processes a display list representing the outline of the image. If an image processed by an image processing means not shown in FIG. 1 is used to draw the inside of the drawing area with different image data for each pixel, reading of the image data may become a bottleneck. There is sex. In such a case, it is necessary to attach a flag as to whether or not the display list is an image as attribute information to each display list, and switch the estimation formula or coefficient accordingly.
[0122]
The estimation processing unit 91 obtains an estimated drawing time for each display list by the above processing, accumulates the values for the band, obtains an estimated drawing time of the band, and outputs the result to the determination processing unit 92.
[0123]
The determination processing unit 92 determines the effect of the overlap removal process. The determination processing unit 92 compares the estimated drawing time of the partial area with a threshold value stored in advance in the parameter storage unit 93. If the removal process is unnecessary and the threshold value is exceeded, a determination result indicating that the overlap removal process is necessary is output. The overlap removal processing unit 10 removes the overlap of the display list of the band according to the determination result.
[0124]
The threshold value used for the determination process is determined in advance from the printing speed of the output device 15 or an error in the estimation formula. For example, in the case of a printer device that outputs the A4 longitudinal direction in 30 seconds, and the band is one in which the A4 longitudinal direction is equally divided into 120, each partial area needs to be developed within 0.25 seconds. Further, when the estimation error has a maximum of 0.05 seconds around the estimated value of 0.25 seconds, the threshold is set to 0.20 seconds.
[0125]
Next, the overlap removal processing unit 10 will be described in detail.
[0126]
FIG. 20 is a block diagram illustrating an example of an implementation of the overlap removal processing unit 10. The overlap removal processing unit 10 includes an overlap removal control unit 101, an active list control unit 102, a first display list storage unit 103 that temporarily stores a display list, and a second display list storage unit 104. .
[0127]
The overlap removal control unit 101 first extracts the display list stored in the display list storage unit 5 from the rear of the drawing order, merges it with the display list temporarily stored in the second display list storage unit 104, and creates a new one. Generate a display list.
[0128]
The meaning of taking out from behind the drawing order will be briefly described. In general drawing, when a plurality of drawing elements are included, for example, when a rectangle B is drawn with a partial overlap on the triangle A and a circle C is drawn with a partial overlap with the rectangle B, a display list The display lists of the drawing elements A, B, and C held in the storage unit 5 are arranged in the order of A, B, and C. In this process, the display list process for the drawing element A is performed first, then the display list for the drawing element B is processed to overwrite B on the drawing data for A, and finally the display for C is performed. This is because by performing the list process, the drawing element C is overwritten on the drawing elements A and B. In this way, the display list storage unit 5 holds the display list of the drawing element that is the lowest layer on the print or on the screen in sequence from the display list of the drawing element that is displayed in the foreground in order. .
[0129]
In the graphic processing apparatus of the present invention, when a plurality of display lists corresponding to such a plurality of drawing elements are stored in the display list storage unit 5, the drawing elements are located in the rear row, that is, are to be displayed in the foreground. The display list is taken out from the display list storage unit 5 first. For example, as described above, in the case where the quadrangle B is drawn with a partial overlap on the triangle A, and the circle C is drawn with a partial overlap with the quadrangle B, the display list storage unit 5 Are stored in the order of display list A, display list B, and display list C. In this case, in the graphic processing apparatus of the present invention, the display list C, the display list B, and the display list A are extracted in this order.
[0130]
When the display list stored in the display list storage unit 5 is taken out from behind the drawing order and merged with the display list temporarily stored in the second display list storage unit 104, a new display list is generated. Due to the necessity of processing, for the vectors included in the second display list storage unit 104, Dir is changed to a specific value (for example, ± 256) and merged. This value may be at least twice the maximum number of vectors intersecting one scan line, as in the case of clip processing. If the upper limit is unknown, a large value can be used with a margin. In the following description, it is assumed that normally 128 or more vectors are not in the same scan line, and 256 is used as the value of Dir. Note that, at the time of merging, if the display list temporarily stored in the second display list storage unit 104 is clipped within the Y-existing range of the display list read from the display list storage unit 5, the processing can be slightly accelerated. FIG. 21 shows an example of the merged display list. FIG. 22 shows the display list temporarily stored in the second display list storage unit 104, which is clipped with the range of Y in the display list read from the display list storage unit 5 and merged. An example is shown.
[0131]
The operation of the overlap removal control unit 101 after creating the merged display list is basically the same as that of the clip control unit 81. The processing flow is also the same as the clip processing flow shown in FIGS. However, the conditions for mode determination in step 14 in FIG. 13 are different and are performed under the conditions shown in FIG.
[0132]
Unlike the case of the clip processing, in the overlap removal processing, only the even / odd rule display list is stored in the second display list storage unit 104 as described later. Therefore, in the mode determination, the upper or lower condition of FIG. 23 is applied according to the input display list filling rule.
[0133]
In the process corresponding to step 21 in FIG. 14 and step 34 in FIG. 15, the extracted edge data is output to the first display list storage unit 103.
[0134]
As described above, when the processing shown in the flowcharts of FIGS. 12 to 15 is performed, the active list is changed so as to show a part of the progress in FIG. 25. As a result, the first display list storage unit 103 stores FIG. A new display list from which the overlap as shown in FIG. FIG. 26 shows a new display list after overlap removal, which is generated from the display list shown in FIG. 22 according to the flow of FIGS. As can be understood by comparing FIG. 22 and FIG. 26, there is a display list regarding the side data (for example, the drawing element B) of the thin solid line in the region (for example, the drawing element A) surrounded by the thick solid line. A new display list is generated as shown in FIG. 26, which is excluded and is composed only of the display list relating to the vector in the region outside the thick solid line.
[0135]
As a result of the processing in the flowchart, even if the input drawing element is a non-zero rule display list, the output is converted to an even / odd rule.
[0136]
Although the overlap removal of the input display list has been completed by the processing described so far, the overlap removal processing unit 10 further determines the merged area required for performing the overlap removal processing with the next display list regarding the new drawing element. A process of generating the merged area display list to be represented is performed. That is, in the above process, the overlap between the drawing element A and the drawing element B is removed, but when the drawing element C is newly input, the drawing element C and the (drawing element A + drawing element B) area It is necessary to perform overlap removal. Therefore, it is necessary to obtain the merged area: (drawing element A + drawing element B) before this new overlap removal process. Hereinafter, this process will be described.
[0137]
First, the display list temporarily stored in the second display list storage unit 104 and the input display list are merged by the overlap removal control unit 101 again. At this time, clipping is not performed in the Y existence range of the input display list.
[0138]
Next, the overlap removal control unit 101 performs the same process as described above. However, the mode determination shown in step 14 of FIG. 13 is performed under the conditions shown in FIG. 24, and the output destination of the edge data in step 21 of FIG. 14 and step 34 of FIG. Change to 104.
[0139]
As a result, the second display list storage unit 104 shows an area where the input display list and the display list originally temporarily stored in the second display list storage unit 104 are merged, as shown in FIG. Display list is generated.
[0140]
With the above, the overlap removal processing for one drawing element is completed, and when a display list to be drawn below is held in the display list storage unit 5, it is input to the overlap removal processing unit 10, The same processing as described above is repeated. If this series of processing is executed for a new display list taken out from the display list storage unit 5 sequentially, a display list from which all drawing elements have been removed is generated.
[0141]
Here, the processing in the state where the display list is already stored in the second display list storage unit 104 has been described, but of course, when performing overlapping removal of the drawing elements with the latest drawing order, Nothing is stored in the second display list storage unit 104. In this case, the input display list is output to the first display list storage unit 103 as it is without performing overlap removal processing. As for the merged area generation process, if the input display list is an even / odd rule, the merged area generation process is directly output to the second display list storage unit 104, and if the input display list is a non-zero rule, the process is performed using only the input display list.
[0142]
Of course, in the process for the last drawing element that requires the overlap removal process, the merged area generation process is unnecessary.
[0143]
In the description so far, the overlap removal processing is performed on the display lists corresponding to all the drawing elements in order to simplify the description. However, for example, there is no overlap between the input display list and the merged display list. If it can be determined, it is possible to simplify the process such as performing only the merged area generation process. When the overlap determination is complicated, for example, a simple determination such as omitting the overlap removal process when the circumscribed rectangular areas of the two display lists are compared and there is no overlap is also conceivable.
[0144]
In the present embodiment, an example is shown in which the overlap removal process is performed on the display list for each partial area based on the determination process result. However, when the purpose of the overlap removal processing in this embodiment is to make drawing in time for the printing speed of the output device 15, the following change can be considered as a method for shortening the overlap removal processing time.
[0145]
When it is determined that overlap removal is necessary, the drawing order is processed in order from the later drawing element, and the previous estimated value is updated every time processing of one element is completed. Specifically, the circumscribed rectangular areas before and after the overlap removal process are obtained, and the time corresponding to the reduction of the circumscribed rectangular area and height is subtracted from the estimated drawing time obtained earlier. As a result, when the estimated time becomes equal to or less than the threshold value, the overlap removal process is terminated at that time.
[0146]
If it is clear that the performance of the display list drawing unit 13 is in time for the printing speed of the output device 15 even if overwriting of about N times the drawing area occurs, it is not necessary to use a single layer as a result of the overlap removal. Therefore, the display list to be processed is divided into M groups in the drawing order, and overlap removal processing is performed for each group to convert the display list into M layers (not a single layer). In the overlap removal process, the processing time tends to increase with an inclination greater than or equal to the increase in the number of drawing elements to be processed. Thus, by dividing the process into M groups in this way, the entire process is performed. Time can be shortened.
[0147]
As another method, the band to be processed is further subdivided, the drawing processing time is estimated by the overlap removal determination unit 9 for each subdivided partial region, and until the total estimated drawing processing time is equal to or less than a threshold, for example, A method of performing overlap removal processing in order from the subdivided region with heavy processing is also conceivable.
[0148]
Furthermore, in the case of a graphic processing apparatus capable of handling images, some of the partial areas obtained by actually drawing a part in order from the bottom of the drawing elements and converting them into image elements or subdividing the processing target band It is also possible to reduce the drawing processing time of the target band to be equal to or less than the threshold value by processing the above and converting it into an image element.
[0149]
Next, the division determination unit 11 will be described in detail.
[0150]
As shown in FIG. 28, the division determination unit 11 includes a division determination control unit 111 that controls the entire division determination and an end point storage unit 112. Hereinafter, the operation of the division determination control unit 111 will be described with reference to the flowchart shown in FIG.
[0151]
First, in step 80, the variable variable i is set to 1. Here, the variable i indicates the number of the side to be processed.
[0152]
Next, in step 81, the sum of the number of unread sides in the target display list and the number of end points stored in the end point storage unit 112 is checked, and if this is 2N or less, it is determined that no division is necessary. Is output and the determination process is terminated. Of course, at the start of processing, the number of end points stored in the end point storage unit 112 is zero.
[0153]
Next, in step 82, the i-th side information is read from the target display list.
[0154]
Next, at step 83, the variable Yc is set to the Y coordinate value Ys representing the start scan line of the i-th side. As described above, each side in the display list is stored in ascending order of the start scan line.
[0155]
Next, in step 84, all elements less than Yc are deleted from the end point storage unit 112.
[0156]
Next, in step 85, the Y coordinate value Ye representing the end scan line of the i-th side read in step 82 is added to the end point storage unit 112.
[0157]
Next, in step 86, the number of end points stored in the end point storage unit 112 is checked, and if it exceeds 2N, a determination result indicating that division is necessary is output, and the determination process ends. If 2N is not exceeded, the process proceeds to step 87.
[0158]
Next, in step 87, it is checked whether or not there is an unread side in the target display list. If there is no remaining side, a determination result indicating that division is unnecessary is output, and the determination process ends. If it remains, go to Step 88.
[0159]
Next, at step 88, i is incremented by 1, and control returns to step 81.
[0160]
By performing such processing, it is possible to obtain a determination result that the division is unnecessary when the number of sides to be determined is 2N or less in all the scan lines, and that the division is necessary in the other cases. Here, the description has been made so that all display lists are determined. However, for example, when the total number of sides in the display list is 2N or less, the processing can be omitted when the division is clearly unnecessary.
[0161]
Next, the division processing unit 12 will be described.
[0162]
As shown in FIG. 30, the division processing unit 12 includes a division control unit 121 that controls the entire division process, an active list control unit 122, a first display list storage unit 123 that temporarily stores a display list, and a second display list. Display list storage unit 124. Hereinafter, the operation of the division control unit 121 will be described in accordance with a flowchart for the case of the non-zero rule and the case of the even / odd rule.
[0163]
In the case of the non-zero rule, the operation of the division control unit 121 is the same as that of the clip control unit 81 for the part of FIG. A description will be given according to the flow of FIGS. 31 to 33 instead of the flow of FIGS. 13 to 15 described above.
[0164]
In step 40, variables cdir, odir, and count are set to 0, respectively.
[0165]
In step 41, the variable i is set to 1.
[0166]
In step 42, the i-th side data is read from the active list.
[0167]
In step 43, by setting odir = cdir, cdir is substituted for odir, and further, the value of dir of the read i-th side data is added to cdir.
[0168]
In step 44, the mode is determined from the values of odir and cdir. This mode determination is performed according to the rule of IN when only one of odir and cdir is 0, and OUT otherwise. If Mode = IN, control is passed to step 45; if OUT, control is passed to S2.
[0169]
In step 45, the value of the variable count is incremented by one.
[0170]
Next, at step 46, it is checked whether or not the value of the variable count is larger than 2N. If it is larger, the control is shifted to S2, and if it is smaller than 2N, the control is shifted to S3.
[0171]
The process proceeds to S2, and in step 50 shown in FIG. 32, the status information Status of the i-th side is read. If this is IN, the process proceeds to step 51. Otherwise (OUT, INIT), the process proceeds to step 53.
[0172]
In step 51, the part of Y = Ys to Yc−1 from the i-th side data is output to the first display list storage unit 123.
[0173]
In step 52, in order to delete the portion output in step 51, the i-th side data in the active list is changed to Ys = Yc, Xs = Xc.
[0174]
In step 53, the status of the i-th side data is changed to Status = OUT.
[0175]
In step 54, it is determined whether or not Ye of the i-th side data is equal to Yc. If yes, the side is output to the second display list storage unit 124 and deleted from the active list in step 55. If not, i is incremented by 1 in step 56. S2 is complete | finished above and it moves to step 47 of FIG.
[0176]
If the determination of count> 2N in step 46 in FIG. 31 is No and the process proceeds to S3, the process proceeds to step 60 shown in FIG. 33, where the status information Status of the i-th side is read, and if this is OUT, If it is other than (IN, INIT), the process proceeds to step 63.
[0177]
In step 61, the part of Y = Ys to Yc−1 from the i-th side data is output to the second display list storage unit 124.
[0178]
In step 62, the i-th side data in the active list is changed to Ys = Yc, Xs = Xc in order to delete the portion output in step 61.
[0179]
In step 63, the status of the i-th side data is changed to Status = IN.
[0180]
In step 64, it is determined whether or not Ye of the i-th side data is equal to Yc. If yes, the side is output to the first display list storage unit 123 in step 65 and deleted from the active list. If not, i is incremented by 1 in step 66. Thus, S3 is finished, and the routine goes to Step 47 shown in FIG.
[0181]
In step 47, it is checked whether or not there is an i-th side in the active list. If there is an i-th side, the process proceeds to step 42. If not, S1 is terminated and the process proceeds to step 5.
[0182]
Next, the case of even-odd rules will be described. In the case of the even-odd rule, the operation of the division control unit 121 is the same as that of the non-zero rule for the parts of FIGS. 12, 32, and 33, and thus the description thereof is omitted, and the flow of FIG. FIG. 34 will be described.
[0183]
In step 70 of FIG. 34, the variable count is set to 0.
[0184]
In step 71, the variable i is set to 1.
[0185]
In step 72, the i-th side data is read from the active list.
[0186]
In step 73, the value of the variable count is incremented by one.
[0187]
In step 74, it is checked whether or not the value of the variable count is larger than 2N. If it is larger, the control is shifted to S2, and if it is smaller than 2N, the control is shifted to S3.
[0188]
In S2 and S3, the same processing as in the case of the non-zero rule is performed according to the flow shown in FIGS. 32 and 33, and then control is returned to step 75 in FIG. In step 75, it is checked whether or not there is an i-th side in the active list. If it is, the process proceeds to step 72. If not, S1 is terminated and the process proceeds to step 5 in FIG.
[0189]
As described above, when the processing described with reference to the flowchart is performed, the display list shown in FIG. 35 is stored in the first display list storage unit 123 and the display list shown in FIG. 36 is stored in the second display list storage unit 124. Is done. FIGS. 35 and 36 are examples when the display list of FIG. 18 is divided by N = 2. If the display lists of FIGS. 35 and 36 are combined, the display list of FIG. 18 is obtained. As a result of the processing in the flowchart, even if the input is a non-zero rule display list, the output is converted to an even / odd rule.
[0190]
Since the non-zero rule is converted to the even / odd rule, even when it is determined that the division is necessary, the result of the division process may be only the first display list storage unit 123. Further, although the first display list storage unit 123 always stores 2N or less, the display list stored in the second display list storage unit 124 may be larger than 2N. When the output is also generated in the display list storage unit 124, it is necessary to return the display list to the division determination unit 11 and repeat the determination / division.
[0191]
Some changes can be considered for the processing flow of the clip processing, overlap removal processing, and division processing described so far. For example, in the flow described in FIG. 12, it has been described that Xc is updated and sorted every time for Ymin to Ymax. However, the status value of the edge data in the active list is changed only when an edge is added / deleted / intersected. Since this is not done, it is possible to obtain a Y-coordinate value at which addition / deletion / intersection occurs in advance and process only that scan line.
[0192]
Alternatively, all sorting can be omitted. Specifically, when moving the edge data from the display list to the active list, the intersection determination with all the edge data already registered in the active list is performed, and if there is an intersection, the edge is divided there, The first half of the divided edge data is registered in the active list, and the second half is returned to the display list. Furthermore, when registering the first half part, it inserts in the position which becomes the ascending order of Xc. In this way, it is guaranteed that the edge data in the active list is always arranged in ascending order of Xc, so that sorting is not necessary. Since the intersection determination is performed only with the edges registered in the active list, the number of objects does not increase so much. Since it is clear that this is not the case, the processing can be further speeded up by removing these.
[0193]
As is clear from FIGS. 11, 20, 30 and the description thereof, the operations of the active list control unit and the display list storage unit in the figure are common and do not need to be independently provided. Further, the merge processing performed by the overlap removal control unit 101 in FIG. 20 and the division control unit 121 in FIG. 30 is the same as the operation of the merge processing unit 7 and may be used in common. Further, since the processes of the clip control unit 81, the overlap removal control unit 101, and the division control unit 121 are substantially the same except for the mode determination condition, different portions may be parameterized and used in common.
[0194]
Next, the operation of the display list drawing unit 13 will be described in detail.
[0195]
Through the above processing, the figure requested to be drawn is changed to display list format data with mixed or drawing elements only, where the number of sides intersecting each scan line is limited to 2N or less. Input to the list drawing unit 13. The display list drawing unit 13 draws a polygon in the memory unit 14 based on this input.
[0196]
Hereinafter, the operation of the display list drawing unit 13 will be described using the flowchart of FIG. 37 as an example of the case of even-odd rules with only drawing elements, and then the other cases will be described.
[0197]
First, in step 90, the variable Yc representing the scan line to be processed is set to the minimum value Ymin of the Y coordinate of the display list.
[0198]
Next, in step 91, the DDA unit 131 is used to calculate the X coordinate value of the intersection between the current scan line and each side and update Xc. The X coordinate value Xc of the intersection of each side can be obtained by {Xc + Dx} using the previous Xc. If no side is set in the DDA unit 131 here, nothing is done here.
[0199]
Next, in step 92, if there is an edge starting from Yc in the input display list, it is set in an empty DDA section. The DDA unit has an intersection X coordinate Xc with the current scan line, an end point Y coordinate Ye of the side, a change amount Xx of the X coordinate with respect to an increase of +1 in the Y coordinate, and a direction flag Dir, and Xc = Xs, Ye = Ye, Dx = Dx, and Dir = Dir are substituted into the DDA unit 131.
[0200]
Next, in step 93, all the values of Xc from the DDA unit 131 for which sides are set are output to the sorting unit 132, and the sorting unit 132 sorts them in ascending order and outputs them to the memory drawing unit 133.
[0201]
Next, at step 94, two X coordinate values sorted by the memory rendering unit 133 are taken out from the top two to make a pair, and the area of the memory unit 14 corresponding to the horizontal line segment between the pair is filled. Although each Xc is output as a decimal number, since drawing to the memory unit 14 requires integer coordinates, actual filling is performed using coordinate values obtained by rounding down / rounding up / rounding off Xc, for example. The fill color is read and used as the color specified by the drawing color data in the case of characters / graphics, and the pixel value to be drawn at the coordinate position in the case of images.
[0202]
Next, in step 95, the side ending with Y = Yc is deleted from the DDA unit 131.
[0203]
Next, in step 96, Yc is increased by one. Next, at step 97, it is checked whether or not this Yc value is larger than the Y coordinate maximum value Ymax of the existence range of the target display list. If it is larger, the process ends. If not, the process returns to step 91 and Y = The process of Yc is continued.
[0204]
FIG. 38 shows an explanatory diagram of the operation from Yc = 10 to Yc = 11 when the display list of FIG. 35 is processed in such a flow. As shown in FIG. 38, each side is obtained by the DDA unit 131 at the intersection with the scan line, sorted, and painted between each pair. Here, it is an example in which N = 2, and processing by 2N, that is, four DDA units 1 to 4 is performed.
[0205]
The processing in FIG. 38 will be described in association with the processing flow in FIG. The processing proceeds from the upper left side of FIG. 38. First, 4 (2N) DDA units 1 to 4 execute calculation of X coordinate values for four display lists for Yc = 10 (FIG. 37, step 91). Equivalent). Further, the calculated X coordinate values are sorted (step 93), and a drawing process is executed (step 94). Furthermore, in the example shown in FIG. 38, the display list processed by the DDA unit 2 and the DDA unit 3 has data of Ye = 10, and the current processing point Y = 10. Therefore, the display list is deleted from the DDA unit. Further, the process moves to the next line Y = 11 and the same processing is executed. By performing such processing from Ymin to Ymax by 4 (= 2N) DDA units 1 to 4, the polygon represented by the input display list is efficiently drawn on the memory unit 14.
[0206]
Since the drawing element and the clip element have two even / odd / non-zero painting rules, when combined, the display list drawing unit 13 needs to deal with the following six cases.
1. Even-odd rule with only drawing elements
2. Non-zero rule with drawing elements only
3. Drawing element is even-odd rule, clip element is even-odd rule
4). Drawing element is even-odd rule, clip element is non-zero rule
5). Drawing element is non-zero rule, clip element is even-odd rule
6). Drawing element is non-zero rule, clip element is non-zero rule
Among the above, 2. 37, in step 94 shown in FIG. 37, instead of pairing the sorted X coordinate value data from the top two, a variable for integrating the Dir of each side is provided, and the side whose value is not 0 and 0 The flow is changed so as to draw a portion between the Xc and the sides to be paired.
[0207]
Of the above, 3. ~ 6. In this case, a variable for integrating Dir of each side is provided, a pair of sides is determined under the conditions shown in FIG. 17, and the flow is changed so as to draw between Xc.
[0208]
Here, for the sake of simplicity, the description has been made assuming that the value of Dir is ± 1 or ± 256. However, when the display list drawing unit 13 is configured by hardware, there is an advantage in reducing the number of bits. It is also possible to configure a determination condition that gives the same result as in FIG. 17 using a 1-bit flag representing a clip element.
[0209]
For example, a display list using a flag for distinguishing between drawing elements and clip elements may be configured as shown in FIG. Cf = 1 indicates the side of the clip element, and Cf = 0 indicates the side of the drawing element. Also in this case, the drawing element can be cut out by checking whether the state of each side changes according to the increment of the Y coordinate. Of course, the overlap removal can be similarly performed.
[0210]
FIG. 40 shows an example of processing S1 (processing corresponding to FIG. 13) in the case of using such a flag. In this example, both drawing and clipping are performed according to an even-odd rule. In this figure, ddir is the value of the even / odd rule of the drawing process, and if it is true, the subsequent drawing is effective. cdir is an even / odd rule value of the clip processing. If true, it indicates that the subsequent clip is valid. The flow of FIG. 40 will be briefly described below.
[0211]
[Step 100]: Initialize ddir = cdir = false. Similarly, it initializes to omode = cmode = false. Cmode indicates whether the drawing is valid or invalid with respect to the current side (i) (on the right side of the side) in consideration of the clip. “omode” indicates whether drawing including a clip is valid or invalid for the immediately preceding side (i−1) (on the right side of the immediately preceding side, that is, on the left side of the current side). Whether or not drawing including a clip is valid is determined by a logical product of ddir and cdir.
[Step 101]: The edge number i is initialized to 1.
[Step 102]: The i-th side data of the active list is read.
[Step 103]: It is determined by the clip flag Cf whether the read edge data is of a drawing vector. If it is a drawing vector, the process proceeds to step 104, and if it is a clip vector, the process proceeds to step 105.
[Step 104]: Invert ddir.
[Step 105]: Invert cdir.
[Step 106]: The current cmode is substituted into omode, and a new cmode is generated from the logical product of ddir and cdir.
[Step 107]: Cmode and omode are compared. If they match, the process proceeds to S2 (FIG. 14), and if they do not match, the process proceeds to S3 (FIG. 15).
[Step 108]: Steps 102 and after are repeated until there are no more active list edges.
[0212]
The above is an example in the case where an even / odd rule is applied to drawing and clipping, but it goes without saying that processing can be performed in other modes. For example, FIG. 41 shows a case where a non-zero rule is applied to drawing and an even / odd rule is applied to a clip. FIG. 42 shows an even / odd rule applied to drawing and a non-zero rule applied to a clip. Further, FIG. 43 shows a case where the non-zero rule is applied to both drawing and clip.
[0213]
In FIG. 41, step 100 ′ and step 104 ′ are performed instead of step 100 and step 104 (FIG. 40). In this figure, doval indicates the value immediately before the non-zero rule of the drawing element, and dcval indicates the current value of the non-zero rule of the drawing element. The operation of this figure is almost the same as that of FIGS. 13 and 40, and detailed description thereof is omitted.
[0214]
In FIG. 42, step 100 ″ and step 105 ′ are performed instead of step 101 and step 105 (FIG. 40). The operation of this figure is also substantially the same as that of FIGS. 13 and 40, and detailed description thereof is omitted.
[0215]
In FIG. 43, step 100 '' is performed instead of step 100 (FIG. 40). Further, instead of step 104 and step 105, step 104 ′ and step 105 ′ are performed. In this figure, coval indicates the value immediately before the non-zero rule of the clip element, and ccval indicates the current value of the non-zero rule of the clip element. The operation of this figure is also substantially the same as that of FIGS. 13 and 40, and detailed description thereof is omitted.
[0216]
Note that it is possible to perform other than the above-described procedure (FIG. 13 and the like) to determine which drawing element or clip element side should be used as a new display list component or clipped as a new side by performing clip processing. It is. In short, it is only necessary to set conditions for cutting out and determine whether the conditions are satisfied.
[0217]
Further, in the above-described embodiment, the edges (straight line vectors) of the display list are stored in ascending order, and the edge information is sequentially extracted to determine whether or not the DDA operation can be performed in parallel. Although the division is performed (FIG. 29), information on the sides starting from the scan lines may be sequentially extracted for each scan line, and it may be similarly determined whether the division is necessary.
[0218]
FIG. 44 shows the processing of such a determination procedure. The process of FIG. 44 will be briefly described. The details of the processing can be easily understood from the figure, and thus detailed description thereof is omitted.
[0219]
[Step 81 ′]: Yc representing the target scan line is set to Ymin. This Ymin is the minimum value of the existence range of Y in the display list to be determined.
[Step 82 ′]: If there is a side starting from Yc in the display list to be determined, the end scan line Ye of that side is stored in the end point storage unit 112.
[Step 83 ']: The number of end points stored in the end point storage unit 112 is checked, and if it exceeds 2N, a determination result indicating that division is necessary is output and the determination ends. If 2N is not exceeded, the process proceeds to step 84 '.
[Step 84 ′]: It is checked whether Yc is equal to Ymax. If it is equal, a determination result indicating that division is unnecessary is output, and the determination process is terminated. This Ymax is the maximum value of the existence range of Y in the display list to be determined. If Yc is not equal to Ymax, the process proceeds to step 85 ′.
[Step 85 ′]: Delete all elements in the end point storage unit 112 where Ye = Yc.
[Step 86 ′]: The value of Yc is incremented by 1, and the process returns to Step 82 ′.
[0220]
By performing such processing, it is possible to obtain a determination result that division is unnecessary when the number of sides to be determined is 2N or less on all scan lines, and that division is necessary otherwise. Here, all the display lists are determined, but the processing can be omitted when the division is clearly unnecessary, for example, when the total number of sides in the display list is 2N or less (FIG. 29). ).
[0221]
【The invention's effect】
As described above, the present invention has overlap removal means for removing overlap between drawing elements expressed in the display list format, and enables storage with a small amount of memory even in the case of high resolution compared to the edge list. In addition, it is possible to realize a high-speed graphic processing apparatus that does not perform special preprocessing and can remove overlap with a small amount of processing. Furthermore, it has a judging means for determining whether or not an overlap removal process is necessary, and a clip processing means for clipping a display list in which a clip element and a drawing element are mixed into a display list having only a drawing element to thereby overlap. It is possible to realize a high-speed graphic processing apparatus that can minimize the removal process and can cope with a case where clip elements and drawing elements are mixed.
[0222]
In the present invention, a determination means for determining whether or not the number of sides intersecting all the scan lines from the display list is 2N (= the number of DDA means) or less, and a display list in which clip elements and drawing elements are mixed are provided. Clip processing means for performing clip processing and converting the display list of drawing elements only, dividing means for dividing the display list of drawing elements into a plurality of display lists in which the number of sides intersecting in all scan lines is 2N or less, When there are 2N (N is 1 or more) DDA means and sorting means that can sort the input output from the DDA means so that clip elements and drawing elements are mixed in the drawing command However, the processing to make the display list only the drawing elements, and the display list is the number of DDA means 2 Since the position information calculation process based on the display list converted and generated by the 2N DDA units capable of parallel processing is executed after the process of dividing into the following divided display lists is performed, a small area of drawing data Thus, even when clip elements and drawing elements are mixed, it is possible to manage and store divided graphics in as small an area as possible, and to realize a graphic processing apparatus capable of high-speed processing.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an embodiment of a graphic processing apparatus of the present invention.
FIG. 2 is a block diagram showing an example of an existing graphic processing apparatus.
FIG. 3 is a diagram illustrating conversion of a line figure into a filled figure.
FIG. 4 is a diagram for explaining approximation of a curved line with a minute straight line.
FIG. 5 is a diagram showing various polygons.
FIG. 6 is a diagram for explaining recursive division of a Bezier curve.
FIG. 7 is a diagram illustrating a display list.
FIG. 8 is a diagram illustrating a mixed display list of drawing elements and clip elements.
FIG. 9 is a diagram illustrating a Y-direction clip of a mixed display list.
FIG. 10 is a diagram for explaining division into partial areas in the graphic processing apparatus of the present invention.
FIG. 11 is a block diagram showing an example of a clip processing unit in the graphic processing apparatus of the present invention.
FIG. 12 is a flowchart (No. 1) showing a procedure of clip processing in the graphic processing apparatus of the present invention;
FIG. 13 is a flowchart (part 2) showing the procedure of clip processing in the graphic processing apparatus of the present invention;
FIG. 14 is a flowchart (No. 3) showing a procedure of clip processing in the graphic processing apparatus of the present invention;
FIG. 15 is a flowchart (No. 4) showing a procedure of clip processing in the graphic processing apparatus of the present invention;
FIG. 16 is a diagram for explaining an active list;
FIG. 17 is a diagram for explaining mode determination in clip processing in the graphic processing apparatus of the present invention;
FIG. 18 is a diagram for explaining a display list output after clip processing in the graphic processing apparatus of the present invention;
FIG. 19 is a block diagram showing an example of an overlap removal determination unit in the graphic processing apparatus of the present invention.
FIG. 20 is a block diagram showing an example of an overlap removal processing unit in the graphic processing apparatus of the present invention.
FIG. 21 is a diagram illustrating a mixed display list of drawing elements and merged areas.
FIG. 22 is a diagram for explaining a Y-direction clip of a mixed display list.
FIG. 23 is a diagram for explaining mode determination in the overlap removal processing in the graphic processing apparatus of the present invention.
FIG. 24 is a diagram for explaining mode determination in the overlap removal (merged area generation) process in the graphic processing apparatus of the present invention.
FIG. 25 is a diagram for explaining an active list (part 2);
FIG. 26 is a diagram for explaining a display list that has been subjected to overlap removal processing in the graphic processing apparatus of the present invention;
FIG. 27 is a diagram for explaining a display list that has been merged in the graphic processing apparatus of the present invention;
FIG. 28 is a block diagram illustrating an example of a division determination unit in the graphic processing apparatus of the present invention.
FIG. 29 is a flowchart showing a procedure of division determination processing in the graphic processing apparatus of the present invention.
FIG. 30 is a block diagram showing an example of a division processing unit in the graphic processing apparatus of the present invention.
FIG. 31 is a flowchart (part 1) showing a procedure of division processing in the graphic processing apparatus of the present invention;
FIG. 32 is a flowchart (No. 2) showing the procedure of the dividing process in the graphic processing apparatus of the present invention.
FIG. 33 is a flowchart (No. 3) showing the procedure of the division processing in the graphic processing apparatus of the present invention.
FIG. 34 is a flowchart (No. 4) showing the procedure of the division processing in the graphic processing apparatus of the present invention.
FIG. 35 is a diagram illustrating a display list output after division processing in the graphic processing apparatus of the present invention.
FIG. 36 is a diagram for explaining a display list remaining after division processing in the graphic processing apparatus of the present invention;
FIG. 37 is a flowchart showing the procedure of display list drawing processing in the graphic processing apparatus of the present invention.
FIG. 38 is a diagram for explaining display list drawing processing in the graphic processing apparatus of the present invention;
FIG. 39 is a diagram for explaining a modification of the display list.
FIG. 40 is a flowchart illustrating clip processing and overlap removal processing in a modification example.
FIG. 41 is a flowchart illustrating clip processing and overlap removal processing in another modified example.
FIG. 42 is a flowchart for describing clip processing and overlap removal processing in still another modified example.
FIG. 43 is a flowchart for explaining clip processing and overlap removal processing in still another modified example.
FIG. 44 is a flowchart for explaining division determination processing in another modified example.
[Explanation of symbols]
1 Instruction interpreter
2 Vector data generator
3 Font Management Department
4 Display list generator
5 Display list storage
6 Partial area division
7 Merge processing section
8 Clip processing section
9 Overlap removal judgment unit
10 Overlap removal processing unit
11 Division determination unit
12 Division processing part
13 Display list drawing section
14 Memory part
15 Output device
81 Clip control unit
82 Active list controller
83 Display list storage
91 Estimator
92 Judgment processing part
93 Parameter storage
101 Overlap removal control unit
102 Active list control unit
103 Display list storage unit 1
104 Display list storage unit 2
111 division determination control unit
112 End point storage
121 Division control unit
122 Active list controller
123 Display list storage unit 1
124 Display list storage unit 2

Claims (5)

図形の描画処理を行う図形処理装置において、
図形の描画要素やクリップ要素を記述するベクター情報を、前記描画要素やクリップ要素を構成するベクターの形状を多角形近似した直線ベクター情報に変換し、前記直線ベクター情報中に含まれる各直線ベクターをベクター開始スキャンライン座標値に基づいてソートして該各直線ベクターの方向、傾き、および横切るスキャンライン数、またはそれらと等価なデータを含む情報によって構成されるディスプレイリストを生成するディスプレイリスト生成手段と、
前記ディスプレイリストを蓄積するディスプレイリスト格納手段と、
クリップ要素と描画要素を表現するディスプレイリストについて、クリップ要素による描画要素のクリップ処理を実行するクリップ処理手段と、
描画領域に重なりを有する複数のディスプレイリストから、前記描画領域の重なりを除去した新たなディスプレイリストを生成する重なり除去手段と、
前記ディスプレイリストの表現する図形を描画するディスプレイリスト描画手段とを有し、
前記ディスプレイリスト生成手段によって生成された、描画要素を表わすディスプレイリストと、当該描画要素の描画領域を制限するクリップ要素を表わすディスプレイリストとをマージ処理し、描画要素とクリップ要素とが混在したディスプレイリストを生成するマージ処理手段をさらに有し、前記マージ処理手段は、描画要素を表わす前記ディスプレイリストと、クリップ要素を表わす前記ディスプレイリストについて、それぞれの外接矩形から少なくともその共通Y座標範囲と共通X座標範囲のどちらか、または両方を求め、前記共通座標範囲内に制約された直線ベクターにより構成された混在ディスプレイリストを生成することを特徴とする図形処理装置。
In a graphic processing apparatus that performs graphic drawing processing,
Vector information describing drawing elements and clip elements of a graphic is converted into linear vector information that approximates the shape of the vector constituting the drawing elements and clip elements to a polygon, and each linear vector included in the linear vector information is converted. Display list generating means for generating a display list constituted by information including data including the direction, inclination, and the number of scan lines across each straight line vector, or data equivalent thereto, sorted based on vector start scan line coordinate values; ,
Display list storage means for storing the display list;
Clip processing means for executing clip processing of a drawing element by a clip element for a display list representing a clip element and a drawing element;
Overlap removal means for generating a new display list from which the overlap of the drawing area is removed from a plurality of display lists having an overlap in the drawing area;
Possess a display list drawing means for drawing a graphic representing the display list,
The display list that is generated by the display list generation means and that displays the drawing element and the display list that represents the clip element that restricts the drawing area of the drawing element are merged, and the display list is a mixture of the drawing element and the clip element. Merge processing means for generating at least a common Y-coordinate range and a common X-coordinate from each circumscribed rectangle for the display list representing drawing elements and the display list representing clip elements. One of or both of the ranges is obtained, and a graphic display device configured to generate a mixed display list composed of straight line vectors constrained within the common coordinate range .
図形の描画処理を行う図形処理装置において、
図形の描画要素やクリップ要素を記述するベクター情報を、前記描画要素やクリップ要素を構成するベクターの形状を多角形近似した直線ベクター情報に変換し、前記直線ベクター情報中に含まれる各直線ベクターをベクター開始スキャンライン座標値に基づいてソートして該各直線ベクターの方向、傾き、および横切るスキャンライン数、またはそれらと等価なデータを含む情報によって構成されるディスプレイリストを生成するディスプレイリスト生成手段と、
前記ディスプレイリストを蓄積するディスプレイリスト格納手段と、
クリップ要素と描画要素を表現するディスプレイリストについて、クリップ要素による描画要素のクリップ処理を実行するクリップ処理手段と、
描画領域に重なりを有する複数のディスプレイリストから、前記描画領域の重なりを除去した新たなディスプレイリストを生成する重なり除去手段と、
前記ディスプレイリストの表現する図形を描画するディスプレイリスト描画手段とを有し、
前記重なり除去手段は、最前面に表示または印刷出力される上層の描画要素に対応するディスプレイリストから下層の描画要素に対応するディスプレイリストを順次、前記ディスプレイリスト格納手段から取り出して、該取り出した複数の描画要素に対応するディスプレイリストに基づいて重なり除去処理を行うことを特徴とする図形処理装置。
In a graphic processing apparatus that performs graphic drawing processing,
Vector information describing drawing elements and clip elements of a graphic is converted into linear vector information that approximates the shape of the vector constituting the drawing elements and clip elements to a polygon, and each linear vector included in the linear vector information is converted. Display list generating means for generating a display list constituted by information including data including the direction, inclination, and the number of scan lines across each straight line vector, or data equivalent thereto, sorted based on vector start scan line coordinate values; ,
Display list storage means for storing the display list;
Clip processing means for executing clip processing of a drawing element by a clip element for a display list representing a clip element and a drawing element;
Overlap removal means for generating a new display list from which the overlap of the drawing area is removed from a plurality of display lists having an overlap in the drawing area;
Possess a display list drawing means for drawing a graphic representing the display list,
The overlap removing means sequentially takes out the display list corresponding to the lower drawing element from the display list corresponding to the upper drawing element displayed or printed on the forefront from the display list storage means, A graphic processing apparatus for performing overlap removal processing based on a display list corresponding to a drawing element .
図形の描画処理を行う図形処理装置において、
図形の描画要素やクリップ要素を記述するベクター情報を、前記描画要素やクリップ要素を構成するベクターの形状を多角形近似した直線ベクター情報に変換し、前記直線ベクター情報中に含まれる各直線ベクターをベクター開始スキャンライン座標値に基づいてソートして該各直線ベクターの方向、傾き、および横切るスキャンライン数、またはそれらと等価なデータを含む情報によって構成されるディスプレイリストを生成するディスプレイリスト生成手段と、
前記ディスプレイリストを蓄積するディスプレイリスト格納手段と、
クリップ要素と描画要素を表現するディスプレイリストについて、クリップ要素による描画要素のクリップ処理を実行するクリップ処理手段と、
描画領域に重なりを有する複数のディスプレイリストから、前記描画領域の重なりを除去した新たなディスプレイリストを生成する重なり除去手段と、
前記ディスプレイリストの表現する図形を描画するディスプレイリスト描画手段とを有し、
前記重なり除去手段は、前記重なり除去処理の対象となった複数の描画要素の描画領域全体を示す併合領域ディスプレイリストを生成して、新たに前記ディスプレイリスト格納手段から取り出されるディスプレイリストとの新たな重なり除去処理を行うことを特徴とする図形処理装置。
In a graphic processing apparatus that performs graphic drawing processing,
Vector information describing drawing elements and clip elements of a graphic is converted into linear vector information that approximates the shape of the vector constituting the drawing elements and clip elements to a polygon, and each linear vector included in the linear vector information is converted. Display list generating means for generating a display list constituted by information including data including the direction, inclination, and the number of scan lines across each straight line vector, or data equivalent thereto, sorted based on vector start scan line coordinate values; ,
Display list storage means for storing the display list;
Clip processing means for executing clip processing of a drawing element by a clip element for a display list representing a clip element and a drawing element;
Overlap removal means for generating a new display list from which the overlap of the drawing area is removed from a plurality of display lists having an overlap in the drawing area;
Possess a display list drawing means for drawing a graphic representing the display list,
The overlap removing unit generates a merged area display list indicating the entire drawing area of the plurality of drawing elements subjected to the overlap removal process, and newly creates a new display list from the display list storage unit. A graphic processing apparatus for performing overlap removal processing .
図形の描画処理を行う図形処理装置において、
図形の描画要素を記述するベクター情報を、前記描画要素を構成するベクターの形状を多角形近似した直線ベクター情報に変換し、前記直線ベクター情報中に含まれる各直線ベクターをベクター開始スキャンライン座標値に基づいてソートして該各直線ベクターの方向、傾き、および横切るスキャンライン数、またはそれらと等価なデータを含む情報によって構成されるディスプレイリストを生成するディスプレイリスト生成手段と、
前記ディスプレイリストを蓄積するディスプレイリスト格納手段と、
描画領域に重なりを有する複数のディスプレイリストから、前記描画領域の重なりを除去した新たなディスプレイリストを生成する重なり除去手段と、
前記ディスプレイリストの表現する図形を描画するディスプレイリスト描画手段とを有し、
前記重なり除去手段は、最前面に表示または印刷出力される上層の描画要素に対応するディスプレイリストから下層の描画要素に対応するディスプレイリストを順次、前記ディスプレイリスト格納手段から取り出して、該取り出した複数の描画要素に対応するディスプレイリストに基づいて重なり除去処理を行うことを特徴とする図形処理装置。
In a graphic processing apparatus that performs graphic drawing processing,
Vector information describing a drawing element of a graphic is converted into linear vector information that approximates the shape of the vector constituting the drawing element to a polygon, and each linear vector included in the linear vector information is converted into a vector start scan line coordinate value. Display list generating means for generating a display list configured based on information including data including the direction, inclination, and the number of scan lines across each straight line vector, or data equivalent thereto, sorted based on
Display list storage means for storing the display list;
Overlap removal means for generating a new display list from which the overlap of the drawing area is removed from a plurality of display lists having an overlap in the drawing area;
Possess a display list drawing means for drawing a graphic representing the display list,
The overlap removing means sequentially takes out the display list corresponding to the lower drawing element from the display list corresponding to the upper drawing element displayed or printed on the forefront from the display list storage means, A graphic processing apparatus for performing overlap removal processing based on a display list corresponding to a drawing element .
図形の描画処理を行う図形処理装置において、
図形の描画要素を記述するベクター情報を、前記描画要素を構成するベクターの形状を多角形近似した直線ベクター情報に変換し、前記直線ベクター情報中に含まれる各直線ベクターをベクター開始スキャンライン座標値に基づいてソートして該各直線ベクターの方向、傾き、および横切るスキャンライン数、またはそれらと等価なデータを含む情報によって構成されるディスプレイリストを生成するディスプレイリスト生成手段と、
前記ディスプレイリストを蓄積するディスプレイリスト格納手段と、
描画領域に重なりを有する複数のディスプレイリストから、前記描画領域の重なりを除去した新たなディスプレイリストを生成する重なり除去手段と、
前記ディスプレイリストの表現する図形を描画するディスプレイリスト描画手段とを有し、
前記重なり除去手段は、前記重なり除去処理の対象となった複数の描画要素の描画領域全体を示す併合領域ディスプレイリストを生成して、新たに前記ディスプレイリスト格納手段から取り出されるディスプレイリストとの新たな重なり除去処理を行うことを特徴とする図形処理装置。
In a graphic processing apparatus that performs graphic drawing processing,
Vector information describing a drawing element of a graphic is converted into linear vector information that approximates the shape of the vector constituting the drawing element to a polygon, and each linear vector included in the linear vector information is converted into a vector start scan line coordinate value. Display list generating means for generating a display list configured based on information including data including the direction, inclination, and the number of scan lines across each straight line vector, or data equivalent thereto, sorted based on
Display list storage means for storing the display list;
Overlap removal means for generating a new display list from which the overlap of the drawing area is removed from a plurality of display lists having an overlap in the drawing area;
Possess a display list drawing means for drawing a graphic representing the display list,
The overlap removing unit generates a merged area display list indicating the entire drawing area of the plurality of drawing elements subjected to the overlap removal process, and newly creates a new display list from the display list storage unit. A graphic processing apparatus for performing overlap removal processing .
JP2001305729A 1998-09-09 2001-10-01 Graphic processing device Expired - Fee Related JP3843794B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001305729A JP3843794B2 (en) 1998-09-09 2001-10-01 Graphic processing device

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
JP25482498 1998-09-09
JP10-256374 1998-09-10
JP10-254824 1998-09-10
JP25637498 1998-09-10
JP2001305729A JP3843794B2 (en) 1998-09-09 2001-10-01 Graphic processing device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP1684499A Division JP3266905B2 (en) 1998-09-09 1999-01-26 Graphic processing unit

Publications (2)

Publication Number Publication Date
JP2002197473A JP2002197473A (en) 2002-07-12
JP3843794B2 true JP3843794B2 (en) 2006-11-08

Family

ID=27334360

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001305729A Expired - Fee Related JP3843794B2 (en) 1998-09-09 2001-10-01 Graphic processing device

Country Status (1)

Country Link
JP (1) JP3843794B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016127423A (en) * 2014-12-26 2016-07-11 淳也 榎本 Synchronization method of screen display, display processing device, and display processing program

Also Published As

Publication number Publication date
JP2002197473A (en) 2002-07-12

Similar Documents

Publication Publication Date Title
US6466229B1 (en) Graphics processing apparatus and graphics processing method
US5241653A (en) Apparatus and method for adjusting and displaying scaled, rasterized characters
US4674058A (en) Method and apparatus for flexigon representation of a two dimensional figure
EP0667018B1 (en) Polygon rasterization
JP4756937B2 (en) How to draw graphic objects
JPH04220780A (en) Method and apparatus for decomposing arbitrary polygon into trapezoid
US8723884B2 (en) Scan converting a set of vector edges to a set of pixel aligned edges
US6894695B2 (en) Apparatus and method for acceleration of 2D vector graphics using 3D graphics hardware
JPH076233A (en) Equipment and method for drawing of curve
JPH08297737A (en) Method and apparatus for clipping of arbitrary graphic
US5489920A (en) Method for determining the optimum angle for displaying a line on raster output devices
EP0344686B1 (en) Clipping process and processor
JP2681367B2 (en) Graphic processing method and apparatus thereof
US5388166A (en) Image drawing apparatus
JP3843794B2 (en) Graphic processing device
JP3266905B2 (en) Graphic processing unit
JPH1196394A (en) Device and method for generating image
Wu et al. Correct resolution rendering of trimmed spline surfaces
JP2002244643A (en) Image processor
JP3536894B2 (en) Graphic processing unit
JP2001034772A (en) Device and method for processing graphic
JPH10177657A (en) Picture processing method and picture processor
JP2004516496A (en) Compressed and scalable outline font
JP2001307115A (en) Image processor and image processing method
JPH1021415A (en) Graphic processor and graphic processing method

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060328

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060428

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20060725

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060807

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100825

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110825

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120825

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120825

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130825

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees