JP4423812B2 - Drawing processing apparatus and drawing processing method - Google Patents

Drawing processing apparatus and drawing processing method Download PDF

Info

Publication number
JP4423812B2
JP4423812B2 JP2001133787A JP2001133787A JP4423812B2 JP 4423812 B2 JP4423812 B2 JP 4423812B2 JP 2001133787 A JP2001133787 A JP 2001133787A JP 2001133787 A JP2001133787 A JP 2001133787A JP 4423812 B2 JP4423812 B2 JP 4423812B2
Authority
JP
Japan
Prior art keywords
intermediate code
data
processing
compression
fallback
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
JP2001133787A
Other languages
Japanese (ja)
Other versions
JP2002326401A (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 JP2001133787A priority Critical patent/JP4423812B2/en
Publication of JP2002326401A publication Critical patent/JP2002326401A/en
Application granted granted Critical
Publication of JP4423812B2 publication Critical patent/JP4423812B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Record Information Processing For Printing (AREA)
  • Storing Facsimile Image Data (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、プリンタ等に搭載されて用いられ、いわゆるイメージ・レンダリングを行うための描画処理装置および描画処理方法に関する。
【0002】
【従来の技術】
近年、パーソナルコンピュータ(PC)の高性能化により、手軽にカラー文書を作成することが可能になっており、これによりプリンタから出力される文書も高度化しつつある。そのため、文書の高度化に対応すべくプリンタ自身の能力も向上させる必要が生じているが、その一方ではPCの低価格化によりプリンタに対しても低価格化が強く求められている。つまり、プリンタについては、高性能化と低価格化とを両立させることが要求されている。
【0003】
プリンタの能力は、一般に、処理速度、解像度、階調で表現される。例えば、20PPM(Page Per Minutes)、1200DPI(Dot Per Inch)、8ビット/コンポーネントといった数字で表現される。これらの数値が大きい方がプリンタの能力が高いと評価できる。一方で、プリンタのコストを決定する要因は複数あるが、特に画像を形成する上で不可欠なCPU(Central Processing Unit)およびメモリは、その中でも価格構成比率が比較的高い方に分類される。ところが、CPUの高性能化は高速な処理速度の実現には必要不可欠なので、プリンタの高性能化と低価格化とを両立させるためには、必然的に搭載するメモリ容量を削減せざるを得ない。さらに、解像度や階調が向上すると処理に必要なデータ量も増える。したがって、高性能化と低価格化との両立にあたっては、限られた容量のメモリでどのように高品位な画像を形成するか(イメージ・レンダリングを行うか)という技術的な問題が顕著になる。
【0004】
このようなイメージ・レンダリングを行う際の技術的な問題を解決する処理として、例えば特開平10−116160号公報には、いわゆるフォールバック処理が提案されている。すなわち、当該公報においては、フォールバック処理を行うことで、(1)画像を出力する際の実時間性を確保しつつ、(2)限られた容量のメモリ内で描画するデータを表現することを可能にしている。
【0005】
ここで、このフォールバック処理について、さらに詳しく説明する。ただし、フォールバック処理は、本来、上記(1)および(2)という二つの目的のために適用されるものであるが、ここでは上記(2)の目的のために適用した場合を中心に説明する。
【0006】
図22は、フォールバック処理を行う場合におけるイメージ・レンダリング処理全体の手順を示すフローチャートである。イメージ・レンダリング処理は、例えば出力画像の1ページ分毎に行われる。すなわち、イメージ・レンダリングすべき描画データの入力があると(ステップ601、以下ステップを「S」と略す)、その描画データを順次所定形式の中間コード(グラフィックスオーダとも呼ばれる)に変換する(S602)。そして、中間コードのデータ量がこれを保持蓄積するメモリ容量よりも大きくなる、いわゆるメモリあふれが生じるか否かをチェックし(S603)、メモリあふれが無ければ中間コードをそのままメモリ内に保持蓄積する(S604)。ただし、メモリあふれが生じる場合には、フォールバック処理を起動する(S605)。この一連の処理を出力画像の1ページ分について終了するまで繰り返す(S606)。
【0007】
図23は、従来におけるフォールバック処理の手順を示すフローチャートである。従来のフォールバック処理は、以下に述べる五つの処理ステップからなる。すなわち、フォールバック処理が起動された場合には、先ず、処理対象となる中間コード(バンド単位に管理している)内にラスタ状のイメージ部分があると、そのラスタ部分を無損失圧縮(可逆圧縮)する(S701)。これにより十分なメモリ容量を確保できなかった場合には、そのラスタ部分を有損失圧縮(非可逆圧縮)する(S702)。これによっても十分なメモリ容量を確保できなかった場合(中間コードがバンドバッファより大きい場合)には、バンド全体をプレレンダリングする(S703)。これによっても十分なメモリ容量を確保できなかった場合には、バンド全体を無損失圧縮する(S704)。これによっても十分なメモリ容量を確保できなかった場合には、バンド全体を有損失圧縮する(S705)。これら五つの処理ステップ(S701〜S705)を順に経ることで、限られた容量のメモリであっても、出力画像の1ページ分に相当する中間コードまたはその圧縮後データの保持蓄積を可能にする。しかも、ラスタ部分以外の文字・図形部分については、四番目のステップ(S704)までは無損失のまま保たれるので、高品質な画像を生成することが期待できる。
【0008】
このようなフォールバック処理によって、またはフォールバック処理に依らずに、出力画像1ページ分の中間コード(フォールバック処理を行った場合は圧縮後データを含む)の蓄積が行われると、その後は、図22のように、ページの出力処理を行って(S607)、プリンタエンジン等に出力画像を形成させることになる。なお、このときに、出力処理の対象となるページ内で有損失圧縮されたバンドが一つでもあった場合には、当該バンドを含むページ全体を有損失圧縮してから出力する。これは、有損失圧縮されたバンドと無損失圧縮されたバンドとの境界で、画像の質が変化することによるディフェクトが発生するのを防止するためである。
【0009】
【発明が解決しようとする課題】
しかしながら、上述した従来のフォールバック処理では、限られた容量のメモリを有効活用する上では非常に有用であるが、以下に述べるように高画質化を妨げる要因となり得る問題点が存在するため、結果としてプリンタ等における高性能化と低価格化との両立が困難になってしまうおそれがある。
【0010】
例えば、従来のフォールバック処理では、五つの処理ステップ(S701〜S705)のうちの四番目のステップ(S704)で無損失圧縮を行うが、その処理対象となる中間コード等が画像の属性に関するオブジェクト情報(文字、図形、イメージ等を識別可能にする情報)を含んでいても、そのオブジェクト情報が無損失圧縮した段階で全て消えてしまう、といった問題点がある。一般に、画像出力を行う場合には、オブジェクト情報に応じた出力処理を行うことが多く、例えば文字や図形のエッジ部分は強調したり、ラスタ状のイメージ部分は階調を豊かに表現したりする。ところが、オブジェクト情報が消えてしまうと、このような処理を行うことができないため、高品質な画像を実現することが困難になると考えられる。
【0011】
また、例えば、従来のフォールバック処理では、ページ内に一つでも有損失圧縮されたバンドが存在すると、ページ全体を有損失圧縮してしまう、といった問題点がある。ページ全体に処理を及ぼすことは、バンド単位で処理を行う場合においては一般的な問題であり、ページ全体での一貫性を保つためには避けられない。ところが、ページ全体を有損失圧縮すると、本来、十分な画質と少ないデータ量で表現できている領域にまで、画質劣化の発生する有損失圧縮を適用することになるので、高品質な画像を実現する上での大きな妨げとなってしまう。
【0012】
そこで、本発明は、従来よりも高画質なフォールバック処理を可能にすることで、限られた容量のメモリを使用しつつも高品位の画像出力を実現することのできる描画処理装置および描画処理方法を提供することを目的とする。
【0013】
【課題を解決するための手段】
本発明は、上記目的を達成するために案出された描画処理装置で、画像を描画するための描画データを受け取ると当該描画データを所定形式の第一の中間コードに変換する中間コード生成手段と、前記中間コード生成手段が変換した第一の中間コードを順次保持蓄積する中間コード蓄積手段と、前記中間コード蓄積手段に蓄積された第一の中間コードを用いて、スキャンライン単位で重ねあわせを行い、圧縮可能な形式の第二の中間コードに展開する展開手段と、前記展開手段によって展開されたスキャンライン単位の第二の中間コードを圧縮する圧縮手段と、前記圧縮手段による圧縮後データを伸長して第二の中間コードに戻す伸長処理手段と、前記圧縮手段による圧縮後データを保持蓄積する圧縮データ蓄積手段と、前記中間コード蓄積手段が使用し得るメモリ容量が不足する状態となるメモリあふれが生じるか否かを判断するメモリ管理手段と、前記メモリ管理手段によりメモリあふれが生じると判断されると、前記展開手段によって展開された第二の中間コードを、前記圧縮手段によって圧縮させるフォールバック処理手段と、前記中間コード蓄積手段および前記圧縮データ蓄積手段が合わせて所定画像量に相当する第一の中間コードまたは圧縮後データを保持蓄積すると当該所定画像量に相当する分の第一の中間コードまたは圧縮後データについての出力処理を行う出力転送手段とを有し、前記メモリ管理手段によりメモリあふれが生じると判断されなければ、前記中間コード生成手段が変換した第一の中間コードを前記中間コード蓄積手段に順次保持蓄積させ、前記メモリ管理手段によりメモリあふれが生じると判断されると、前記フォールバック処理手段は、フォールバック処理が二度目以降の場合には、既に行われているフォールバック処理で得られた圧縮後データを前記伸長処理手段により伸長させ、その伸長された第二の中間コードと前記二度目以降のフォールバック処理の要因となる第一の中間コードとについて、前記展開手段によりスキャンライン単位で重ね合わせを行って第二の中間コードに展開し、その展開後の第二の中間コードを前記圧縮手段によって圧縮させ、フォールバック処理が一度目の場合には、前記展開手段によって新たなフォールバック処理の要因となった第一の中間コードを用いて展開された第二の中間コードを、前記圧縮手段によって圧縮させることを特徴とするものである。
【0014】
また、本発明は、上記目的を達成するために案出された描画処理方法である。すなわち、限られた容量のメモリで描画処理を行う際に用いられる描画処理方法であって、画像を描画するための描画データを受け取ると当該描画データを所定形式の第一の中間コードに変換する中間コード生成ステップと、前記中間コード生成ステップで変換した第一の中間コードを前記メモリに順次保持蓄積させる中間コード蓄積ステップと、前記中間コード蓄積ステップで蓄積された第一の中間コードを用いて、スキャンライン単位で重ねあわせを行い、圧縮可能な形式の第二の中間コードに展開する展開ステップと、前記展開ステップによって展開されたスキャンライン単位の第二の中間コードを圧縮する圧縮ステップと、前記圧縮ステップによる圧縮後データを伸長して第二の中間コードに戻す伸長処理ステップと、前記圧縮ステップによる圧縮後データを保持蓄積する圧縮データ蓄積ステップと、前記メモリの容量が不足する状態となるメモリあふれが生じるか否かを判断するメモリ管理ステップと、前記メモリ管理ステップによりメモリあふれが生じると判断されると、前記展開ステップによって展開された第二の中間コードを、前記圧縮ステップによって圧縮させるフォールバック処理ステップと、前記中間コード蓄積ステップおよび前記圧縮データ蓄積ステップで合わせて所定画像量に相当する第一の中間コードまたは圧縮後データを保持蓄積すると当該所定画像量に相当する分の第一の中間コードまたは圧縮後データについての出力処理を行う出力転送ステップとを有し、前記メモリ管理ステップによりメモリあふれが生じると判断されなければ、前記中間コード生成ステップで変換した第一の中間コードを前記中間コード蓄積ステップにて順次保持蓄積させ、前記メモリ管理ステップによりメモリあふれが生じると判断されると、前記フォールバック処理ステップでは、フォールバック処理が二度目以降の場合には、既に行われているフォールバック処理で得られた圧縮後データを前記伸長処理ステップにより伸長させ、その伸長された第二の中間コードと前記二度目以降のフォールバック処理の要因となる第一の中間コードとについて、前記展開ステップによりスキャンライン単位で重ね合わせを行って第二の中間コードに展開し、その展開後の第二の中間コードを前記圧縮ステップによって圧縮させ、フォールバック処理が一度目の場合には、前記展開ステップによって新たなフォールバック処理の要因となった第一の中間コードを用いて展開された第二の中間コードを、前記圧縮ステップによって圧縮させることを特徴とする。
【0015】
上記構成の描画処理装置および上記手順の描画処理方法によれば、メモリあふれが生じると、メモリに保持蓄積させるべき第二の中間コードに対して圧縮処理を行う。ただし、圧縮処理を行っても、その圧縮処理後の圧縮データに対して伸長処理を施すことで、その圧縮データを第二の中間コードに戻し得る。つまり、展開手段(展開ステップ)で中間コードの重ね合わせ処理を行っており、二度目以降のフォールバック処理の場合には、圧縮済みの第二の中間コードを伸張して、伸張したデータと新たな中間コードとを重ね合わせた上で、圧縮することで、限られた容量のメモリを使用しながら高品位の画像出力が得られる。さらに、圧縮処理によって第二の中間コードに付随する特定の情報(例えば、画像の属性に関するオブジェクト情報)が失われてしまったり、第二の中間コードの全てが圧縮処理によって全く異なる形式のデータ(例えば、ラスタ状のビットマップデータ)に変換されてしまったりすることがない。したがって、例えば、圧縮処理を行ってもメモリあふれが解消しない場合には、その圧縮処理後の圧縮データを第二の中間コードに戻した圧縮前データを用いて、その圧縮前データの特定部分(例えばイメージ部分)のみにさらに圧縮率の高い有損失圧縮を施す、といったことが行えるようになる。
【0016】
【発明の実施の形態】
以下、図面に基づき本発明に係る描画処理装置および描画処理方法について説明する。
【0017】
〔描画処理装置の概略構成の説明〕
はじめに、描画処理装置の概略構成について説明する。図1は本発明に係る描画処理装置の概略構成の一例を示すブロック図であり、図2はその描画処理装置が用いられるシステムの構成例を示す概略図である。
【0018】
本実施形態で説明する描画処理装置は、例えば図2(a)に示すように、クライアント1とプリンタ2とがネットワーク回線3を介して互いに接続されてなるシステムにおいて用いられる。ここで、描画処理装置は、クライアント1内に搭載しても、プリンタ2内に搭載しても、あるいはクライアント1とプリンタ2に分散して搭載してもよい。また、例えば図2(b)に示すように、ネットワーク回線3上にプリントサーバ4が設けられている場合には、そのプリントサーバ4内に搭載したり、あるいはプリントサーバ4を含む各装置1,2に分散して搭載しても良い。
【0019】
このようなシステムにおいて用いられる描画処理装置は、例えばクライアント1にインストールされたアプリケーションソフトウエア(例えば、文書作成ソフトウエア)により作成された描画データを受け取ると、その描画データに基づいてイメージ・レンダリング処理を行って出力し、プリンタ2のプリンタエンジンに画像出力を行わせるものである。なお、このイメージ・レンダリング処理を行う際の概略手順については、従来と同様であるため(図22参照)、ここではその詳細な説明を省く。
【0020】
このようなイメージ・レンダリング処理およびこれに付随する処理を行うために、描画処理装置は、例えば図1に示すように構成されている。すなわち、描画処理装置は、中間コード生成部11と、中間コード蓄積部12と、メモリ管理部13と、フォールバック処理部14と、中間コード展開部15と、圧縮処理部16と、伸長処理部17と、圧縮データ蓄積部18と、出力転送部19と、を備えて構成されている。
【0021】
中間コード生成部11は、画像を描画するための描画データを受け取ると、その描画データを後述するような所定形式の中間コードに変換するものである。すなわち、中間コード生成部11は、図22におけるS602の処理を行うものである。
【0022】
中間コード蓄積部12は、中間コード生成部11によって変換された中間コードを順次保持蓄積するものである。すなわち、中間コード蓄積部12は、図22におけるS604の処理を行うものである。
【0023】
メモリ管理部13は、中間コード蓄積部12が使用し得るメモリ容量が不足する状態となるメモリあふれが生じるか否かを判断するものである。すなわち、メモリ管理部13は、図22におけるS603の処理を行うものである。
【0024】
フォールバック処理部14は、メモリ管理部13によりメモリあふれが生じると判断されると、圧縮処理部16を動作させるとともに、必要に応じて伸長処理部17を動作させた後に再度圧縮処理部16を動作させるものである。すなわち、フォールバック処理部14は、図22におけるS605の処理を行うものである。ただし、本実施形態で説明する描画処理装置においては、このフォールバック処理部14が従来と大きく異なる。
【0025】
中間コード展開部15は、中間コード生成部11によって変換された中間コードを、後述するような圧縮可能な形式に展開するものである。
【0026】
圧縮処理部16は、中間コード展開部15による展開結果に対する圧縮処理を行い、そのデータ量を削減するものである。
【0027】
伸長処理部17は、必要に応じて、圧縮処理部16が圧縮処理を行った後のデータ(以下「圧縮後データ」という)に対する伸長処理を行い、その圧縮後データを圧縮前の形式に戻すものである。
【0028】
圧縮データ蓄積部18は、フォールバック処理部14からの指示によって圧縮処理部16が圧縮処理した圧縮後データを保持蓄積するものである。
【0029】
出力転送部19は、中間コード蓄積部12および圧縮データ蓄積部18が、合わせて所定画像量に相当する分、例えば出力画像の1ページ分だけ、中間コードまたは圧縮後データを保持蓄積すると、その中間コードまたは圧縮後データについての出力処理を行うものである。すなわち、出力転送部19は、図22におけるS607の処理を行うものである。
【0030】
なお、出力転送部19による出力処理には、フォールバック処理部14からの指示による圧縮処理等とは全く別に、中間コード展開部15および圧縮処理部16を動作させ、中間コードを圧縮可能な形式に展開して圧縮する処理が含まれるものとする。これは、中間コードを直接プリンタエンジン等に出力しても、そのプリンタエンジン等を同期駆動することが難しいからである。すなわち、中間コードの複雑さ(特に重なりの度合いや描画面積等)が均一でなく、また中間コードの展開処理の所要時間を予測することが難しい(そのため予め間に合わない部分だけ展開してしまいたいがどこを展開知ればよいか分からない)ので、プリンタエンジン等における動作の実時間性を保証するためには、中間コードの圧縮が有効(伸長時間は一般に実時間性を保証しやすい)と考えられるからである。ただし、実時間性が保証できれば、中間コードを編集して別の中間コード形式に変換するようにしても、あるいはページメモリを持ってラスタ展開してから出力するようにしてもよい。
【0031】
〔中間コードの説明〕
次に、以上のように構成された描画処理装置において、中間コード生成部11が変換する中間コードの形式および中間コード展開部15による中間コードの展開方式について説明する。
【0032】
中間コード生成部11が受け取る描画データは、通常、その描画データによって特定される画像の属性に関するオブジェクト情報(文字、図形、イメージ等を識別可能にする情報)を含んでいる。また、中間コードを圧縮可能な形式に展開する際の展開方式としては、多種多様のものが知られている。ところが、例えば中間コードをラスタ展開してしまうと、圧縮可能とはなるが、データ量が増加してしまい、しかもその時点でオブジェクト情報が消えてしまうため、望ましくない。
【0033】
そこで、本実施形態の描画処理装置においては、中間コードの展開結果を第二の中間コードとして出力する形態を採用し、中間コード生成部11が描画データを中間コードに変換し、さらに中間コード展開部15が中間コードを圧縮可能な形式に展開しても、オブジェクト情報が維持されたまま消えてしまうことがないようにしている。つまり、本実施形態の描画処理装置では、中間コード生成部11が描画データを第一の中間コードに変換し、さらに中間コード展開部15がその第一の中間コードを圧縮可能な形式の第二の中間コードに展開するようになっている。
【0034】
このときの第一の中間コードの形式は、スキャンライン単位で取得できる形式であれば、ベクタ形式、台形形式、ランレングス形式等、どのような形式であっても良い。スキャンライン単位で取得できる形式である必要があるのは、中間コード展開部15が以下のような手順で展開処理を行うからである。図3は、中間コードの展開処理の手順の一例を示すフローチャートである。
【0035】
すなわち、中間コード展開部15では、先ず、最上部の(最下部でも可能)スキャンライン上のデータを全て取得する(S101)。そして、そのうちの最も左側の描画点(左から右に描画する場合。右から左に描画する場合には最も右側の描画)を取得して(S102)、その描画点が描画開始点であるかどうかを判断する(S103)。
【0036】
描画開始点の場合、中間コード展開部15は、この描画データが描画開始になったことを登録しておく(S104)。そして、描画開始している描画データ内で最も上側(描画順で後に描画された)データであるかどうか判断し(S105)、最も上側である場合には、さらにこの描画データより下(描画順で前に描画されたデータ)があるかどうか判断し(S106)、ある場合には下側の描画データの色で塗り開始点から注目点(描画開始になった描画データの座標点)の左側の点まで塗り(S107)、塗り開始点を注目点に変更する(S108)。ただし、描画開始しているデータ内で最も上側でない場合、または下側で描画開始している描画データが無い場合には、塗り開始点の変更までの処理をスキップする。
【0037】
一方、描画開始点でない場合(描画終了点)、中間コード展開部15は、描画開始している描画データ内で最も上側であるかどうか判断し(S109)、最も上側である場合この描画データの色で塗り開始点から注目点の左側の点まで塗り(S110)、塗り開始点を注目点に変更する(S108)。ただし、描画開始している描画データ内で最も上側ではない場合、塗り開始点の変更までの処理をスキップする。
【0038】
その後、中間コード展開部15は、スキャンライン上のデータを全て処理したかどうかを判断し(S111)、まだ残っている場合には、最左の描画点の取得まで戻って上述した処理(S102〜S110)を繰り返す。全て処理した場合には、まだ所定の処理単位であるバンド内に処理していないスキャンラインがあるかどうか判断し(S112)、まだ残っている場合には、スキャンライン上のデータ取得まで戻って上述した処理(S101〜S111)を繰り返す。そして、全て処理した場合には、一つのバンド内の処理を終了する。
【0039】
ここで、以上のような手順の展開処理にて扱われる第一の中間コードの形式について説明する。ここでは、第一の中間コードとしてベクタ形式を例に挙げる。
【0040】
図4は、ベクタによるデータ表現形式の一例を示す説明図である。図中において、「順序」は、描画コマンドの描画順序である。「X」は、現在のスキャンラインを横切るベクタのX切片の値を示す。「X変位」は、次のスキャンラインに処理が移動した場合のX切片の変化量を示している。「Y変位」は、当該ベクタに影響を受ける残りのスキャンライン数を示している。「向き」は、当該ベクタの向きを示す。
【0041】
このような構成のベクタをさらに詳しく説明する。図5は、ベクタにより表現されるデータの一具体例を示す説明図である。図中において、座標系は左上方を原点とし、したがって図中の水平右方向にX座標値は増加し、図面の垂直下方向にY座標値は増加するものとする。図例では、P1(0,300)、P2(600,0)、P3(300,600)の3点で表現される三角形を示している。この3点から、ベクタの向きを考慮して、P1P2、P2P3、P3P1の3つのベクタが生成される。P1P2は、「X」が600、「X変位」が−2、「Y変位」が300、「向き」が−1となる。他のベクタも同様に図例の如くなる。
【0042】
ところで、ベクタ形式の場合、図形の内部/外部判定が必要となる。図6は、図形の内部/外部判定に用いる規則の一具体例を示す説明図である。判定規則には、図6(a)に示す非ゼロ巻き規則と、図6(b)に示す奇偶規則との2種類がある。これらはいずれも複数の外形(パス)で形成された一つの図形の内部を判定する際に用いられる規則である。
【0043】
図6(a)に示す非ゼロ巻き規則は、図形を構成する外形がスキャンラインと交差する際の向きを考慮したものである。すなわち、外形がスキャンラインを上向きに交差する場合を正、下向きに交差する場合を負としている。走査方向に向かって正の交差であれば1を加算し、負の交差であれば1を減算することにし、合計値が0でなくなった点から0に戻った点までが内部であると判定する。一方、図7(b)に示す奇偶規則は、スキャンラインと交差するパスの個数をカウントして、奇数の点から偶数の点までを内部と判定することにしている。
【0044】
このような判定規則による内部判定処理は、図3を用いて説明した展開処理における描画開始点、描画終了点の判別のために使用される。ここで、内部判定処理について、さらに詳しく説明する。図7は、内部判定処理の手順の一例を示すフローチャートである。なお、描画図形に対応した属性領域(内部判定規則と内部判定値)が別途あり、これは描画順序を示す値から取得できるものとする。
【0045】
内部判定処理を行う場合は、先ず、ベクタの順序から、このベクタで構成される図形の内部判定規則を取得する(S201)。内部判定規則の種類が非ゼロ巻き規則であれば(S202)、続けて内部判定値を取得し(S203)、その値が「0」であるか否かをチェックする(S204)。値が「0」の場合には、ベクタの向きを足し(S205)、「領域の開始」であると判断する(S206)。一方、値が「0」でなければ、ベクタの向きを足してから(S207)、再度値が「0」であるか否かをチェックする(S208)。そして、値が「0」であれば「領域の終了」であると判断し(S209)、値が「0」以外であれば領域が継続すると判断する(S210)。
【0046】
また、内部判定規則の種類が奇偶規則であった場合には(S202)、続けて内部判定値を取得し、その値を「1」だけ増加させてから2の剰余を求める(S211)。そして、2の剰余の値が「1」であれば、判定結果は奇数となり(S212)、図形が内部になるので、「領域の開始」と判断する(S213)。一方、2の剰余が「0」であれば、判定結果は偶数となり、図形の外部となるので、「領域の終了」と判断する(S214)。
【0047】
このような手順の内部判定処理における「領域の開始」は描画開始点に対応し、「領域の終了」は描画終了点に対応するものである。したがって、取得したベクタのそれぞれに対して、上述した内部判定処理を適用すれば、描画開始点と描画終了点を判別することができるようになる。
【0048】
なお、ここでは、第一の中間コードとしてベクタ形式を例に挙げて説明したが、第一の中間コードの形式としては、他の形式(ランレングス形式等)が混在してもよいことはいうまでもない。
【0049】
続いて、上述した第一の中間コードに対して、図3を用いて説明した展開処理を行った結果である、第二の中間コードの形式について説明する。ここでは、第二の中間コードとしてランレングス形式を例に挙げる。
【0050】
図8は、ランレングスによるデータ表現形式の一例を示す説明図である。図例では、2種類のランレングス形式が示しているが、共通の構造として、オブジェクトの種類やデータ形式を表現するフィールド(種別)と、スキャンライン上の開始座標値を表わすフィールド(始点)と、スキャンライン上の終了座標を表わすフィールド(終点)とを持っている。ただし、一方の「種別1」においては色値がランレングスに埋め込まれているが、他方の「種別2」では色値がポインタで別領域に画素列が格納されている。通常、「種別1」の形式は文字、図形を表現するために用いられ、「種別2」の形式はラスタを表現するために用いられる。
【0051】
以上のように、中間コード展開部15は、中間コード生成部11が変換した第一の中間コードを、圧縮可能な形式の第二の中間コードに展開するようになっているが、その展開処理の一環として、以下に述べるデータ重ね合わせ処理を行う機能をも有している。
【0052】
図9は、中間コードの展開処理の一環として行われるデータ重ね合わせ処理の手順の一例を示すフローチャートである。ここでは、図中の上部に示すように、あるスキャンライン上で互いに重なり合う3つの描画データが入力され、その描画順序は下側が先に描画されるデータ、上側が後から描画されるデータであり、各描画データの内容は最下方が「青」の図形データ、中央が「緑」のラスタデータ、最上方が「赤」の文字データである場合を例に挙げる。
【0053】
この場合、先ず、最初のステップ(S301)では、描画開始点を取得するが、これ以前にどの描画データも描画開始となっていないので、その描画開始点の座標値を塗り開始点として一時的に保持するに留める。その後、次のステップ(S302)では、「緑」の描画開始点を取得するが、既に緑より後に描画される「赤」が描画開始となっているので何もしない。さらに次のステップ(S303)では、「赤」の描画終了点を取得し、描画開始している描画データの中で一番上なので塗り開始点「0」からその座標値「5」まで「赤」で塗ることを決定し、「種別1、赤、0、5」といったランレングス形式のデータを出力し、塗り開始点を「6」に更新する。
【0054】
次のステップ(S304)では、「青」の描画開始点を取得するが、既に「青」より後に描画される「緑」が描画開始となっているので何もしない。そして、次のステップ(S305)では、「緑」の描画終了点を取得し、描画開始している描画データの中で一番上なので、塗り開始点「6」からその座標値「9」まで「緑」を塗ることを決定し、「種別2、緑の画素列、6、9」といったランレングス形式のデータを出力し、塗り開始点を「10」に更新する。さらに次のステップ(S306)では、「青」の描画終了点を取得し、描画開始している描画データの中で一番上なので、塗り開始点「10」からその座標値「13」まで「青」で塗ることを決定し、「種別1、青、10、13」といったランレングス形式のデータを出力し、塗り開始点を「14」に更新する。
【0055】
以上のようにして、中間コード展開部15は、中間コード生成部11が変換した第一の中間コードに対し、必要に応じてデータ重ね合わせ処理を行いつつ、圧縮可能な形式の一つであるランレングス形式の第二の中間コードに展開するようになっている。
【0056】
〔圧縮処理の説明〕
次に、圧縮処理部16が行う圧縮処理について説明する。圧縮可能な形式に展開された中間コードに対する圧縮方式としても多種多様のものが知られているが、ここでは以下に述べるカラー画像符号化方式を適用した場合を例に挙げる。
【0057】
図10は、圧縮処理部における機能構成の一例を示すブロック図である。図例のように、本実施形態における圧縮処理部16は、参照領域生成手段16aと、同一画素値分布生成手段16bと、予測情報符号化手段16cと、誤差算出符号化手段16dと、符号合成手段16eと、を備えて構成されている。
【0058】
参照領域生成手段16aは、ラスタ走査順に1画素ずつ入力されるデータから、符号化すべき画素データ、および、その周辺領域にある複数の画素データを抽出し、これらをそれぞれ注目画素データ、および参照領域データとするものである。
【0059】
同一画素値分布生成手段16bは、参照領域生成手段16aが特定した注目画素データおよび参照領域データに基づいて、注目画素の周辺にその注目画素と同じ画素値を持つ画素がどのように分布しているかを検出し、その結果を同一画素値分布として出力するものである。
【0060】
予測情報符号化手段16cは、注目画素データを同一画素値分布だけで符号化可能であるならば、同一画素値分布生成手段16bが検出した同一画素値分布を基に注目画素値の符号化を行う一方、符号化不可能であるならば符号化不可能という符号を生成し、これらを選択的に予測情報符号データとして出力するものである。
【0061】
誤差算出符号化手段16dは、画素値データから予測画素値を算出し、さらに予測画素値と画素値データとの誤差を算出して符号化し、予測誤差符号データとして出力するものである。
【0062】
符号合成手段16eは、予測情報符号化手段16cによる予測情報符号データと、誤差算出符号化手段16dによる予測誤差符号データとを合成し、単一の符号ストリームとして出力するものである。
【0063】
このような構成の圧縮処理部16では、圧縮処理の対象となるデータを受け取ると、参照領域生成手段16aが、受け取ったデータ中における符号化すべき画素(注目画素)の画素値およびその周辺画素(例えば周辺四画素)の画素値を抽出し、これらをそれぞれ注目画素データおよび参照領域データとして特定する。注目画素およびその周辺画素の配置としては、例えば図11に示す具体例のようなものが考えられる。なお、注目画素の位置は、画素の走査順と同様に、1ページ分の中で順に走査されるものとする。
【0064】
注目画素データおよび参照領域データが特定されると、続いて、圧縮処理部16では、同一画素値分布生成手段16bが、参照領域データの中に注目画素データと同一の画素値があるか否かを比較し、その結果をまとめて同一画素値分布として出力する。例えば、同一画素値分布生成手段16bは、注目画素の画素値と同一の画素値を持つ周辺画素を「1」に、そうでない周辺画素を「0」に置き換え、置き換えられた周辺四画素をまとめて同一画素値分布として出力する。したがって、例えば図12に示す具体例の場合であれば、注目画素の真上および左側が「1」となり、他は「0」となる同一画素分布が生成される。
【0065】
その後、圧縮処理部16では、同一画素値分布生成手段16bが生成した同一画素分布に対して、予測情報符号化手段16cが符号化を行って、その結果を予測情報符号データとして出力する。このとき、予測情報符号化手段16cは、同一画素分布に対する符号化を、予め設定されている参照画素ラベルおよび符号生成表に従って行う。参照画素ラベルおよび符号生成表としては、例えば図13に示す具体例のようなものが挙げられる。
【0066】
また、これと合わせて、圧縮処理部16では、同一画素値分布生成手段16bが生成した同一画素分布に対して、誤差算出符号化手段16dが符号化を行って、その結果を予測誤差符号データとして出力する。このとき、誤差算出符号化手段16dは、同一画素分布に対する符号化を、予め設定された演算式を用いた算術符号化方式によって行う。演算式としては、例えば図14に示す具体例のようなものが挙げられる。
【0067】
そして、予測情報符号化手段16cおよび誤差算出符号化手段16dから予測情報符号データおよび予測誤差符号データがそれぞれ出力されると、圧縮処理部16では、符号合成手段16eがこれらを合成して単一の符号ストリームとして出力する。ただし、この際に、例えば、符号合成手段16eでは、予測情報符号化手段16cにより出力される予測情報符号データとして同一のものが連続して出力される場合に、その連続する回数をカウントして、符号が同一でなくなった後にカウント結果と合わせて出力する。したがって、例えば図15(a)に示す具体例のような予測情報符号データおよび予測誤差符号データがそれぞれ出力された場合であれば、符号合成手段16eでは、図15(b)に示すような合成データを出力することになる。
【0068】
〔伸長処理の説明〕
次に、伸長処理部17が行う伸長処理について説明する。伸長処理部17による伸長処理は、圧縮処理部16による圧縮後データに対して行われる。したがって、ここでは、上述した圧縮処理の説明に対応して、伸長方式として以下に述べるカラー画像復号化方式を適用した場合を例に挙げる。
【0069】
図16は、伸長処理部における機能構成の一例を示すブロック図である。図例のように、本実施形態における伸長処理部17は、符号判別手段17aと、予測情報復号化手段17bと、誤差復号加算手段17cと、中間コード生成手段17dと、を備えて構成されている。
【0070】
符号判別手段17aは、圧縮処理部16による圧縮後データを読み込んで、その圧縮後データを構成する各符号が、予測情報符号データであるか、あるいは予測誤差符号データであるかを判別するものである。
【0071】
予測情報復号化手段17bは、圧縮後データを構成する符号が予測情報符号データである場合に、その予測情報符号データを復号して、符号化に対応付けて、例えば図13に示した参照画素ラベルに関する情報にまで戻すものである。さらには同一の予測情報符号データが何回連続するかを示す情報(カウント結果)も併せて復号するようになっている。
【0072】
誤差復号加算手段17cは、圧縮後データを構成する符号が予測誤差符号データである場合に、その予測誤差符号データの誤差値に基づいて、注目画素の値を算出するものである。算出方法としては、符号化時に用いた演算式から注目画素値を算出する演算式を導き、その演算式を使用することが考えられる。例えば図14に示した演算式によって符号化した場合であれば、注目画素=(A+B)/2+誤差といった演算式を用いればよい。
【0073】
中間コード生成手段17dは、予測情報復号化手段17bによって復号された予測情報および誤差復号加算手段17cによって復号された誤差情報を用いて、圧縮前の形式のデータ、例えばランレングス形式の中間コードを生成するものである。
【0074】
ここで、この中間コード生成手段17dによる中間コードを生成処理について、さらに詳しく説明する。図17は、中間コード生成の手順の一例を示すフローチャートである。
【0075】
図例のように、中間コード生成手段17dは、先ず、復号されたデータを取得し(S401)、そのデータの画素値が直左の画素(または現在のランレングスの画素値)と等しいか否かをチェックする(S402)。その結果、これらが等しければ、現在のランレングスの長さに、取得したデータの長さ(予測情報の場合は同一画素値の連続する回数、誤差情報の場合は「1」)を加算する(S403)。また、等しくない場合には、現在のランレングスを出力するとともに、新しいランレングスを開始する(S404)。このとき、新しいランレングスは、取得したデータの画素値および長さを初期値として持つ。そして、以上の処理を復号データがなくなるまで繰り返して行うことで(S405)、中間コード生成手段17dは、圧縮後データをランレングス形式の第二の中間データと同一状態に戻す。
【0076】
〔フォールバック処理の説明〕
次に、本実施形態における描画処理装置において最も特徴的な処理である、フォールバック処理部14によるフォールバック処理について説明する。フォールバック処理は、既に説明した図22のフローチャートからも明らかなように、メモリあふれが生じる際に行う処理である。したがって、フォールバック処理では、メモリ内に保持蓄積すべきデータ量を削減する必要がある。
【0077】
データ量を削減する方法としては様々なものがあるが、本実施形態の描画処理装置では、上述した圧縮処理部16による符号化方式によって、文字図形およびCG(Computer Graphics)画像については高い圧縮率を保証できる。したがって、フォールバック処理部14は、文字図形およびCG画像であれば、圧縮処理部16を動作させることによって、そのデータ量を削減することができる。これに対して、ビットマップ状のラスタデータによって表現される自然画(イメージ)は、一般的に言われているように、高画質を保ったまま高い圧縮率で圧縮することは難しい。ところが、その反面、イメージは、画質を劣化させても人間の目には目立ち難い。そのため、本実施形態では、イメージを圧縮する際には、解像度を下げる処理を行って、高い圧縮率を確保する場合を例に挙げる。ただし、これは説明を簡単にするためであって、別の方式を用いて高い圧縮率を確保するようにしても何ら問題はない。別の方式としては、例えば、JPEG(Joint Photographic Experts Group)等のさらに別の符号化方式を組み合わせたものが挙げられる。
【0078】
このように、文字図形やイメージといった画像のオブジェクト毎に異なる符号化方式を適用することは、オブジェクト情報を基にすることで実現できる。そのため、本実施形態の描画処理装置では、オブジェクト情報を画素値と同様に扱い、圧縮処理および伸長処理を経てもそのオブジェクト情報が復元されるようにする。具体的には、図18に示すように、オブジェクト情報と画素情報とを一塊にして扱い、符号・復号化時の予測情報の判断に使用する。すなわち、画素値が同じでもオブジェクト情報が異なれば、異なるデータとして扱うようにする。
【0079】
ここで、フォールバック処理部14によるフォールバック処理について、具体例を挙げて詳細に説明する。図19は、処理対象となるページのオブジェクトの構成の一具体例を示す説明図である。図19(a)において、ハッチング(斜線)部は文字が記載された部分、塗りつぶし(黒塗り)部はイメージの部分であり、当該ページの右上四分の一をイメージが占めている。また、これらの描画順序としては、文字の領域を描いた後に、イメージの領域を描くものとする。さらに、当該ページは、図19(b)のように、4つのバンドに分割されて処理されるものとする。
【0080】
図20は、図19に示したオブジェクト構成、特に最上部のバンドにおけるオブジェクト構成をさらに詳細に示した説明図である。図例のように、このバンドは、主に、ページの余白部分(下地)、文字、下地、イメージ、下地の順で構成されている。なお、より詳細には、文字の部分の中には文字部と下地部とが混在しているが、ここでは単に文字として扱い、説明を簡略化する。
【0081】
このようなオブジェクト構成のページを描画するための描画データを受け取った場合に、本実施形態の描画処理装置では、先ず、中間コード生成部11が文字に関する描画データを第一の中間コードに変換し、これを中間コード蓄積部12が保持蓄積する。そして、その後に、中間コード生成部11がイメージに関する描画データを第一の中間コードに変換し、これを中間コード蓄積部12が保持蓄積するが、このとき(イメージの中間コード化の段階)にメモリ管理部13によってメモリあふれが発生すると判断され、フォールバック処理部14がフォールバック処理を行う場合を例に挙げて説明する。
【0082】
図21は、本実施形態におけるフォールバック処理の手順の一例を示すフローチャートである。フォールバック処理部14では、メモリあふれが発生し、フォールバック処理を行う必要が生じた場合に、その処理対象となる同一ページに対して、既にフォールバック処理が行われたか否か、すなわち新たに行おうとするフォールバック処理が二度目以降のもの(以下、二度目以降に行う場合を「多重フォールバック処理」という)であるか否かを判断する(S501)。この判断は、圧縮後データの有無や処理履歴等に基づいて行えばよい。
【0083】
この判断の結果、多重フォールバック処理である場合には、同一ページについての圧縮後データが存在するので、フォールバック処理部14は、伸長処理部17を動作させ、その圧縮後データに対する伸長処理を行い、その圧縮後データをランレングス形式の第二の中間データと同一状態に戻す(S502)。このときの伸長処理部17による伸長処理は、既に説明した手順で行われる(図16,17参照)。
【0084】
そして、フォールバック処理部14は、伸長処理後の中間データを下地絵柄についてのランレングスデータとして扱い、そのランレングスデータに新たなフォールバック処理の要因となる中間コードを合成するデータ重ね合わせ処理を、中間コード展開部15に行わせる(S503)。このときのデータ重ね合わせ処理は、既に説明した手順で行われる(図9参照)。ただし、上述したように描画データは上下関係を持っており、中間コードの生成は描画順に行われる。したがって、データ重ね合わせ処理にあたって、フォールバック処理部14は、伸長処理後のランレングスデータを、新たなフォールバック処理の要因となる中間コードの下側に入れるよう指示を与える。これにより、中間コード展開部15は、上下関係を持つデータ形式の最も下側に、前回までのフォールバック処理についての伸長結果を配置することになる。
【0085】
一方、多重フォールバック処理でないと判断した場合には、これらの伸長処理(S502)およびデータ重ね合わせ処理(S503)をスキップする。
【0086】
その後は、データ重ね合わせ処理後の中間コードまたは新たなフォールバック処理の要因となる中間コードについて、中間コード展開部15に展開処理を行わせ、ランレングス形式の第二の中間コードを作成させる(S504)。このときの展開処理は、既に説明した手順で行われる(図3〜9参照)。そして、フォールバック処理部14は、圧縮処理部16を動作させ、中間コード展開部15が生成した中間コードに対する圧縮処理を行わせる(S505)。このときの圧縮処理も、展開処理と同様、既に説明した手順で行われる(図10〜15参照)。
【0087】
ここで、フォールバック処理部14は、上述した一連の処理(S501〜S505)によって、メモリ容量に十分な空きができたか否かをメモリ管理部13に問い合わせる(S506)。その結果、十分な空きができていれば、フォールバック処理部14は、ページの終わりであるかどうかチェックし(S507)、まだ終わりでなければ一連の処理(S501〜S507)を繰り返す。そして、出力画像1ページ分についてのメモリ容量を確保して、中間コード蓄積部12または圧縮データ蓄積部18に中間コードまたは圧縮後データを保持蓄積させる。
【0088】
ただし、圧縮処理部16が圧縮処理を行ってもメモリ容量に十分な空きができない場合には、フォールバック処理部14は、伸長処理部17を動作させ、その圧縮処理によって得られた圧縮後データに対する伸長処理を行う(S508)。このときの伸長処理も、既に説明した手順で行われる(図16,17参照)。よって、圧縮後データは、ランレングス形式の第二の中間コードと同一状態に戻ることになる。しかも、このとき、オブジェクト情報と画素値とが同様に扱われるので、圧縮後データが中間コードに戻るのと同様に、その中間コードについてのオブジェクト情報も復元される。
【0089】
そこで、フォールバック処理部14は、そのオブジェクト情報に基づいて、イメージの部分のみを抽出し、そのイメージの属性を持つ部分だけにデータ量削減処理を行う(S509)。このときのデータ量削減処理としては、上述したように、解像度変換処理が挙げられるが、JPEG等の符号化方式を利用してもよい。そして、イメージ部分のデータ削減後、再び圧縮処理部16を動作させ、上述した一連の処理(S505〜S509)を繰り返し、出力画像1ページ分についてのメモリ容量を確保して、フォールバック処理を終了する。
【0090】
以上のように、本実施形態における描画処理装置およびその描画処理装置が実施する描画処理方法によれば、フォールバック処理時に必要に応じて圧縮処理または伸長処理を行うが、その際に圧縮後データを圧縮前の形式に戻し得るようになっている。つまり、従来とは異なり、圧縮処理によって中間データに付随する特定の情報(例えば、画像の属性に関するオブジェクト情報)が失われてしまったり、中間データの全てが圧縮処理によって全く異なる形式のデータ(例えば、ラスタ状のビットマップデータ)に変換されてしまったりすることがない。
【0091】
そのため、本実施形態の描画処理装置および描画処理方法によれば、フォールバック処理を行う場合であっても、そのフォールバック処理およびその後に行う処理をオブジェクト情報に応じて行うことが可能となり、フォールバック処理にあたってイメージ部分のみに圧縮率の高い圧縮処理(例えば有損失圧縮)を施すといったことが行えるようになる。また、オブジェクトに応じて異なる圧縮処理を行えるので、ページ内に一つでも有損失圧縮された部分が存在しても、ページ全体の有損失圧縮を必要とすることがない。さらには、フォールバック処理後においても、例えば文字や図形のエッジ部分は強調したり、ラスタ状のイメージ部分は階調を豊かに表現したりする、といったことが可能になる。
【0092】
特に、本実施形態の描画処理装置および描画処理方法では、無損失圧縮のみではメモリあふれが解消しない場合に、イメージ部分のみに圧縮率の高い有損失圧縮を施すようになっている。したがって、有損失圧縮を施しても画質劣化が目立たない属性部分であるイメージ部分に対してのみ有損失圧縮が適用され、他の部分(文字や図形等)については無損失圧縮が適用されることになる。
【0093】
これらのことから、本実施形態の描画処理装置および描画処理方法によれば、限られた容量のメモリを有効に活用しつつも、出力画像の画質劣化を極力抑えて高品位の画像出力を実現し得るようになるので、結果としてプリンタ等における高性能化と低価格化との両立に寄与し得るようになる。
【0094】
このことは、圧縮後データを伸長して圧縮前の形式に戻し得るようにしたことによって実現されるものである。すなわち、圧縮後データを圧縮前の形式に戻し得るので、オブジェクト情報と画素情報とを一塊にして扱えば、伸長処理後にオブジェクト情報が失われてしまうこともなくなり、上述したようなフォールバック処理が実現可能となる。
【0095】
なお、本実施形態では、圧縮後データを伸長処理によってランレングス形式の第二の中間コードに戻す場合を例に挙げて説明したが、本発明はこれに限定されないことは勿論である。すなわち、中間コードはベクタ形式、台形形式、ランレングス形式、ラスタ形式等といった各種形式のものが混在していることが考えられるので、圧縮後データを圧縮前の形式に戻し得れば、その形式は特定のものに限定されるわけではない。ただし、フォールバック処理の一環として行われる圧縮処理においてはオブジェクトに応じて有損失圧縮と無損失圧縮とが選択的に施されるので、伸長処理後に行われる再圧縮処理を考慮すれば、伸長処理にあたって、有損失圧縮が適用された圧縮後データについてはラスタ表現により、それ以外の無損失圧縮が適用された圧縮後データについてはランレングス表現により、それぞれ復号することが好ましい。
【0096】
【発明の効果】
以上に説明したように、本発明の描画処理装置および描画処理方法によれば、従来よりも高画質なフォールバック処理を可能にすることで、限られた容量のメモリを使用しつつも高品位の画像出力を実現することができる。
【図面の簡単な説明】
【図1】 本発明に係る描画処理装置の概略構成の一例を示すブロック図である。
【図2】 本発明に係る描画処理装置が用いられるシステムの構成例を示す概略図であり、(a)はその一例を示す図、(b)は他の例を示す図である。
【図3】 中間コードの展開処理の手順の一例を示すフローチャートである。
【図4】 ベクタによるデータ表現形式の一例を示す説明図である。
【図5】 ベクタにより表現されるデータの一具体例を示す説明図である。
【図6】 図形の内部/外部判定に用いる規則の一具体例を示す説明図であり、(a)は非ゼロ巻き規則を示す図、(b)は奇偶規則を示す図である。
【図7】 内部判定処理の手順の一例を示すフローチャートである。
【図8】 ランレングスによるデータ表現形式の一例を示す説明図である。
【図9】 中間コードの展開処理の一環として行われるデータ重ね合わせ処理の手順の一例を示すフローチャートである。
【図10】 本発明に係る描画処理装置の圧縮処理部における機能構成の一例を示すブロック図である。
【図11】 圧縮処理の際に用いられる参照領域データの一具体例を示す説明図である。
【図12】 圧縮処理の際に用いられる同一画素値分布の一具体例を示す説明図である。
【図13】 圧縮処理の際に用いられる参照画素ラベルおよび符号生成表の一具体例を示す説明図である。
【図14】 圧縮処理の際に用いられる誤差算出符号化の演算式の一具体例を示す説明図である。
【図15】 符号化フォーマットの一具体例を示す説明図であり、(a)は予測情報符号データおよび予測誤差符号データを示す図、(b)はこれらの合成データを示す図である。
【図16】 本発明に係る描画処理装置の伸長処理部における機能構成の一例を示すブロック図である。
【図17】 中間コード生成の手順の一例を示すフローチャートである。
【図18】 オブジェクト情報と画素情報との扱いの概要を示す説明図である。
【図19】 処理対象となるページのオブジェクトの構成の一具体例を示す説明図である、(a)はページ全体の様子を示す図、(b)はバンド分割状態を示す図である。
【図20】 図19に示したオブジェクト構成、特に最上部のバンドにおけるオブジェクト構成をさらに詳細に示した説明図である。
【図21】 本発明におけるフォールバック処理の手順の一例を示すフローチャートである。
【図22】 フォールバック処理を行う場合におけるイメージ・レンダリング処理全体の手順を示すフローチャートである。
【図23】 従来におけるフォールバック処理の手順の一例を示すフローチャートである。
【符号の説明】
11…中間コード生成部、12…中間コード蓄積部、13…メモリ管理部、14…フォールバック処理部、15…中間コード展開部、16…圧縮処理部、17…伸長処理部、18…圧縮データ蓄積部、19…出力転送部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a drawing processing apparatus and a drawing processing method for use in a so-called image rendering that is mounted on a printer or the like.
[0002]
[Prior art]
In recent years, the performance of personal computers (PCs) has made it possible to easily create color documents, and documents output from printers are also becoming more sophisticated. For this reason, it is necessary to improve the capability of the printer itself in order to cope with the sophistication of documents. On the other hand, the price of printers is strongly demanded due to the lower price of PCs. In other words, printers are required to achieve both high performance and low price.
[0003]
The capability of a printer is generally expressed by processing speed, resolution, and gradation. For example, it is expressed by numbers such as 20 PPM (Page Per Minutes), 1200 DPI (Dot Per Inch), and 8 bits / component. It can be evaluated that the larger these values are, the higher the capability of the printer. On the other hand, although there are a plurality of factors that determine the cost of the printer, a CPU (Central Processing Unit) and a memory that are indispensable for forming an image are classified into those having a relatively high price composition ratio. However, since high performance of the CPU is indispensable for realizing high processing speed, in order to achieve both high performance and low price of the printer, it is necessary to reduce the memory capacity installed. Absent. Furthermore, as the resolution and gradation are improved, the amount of data required for processing increases. Therefore, in order to achieve both high performance and low price, the technical problem of how to form high-quality images (how to perform image rendering) with a limited amount of memory becomes significant. .
[0004]
As a process for solving the technical problem in performing such image rendering, for example, Japanese Patent Application Laid-Open No. 10-116160 proposes a so-called fallback process. That is, in this publication, by performing fallback processing, (1) while ensuring the real-time property when outputting an image, (2) expressing data to be drawn in a limited amount of memory Is possible.
[0005]
Here, this fallback processing will be described in more detail. However, the fallback processing is originally applied for the above two purposes (1) and (2), but here, the description will focus on the case where it is applied for the above purpose (2). To do.
[0006]
FIG. 22 is a flowchart illustrating a procedure of the entire image rendering process when the fallback process is performed. The image rendering process is performed for each page of the output image, for example. In other words, when drawing data to be image-rendered is input (step 601; hereinafter, step is abbreviated as “S”), the drawing data is sequentially converted into an intermediate code (also referred to as a graphics order) in a predetermined format (S602). ). Then, it is checked whether or not a so-called memory overflow occurs in which the data amount of the intermediate code is larger than the memory capacity for storing and storing it (S603). If there is no memory overflow, the intermediate code is stored and stored in the memory as it is. (S604). However, if memory overflow occurs, the fallback process is activated (S605). This series of processing is repeated until one page of the output image is completed (S606).
[0007]
FIG. 23 is a flowchart showing a conventional fallback processing procedure. The conventional fallback process consists of the following five processing steps. That is, when the fallback process is activated, first, if there is a raster-like image portion in the intermediate code to be processed (managed in units of bands), the raster portion is losslessly compressed (reversible). Compression) (S701). If a sufficient memory capacity cannot be secured as a result, the raster portion is lossy compressed (lossy compression) (S702). If sufficient memory capacity cannot be ensured by this (when the intermediate code is larger than the band buffer), the entire band is pre-rendered (S703). If a sufficient memory capacity cannot be secured by this, the entire band is losslessly compressed (S704). If a sufficient memory capacity cannot be secured by this, the entire band is lossy compressed (S705). By going through these five processing steps (S701 to S705) in sequence, it is possible to hold and store an intermediate code corresponding to one page of the output image or its compressed data even with a limited capacity memory. . In addition, since the character / graphic part other than the raster part is kept lossless until the fourth step (S704), it can be expected to generate a high-quality image.
[0008]
When the intermediate code for one page of the output image (including the compressed data if fallback processing is performed) is accumulated by such fallback processing or without depending on the fallback processing, As shown in FIG. 22, a page output process is performed (S607), and the printer engine or the like forms an output image. At this time, if there is any lossy compressed band in the page to be output, the entire page including the band is lossy compressed and output. This is to prevent a defect caused by a change in image quality at the boundary between the lossy compressed band and the lossless compressed band.
[0009]
[Problems to be solved by the invention]
However, the above-described conventional fallback processing is very useful in effectively utilizing a limited amount of memory, but there are problems that can hinder high image quality as described below. As a result, it may be difficult to achieve both high performance and low price in a printer or the like.
[0010]
For example, in the conventional fallback processing, lossless compression is performed in the fourth step (S704) of the five processing steps (S701 to S705), but the intermediate code to be processed is an object related to the image attribute. Even if information (information enabling identification of characters, figures, images, etc.) is included, there is a problem that all the object information disappears at the stage of lossless compression. In general, when performing image output, output processing is often performed according to object information. For example, edges of characters and figures are emphasized, and raster-like image portions express rich gradation. . However, if the object information disappears, such processing cannot be performed, and it is considered difficult to realize a high-quality image.
[0011]
Further, for example, in the conventional fallback processing, if even one lossy band exists in a page, the entire page is lossy compressed. Processing on the entire page is a general problem when processing in band units, and is inevitable in order to maintain consistency on the entire page. However, when lossy compression is applied to the entire page, lossy compression that causes image quality degradation is applied to areas that can be expressed with sufficient image quality and a small amount of data. It becomes a big hindrance in doing.
[0012]
Therefore, the present invention provides a rendering processing apparatus and rendering processing capable of realizing high-quality image output while using a limited amount of memory by enabling fallback processing with higher image quality than before. It aims to provide a method.
[0013]
[Means for Solving the Problems]
The present invention provides an intermediate code generating means for converting drawing data into a first intermediate code of a predetermined format when drawing data for drawing an image is received by a drawing processing device devised to achieve the above object. Using the intermediate code storage means for sequentially holding and storing the first intermediate code converted by the intermediate code generation means, and the first intermediate code stored in the intermediate code storage means, Performing decompression into a second intermediate code in a compressible format, compression means for compressing the second intermediate code in scanline units decompressed by the decompression means, and data compressed by the compression means Decompression processing means for decompressing and returning to the second intermediate code; Compressed data storage means for holding and storing data compressed by the compression means; Memory management means for determining whether or not a memory overflow occurs in which the memory capacity that can be used by the intermediate code storage means is insufficient, and when the memory management means determines that memory overflow occurs, the expansion means Fallback processing means for compressing the second intermediate code expanded by the compression means; The intermediate code storage means and the compressed data storage means together When the first intermediate code or the compressed data corresponding to the predetermined image amount is held and accumulated, the output transfer means performs an output process for the first intermediate code or the compressed data corresponding to the predetermined image amount. If it is not determined by the memory management means that memory overflow occurs, the intermediate code generation means sequentially stores and stores the first intermediate code converted by the intermediate code generation means, and the memory management means causes memory overflow. The fallback processing means, when the fallback processing is performed for the second time or later, the decompression processing means decompresses the post-compression data obtained by the fallback processing already performed, About the decompressed second intermediate code and the first intermediate code that causes the fallback process for the second and subsequent times, When the first intermediate code is overlapped in scan line units by the opening means and expanded into a second intermediate code, the second intermediate code after the expansion is compressed by the compression means. The second intermediate code expanded by using the first intermediate code that causes a new fallback process by the expansion means is compressed by the compression means.
[0014]
The present invention is also a drawing processing method devised to achieve the above object. That is, a drawing processing method used when drawing processing is performed with a memory of a limited capacity. When drawing data for drawing an image is received, the drawing data is converted into a first intermediate code of a predetermined format. Using the intermediate code generation step, the intermediate code accumulation step for sequentially storing and storing the first intermediate code converted in the intermediate code generation step in the memory, and the first intermediate code accumulated in the intermediate code accumulation step A decompression step of superimposing in units of scan lines and expanding into a second intermediate code in a compressible format; and a compression step of compressing the second intermediate code in units of scan lines expanded by the expansion step; A decompression process step of decompressing the data after compression by the compression step and returning it to the second intermediate code; A compressed data storage step for holding and storing data after compression by the compression step; A memory management step for determining whether or not a memory overflow occurs in a state where the capacity of the memory is insufficient; and if the memory management step determines that a memory overflow occurs, the second step expanded by the expansion step A fallback processing step for compressing the intermediate code by the compression step; In the intermediate code accumulation step and the compressed data accumulation step An output transfer step for performing output processing on the first intermediate code or the compressed data corresponding to the predetermined image amount when the first intermediate code or the compressed data corresponding to the predetermined image amount is held and accumulated. If it is not determined that the memory overflow occurs in the memory management step, the first intermediate code converted in the intermediate code generation step is sequentially held and accumulated in the intermediate code accumulation step, and the memory management step causes the memory overflow. If it is determined that, in the fallback processing step, if the fallback processing is the second time or later, the decompressed data obtained by the fallback processing already performed is decompressed by the decompression processing step, Causes the expanded second intermediate code and the second and subsequent fallback processes With respect to one intermediate code, it is overlapped in units of scan lines by the expansion step and expanded to a second intermediate code, the second intermediate code after the expansion is compressed by the compression step, and fallback processing is performed. In the first case, the second intermediate code expanded by using the first intermediate code that causes a new fallback process by the expansion step is compressed by the compression step. .
[0015]
According to the drawing processing apparatus having the above-described configuration and the drawing processing method having the above procedure, when a memory overflow occurs, the memory should be stored and accumulated. Second intermediate code Compression processing is performed. However, even if compression processing is performed, the compressed data is decompressed by performing decompression processing on the compressed data after the compression processing. Second intermediate code You can return to That means The intermediate code is overlaid by the expansion means (decompression step). In the second and subsequent fallback processes, the compressed second intermediate code is expanded, and the expanded data and a new intermediate By superimposing the code and compressing it, a high-quality image output can be obtained while using a limited amount of memory. further, By compression process Second intermediate code Specific information attached to the (for example, object information about image attributes) Second intermediate code Are not converted into data of a completely different format (for example, raster-like bitmap data) by the compression process. Therefore, for example, if memory overflow is not resolved even after compression processing, the compressed data after the compression processing is Second intermediate code It is possible to perform lossy compression with a higher compression rate only on a specific portion (for example, an image portion) of the pre-compression data using the pre-compression data returned to the above.
[0016]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, a drawing processing apparatus and a drawing processing method according to the present invention will be described with reference to the drawings.
[0017]
[Description of schematic configuration of drawing processing apparatus]
First, a schematic configuration of the drawing processing apparatus will be described. FIG. 1 is a block diagram illustrating an example of a schematic configuration of a drawing processing apparatus according to the present invention, and FIG. 2 is a schematic diagram illustrating a configuration example of a system in which the drawing processing apparatus is used.
[0018]
The drawing processing apparatus described in the present embodiment is used in a system in which a client 1 and a printer 2 are connected to each other via a network line 3 as shown in FIG. Here, the drawing processing apparatus may be installed in the client 1, installed in the printer 2, or distributed in the client 1 and the printer 2. For example, as shown in FIG. 2B, when the print server 4 is provided on the network line 3, each device 1, including the print server 4 is installed in the print server 4. 2 may be distributed and mounted.
[0019]
When the drawing processing apparatus used in such a system receives drawing data created by application software (for example, document creation software) installed in the client 1, for example, image rendering processing is performed based on the drawing data. Are output and the printer engine of the printer 2 outputs the image. The general procedure for performing this image rendering process is the same as the conventional one (see FIG. 22), and therefore detailed description thereof is omitted here.
[0020]
In order to perform such an image rendering process and a process associated therewith, the drawing processing apparatus is configured as shown in FIG. 1, for example. That is, the drawing processing apparatus includes an intermediate code generation unit 11, an intermediate code storage unit 12, a memory management unit 13, a fallback processing unit 14, an intermediate code expansion unit 15, a compression processing unit 16, and an expansion processing unit. 17, a compressed data storage unit 18, and an output transfer unit 19.
[0021]
Upon receiving drawing data for drawing an image, the intermediate code generation unit 11 converts the drawing data into an intermediate code having a predetermined format as will be described later. That is, the intermediate code generation unit 11 performs the process of S602 in FIG.
[0022]
The intermediate code storage unit 12 sequentially stores and stores the intermediate codes converted by the intermediate code generation unit 11. That is, the intermediate code storage unit 12 performs the process of S604 in FIG.
[0023]
The memory management unit 13 determines whether or not a memory overflow occurs in which the memory capacity that can be used by the intermediate code storage unit 12 is insufficient. That is, the memory management unit 13 performs the process of S603 in FIG.
[0024]
When the memory management unit 13 determines that the memory overflow occurs, the fallback processing unit 14 operates the compression processing unit 16, operates the expansion processing unit 17 as necessary, and then restarts the compression processing unit 16. It is what makes it work. That is, the fallback processing unit 14 performs the processing of S605 in FIG. However, in the drawing processing apparatus described in the present embodiment, the fallback processing unit 14 is significantly different from the conventional one.
[0025]
The intermediate code expansion unit 15 expands the intermediate code converted by the intermediate code generation unit 11 into a compressible format as described later.
[0026]
The compression processing unit 16 performs a compression process on the expansion result by the intermediate code expansion unit 15 to reduce the data amount.
[0027]
If necessary, the decompression processing unit 17 performs decompression processing on data after the compression processing unit 16 performs compression processing (hereinafter referred to as “compressed data”), and returns the compressed data to the format before compression. Is.
[0028]
The compressed data storage unit 18 holds and stores the post-compression data compressed by the compression processing unit 16 according to an instruction from the fallback processing unit 14.
[0029]
When the intermediate code accumulating unit 12 and the compressed data accumulating unit 18 hold and accumulate the intermediate code or the compressed data for an amount corresponding to a predetermined image amount, for example, one page of the output image, the output transfer unit 19 An output process is performed on the intermediate code or the compressed data. That is, the output transfer unit 19 performs the process of S607 in FIG.
[0030]
In the output processing by the output transfer unit 19, the intermediate code decompressing unit 15 and the compression processing unit 16 are operated independently from the compression processing by the instruction from the fallback processing unit 14, and the intermediate code can be compressed. It is assumed that the process of decompressing and compressing is included. This is because even if the intermediate code is directly output to the printer engine or the like, it is difficult to drive the printer engine or the like synchronously. That is, the complexity of the intermediate code (particularly the degree of overlap and the drawing area) is not uniform, and it is difficult to predict the time required for the development process of the intermediate code. Since it is not known where to develop), it is considered effective to compress the intermediate code in order to guarantee the real-time performance of the printer engine, etc. (decompression time is generally easy to guarantee real-time performance) Because. However, if real-time performance can be guaranteed, the intermediate code may be edited and converted into another intermediate code format, or may be output after raster development with a page memory.
[0031]
[Explanation of intermediate code]
Next, the intermediate code format converted by the intermediate code generation unit 11 and the intermediate code expansion method by the intermediate code expansion unit 15 in the drawing processing apparatus configured as described above will be described.
[0032]
The drawing data received by the intermediate code generation unit 11 usually includes object information (information that makes it possible to identify characters, graphics, images, etc.) relating to image attributes specified by the drawing data. Also, a wide variety of expansion methods are known for expanding the intermediate code into a compressible format. However, for example, if raster development of the intermediate code is performed, compression is possible, but the amount of data increases, and the object information disappears at that point, which is not desirable.
[0033]
Therefore, the drawing processing apparatus according to the present embodiment employs a form in which the intermediate code expansion result is output as the second intermediate code, the intermediate code generation unit 11 converts the drawing data into the intermediate code, and further expands the intermediate code. Even if the unit 15 expands the intermediate code into a compressible format, the object information is not lost while being maintained. That is, in the drawing processing apparatus of the present embodiment, the intermediate code generation unit 11 converts the drawing data into the first intermediate code, and the intermediate code expansion unit 15 further compresses the first intermediate code in the second format. Is expanded to the intermediate code.
[0034]
The format of the first intermediate code at this time may be any format such as a vector format, a trapezoid format, or a run length format as long as it can be acquired in units of scan lines. The reason that the format needs to be acquired in units of scan lines is that the intermediate code expansion unit 15 performs expansion processing in the following procedure. FIG. 3 is a flowchart illustrating an example of an intermediate code expansion processing procedure.
[0035]
That is, the intermediate code development unit 15 first acquires all data on the uppermost (or even the lowermost) scan line (S101). Then, the leftmost drawing point (in the case of drawing from left to right or the rightmost drawing in the case of drawing from right to left) is acquired (S102), and is the drawing point the drawing start point? It is determined whether or not (S103).
[0036]
In the case of the drawing start point, the intermediate code development unit 15 registers that the drawing data has started drawing (S104). Then, it is determined whether it is the uppermost data (drawn later in the drawing order) in the drawing data that has started drawing (S105). If it is the uppermost data, it is further below this drawing data (drawing order). (S106), if there is, the left side of the point of interest (coordinate point of the drawing data that started drawing) from the paint start point with the color of the lower drawing data. (S107), and the coating start point is changed to the point of interest (S108). However, when the drawing start data is not the uppermost side or when there is no drawing data that has started drawing on the lower side, the processing up to the change of the paint start point is skipped.
[0037]
On the other hand, if it is not the drawing start point (drawing end point), the intermediate code development unit 15 determines whether it is the uppermost drawing data that has started drawing (S109). Color is applied from the paint start point to the point to the left of the target point (S110), and the paint start point is changed to the target point (S108). However, if it is not the uppermost drawing data in the drawing start, the processing up to the change of the paint start point is skipped.
[0038]
Thereafter, the intermediate code development unit 15 determines whether or not all the data on the scan line has been processed (S111), and if it still remains, returns to the acquisition of the leftmost drawing point and performs the above-described processing (S102). To S110). If all of the data have been processed, it is determined whether there is an unprocessed scan line in the band that is a predetermined processing unit (S112). If there is still a scan line, the process returns to data acquisition on the scan line. The above-described processing (S101 to S111) is repeated. When all the processes are performed, the process in one band is ended.
[0039]
Here, the format of the first intermediate code handled in the expansion process of the procedure as described above will be described. Here, a vector format is taken as an example as the first intermediate code.
[0040]
FIG. 4 is an explanatory diagram showing an example of a data representation format using vectors. In the figure, “order” is a drawing order of drawing commands. “X” indicates the value of the X intercept of the vector across the current scan line. “X displacement” indicates the amount of change in the X intercept when the process moves to the next scan line. “Y displacement” indicates the number of remaining scan lines affected by the vector. “Direction” indicates the direction of the vector.
[0041]
The vector having such a configuration will be described in more detail. FIG. 5 is an explanatory diagram showing a specific example of data represented by vectors. In the figure, the coordinate system has an origin at the upper left, and therefore, the X coordinate value increases in the horizontal right direction in the figure, and the Y coordinate value increases in the vertical downward direction in the drawing. In the illustrated example, a triangle represented by three points P1 (0, 300), P2 (600, 0), and P3 (300, 600) is shown. From these three points, three vectors P1P2, P2P3, and P3P1 are generated in consideration of the direction of the vector. In P1P2, “X” is 600, “X displacement” is −2, “Y displacement” is 300, and “direction” is −1. The other vectors are similarly shown in the figure.
[0042]
By the way, in the case of the vector format, it is necessary to determine whether the figure is internal or external. FIG. 6 is an explanatory diagram showing a specific example of rules used for internal / external determination of a figure. There are two types of determination rules: a non-zero winding rule shown in FIG. 6A and an odd / even rule shown in FIG. These are all rules used when determining the inside of one figure formed by a plurality of external shapes (paths).
[0043]
The non-zero winding rule shown in FIG. 6A considers the direction when the outer shape constituting the figure intersects the scan line. That is, the case where the outer shape crosses the scan line upward is positive, and the case where the outer shape crosses downward is negative. If the crossing is positive in the scanning direction, 1 is added, and if it is a negative crossing, 1 is subtracted, and it is determined that the point from the point where the total value is no longer 0 to the point where it returns to 0 is inside. To do. On the other hand, the odd / even rule shown in FIG. 7B counts the number of paths crossing the scan line, and determines from odd points to even points as internal.
[0044]
The internal determination process based on such a determination rule is used for determining the drawing start point and the drawing end point in the expansion process described with reference to FIG. Here, the internal determination process will be described in more detail. FIG. 7 is a flowchart illustrating an example of the procedure of the internal determination process. Note that there is a separate attribute area (internal determination rule and internal determination value) corresponding to the drawing figure, which can be obtained from a value indicating the drawing order.
[0045]
When the internal determination process is performed, first, an internal determination rule for a graphic composed of the vectors is acquired from the vector order (S201). If the type of the internal determination rule is a non-zero winding rule (S202), an internal determination value is subsequently acquired (S203), and it is checked whether or not the value is “0” (S204). When the value is “0”, the direction of the vector is added (S205), and it is determined that it is “start of region” (S206). On the other hand, if the value is not “0”, the direction of the vector is added (S207), and it is checked again whether the value is “0” (S208). If the value is “0”, it is determined that “the end of the region” is set (S209), and if the value is other than “0”, it is determined that the region is continued (S210).
[0046]
If the type of the internal determination rule is an odd / even rule (S202), the internal determination value is subsequently acquired, the value is increased by "1", and a remainder of 2 is obtained (S211). If the value of the remainder of 2 is “1”, the determination result is an odd number (S212), and since the figure is inside, it is determined that “region start” (S213). On the other hand, if the remainder of 2 is “0”, the determination result is an even number and is outside the figure, so it is determined as “end of region” (S214).
[0047]
In the internal determination process of such a procedure, “region start” corresponds to the drawing start point, and “region end” corresponds to the drawing end point. Therefore, if the internal determination process described above is applied to each acquired vector, the drawing start point and the drawing end point can be determined.
[0048]
Here, the first intermediate code has been described by taking a vector format as an example. However, as the first intermediate code, other formats (such as run-length format) may be mixed. Not too long.
[0049]
Next, the format of the second intermediate code, which is the result of performing the expansion process described with reference to FIG. 3 on the first intermediate code described above, will be described. Here, a run length format is taken as an example of the second intermediate code.
[0050]
FIG. 8 is an explanatory diagram showing an example of a data representation format by run length. In the example of the figure, two types of run length formats are shown, but as a common structure, a field (type) that represents the type and data format of the object, and a field (start point) that represents the start coordinate value on the scan line, And a field (end point) representing the end coordinates on the scan line. However, in one “type 1”, the color value is embedded in the run length, while in the other “type 2”, the color value is a pointer and a pixel row is stored in another area. Normally, the “type 1” format is used to represent characters and graphics, and the “type 2” format is used to represent rasters.
[0051]
As described above, the intermediate code expansion unit 15 expands the first intermediate code converted by the intermediate code generation unit 11 into a second intermediate code in a compressible format. As part of this, it also has a function of performing data overlay processing described below.
[0052]
FIG. 9 is a flowchart illustrating an example of a procedure of data superimposition processing performed as part of the intermediate code expansion processing. Here, as shown in the upper part of the figure, three drawing data that overlap each other on a certain scan line are input, and the drawing order is data that is drawn first on the lower side and data that is drawn later on the upper side. As an example, the content of each drawing data is “blue” graphic data at the bottom, raster data “green” at the center, and character data “red” at the top.
[0053]
In this case, first, in the first step (S301), the drawing start point is acquired, but since no drawing data has been started before that, the coordinate value of the drawing start point is temporarily used as the paint start point. Fasten to hold on. Thereafter, in the next step (S302), the drawing start point of “green” is acquired, but nothing is done because “red” drawn after green has already started drawing. In the next step (S303), the drawing end point of “red” is acquired, and since it is the top in the drawing data that has started drawing, “red” from the paint starting point “0” to its coordinate value “5” is obtained. ”Is output, run-length data such as“ type 1, red, 0, 5 ”is output, and the paint start point is updated to“ 6 ”.
[0054]
In the next step (S304), the drawing start point of “blue” is acquired, but nothing is done because “green” drawn after “blue” has already started drawing. In the next step (S305), the drawing end point of “green” is acquired, and since it is the top of the drawing data that has been drawn, from the paint starting point “6” to the coordinate value “9”. It decides to paint “green”, outputs run-length data such as “type 2, green pixel row, 6, 9”, and updates the paint start point to “10”. In the next step (S 306), the drawing end point of “blue” is acquired, and since it is the top of the drawing data that has been drawn, from the painting start point “10” to its coordinate value “13”, “ It decides to paint with “blue”, outputs run-length data such as “type 1, blue, 10, 13”, and updates the paint start point to “14”.
[0055]
As described above, the intermediate code expansion unit 15 is one of the formats that can be compressed while performing data overlay processing on the first intermediate code converted by the intermediate code generation unit 11 as necessary. It is designed to expand to a second intermediate code in run length format.
[0056]
[Description of compression processing]
Next, the compression process performed by the compression processing unit 16 will be described. A wide variety of compression methods for intermediate codes developed into a compressible format are known. Here, a case where a color image encoding method described below is applied is taken as an example.
[0057]
FIG. 10 is a block diagram illustrating an example of a functional configuration in the compression processing unit. As shown in the figure, the compression processing unit 16 in the present embodiment includes a reference area generation unit 16a, an identical pixel value distribution generation unit 16b, a prediction information encoding unit 16c, an error calculation encoding unit 16d, and a code synthesis. And means 16e.
[0058]
The reference area generation unit 16a extracts pixel data to be encoded and a plurality of pixel data in the peripheral area from data input pixel by pixel in the raster scan order, and extracts these as target pixel data and reference area, respectively. Data.
[0059]
Based on the target pixel data and reference region data specified by the reference region generation unit 16a, the same pixel value distribution generation unit 16b distributes the pixels having the same pixel value as the target pixel around the target pixel. And the result is output as the same pixel value distribution.
[0060]
The prediction information encoding unit 16c encodes the target pixel value based on the same pixel value distribution detected by the same pixel value distribution generation unit 16b if the target pixel data can be encoded only by the same pixel value distribution. On the other hand, if the encoding is impossible, a code indicating that the encoding is impossible is generated, and these are selectively output as the prediction information code data.
[0061]
The error calculation encoding means 16d calculates a predicted pixel value from the pixel value data, calculates and encodes an error between the predicted pixel value and the pixel value data, and outputs it as predicted error code data.
[0062]
The code synthesizing unit 16e synthesizes the prediction information code data from the prediction information encoding unit 16c and the prediction error code data from the error calculation encoding unit 16d, and outputs it as a single code stream.
[0063]
When the compression processing unit 16 having such a configuration receives data to be subjected to compression processing, the reference area generation unit 16a and the surrounding pixel (the pixel value of the pixel (target pixel) to be encoded in the received data) For example, pixel values of peripheral four pixels) are extracted, and these are specified as target pixel data and reference area data, respectively. As an arrangement of the pixel of interest and its peripheral pixels, for example, a specific example shown in FIG. 11 can be considered. It is assumed that the position of the pixel of interest is scanned in order for one page as in the pixel scanning order.
[0064]
When the pixel-of-interest data and the reference region data are specified, subsequently, in the compression processing unit 16, the same pixel value distribution generation unit 16b determines whether the reference region data has the same pixel value as the pixel-of-interest data. Are compared, and the results are collectively output as the same pixel value distribution. For example, the same pixel value distribution generation unit 16b replaces peripheral pixels having the same pixel value as the pixel value of the target pixel with “1”, other peripheral pixels with “0”, and collects the replaced peripheral four pixels. Are output as the same pixel value distribution. Therefore, for example, in the case of the specific example shown in FIG. 12, the same pixel distribution is generated in which “1” is directly above and to the left of the target pixel, and “0” is the others.
[0065]
Thereafter, in the compression processing unit 16, the prediction information encoding unit 16c encodes the same pixel distribution generated by the same pixel value distribution generation unit 16b, and outputs the result as prediction information code data. At this time, the prediction information encoding unit 16c performs encoding for the same pixel distribution according to the preset reference pixel label and code generation table. Examples of the reference pixel label and the code generation table include the specific example shown in FIG.
[0066]
At the same time, in the compression processing unit 16, the error calculation encoding unit 16d encodes the same pixel distribution generated by the same pixel value distribution generation unit 16b, and the result is predicted error code data. Output as. At this time, the error calculation encoding unit 16d performs encoding on the same pixel distribution by an arithmetic encoding method using a preset arithmetic expression. An example of the arithmetic expression is a specific example shown in FIG.
[0067]
When the prediction information code data and the prediction error code data are output from the prediction information encoding unit 16c and the error calculation encoding unit 16d, respectively, in the compression processing unit 16, the code synthesizing unit 16e combines these to generate a single unit. Is output as a code stream. However, at this time, for example, in the code synthesizing unit 16e, when the same information is continuously output as the prediction information code data output by the prediction information encoding unit 16c, the number of consecutive times is counted. After the codes are not the same, output together with the count result. Therefore, for example, if the prediction information code data and the prediction error code data as in the specific example shown in FIG. 15A are output, the code synthesizing unit 16e combines them as shown in FIG. 15B. Data will be output.
[0068]
[Explanation of decompression process]
Next, the decompression process performed by the decompression processing unit 17 will be described. The decompression processing by the decompression processing unit 17 is performed on the data after compression by the compression processing unit 16. Therefore, here, a case where a color image decoding method described below is applied as an expansion method is taken as an example in response to the description of the compression processing described above.
[0069]
FIG. 16 is a block diagram illustrating an example of a functional configuration in the decompression processing unit. As shown in the figure, the decompression processing unit 17 in this embodiment includes a code determination unit 17a, a prediction information decoding unit 17b, an error decoding addition unit 17c, and an intermediate code generation unit 17d. Yes.
[0070]
The code discriminating unit 17a reads data after compression by the compression processing unit 16 and discriminates whether each code constituting the data after compression is prediction information code data or prediction error code data. is there.
[0071]
When the code constituting the compressed data is the prediction information code data, the prediction information decoding unit 17b decodes the prediction information code data and associates it with the encoding, for example, the reference pixel shown in FIG. Return to information about the label. Furthermore, information (count result) indicating how many times the same prediction information code data continues is also decoded.
[0072]
The error decoding addition means 17c calculates the value of the target pixel based on the error value of the prediction error code data when the code constituting the compressed data is prediction error code data. As a calculation method, it is conceivable to derive an arithmetic expression for calculating a target pixel value from an arithmetic expression used at the time of encoding, and use the arithmetic expression. For example, when encoding is performed using the arithmetic expression shown in FIG. 14, an arithmetic expression such as pixel of interest = (A + B) / 2 + error may be used.
[0073]
The intermediate code generation means 17d uses the prediction information decoded by the prediction information decoding means 17b and the error information decoded by the error decoding addition means 17c to generate data in a format before compression, for example, an intermediate code in run length format. Is to be generated.
[0074]
Here, the intermediate code generation processing by the intermediate code generation means 17d will be described in more detail. FIG. 17 is a flowchart illustrating an example of an intermediate code generation procedure.
[0075]
As shown in the figure, the intermediate code generation means 17d first acquires the decoded data (S401), and whether or not the pixel value of the data is equal to the pixel on the left (or the pixel value of the current run length). Is checked (S402). As a result, if they are equal, the length of the acquired data (the number of consecutive identical pixel values in the case of prediction information, “1” in the case of error information) is added to the length of the current run length ( S403). If they are not equal, the current run length is output and a new run length is started (S404). At this time, the new run length has the pixel value and length of the acquired data as initial values. The intermediate code generation unit 17d returns the compressed data to the same state as the second intermediate data in the run-length format by repeatedly performing the above processing until there is no decoded data (S405).
[0076]
[Explanation of fallback processing]
Next, a fallback process by the fallback processing unit 14 that is the most characteristic process in the drawing processing apparatus according to the present embodiment will be described. The fallback process is a process performed when memory overflow occurs, as is apparent from the flowchart of FIG. 22 described above. Therefore, in the fallback process, it is necessary to reduce the amount of data to be stored and accumulated in the memory.
[0077]
There are various methods for reducing the amount of data. In the drawing processing apparatus of the present embodiment, a high compression rate is obtained for character graphics and CG (Computer Graphics) images by the encoding method by the compression processing unit 16 described above. Can guarantee. Therefore, the fallback processing unit 14 can reduce the data amount by operating the compression processing unit 16 in the case of a character graphic and a CG image. On the other hand, natural images (images) expressed by bitmap raster data are difficult to compress at a high compression rate while maintaining high image quality, as is generally said. However, on the other hand, the image is not noticeable to human eyes even if the image quality is degraded. Therefore, in the present embodiment, when compressing an image, a case where a high compression rate is ensured by performing a process for reducing the resolution will be described as an example. However, this is for simplifying the explanation, and there is no problem even if another method is used to ensure a high compression rate. Another method includes, for example, a combination of other encoding methods such as JPEG (Joint Photographic Experts Group).
[0078]
In this manner, applying different encoding methods for each image object such as a character graphic and an image can be realized based on the object information. For this reason, in the rendering processing apparatus of this embodiment, object information is handled in the same way as pixel values, and the object information is restored even after undergoing compression processing and decompression processing. Specifically, as shown in FIG. 18, object information and pixel information are handled in a lump and used to determine prediction information at the time of encoding / decoding. That is, even if the pixel value is the same, if the object information is different, it is handled as different data.
[0079]
Here, the fallback processing by the fallback processing unit 14 will be described in detail with a specific example. FIG. 19 is an explanatory diagram showing a specific example of the configuration of the object of the page to be processed. In FIG. 19A, the hatched (hatched) portion is a portion where characters are written, and the filled (black) portion is an image portion, and the image occupies the upper right quarter of the page. In addition, as the drawing order, after drawing the character area, the image area is drawn. Furthermore, it is assumed that the page is divided into four bands and processed as shown in FIG.
[0080]
FIG. 20 is an explanatory diagram showing in more detail the object configuration shown in FIG. 19, particularly the object configuration in the uppermost band. As shown in the figure, this band is mainly composed of the page margin (background), characters, background, image, and background. In more detail, although the character portion and the background portion are mixed in the character portion, it is simply treated as a character here, and the description is simplified.
[0081]
When drawing data for drawing a page having such an object configuration is received, in the drawing processing apparatus of this embodiment, first, the intermediate code generation unit 11 converts drawing data related to characters into a first intermediate code. The intermediate code storage unit 12 holds and stores this. After that, the intermediate code generation unit 11 converts the drawing data relating to the image into the first intermediate code, and the intermediate code storage unit 12 holds and stores this, but at this time (in the intermediate encoding stage of the image) An example will be described in which the memory management unit 13 determines that memory overflow occurs and the fallback processing unit 14 performs the fallback processing.
[0082]
FIG. 21 is a flowchart illustrating an example of a fallback process procedure according to the present embodiment. When the memory overflow occurs and the fallback processing needs to be performed, the fallback processing unit 14 determines whether or not the fallback processing has already been performed on the same page to be processed, that is, newly It is determined whether or not the fallback process to be performed is a second or later process (hereinafter referred to as “multiple fallback process”) (S501). This determination may be made based on the presence / absence of post-compression data, processing history, and the like.
[0083]
If the result of this determination is multiple fallback processing, since there is compressed data for the same page, the fallback processing unit 14 operates the decompression processing unit 17 to perform decompression processing on the compressed data. The compressed data is returned to the same state as the second intermediate data in the run length format (S502). The decompression processing by the decompression processing unit 17 at this time is performed according to the procedure already described (see FIGS. 16 and 17).
[0084]
Then, the fallback processing unit 14 treats the intermediate data after the decompression process as run-length data for the background pattern, and performs a data overlay process for synthesizing the run-length data with an intermediate code that causes a new fallback process. Then, the intermediate code expansion unit 15 is caused to perform (S503). The data superimposing process at this time is performed according to the procedure already described (see FIG. 9). However, the drawing data has a vertical relationship as described above, and the generation of the intermediate code is performed in the drawing order. Therefore, in the data overlay process, the fallback processing unit 14 gives an instruction to put the run-length data after the decompression process below the intermediate code that causes a new fallback process. As a result, the intermediate code expansion unit 15 arranges the decompression result of the fallback processing up to the previous time on the lowest side of the data format having the vertical relationship.
[0085]
On the other hand, if it is determined that it is not a multiple fallback process, the decompression process (S502) and the data overlay process (S503) are skipped.
[0086]
Thereafter, the intermediate code expansion unit 15 performs expansion processing on the intermediate code after the data superimposition processing or the intermediate code that causes the new fallback processing, and creates a second intermediate code in the run length format ( S504). The expansion process at this time is performed according to the procedure already described (see FIGS. 3 to 9). Then, the fallback processing unit 14 operates the compression processing unit 16 to perform compression processing on the intermediate code generated by the intermediate code expansion unit 15 (S505). The compression process at this time is also performed in the procedure already described, as in the decompression process (see FIGS. 10 to 15).
[0087]
Here, the fallback processing unit 14 inquires of the memory management unit 13 whether or not the memory capacity is sufficient by the above-described series of processing (S501 to S505) (S506). As a result, if there is sufficient free space, the fallback processing unit 14 checks whether or not it is the end of the page (S507), and repeats a series of processing (S501 to S507) if it is not yet over. Then, the memory capacity for one page of the output image is secured, and the intermediate code storage unit 12 or the compressed data storage unit 18 holds and stores the intermediate code or the compressed data.
[0088]
However, when the compression processing unit 16 performs the compression process and the memory capacity is not sufficient, the fallback processing unit 14 operates the decompression processing unit 17 to obtain the post-compression data obtained by the compression process. A decompression process is performed on (S508). The decompression process at this time is also performed according to the procedure already described (see FIGS. 16 and 17). Therefore, the compressed data returns to the same state as the second intermediate code in the run length format. In addition, at this time, since the object information and the pixel value are handled in the same manner, the object information for the intermediate code is restored in the same manner as the compressed data returns to the intermediate code.
[0089]
Therefore, the fallback processing unit 14 extracts only the image part based on the object information, and performs the data amount reduction process only on the part having the attribute of the image (S509). As the data amount reduction processing at this time, as described above, resolution conversion processing may be mentioned, but an encoding method such as JPEG may be used. After the data of the image portion is reduced, the compression processing unit 16 is operated again, the above-described series of processing (S505 to S509) is repeated, the memory capacity for one page of the output image is secured, and the fallback processing is finished. To do.
[0090]
As described above, according to the drawing processing apparatus and the drawing processing method executed by the drawing processing apparatus according to the present embodiment, compression processing or decompression processing is performed as necessary during the fallback processing. Can be restored to its original format. That is, unlike the conventional case, specific information (for example, object information related to image attributes) attached to the intermediate data is lost by the compression process, or all of the intermediate data is completely different in the format (for example, the object information about the attribute of the image) In other words, it is not converted into raster bitmap data).
[0091]
Therefore, according to the drawing processing apparatus and the drawing processing method of the present embodiment, even when the fallback process is performed, the fallback process and the subsequent process can be performed according to the object information. In the back process, it is possible to perform a compression process with a high compression rate (for example, lossy compression) only on the image portion. Also, since different compression processing can be performed depending on the object, even if there is even one lossy compressed portion in the page, lossy compression of the entire page is not required. Furthermore, even after the fallback processing, for example, the edge portions of characters and figures can be emphasized, and the raster-like image portion can express the gradation richly.
[0092]
In particular, in the drawing processing apparatus and the drawing processing method of this embodiment, lossless compression with a high compression rate is performed only on the image portion when memory overflow is not eliminated only by lossless compression. Therefore, lossy compression is applied only to image parts that are attribute parts where image quality degradation is not noticeable even when lossy compression is applied, and lossless compression is applied to other parts (characters, graphics, etc.). become.
[0093]
For these reasons, according to the drawing processing apparatus and the drawing processing method of the present embodiment, high-quality image output is realized by minimizing the deterioration of the image quality of the output image while effectively utilizing the limited memory capacity. As a result, it is possible to contribute to both high performance and low price in a printer or the like.
[0094]
This is realized by decompressing the compressed data so that it can be returned to the format before compression. In other words, since the compressed data can be returned to the format before compression, if the object information and the pixel information are handled together, the object information is not lost after the decompression process, and the fallback process as described above can be performed. It becomes feasible.
[0095]
In the present embodiment, the case where the compressed data is returned to the second intermediate code in the run-length format by the decompression process has been described as an example, but the present invention is not limited to this. In other words, intermediate codes can be mixed in various formats such as vector format, trapezoid format, run length format, raster format, etc. If the compressed data can be returned to the format before compression, that format Is not limited to a specific one. However, in the compression processing performed as part of the fallback processing, lossy compression and lossless compression are selectively performed according to the object, so if considering the recompression processing performed after the decompression processing, the decompression processing In this case, it is preferable that the compressed data to which lossy compression is applied is decoded by raster expression, and the other compressed data to which lossless compression is applied is decoded by run length expression.
[0096]
【The invention's effect】
As described above, according to the drawing processing apparatus and the drawing processing method of the present invention, it is possible to perform a fallback process with higher image quality than before, thereby enabling high quality while using a limited amount of memory. Image output can be realized.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an example of a schematic configuration of a drawing processing apparatus according to the present invention.
FIGS. 2A and 2B are schematic diagrams illustrating a configuration example of a system in which a drawing processing apparatus according to the present invention is used, in which FIG. 2A is a diagram illustrating an example thereof, and FIG. 2B is a diagram illustrating another example;
FIG. 3 is a flowchart illustrating an example of an intermediate code expansion processing procedure;
FIG. 4 is an explanatory diagram showing an example of a data representation format using vectors.
FIG. 5 is an explanatory diagram showing a specific example of data represented by vectors.
6A and 6B are explanatory diagrams showing a specific example of a rule used for internal / external determination of a figure. FIG. 6A is a diagram showing a non-zero winding rule, and FIG. 6B is a diagram showing an odd / even rule.
FIG. 7 is a flowchart illustrating an example of a procedure of an internal determination process.
FIG. 8 is an explanatory diagram showing an example of a data expression format by run length.
FIG. 9 is a flowchart illustrating an example of a procedure of data superimposition processing performed as part of intermediate code expansion processing.
FIG. 10 is a block diagram illustrating an example of a functional configuration in a compression processing unit of the drawing processing apparatus according to the present invention.
FIG. 11 is an explanatory diagram showing a specific example of reference area data used in compression processing.
FIG. 12 is an explanatory diagram showing a specific example of the same pixel value distribution used in the compression process.
FIG. 13 is an explanatory diagram showing a specific example of a reference pixel label and a code generation table used in compression processing.
FIG. 14 is an explanatory diagram showing a specific example of an arithmetic expression for error calculation encoding used in the compression process.
15A and 15B are explanatory diagrams showing a specific example of an encoding format, in which FIG. 15A is a diagram showing prediction information code data and prediction error code data, and FIG. 15B is a diagram showing their combined data.
FIG. 16 is a block diagram illustrating an example of a functional configuration in an expansion processing unit of the drawing processing apparatus according to the present invention.
FIG. 17 is a flowchart illustrating an example of an intermediate code generation procedure.
FIG. 18 is an explanatory diagram showing an outline of handling object information and pixel information.
FIGS. 19A and 19B are explanatory diagrams illustrating a specific example of the configuration of an object of a page to be processed, where FIG. 19A is a diagram illustrating a state of the entire page, and FIG. 19B is a diagram illustrating a band division state;
20 is an explanatory diagram showing in more detail the object configuration shown in FIG. 19, particularly the object configuration in the uppermost band. FIG.
FIG. 21 is a flowchart showing an example of a fallback processing procedure according to the present invention.
FIG. 22 is a flowchart showing a procedure of the entire image rendering process when a fallback process is performed.
FIG. 23 is a flowchart showing an example of a conventional fallback processing procedure.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 11 ... Intermediate code production | generation part, 12 ... Intermediate code storage part, 13 ... Memory management part, 14 ... Fallback process part, 15 ... Intermediate code expansion | deployment part, 16 ... Compression process part, 17 ... Decompression process part, 18 ... Compressed data Accumulation unit, 19 ... output transfer unit

Claims (6)

画像を描画するための描画データを受け取ると当該描画データを所定形式の第一の中間コードに変換する中間コード生成手段と、
前記中間コード生成手段が変換した第一の中間コードを順次保持蓄積する中間コード蓄積手段と、
前記中間コード蓄積手段に蓄積された第一の中間コードを用いて、スキャンライン単位で重ねあわせを行い、圧縮可能な形式の第二の中間コードに展開する展開手段と、
前記展開手段によって展開されたスキャンライン単位の第二の中間コードを圧縮する圧縮手段と、
前記圧縮手段による圧縮後データを伸長して第二の中間コードに戻す伸長処理手段と、
前記圧縮手段による圧縮後データを保持蓄積する圧縮データ蓄積手段と、
前記中間コード蓄積手段が使用し得るメモリ容量が不足する状態となるメモリあふれが生じるか否かを判断するメモリ管理手段と、
前記メモリ管理手段によりメモリあふれが生じると判断されると、前記展開手段によって展開された第二の中間コードを、前記圧縮手段によって圧縮させるフォールバック処理手段と、
前記中間コード蓄積手段および前記圧縮データ蓄積手段が合わせて所定画像量に相当する第一の中間コードまたは圧縮後データを保持蓄積すると当該所定画像量に相当する分の第一の中間コードまたは圧縮後データについての出力処理を行う出力転送手段とを有し、
前記メモリ管理手段によりメモリあふれが生じると判断されなければ、前記中間コード生成手段が変換した第一の中間コードを前記中間コード蓄積手段に順次保持蓄積させ、
前記メモリ管理手段によりメモリあふれが生じると判断されると、前記フォールバック処理手段は、
フォールバック処理が二度目以降の場合には、既に行われているフォールバック処理で得られた圧縮後データを前記伸長処理手段により伸長させ、その伸長された第二の中間コードと前記二度目以降のフォールバック処理の要因となる第一の中間コードとについて、前記展開手段によりスキャンライン単位で重ね合わせを行って第二の中間コードに展開し、その展開後の第二の中間コードを前記圧縮手段によって圧縮させ、
フォールバック処理が一度目の場合には、前記展開手段によって新たなフォールバック処理の要因となった第一の中間コードを用いて展開された第二の中間コードを、前記圧縮手段によって圧縮させる
ことを特徴とする描画処理装置。
Intermediate code generating means for receiving drawing data for drawing an image and converting the drawing data into a first intermediate code of a predetermined format;
Intermediate code storage means for sequentially holding and storing the first intermediate code converted by the intermediate code generation means;
Using the first intermediate code stored in the intermediate code storage means, performing the superimposition in units of scan lines, and developing the second intermediate code in a compressible format;
Compression means for compressing the second intermediate code in scanline units developed by the expansion means;
Decompression processing means for decompressing the data compressed by the compression means and returning it to the second intermediate code;
Compressed data storage means for holding and storing data compressed by the compression means;
Memory management means for determining whether or not a memory overflow occurs in which the memory capacity that can be used by the intermediate code storage means is insufficient;
A fallback processing unit for compressing the second intermediate code expanded by the expansion unit by the compression unit when it is determined that the memory overflow occurs by the memory management unit;
When the intermediate code accumulating unit and the compressed data accumulating unit hold and accumulate the first intermediate code corresponding to the predetermined image amount or the compressed data, the first intermediate code corresponding to the predetermined image amount or the post-compression Output transfer means for performing output processing on data,
If it is not determined by the memory management means that memory overflow will occur, the intermediate code storage means sequentially stores and stores the first intermediate code converted by the intermediate code generation means,
When the memory management means determines that memory overflow occurs, the fallback processing means
When the fallback processing is performed for the second time or later, the decompressed data obtained by the fallback processing already performed is decompressed by the decompression processing means, and the decompressed second intermediate code and the second or later The first intermediate code that causes the fallback processing of the image is overlapped in units of scan lines by the expansion means and expanded into a second intermediate code, and the second intermediate code after the expansion is compressed. Compressed by means,
When the fallback process is performed for the first time, the compression unit compresses the second intermediate code expanded using the first intermediate code that causes a new fallback process by the expansion unit. A drawing processing apparatus characterized by the above.
前記展開手段が展開する第二の中間コードは、当該第二の中間コードによって表される画像の属性に関するオブジェクト情報を含んでおり、
前記伸長処理手段は、圧縮後データを伸長して第二の中間コードに戻す際に、前記オブジェクト情報も復元するものであり、
前記フォールバック処理手段は、
フォールバック処理が二度目以降の場合には、既に行われているフォールバック処理で得られた圧縮後データを前記伸長処理手段により伸長させ、その伸長された第二の中間コードと前記二度目以降のフォールバック処理の要因となる第一の中間コードとについて、前記オブジェクト情報を用いて、前記展開手段によりスキャンライン単位で重ね合わせを行って第二の中間コードに展開し、その展開後の第二の中間コードを前記圧縮手段によって圧縮させる
ことを特徴とする請求項1記載の描画処理装置。
The second intermediate code expanded by the expansion means includes object information related to the attribute of the image represented by the second intermediate code,
The decompression processing means restores the object information when decompressing the compressed data and returning it to the second intermediate code,
The fallback processing means includes
When the fallback processing is performed for the second time or later, the decompressed data obtained by the fallback processing already performed is decompressed by the decompression processing means, and the decompressed second intermediate code and the second or later For the first intermediate code that causes the fallback processing of the image, the object information is used to superimpose the data in units of scan lines by the expansion means, and the second intermediate code is expanded. The drawing processing apparatus according to claim 1, wherein a second intermediate code is compressed by the compression unit.
前記フォールバック処理手段は、
フォールバック処理が二度目以降の場合には、
前記展開手段により、前記伸張処理手段により伸張された第二の中間コードを下側に配置して、前記二度目以降のフォールバック処理の要因となる第一の中間コードをスキャンライン単位で重ね合わせて、第二の中間コードに展開し、その展開後の第二の中間コードを前記圧縮手段によって圧縮させる
ことを特徴とする請求項1または2に記載の描画処理装置。
The fallback processing means includes
If the fallback process is the second or later,
The expansion means arranges the second intermediate code expanded by the expansion processing means on the lower side, and superimposes the first intermediate code that causes the second and subsequent fallback processes in units of scan lines. The drawing processing apparatus according to claim 1, wherein the drawing processing device is expanded into a second intermediate code, and the compressed second intermediate code is compressed by the compression unit.
前記フォールバック処理手段は、前記オブジェクト情報に基づいて、有損失圧縮を施しても画質劣化が目立たない属性の部分に対してのみ、前記圧縮手段による有損失圧縮処理を適用する
ことを特徴とする請求項2記載の描画処理装置。
The fallback processing means applies the lossy compression processing by the compression means only to an attribute part in which image quality deterioration is not noticeable even when lossy compression is performed based on the object information. The drawing processing apparatus according to claim 2.
前記伸長処理手段は、前記圧縮手段による有損失圧縮処理が適用された圧縮後データについてはラスタ表現により、それ以外の無損失圧縮処理が適用された圧縮後データについてはランレングス表現により、それぞれ復号するものである
ことを特徴とする請求項4記載の描画処理装置。
The decompression processing means decodes the compressed data to which the lossy compression processing by the compression means is applied by raster representation, and the compressed data to which other lossless compression processing is applied by the run length representation. The drawing processing apparatus according to claim 4, wherein:
限られた容量のメモリで描画処理を行う際に用いられる描画処理方法であって、
画像を描画するための描画データを受け取ると当該描画データを所定形式の第一の中間コードに変換する中間コード生成ステップと、
前記中間コード生成ステップで変換した第一の中間コードを前記メモリに順次保持蓄積させる中間コード蓄積ステップと、
前記中間コード蓄積ステップで蓄積された第一の中間コードを用いて、スキャンライン単位で重ねあわせを行い、圧縮可能な形式の第二の中間コードに展開する展開ステップと、
前記展開ステップによって展開されたスキャンライン単位の第二の中間コードを圧縮する圧縮ステップと、
前記圧縮ステップによる圧縮後データを伸長して第二の中間コードに戻す伸長処理ステップと、
前記圧縮ステップによる圧縮後データを保持蓄積する圧縮データ蓄積ステップと、
前記メモリの容量が不足する状態となるメモリあふれが生じるか否かを判断するメモリ管理ステップと、
前記メモリ管理ステップによりメモリあふれが生じると判断されると、前記展開ステップによって展開された第二の中間コードを、前記圧縮ステップによって圧縮させるフォールバック処理ステップと、
前記中間コード蓄積ステップおよび前記圧縮データ蓄積ステップで合わせて所定画像量に相当する第一の中間コードまたは圧縮後データを保持蓄積すると当該所定画像量に相当する分の第一の中間コードまたは圧縮後データについての出力処理を行う出力転送ステップとを有し、
前記メモリ管理ステップによりメモリあふれが生じると判断されなければ、前記中間コード生成ステップで変換した第一の中間コードを前記中間コード蓄積ステップにて順次保持蓄積させ、
前記メモリ管理ステップによりメモリあふれが生じると判断されると、前記フォールバック処理ステップでは、
フォールバック処理が二度目以降の場合には、既に行われているフォールバック処理で得られた圧縮後データを前記伸長処理ステップにより伸長させ、その伸長された第二の中間コードと前記二度目以降のフォールバック処理の要因となる第一の中間コードとについて、前記展開ステップによりスキャンライン単位で重ね合わせを行って第二の中間コードに展開し、その展開後の第二の中間コードを前記圧縮ステップによって圧縮させ、
フォールバック処理が一度目の場合には、前記展開ステップによって新たなフォールバック処理の要因となった第一の中間コードを用いて展開された第二の中間コードを、前記圧縮ステップによって圧縮させる
ことを特徴とする描画処理方法。
A drawing processing method used when drawing processing is performed with a limited amount of memory,
An intermediate code generating step of receiving drawing data for drawing an image and converting the drawing data into a first intermediate code of a predetermined format;
An intermediate code storage step of sequentially storing and storing the first intermediate code converted in the intermediate code generation step in the memory;
Using the first intermediate code stored in the intermediate code storage step, performing the superimposition in units of scan lines, and expanding the second intermediate code in a compressible format,
A compression step of compressing the second intermediate code of the scan line unit expanded by the expansion step;
A decompression process step of decompressing the data after compression by the compression step and returning it to the second intermediate code;
A compressed data storage step for holding and storing data after compression by the compression step;
A memory management step for determining whether or not a memory overflow that results in a shortage of memory capacity occurs;
A fallback processing step of compressing the second intermediate code expanded by the expansion step by the compression step when it is determined that the memory overflow occurs by the memory management step;
When the first intermediate code or the compressed data corresponding to the predetermined image amount is held and accumulated in the intermediate code storage step and the compressed data storage step, the first intermediate code or the amount corresponding to the predetermined image amount is stored. An output transfer step for performing output processing on the data,
If it is not determined that memory overflow occurs in the memory management step, the first intermediate code converted in the intermediate code generation step is sequentially held and accumulated in the intermediate code accumulation step,
When it is determined that memory overflow occurs in the memory management step, the fallback processing step includes:
When the fallback process is performed for the second time or later, the decompressed data obtained by the fallback process already performed is decompressed by the decompression process step, and the decompressed second intermediate code and the second or later process are performed. The first intermediate code that causes the fallback processing of the image is overlapped in units of scan lines by the expansion step and expanded to a second intermediate code, and the second intermediate code after the expansion is compressed to the second intermediate code Compressed by steps,
When the fallback process is performed for the first time, the second intermediate code developed using the first intermediate code that causes a new fallback process by the decompression step is compressed by the compression step. A drawing processing method characterized by the above.
JP2001133787A 2001-05-01 2001-05-01 Drawing processing apparatus and drawing processing method Expired - Fee Related JP4423812B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001133787A JP4423812B2 (en) 2001-05-01 2001-05-01 Drawing processing apparatus and drawing processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001133787A JP4423812B2 (en) 2001-05-01 2001-05-01 Drawing processing apparatus and drawing processing method

Publications (2)

Publication Number Publication Date
JP2002326401A JP2002326401A (en) 2002-11-12
JP4423812B2 true JP4423812B2 (en) 2010-03-03

Family

ID=18981587

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001133787A Expired - Fee Related JP4423812B2 (en) 2001-05-01 2001-05-01 Drawing processing apparatus and drawing processing method

Country Status (1)

Country Link
JP (1) JP4423812B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5392543B2 (en) * 2009-03-04 2014-01-22 富士ゼロックス株式会社 Image composition apparatus, image forming apparatus, and program

Also Published As

Publication number Publication date
JP2002326401A (en) 2002-11-12

Similar Documents

Publication Publication Date Title
JP5558767B2 (en) Image processing apparatus and processing method thereof
JP4766657B2 (en) Image processing apparatus, control method therefor, and program
US8855438B2 (en) Image processing apparatus, image processing method of image processing apparatus, and program
JP2006121645A (en) Image compression apparatus and image compression program
JP3278298B2 (en) Bitmap data compression method and compression apparatus
US9230200B2 (en) Method of processing graphics with limited memory
JPH11150660A (en) Information compressing method and its device, information processing method and its device, and recording medium
JP2008042345A (en) Image processing method and image processor
JP4423812B2 (en) Drawing processing apparatus and drawing processing method
JP2003087558A (en) Apparatus and method for processing image
JP2008078826A (en) Image processor and its control method
JP2007013266A (en) Image processing apparatus and image processing method
JP2001169120A (en) Method, device, and system for image processing
JPH0531974A (en) Image processing device
JP5432690B2 (en) Image coding apparatus and control method thereof
JP3997851B2 (en) Image coding apparatus and image coding program
JP3855731B2 (en) Image coding apparatus and method
JP2010183436A (en) Apparatus, system, method and program for image processing
JP2011139165A (en) Image processing apparatus and processing method thereof
JPH06113145A (en) Image processor
JP4274187B2 (en) Display data decompression method, display data compression / decompression method, display data decompression device, and display data compression / decompression device
JP2006222940A (en) Image processing apparatus
JP5523177B2 (en) Image coding apparatus and control method thereof
JP2006159436A (en) Image forming apparatus and image forming method
JP2000078415A (en) Image processing system, image compressing device and recording medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040913

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080819

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081020

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090421

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090622

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090825

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091022

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20091102

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: 20091117

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20091130

R150 Certificate of patent or registration of utility model

Ref document number: 4423812

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20121218

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20121218

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20131218

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees