JP5760728B2 - Image processing apparatus, image forming apparatus, and program - Google Patents

Image processing apparatus, image forming apparatus, and program Download PDF

Info

Publication number
JP5760728B2
JP5760728B2 JP2011132415A JP2011132415A JP5760728B2 JP 5760728 B2 JP5760728 B2 JP 5760728B2 JP 2011132415 A JP2011132415 A JP 2011132415A JP 2011132415 A JP2011132415 A JP 2011132415A JP 5760728 B2 JP5760728 B2 JP 5760728B2
Authority
JP
Japan
Prior art keywords
format
pattern image
information
edge
pattern
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
JP2011132415A
Other languages
Japanese (ja)
Other versions
JP2013005105A (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 JP2011132415A priority Critical patent/JP5760728B2/en
Publication of JP2013005105A publication Critical patent/JP2013005105A/en
Application granted granted Critical
Publication of JP5760728B2 publication Critical patent/JP5760728B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Description

本発明は画像処理装置、画像形成装置、及びプログラムに関する。   The present invention relates to an image processing apparatus, an image forming apparatus, and a program.

特許文献1には、1ラインデータを参照データとしてラインバッファに格納し、格納データとの比較を行なってデータの符号化又は復号処理を行なう二次元符号化復号処理装置において、参照データを構成するランレングスデータサイズがラインバッファのサイズを超えないときはランレングスデータ形式でラインバッファに格納し、ランレングスデータサイズがラインバッファのサイズより大きいときはビットマップデータ形式で格納する技術が開示されている。   In Patent Document 1, reference data is configured in a two-dimensional encoding / decoding processing apparatus that stores one line data as reference data in a line buffer and compares the stored data with each other to perform data encoding or decoding processing. When the run-length data size does not exceed the size of the line buffer, it is stored in the line buffer in the run-length data format, and when the run-length data size is larger than the size of the line buffer, a technique for storing in the bitmap data format is disclosed. Yes.

また特許文献2には、複数の画像オブジェクト(例えば文字やイメージやグラフィック)で構成されている電子ドキュメント及びPDLデータを受信し、画像を形成する画像形成装置において、ベクターエッジで構成されるディスプレイリストを生成する手段を備え、描画処理の速度の妨げになるラインを抽出する処理を備え、抽出されたラインのみスキャンラインエッジに変換する技術が開示されている。   Further, Patent Document 2 discloses a display list composed of vector edges in an image forming apparatus that receives an electronic document and PDL data composed of a plurality of image objects (for example, characters, images, and graphics) and forms an image. There is disclosed a technique that includes a means for generating a line, a process for extracting a line that hinders the speed of the drawing process, and converting only the extracted line into a scan line edge.

特開2001−078042号公報JP 2001-078042 A 特開2009−101519号公報JP 2009-101519 A

本発明は、描画情報に含まれる定義命令により定義されたパターン画像を該描画情報に含まれる塗りつぶし命令により指定された範囲に配列して塗りつぶす場合において、該塗りつぶし命令の実行の際に該パターン画像を表すパターン画像情報の他にマスク情報が必要なときでも、該パターン画像を表すパターン画像情報を記憶するときの記憶手段の使用量だけでなく、マスク情報を記憶するときの記憶手段の使用量も抑制することができる画像処理装置、画像形成装置、及びプログラムを得ることを目的とする。   In the case where the pattern image defined by the definition command included in the drawing information is arranged and painted in the range specified by the fill command included in the drawing information, the pattern image is executed when the fill command is executed. Even when the mask information is necessary in addition to the pattern image information indicating, not only the usage amount of the storage means when storing the pattern image information indicating the pattern image but also the usage amount of the storage means when storing the mask information It is an object of the present invention to obtain an image processing apparatus, an image forming apparatus, and a program that can suppress the above-described problem.

請求項1の発明の画像処理装置は、パターン画像を定義するための定義命令と、前記定義命令により定義されたパターン画像を指定された範囲に配列して塗りつぶす塗りつぶし命令とを含む描画情報を解釈して実行する際に、前記定義命令により定義された前記パターン画像を、ライン毎に同一の画素値の画素が連続する区間及び該画素値を示すエッジデータを有する第1の形式で表したときの前記エッジデータの数が第1の閾値以下となる場合には、前記パターン画像を前記第1の形式で表したパターン画像情報を第1の記憶手段に記憶するように処理し、前記パターン画像を前記第1の形式で表したときのエッジデータの数が前記第1の閾値を超える場合には、画素毎に画素値を有する第2の形式で前記パターン画像を表したパターン画像情報を前記第1の記憶手段に記憶するように処理する第1の記憶処理手段と、前記第1の記憶手段に記憶されるパターン画像情報が前記第2の形式の場合に、前記第2の形式の前記パターン画像情報から前記塗りつぶし命令の塗りつぶしに使用される画素値を抽出するためのマスク情報を作成し、前記マスク情報を前記第1の形式で表したときのエッジデータの数が第2の閾値以下となる場合には、前記マスク情報を前記第1の形式で表して第2の記憶手段に記憶するように処理し、前記マスク情報を前記第1の形式で表したときのエッジデータの数が前記第2の閾値を超える場合には、前記マスク情報を前記第2の形式で表して前記第2の記憶手段に記憶するように処理する第2の記憶処理手段と、前記第1の記憶手段に記憶したパターン画像情報が前記第1の形式の場合には、該パターン画像情報を用いて前記塗りつぶし命令を実行し、前記第1の記憶手段に記憶したパターン画像情報が前記第2の形式の場合には、該パターン画像情報と共に前記第2の記憶手段に記憶した前記マスク情報も用いて前記塗りつぶし命令を実行する実行手段と、を備えている。 The image processing apparatus according to claim 1 interprets drawing information including a definition command for defining a pattern image and a fill command for arranging and painting the pattern image defined by the definition command in a specified range. When the pattern image defined by the definition command is expressed in a first format having a section in which pixels of the same pixel value continue for each line and edge data indicating the pixel value. When the number of edge data of the pattern data is equal to or less than a first threshold value, the pattern image information representing the pattern image in the first format is stored in a first storage unit , and the pattern image is processed. When the number of edge data when the value is represented in the first format exceeds the first threshold value, the pattern image representing the pattern image in the second format having a pixel value for each pixel. If the first storage processing unit, the pattern image information stored in said first storage means for processing to store information in the first storage means of the second type, the second Mask information for extracting a pixel value used for painting of the painting command from the pattern image information in the format is created, and the number of edge data when the mask information is expressed in the first format is second. The mask information is represented in the first format and stored in the second storage means, and the edge information when the mask information is represented in the first format. If the number of exceeds the second threshold value, a second storage processing means for processing to store the mask information in the second storage means represented by the second type, the first putter stored in the storage means When the image information is the first type, when executing the fill instruction by using the pattern image information, the pattern image information stored in the first storage means of the second type, Execution means for executing the paint command using the mask information stored in the second storage means together with the pattern image information.

請求項2の発明は、請求項1記載の画像処理装置において、前記第2の閾値を、前記マスク情報を前記第1の形式で表したときのデータ量と、前記マスク情報を前記第2の形式で表したときのデータ量と、が等しくなるときのエッジデータの数となるように設定したものである。   According to a second aspect of the present invention, in the image processing apparatus according to the first aspect, the second threshold value, the amount of data when the mask information is expressed in the first format, and the mask information are expressed as the second threshold value. This is set so as to be the number of edge data when the amount of data expressed in the format is equal.

請求項3の発明は、請求項1又は請求項2に記載の画像処理装置において、前記第1の閾値を、前記パターン画像を前記第1の形式で表したときの前記パターン画像情報のデータ量と、前記パターン画像を前記第2の形式で表したときの前記パターン画像情報のデータ量と、が等しくなるときのエッジデータの数となるように設定したものである。
A third aspect of the present invention is the image processing apparatus according to the first or second aspect, wherein the first threshold value is a data amount of the pattern image information when the pattern image is expressed in the first format. And the number of edge data when the data amount of the pattern image information when the pattern image is expressed in the second format is equal.

請求項4の発明は、請求項1又は請求項2に記載の画像処理装置において、前記第1の閾値を、前記パターン画像を前記第1の形式で表したときの前記パターン画像情報のデータ量と、前記パターン画像を前記第2の形式で表したときの前記パターン画像情報のデータ量に前記マスク情報を前記第2の形式で表したときのデータ量を加算した加算データ量と、が等しくなるときの前記パターン画像情報のエッジデータの数となるように設定したものである。   According to a fourth aspect of the present invention, in the image processing apparatus according to the first or second aspect, the first threshold value is a data amount of the pattern image information when the pattern image is expressed in the first format. And an added data amount obtained by adding a data amount when the mask information is expressed in the second format to a data amount of the pattern image information when the pattern image is expressed in the second format. Is set to be the number of edge data of the pattern image information.

請求項5の発明は、請求項1に記載の画像処理装置において、前記第1の記憶処理手段は、ライン単位で前記パターン画像を前記第1の形式で表したときのエッジデータの数が前記第1の閾値以下となるか否かを判断し、前記パターン画像を前記第1の形式で表したときのエッジデータの数が前記第1の閾値以下となるラインについては、前記第1の形式で表したパターン画像情報を前記第1の記憶手段に記憶するように処理し、前記パターン画像を前記第1の形式で表したときのエッジデータの数が前記第1の閾値を超えるラインについては、前記第2の形式で表したパターン画像情報を前記第1の記憶手段に記憶するように処理し、前記第2の記憶処理手段は、ライン単位で前記マスク情報を前記第2の形式で表したときのエッジデータの数が前記第2の閾値以下となるか否かを判断し、前記マスク情報を前記第1の形式で表したときのエッジデータの数が前記第2の閾値以下となるラインについては、前記第1の形式で表したマスク情報を前記第2の記憶手段に記憶するように処理し、前記マスク情報を前記第1の形式で表したときのエッジデータの数が前記第2の閾値を超えるラインについては、前記第2の形式で表した前記マスク情報を前記第2の記憶手段に記憶するように処理する。 According to a fifth aspect of the present invention, in the image processing apparatus according to the first aspect, the first storage processing unit is configured such that the number of edge data when the pattern image is expressed in the first format in units of lines is It is determined whether or not the first threshold value is equal to or less than the first threshold value, and the line of which the number of edge data when the pattern image is expressed in the first format is equal to or less than the first threshold value is the first format. For the line in which the number of edge data when the pattern image is expressed in the first format exceeds the first threshold value is processed so as to be stored in the first storage means. The pattern image information expressed in the second format is processed so as to be stored in the first storage means, and the second storage processing means expresses the mask information in the second format in line units. Edge data when It is determined whether or not the number is equal to or less than the second threshold value, and the line having the number of edge data when the mask information is expressed in the first format is equal to or less than the second threshold value is A line in which the mask information expressed in the format 1 is processed so as to be stored in the second storage means, and the number of edge data when the mask information is expressed in the first format exceeds the second threshold value Is processed so that the mask information expressed in the second format is stored in the second storage means .

請求項6の発明は、請求項5記載の画像処理装置において、前記第2の閾値を、前記マスク情報を前記第1の形式で表したときの1ライン分データ量と、前記マスク情報を前記第2の形式で表したときの1ライン分のデータ量と、が等しくなるときのエッジデータの数となるように設定したものである。   According to a sixth aspect of the present invention, in the image processing apparatus according to the fifth aspect, the second threshold value, the data amount for one line when the mask information is expressed in the first format, and the mask information are The data amount for one line when expressed in the second format is set to be the number of edge data when equal.

請求項7の発明は、請求項5又は請求項6に記載の画像処理装置において、前記第1の閾値を、前記パターン画像を前記第1の形式で表したときの1ライン分のデータ量と、前記パターン画像を前記第2の形式で表したときの1ライン分のデータ量と、が等しくなるときのエッジデータの数となるように設定したものである。   According to a seventh aspect of the present invention, in the image processing apparatus according to the fifth or sixth aspect, the first threshold value is a data amount for one line when the pattern image is expressed in the first format. The data amount for one line when the pattern image is expressed in the second format is set to be the number of edge data when equal.

請求項8の発明は、請求項6又は請求項7に記載の画像処理装置において、前記第1の閾値を、前記パターン画像を前記第1の形式で表したときの1ライン分のデータ量と、前記パターン画像を前記第2の形式で表したときの1ライン分のデータ量に前記マスク情報を前記第2の形式で表したときの1ライン分のデータ量を加算した加算データ量と、が等しくなるときの前記パターン画像情報のエッジデータの数となるように設定したものである。   The invention according to claim 8 is the image processing apparatus according to claim 6 or 7, wherein the first threshold value is a data amount for one line when the pattern image is expressed in the first format. An added data amount obtained by adding a data amount for one line when the mask information is expressed in the second format to a data amount for one line when the pattern image is expressed in the second format; Are set so as to be the number of edge data of the pattern image information when.

請求項9の発明の画像形成装置は、請求項1〜請求項8のいずれか1項記載の画像処理装置と、前記画像処理装置により前記塗りつぶし命令が実行されて生成された出力画像情報に基づいて画像を形成する画像形成手段と、を備えている。   An image forming apparatus according to a ninth aspect of the present invention is based on the image processing apparatus according to any one of the first to eighth aspects and output image information generated by executing the paint command by the image processing apparatus. Image forming means for forming an image.

請求項10の発明は、コンピュータを、パターン画像を定義するための定義命令と、前記定義命令により定義されたパターン画像を指定された範囲に配列して塗りつぶす塗りつぶし命令とを含む描画情報を解釈して実行する際に、前記定義命令により定義された前記パターン画像を、ライン毎に同一の画素値の画素が連続する区間及び該画素値を示すエッジデータを有する第1の形式で表したときの前記エッジデータの数が第1の閾値以下となる場合には、前記パターン画像を前記第1の形式で表したパターン画像情報を第1の記憶手段に記憶するように処理し、前記パターン画像を前記第1の形式で表したときのエッジデータの数が前記第1の閾値を超える場合には、画素毎に画素値を有する第2の形式で前記パターン画像を表したパターン画像情報を前記第1の記憶手段に記憶するように処理する第1の記憶処理手段、前記第1の記憶手段に記憶されるパターン画像情報が前記第2の形式の場合に、前記第2の形式の前記パターン画像情報から前記塗りつぶし命令の塗りつぶしに使用される画素値を抽出するためのマスク情報を作成し、前記マスク情報を前記第1の形式で表したときのエッジデータの数が第2の閾値以下となる場合には、前記マスク情報を前記第1の形式で表して第2の記憶手段に記憶するように処理し、前記マスク情報を前記第1の形式で表したときのエッジデータの数が前記第2の閾値を超える場合には、前記マスク情報を前記第2の形式で表して前記第2の記憶手段に記憶するように処理する第2の記憶処理手段、及び前記第1の記憶手段に記憶したパターン画像情報が前記第1の形式の場合には、該パターン画像情報を用いて前記塗りつぶし命令を実行し、前記第1の記憶手段に記憶したパターン画像情報が前記第2の形式の場合には、該パターン画像情報と共に前記第2の記憶手段に記憶した前記マスク情報も用いて前記塗りつぶし命令を実行する実行手段と、として機能させるためのプログラムである。 According to a tenth aspect of the present invention, the computer interprets drawing information including a definition command for defining a pattern image and a fill command for arranging and painting the pattern image defined by the definition command in a specified range. When the pattern image defined by the definition command is expressed in a first format having a section in which pixels of the same pixel value continue for each line and edge data indicating the pixel value. When the number of edge data is equal to or less than a first threshold value, processing is performed so that pattern image information representing the pattern image in the first format is stored in a first storage unit , and the pattern image is When the number of edge data expressed in the first format exceeds the first threshold, the pattern image representing the pattern image in the second format having a pixel value for each pixel. First storage processing means for processing to store the image information in the first storage means, when the pattern image information stored in the first storage means of the second type, the second Mask information for extracting a pixel value used for painting of the painting command from the pattern image information in the format is created, and the number of edge data when the mask information is expressed in the first format is second. The mask information is represented in the first format and stored in the second storage means, and the edge information when the mask information is represented in the first format. Second storage processing means for processing the mask information in the second format and storing it in the second storage means when the number exceeds the second threshold, and the first Pa stored in the storage means If over down image information of the first format, perform the fill instruction by using the pattern image information, if the pattern image information stored in the first storage means of the second type Is a program for functioning as execution means for executing the paint command using the mask information stored in the second storage means together with the pattern image information.

請求項1に記載の発明は、本発明は、描画情報に含まれる定義命令により定義されたパターン画像を該描画情報に含まれる塗りつぶし命令により指定された範囲に配列して塗りつぶす場合において、該塗りつぶし命令の実行の際に該パターン画像を表すパターン画像情報の他にマスク情報が必要なときでも、該パターン画像を表すパターン画像情報を記憶するときの第1の記憶手段の使用量だけでなく、マスク情報を記憶するときの第2の記憶手段の使用量も抑制することができる、という効果を有する。 According to the first aspect of the present invention, in the case where the pattern image defined by the definition command included in the drawing information is arranged and painted in a range specified by the fill command included in the drawing information, Even when mask information is required in addition to the pattern image information representing the pattern image at the time of execution of the instruction, not only the amount of use of the first storage means when storing the pattern image information representing the pattern image, The amount of use of the second storage means when storing the mask information can be suppressed.

請求項2に記載の発明は、本構成を有しない場合に比べて、マスク情報を記憶するために必要な第2の記憶手段の使用量を抑えることができる、という効果を有する。   The invention according to claim 2 has an effect that the amount of use of the second storage means necessary for storing the mask information can be suppressed as compared with the case where this configuration is not provided.

請求項3に記載の発明は、本構成を有しない場合に比べて、パターン画像情報を格納するために必要な第1の記憶手段の使用量を抑えることができる、という効果を有する。   The invention described in claim 3 has an effect that the amount of the first storage means required for storing the pattern image information can be suppressed as compared with the case where the present configuration is not provided.

請求項4に記載の発明は、本構成を有しない場合に比べて、パターン画像情報を格納するために必要な第1の記憶手段の使用量と、マスク情報を格納するために必要な第2の記憶手段の使用量と、を合計した合計使用量を抑えることができる。   According to the invention described in claim 4, compared to the case where the present configuration is not provided, the usage amount of the first storage means required for storing the pattern image information and the second required for storing the mask information are stored. The total usage amount of the storage means can be reduced.

請求項5に記載の発明は、本構成を有しない場合に比べて、ライン毎に第1の記憶手段及び第2の記憶手段の使用量を抑制することができる、という効果を有する。   The invention according to claim 5 has an effect that the amount of use of the first storage means and the second storage means can be suppressed for each line as compared with the case where this configuration is not provided.

請求項6に記載の発明は、本構成を有しない場合に比べて、マスク情報を記憶するために必要な第2の記憶手段の使用量を抑えることができる、という効果を有する。   The invention according to claim 6 has an effect that the amount of the second storage means required for storing the mask information can be reduced as compared with the case where the present configuration is not provided.

請求項7に記載の発明は、本構成を有しない場合に比べて、パターン画像情報を格納するために必要な第1の記憶手段の使用量を抑えることができる、という効果を有する。   The invention according to claim 7 has an effect that the amount of use of the first storage means necessary for storing the pattern image information can be suppressed as compared with the case where the present configuration is not provided.

請求項8に記載の発明は、本構成を有しない場合に比べて、パターン画像情報を格納するために必要な第1の記憶手段の使用量と、マスク情報を格納するために必要な第2の記憶手段の使用量と、を合計した合計使用量を抑えることができる、という効果を有する。   According to the eighth aspect of the present invention, the usage amount of the first storage means required for storing the pattern image information and the second required for storing the mask information are compared with the case where the present configuration is not provided. It is possible to reduce the total amount of use of the storage means.

請求項10に記載の発明は、本発明は、描画情報に含まれる定義命令により定義されたパターン画像を該描画情報に含まれる塗りつぶし命令により指定された範囲に配列して塗りつぶす場合において、該塗りつぶし命令の実行の際に該パターン画像を表すパターン画像情報の他にマスク情報が必要なときでも、該パターン画像を表すパターン画像情報を記憶するときの記憶手段の使用量だけでなく、マスク情報を記憶するときの記憶手段の使用量も抑制することができる、という効果を有する。   The present invention described in claim 10 is directed to a case where the pattern image defined by the definition command included in the drawing information is arranged and painted in a range specified by the fill command included in the drawing information. Even when mask information is required in addition to the pattern image information representing the pattern image at the time of execution of the instruction, not only the usage amount of the storage means for storing the pattern image information representing the pattern image but also the mask information It has the effect that the amount of storage means used when storing can also be suppressed.

請求項11に記載の発明は、本発明は、描画情報に含まれる定義命令により定義されたパターン画像を該描画情報に含まれる塗りつぶし命令により指定された範囲に配列して塗りつぶす場合において、該塗りつぶし命令の実行の際に該パターン画像を表すパターン画像情報の他にマスク情報が必要なときでも、該パターン画像を表すパターン画像情報を記憶するときの記憶手段の使用量だけでなく、マスク情報を記憶するときの記憶手段の使用量も抑制することができる、という効果を有する。   The invention according to claim 11 is the case where the pattern image defined by the definition command included in the drawing information is arranged and painted in a range specified by the fill command included in the drawing information. Even when mask information is required in addition to the pattern image information representing the pattern image at the time of execution of the instruction, not only the usage amount of the storage means for storing the pattern image information representing the pattern image but also the mask information It has the effect that the amount of storage means used when storing can also be suppressed.

画像形成装置の構成の一例を示す概略ブロック図である。1 is a schematic block diagram illustrating an example of a configuration of an image forming apparatus. PDLデータに含まれる命令の処理内容を模式的に示す模式図である。It is a schematic diagram which shows typically the processing content of the command contained in PDL data. (A)は、パターン画像における、塗りつぶし範囲の始点座標(x_start, y_start)に対応する座標(ptn_x, ptn_y)を示す図であり、(B)は、該座標(ptn_x, ptn_y)をパターン画像の描画を開始する開始点としてパターン画像を塗りつぶし範囲に配列して敷き詰めた状態を示す図である。(A) is a figure which shows the coordinate (ptn_x, ptn_y) corresponding to the starting point coordinate (x_start, y_start) of the filling range in a pattern image, (B) is a figure which shows this coordinate (ptn_x, ptn_y) of a pattern image. It is a figure which shows the state which arranged and spread the pattern image in the filling range as a starting point which starts drawing. (A)は、パターン画像によるパターン塗りつぶし処理より先に描画された画像を示す図であり、(B)は、該先に(A)に示す画像が描画された後に、画像領域と非画像領域とを含むパターン画像が描画された状態を示す図である。(A) is a figure which shows the image drawn before the pattern filling process by a pattern image, (B) is an image area | region and a non-image area | region after the image shown to (A) is drawn ahead in this (A) Is a diagram showing a state in which a pattern image including (A)は、カラーのパターン画像をラスタ形式で表したときのパターン画像情報を模式的に示す図であり、(B)は、カラーのパターン画像、白黒のパターン画像、及びマスク情報をラスタ形式で表したときのメモリ使用量を示すテーブルである。(A) is a diagram schematically showing pattern image information when a color pattern image is expressed in a raster format, and (B) is a color pattern image, a monochrome pattern image, and mask information in a raster format. It is a table which shows the memory usage when it represents with. (A)は、パターン画像をエッジリスト形式で表したときのエッジリストの一例を模式的に示した図であり、(B)は、マスク情報をエッジリストで表したときのエッジリストの一例を模式的に示した図である。(A) is a diagram schematically showing an example of an edge list when a pattern image is represented in an edge list format, and (B) is an example of an edge list when mask information is represented by an edge list. It is the figure shown typically. (A)は、エッジリスト形式のパターン画像情報の一例であり、(B)は、(A)のパターン画像情報により表されるパターン画像を模式的に示す図である。(A) is an example of pattern image information in an edge list format, and (B) is a diagram schematically showing a pattern image represented by the pattern image information of (A). (A)は、カラーのパターン画像をエッジリスト形式で表したときのエッジリストの一例を模式的に示した図であり、(B)は、カラーのパターン画像、白黒のパターン画像、及びマスク情報をエッジリスト形式で表したときのメモリ使用量を示すテーブルである。(A) is a diagram schematically showing an example of an edge list when a color pattern image is represented in an edge list format, and (B) is a color pattern image, a monochrome pattern image, and mask information. Is a table showing the amount of memory used when is expressed in an edge list format. パターン画像の一例を示す図である。It is a figure which shows an example of a pattern image. 図9に示すパターン画像を定義するための定義命令の疑似コードである。10 is a pseudo code of a definition instruction for defining the pattern image shown in FIG. 9. 図9に示すパターン画像をエッジリスト形式で表したパターン画像情報を模式的に示した図である。It is the figure which showed typically the pattern image information which represented the pattern image shown in FIG. 9 in the edge list format. 図9に示すパターン画像をラスタ形式で表したパターン画像情報を模式的に示すと共に、ラスタ形式で表したマスク情報を模式的に示した図である。FIG. 10 is a diagram schematically showing pattern image information representing the pattern image shown in FIG. 9 in a raster format, and schematically showing mask information represented in a raster format. 図9に示すパターン画像をラスタ形式で表したパターン画像情報を模式的に示すと共に、エッジリスト形式で表したマスク情報を模式的に示した図である。FIG. 10 is a diagram schematically showing pattern image information in which the pattern image shown in FIG. 9 is represented in a raster format, and mask information in which an edge list format is represented. 定義命令によるパターン定義処理の一例を示す概略的なフローチャートである。It is a schematic flowchart which shows an example of the pattern definition process by a definition command. (A)は、パターン塗りつぶし命令の疑似コードであり、(B)は、(A)に示すパターン塗りつぶし命令が実行されたときの出力画像を示す図である。(A) is a pseudo code of a pattern fill command, and (B) is a diagram showing an output image when the pattern fill command shown in (A) is executed. PDLデータ処理のメインルーチンのフローチャートを示す図である。It is a figure which shows the flowchart of the main routine of a PDL data process. パターン管理テーブルの一例を示す図である。It is a figure which shows an example of a pattern management table. パターン定義処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a pattern definition process. エッジリスト形式のパターン画像に対する描画処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the drawing process with respect to the pattern image of an edge list format. イメージ描画コマンドのエッジリスト形式描画処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the edge list format drawing process of an image drawing command. エッジの切り出し処理の流れを示すフローチャートである。It is a flowchart which shows the flow of an edge cut-out process. エッジリストへのエッジデータ追加処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the edge data addition process to an edge list. エッジ挿入処理の流れを示すフローチャートである。It is a flowchart which shows the flow of an edge insertion process. パターン画像情報のエッジ挿入処理を説明する説明図である。It is explanatory drawing explaining the edge insertion process of pattern image information. グラフィックス描画コマンドのエッジリスト形式描画処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the edge list format drawing process of a graphics drawing command. 文字描画コマンドのエッジリスト形式描画処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the edge list format drawing process of a character drawing command. 文字のエッジ抽出処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the edge extraction process of a character. 黒座標の検出処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the detection process of a black coordinate. 白座標の検出処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a detection process of a white coordinate. パターン画像情報をラスタ形式に変換する変換処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the conversion process which converts pattern image information into a raster format. マスク情報のエッジ挿入処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the edge insertion process of mask information. ラスタ形式のパターン画像に対する描画処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the drawing process with respect to the pattern image of a raster format. イメージ描画コマンドのラスタ形式描画処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the raster format drawing process of an image drawing command. マスク情報へのマスク範囲の追加処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the addition process of the mask range to mask information. マスク情報をラスタ形式に変換する処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process which converts mask information into a raster format. グラフィックス描画コマンドのラスタ形式描画処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the raster format drawing process of a graphics drawing command. 文字描画コマンドのラスタ形式描画処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the raster format drawing process of a character drawing command. パターン塗りつぶし処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a pattern filling process. 塗りつぶし処理を概念的に説明する説明図である。It is explanatory drawing which illustrates a filling process notionally. ラスタ形式パターンの塗りつぶし処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the painting process of a raster format pattern. エッジリスト形式パターンの塗りつぶし処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the painting process of an edge list format pattern. ハイブリッド形式パターンの塗りつぶし処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the painting process of a hybrid format pattern.

以下、図面を参照して画像形成装置の一実施形態を詳細に説明する。図1には本実施形態に係る画像形成装置10が示されている。画像形成装置10には、装置制御部12と、セットされた読取対象の文書(紙原稿)を光学的に読み取って読取画像データを出力する画像読取部14と、入力された出力画像情報が表す出力画像を記録用紙等の記録媒体上に形成する画像形成部16と、LCD等から成る表示部18A及びテンキーやタッチパネル等から成り利用者による操作を受付ける操作受付部18Bが設けられた操作パネル18と、ファクシミリ装置としての機能を備えた他の機器と電話線及び公衆通信網(図示省略)経由で画情報の送受信(ファクシミリ通信)を行なう画情報送受信部20と、PC(Personal Computer)等の情報処理装置とネットワークケーブル及びコンピュータネットワーク(図示省略)経由で情報の送受信を行なうためのネットワーク通信制御部22と、が設けられており、これらはバス24を介して互いに接続されている。   Hereinafter, an embodiment of an image forming apparatus will be described in detail with reference to the drawings. FIG. 1 shows an image forming apparatus 10 according to this embodiment. The image forming apparatus 10 includes an apparatus control unit 12, an image reading unit 14 that optically reads a set document (paper original) to be read and outputs read image data, and input output image information. An operation panel 18 provided with an image forming unit 16 that forms an output image on a recording medium such as a recording sheet, a display unit 18A composed of an LCD or the like, and an operation accepting unit 18B composed of a numeric keypad, a touch panel, etc. An image information transmitting / receiving unit 20 for transmitting / receiving image information (facsimile communication) to / from other devices having a function as a facsimile apparatus via a telephone line and a public communication network (not shown), and a PC (Personal Computer), etc. A network communication control unit 22 for transmitting / receiving information via an information processing device, a network cable, and a computer network (not shown); Cage, which are connected to each other via a bus 24.

装置制御部12はマイクロコンピュータ等から成り、CPU12A、メモリ12B、HDD(Hard Disk Drive)やフラッシュメモリ等から成る不揮発性の記憶部12Cが設けられている。記憶部12Cには、各種プログラム(描画情報を解釈して実行する画像処理のプログラムも含まれる。詳細は後述する)及び必要なデータ等が各々記憶されている。装置制御部12は請求項1等に記載の画像処理装置の一例であり、CPU12Aが画像処理プログラムを実行することで画像処理装置の一例として機能する。   The device control unit 12 includes a microcomputer and the like, and is provided with a non-volatile storage unit 12C including a CPU 12A, a memory 12B, an HDD (Hard Disk Drive), a flash memory, and the like. The storage unit 12C stores various programs (including an image processing program that interprets and executes drawing information, details will be described later), necessary data, and the like. The apparatus control unit 12 is an example of an image processing apparatus described in claim 1 and the like, and functions as an example of an image processing apparatus when the CPU 12A executes an image processing program.

画像形成部16は、装置制御部12により行われた画像処理により生成された出力画像情報に基づいて、記録用紙等に画像を形成する。   The image forming unit 16 forms an image on a recording sheet or the like based on output image information generated by image processing performed by the apparatus control unit 12.

本実施の形態では、前述したように装置制御部12の画像処理の機能により、入力された描画情報が解釈されて出力画像情報が生成され、ページバッファに書き込まれる。描画情報は、ポストスクリプト等のページ記述言語(Page Description Language)により記述された情報であり、本実施の形態では少なくとも定義命令及び塗りつぶし命令を含むものとする。以下、描画情報をPDLデータと呼称する。   In the present embodiment, as described above, the image processing function of the apparatus control unit 12 interprets the input drawing information, generates output image information, and writes the output image information in the page buffer. The drawing information is information described in a page description language (Page Description Language) such as a postscript, and in this embodiment, includes at least a definition command and a paint command. Hereinafter, the drawing information is referred to as PDL data.

定義命令は、パターン画像を定義するための命令である。本実施の形態において、定義命令は、1又は複数のコマンドを含んで構成される。   The definition command is a command for defining a pattern image. In the present embodiment, the definition instruction includes one or a plurality of commands.

塗りつぶし命令は、出力画像情報をページバッファに書き込むための描画命令の一種であって、出力画像の指定された範囲(以下、塗りつぶし範囲)を指定された色で塗りつぶすか或いはパターン画像を配列して塗りつぶす。以下、パターン画像を用いた塗りつぶし命令をパターン塗りつぶし命令と呼称し、指定された色で塗りつぶす塗りつぶし命令(色塗りつぶし命令)と区別して説明する。なお、本実施の形態において、各描画命令も、定義命令と同様、1又は複数のコマンドを含んで構成される。   A fill command is a kind of drawing command for writing output image information to a page buffer, and a specified range of an output image (hereinafter referred to as a fill range) is filled with a specified color or a pattern image is arranged. Fill. Hereinafter, a paint command using a pattern image is referred to as a pattern paint command, and will be described separately from a paint command (color paint command) for painting with a specified color. In the present embodiment, each drawing command is also configured to include one or a plurality of commands, like the definition command.

なお、パターン塗りつぶし命令では、パターン画像が繰り返し用いられ塗りつぶし範囲に複写されるため、パターン画像を表す情報(パターン画像情報という)を、出力画像情報とは別に、中間画像データとしてメモリ12Bの領域に格納しておく必要がある。本実施の形態では、定義命令の実行により、パターン画像情報がメモリ12Bのメモリ領域に記憶される。また、後述するが、定義命令において作成されるパターン画像情報のデータ形式によっては、パターン画像情報の他に、マスク情報が作成されメモリ領域に記憶される場合もある。   In the pattern fill command, since the pattern image is repeatedly used and copied to the fill range, information representing the pattern image (referred to as pattern image information) is stored in the area of the memory 12B as intermediate image data separately from the output image information. Must be stored. In the present embodiment, the pattern image information is stored in the memory area of the memory 12B by executing the definition instruction. As will be described later, depending on the data format of the pattern image information created in the definition command, mask information may be created and stored in the memory area in addition to the pattern image information.

また、本実施の形態では、幅方向(水平方向)の軸をX軸、高さ方向(垂直方向)の軸をY軸とするX−Y座標系で位置を表すものとする。また、矩形領域における左上座標を(0,0)とする。   Further, in the present embodiment, the position is represented by an XY coordinate system in which the axis in the width direction (horizontal direction) is the X axis and the axis in the height direction (vertical direction) is the Y axis. Further, the upper left coordinate in the rectangular area is (0, 0).

ここで、本実施の形態の作用を概念的に説明する。本実施の形態において、PDLデータに基づく画像処理は、図2に示すように、PDLデータに含まれる命令の記述順に実行される。図2では、PDLデータの命令に含まれる各コマンドを、擬似的或いは模式的に示しており、31がパターン属性定義コマンドの疑似コード、321〜3が模式的に示した描画コマンド(32はグラフィックス描画コマンド、32は文字描画コマンド、32はイメージ描画コマンドを示している)、33がカレントパターン設定コマンドの疑似コード,34が塗りつぶしコマンドの疑似コードであり、これら各コマンドが、この順にPDLデータに記述されているものとする。 Here, the operation of the present embodiment will be conceptually described. In the present embodiment, image processing based on PDL data is executed in the order of description of instructions included in PDL data, as shown in FIG. In FIG. 2, each command included in the instruction of the PDL data is shown in a pseudo or schematic manner, 31 is a pseudo code of the pattern attribute definition command, and 32 to 1 are drawing commands (32 1 ) schematically shown. graphics drawing command, 32 2 character drawing command, 32 3 shows an image drawing command), 33 pseudocode current pattern setting command 34 is pseudo-code of the fill command, these commands, The PDL data is described in this order.

ここで、パターン属性定義コマンド31及び描画コマンド321〜3は、定義命令に含まれるコマンドである。パターン属性定義コマンド31は、パターン画像のサイズ等、パターン画像の属性を定義するためのコマンドである。なお、パターン属性にはサイズの他、パターン名が含まれていてもよい。描画コマンド321〜3は、パターン属性定義コマンドにより定義されたサイズの矩形領域に画像を描画するコマンドであり、描画コマンド321〜3により画像が描画される領域を画像領域という。 Here, the pattern attribute definition command 31 and the drawing commands 32 1 to 3 are commands included in the definition command. The pattern attribute definition command 31 is a command for defining pattern image attributes such as the size of the pattern image. The pattern attribute may include a pattern name in addition to the size. The drawing commands 32 1 to 3 are commands for drawing an image in a rectangular area having a size defined by the pattern attribute definition command, and an area in which an image is drawn by the drawing commands 32 1 to 3 is referred to as an image area.

カレントパターン設定コマンド33及び塗りつぶしコマンドは、パターン塗りつぶし命令に含まれるコマンドである。カレントパターン設定コマンド33は、塗りつぶし範囲に配列するパターン画像を設定するコマンドである。塗りつぶしコマンド33は、該カレントパターン設定コマンドで設定されたパターン画像により塗りつぶす処理を実行するためのコマンドである。   The current pattern setting command 33 and the fill command are commands included in the pattern fill command. The current pattern setting command 33 is a command for setting a pattern image arranged in the filled range. The fill command 33 is a command for executing a fill process using the pattern image set by the current pattern setting command.

まず、パターン属性定義コマンド31により、パターン画像の始点を示す座標(0,0)と、パターン画像の幅100画素、及び高さ100画素の各々が定義される。これにより、メモリ12B内のパターン用バッファ内に、始点を基準として(ここでは矩形の左上を基準とする)、幅が100画素、高さが100画素のパターン画像を表すパターン画像情報を一時的に格納するためのパターン画像用のメモリ領域が確保される(図2(1)も参照)。高さが100画素であるため、該パターン画像を構成する水平方向のライン(スキャンライン)の数は100本となる。なお、本実施の形態において、図2に示されるマスク情報(詳細は後述する)を格納するためのメモリ領域は、描画コマンドによるパターン作成中に必要に応じて確保されるものである。詳細は後述する。   First, the pattern attribute definition command 31 defines coordinates (0, 0) indicating the start point of the pattern image, and each of the pattern image width 100 pixels and height 100 pixels. As a result, pattern image information representing a pattern image having a width of 100 pixels and a height of 100 pixels is temporarily stored in the pattern buffer in the memory 12B with reference to the start point (here, the upper left corner of the rectangle is used as a reference). A memory area for the pattern image to be stored in is stored (see also FIG. 2 (1)). Since the height is 100 pixels, the number of horizontal lines (scan lines) constituting the pattern image is 100. In the present embodiment, the memory area for storing the mask information (details will be described later) shown in FIG. 2 is secured as necessary during pattern creation by the drawing command. Details will be described later.

続いて、グラフィックス描画コマンド31により、上記定義されたサイズの矩形領域の指定された位置に、図形等のグラフィックス画像が描画される。更に、文字描画コマンド31により、上記矩形領域の指定された位置に、文字を表す文字画像が追加的に描画される。更に、イメージ描画コマンド31により、上記矩形領域の指定された位置に、自然画や写真画等のイメージ画像が追加的に描画される。描画コマンドを処理する毎にパターン画像が編集され、定義命令に含まれる描画コマンドの各々が実行され最終的なパターン画像ができあがる。このように、複数或いは1つの描画コマンドにより、例えば図2に示すパターン画像が作成される。作成されたパターン画像を示すパターン画像情報は、前述したパターン画像用のメモリ領域に格納される。 Subsequently, the graphics drawing command 31 1, to the specified position of the rectangular area of the defined size, the graphics image of the figure or the like is drawn. Further, by the character drawing command 312, the specified position of the rectangular area, a character image representing the character is additionally drawn. Further, by the image drawing command 313, the specified position of the rectangular area, images such as natural image or photographic image is additionally drawn. Each time a drawing command is processed, the pattern image is edited, and each drawing command included in the definition command is executed to complete a final pattern image. Thus, for example, a pattern image shown in FIG. 2 is created by a plurality of or one drawing command. The pattern image information indicating the created pattern image is stored in the above-described pattern image memory area.

なお、図2では、複数の描画コマンドの画像領域が重ならないパターン画像が図示されているが、複数の描画コマンドの画像領域が重なる場合には、後から描画される画像が優先され、先に描画された画像の画素値が後に描画される画像の画素値に置き換えられる。また、定義命令においては、パターン画像の描画コマンドにより画像が描画される画像領域以外の非画像領域の画素値については指定がない(データがない)。   In FIG. 2, a pattern image in which the image areas of a plurality of drawing commands do not overlap is illustrated. However, when the image areas of a plurality of drawing commands overlap, the image drawn later is given priority. The pixel value of the drawn image is replaced with the pixel value of the image drawn later. In the definition command, there is no specification (no data) for pixel values in non-image areas other than the image area in which an image is drawn by a pattern image drawing command.

次に、パターン塗りつぶし命令の処理に移行する。パターン塗りつぶし命令に含まれるカレントパターン設定コマンド33により指定された(上記定義命令により定義済みの)パターン画像が、塗りつぶし範囲に配列するパターン画像(カレントパターン)に設定される(図2(3)も参照。)。   Next, the process proceeds to processing of a pattern fill command. The pattern image specified by the current pattern setting command 33 included in the pattern fill command (defined by the definition command) is set as a pattern image (current pattern) arranged in the fill range (FIG. 2 (3) is also shown). reference.).

次に、塗りつぶしコマンド34により、上記メモリ領域に格納されたパターン画像情報が読み出されて繰り返し用いられ、出力画像における指定された塗りつぶし範囲にパターン画像が配列されて敷き詰められる。該塗りつぶし命令の実行によりパターン画像が配列された出力画像を示す出力画像情報は、メモリ12Bに確保された出力画像情報用の記憶領域(ページバッファ)に、画素毎に画素値を有するラスタ形式で格納される(図2(4)も参照。)。図2に擬似的に示した塗りつぶしコマンド34では、塗りつぶし範囲の始点座標(50,50)と、塗りつぶし範囲の幅150画素、及び高さ200画素が指定されている。従って、該塗りつぶしコマンド34により、該始点の座標(50,50)を左上の座標として幅150画素、高さ200画素の矩形の塗りつぶし範囲に、上記パターン画像が配列されることになる。   Next, the pattern image information stored in the memory area is read out and repeatedly used by the fill command 34, and the pattern image is arranged and spread over the designated fill range in the output image. The output image information indicating the output image in which the pattern image is arranged by the execution of the paint command is stored in a raster format having a pixel value for each pixel in the output image information storage area (page buffer) secured in the memory 12B. Stored (see also FIG. 2 (4)). In the fill command 34 shown in a pseudo manner in FIG. 2, the start point coordinates (50, 50) of the fill range, the width 150 pixels of the fill range, and the height of 200 pixels are designated. Accordingly, the pattern command is arranged in a rectangular fill range having a width of 150 pixels and a height of 200 pixels with the coordinates (50, 50) of the start point as the upper left coordinates by the fill command 34.

図3(A)に示すように、パターン画像を塗りつぶし範囲に配列する際には、パターン画像において、塗りつぶし範囲の始点の座標(x_start, y_start)に対応する座標(ptn_x, ptn_y)を求め、図3(B)に示すように、該座標(ptn_x, ptn_y)をパターン画像の描画を開始する開始点として塗りつぶし範囲に敷き詰める。従って、塗りつぶし命令で指定された座標によっては、図2,図3に示すように、塗りつぶし範囲に対して、パターン画像がパターン画像の始点から配列されない場合もある。   As shown in FIG. 3A, when the pattern image is arranged in the filled area, coordinates (ptn_x, ptn_y) corresponding to the coordinates (x_start, y_start) of the starting point of the filled area are obtained in the pattern image. As shown in FIG. 3B, the coordinates (ptn_x, ptn_y) are spread over the filled range as the starting point for starting drawing of the pattern image. Therefore, depending on the coordinates specified by the fill command, as shown in FIGS. 2 and 3, the pattern image may not be arranged from the start point of the pattern image with respect to the fill range.

また、PDLデータに、上記パターン画像によるパターン塗りつぶし命令以外に他の描画命令が含まれている場合もある。その場合には、パターン塗りつぶし命令より先に記述された描画命令により描画された画像に対して上書きするようにパターン塗りつぶし命令が実行される。   In addition, there are cases where the PDL data includes other drawing commands in addition to the pattern painting command using the pattern image. In this case, the pattern fill command is executed so as to overwrite the image drawn by the drawing command described before the pattern fill command.

一方、パターン定義において上記描画コマンドにより画像が描画される画像領域以外の非画像領域は、画素値のデータがない領域である。従って、PDLデータにおいて、図4(A)に示すように、該パターン画像によるパターン塗りつぶし命令より先に何らかの画像を描画する命令が記述されていた場合には、該命令により先に描画された画像の描画領域とパターン画像の非画像領域とが重なる領域においては、図4(B)に示すように、該先に描画された画像の画素値は、パターン画像の画素値により上書きされずにそのままページバッファに保持される。従って、パターン画像の非画像領域は、先に描画された画像(背景)が透過される状態となる。   On the other hand, a non-image area other than an image area in which an image is drawn by the drawing command in the pattern definition is an area without pixel value data. Therefore, in the PDL data, as shown in FIG. 4A, when a command for drawing some image is described prior to the pattern painting command by the pattern image, the image drawn first by the command is displayed. In the area where the drawing area of the pattern image overlaps with the non-image area of the pattern image, as shown in FIG. 4B, the pixel value of the previously drawn image is not overwritten by the pixel value of the pattern image. Stored in the page buffer. Therefore, the non-image area of the pattern image is in a state where the previously drawn image (background) is transmitted.

なお、上記で説明した定義命令やパターン塗りつぶし命令を構成するコマンドは一例であって、PDLデータにおける定義命令やパターン塗りつぶし命令の記述は特に限定されない。   Note that the commands constituting the definition command and pattern fill command described above are examples, and the description of the definition command and pattern fill command in the PDL data is not particularly limited.

ところで、本実施の形態において、パターン画像情報及び後述するマスク情報をメモリ12Bに格納する際のデータ形式は2種類ある。1つは前述したラスタ形式である。   By the way, in this embodiment, there are two types of data formats for storing pattern image information and mask information described later in the memory 12B. One is the raster format described above.

図5(A)に示すように、カラーのパターン画像情報をラスタ形式で表す場合には、ブラック(K)色、イエロー(Y)色、マゼンタ(M)色、シアン(C)色の各々の画素値(パターン画像においては色値ともいう)が画素毎に保持される。本実施の形態では、上記KYMC各色の各々を1バイトの値で表すようにしているため、カラーの色値を表すには1画素につき4バイト必要となる。   As shown in FIG. 5A, when the color pattern image information is expressed in a raster format, each of black (K) color, yellow (Y) color, magenta (M) color, and cyan (C) color is displayed. A pixel value (also referred to as a color value in the pattern image) is held for each pixel. In this embodiment, each of the KYMC colors is represented by a 1-byte value, so that 4 bytes are required for each pixel to represent the color value of the color.

従って、図5(B)に示すように、幅がwidth、高さがheightのカラーのパターン画像情報をラスタ形式で表してメモリ12Bに格納するときのメモリ使用量は、4×width×height(バイト)となる。   Accordingly, as shown in FIG. 5B, the amount of memory used when the color pattern image information having a width of width and a height of height is expressed in a raster format and stored in the memory 12B is 4 × width × height ( Byte).

白黒のパターン画像情報をラスタ形式で表す場合には、ブラックの色値が画素毎に保持されるため、1画素につき1バイト必要となる。従って、図5(B)に示すように、幅がwidth、高さがheightの白黒のパターン画像情報をラスタ形式で表してメモリ12Bに格納するときのメモリ使用量は、width×height(バイト)となる。   When the black and white pattern image information is expressed in a raster format, since a black color value is held for each pixel, one byte is required for each pixel. Accordingly, as shown in FIG. 5B, the amount of memory used when the black and white pattern image information having the width of width and the height of height is represented in raster format and stored in the memory 12B is width × height (bytes). It becomes.

なお、ラスタ形式のパターン画像情報における画像領域の画素値は定義命令の定義に従った画素値とされるが、非画像領域の各画素の色値は、何らかの値であればよく、特に限定されない。これはパターン塗りつぶし命令の実行の際にマスク情報によりマスク処理(すなわち画像領域の色値が抽出されて使用)され、非画像領域の各画素の値は塗りつぶし範囲の塗りつぶしには使用されないためである。   The pixel value of the image area in the pattern image information in the raster format is a pixel value according to the definition of the definition command. However, the color value of each pixel in the non-image area may be any value and is not particularly limited. . This is because mask processing is performed using the mask information (that is, the color value of the image area is extracted and used) when the pattern fill command is executed, and the value of each pixel in the non-image area is not used for filling the fill range. .

また、パターン画像を示すパターン画像情報をメモリ12Bに格納する際に取り得るもう1つのデータ形式は、エッジリスト形式である。エッジリスト形式は、ライン毎(本実施の形態ではスキャンライン毎)に同一の画素値の画素が連続する区間及び該画素値を示すエッジデータで画像を表現するものである。   Another data format that can be taken when storing pattern image information indicating a pattern image in the memory 12B is an edge list format. In the edge list format, an image is represented by a section in which pixels having the same pixel value continue for each line (each scan line in the present embodiment) and edge data indicating the pixel value.

図6(A)は、X−Y座標系のY座標値が0のスキャンラインに対応するエッジリストの一例を模式的に示した図である。図6(A)に示すように、エッジリストを構成するエッジデータは、色値colorと、該色値colorの画素が連続する区間の始点startと、該色値colorの画素が連続する区間の終点endと、次のエッジデータの格納先を示すアドレスnextとを有する。次のエッジデータが存在しなければ、アドレスnextにはNULLが格納される。このように、本実施の形態では、エッジリスト形式は、次のエッジデータへのアドレスnextによって、スキャンライン毎のエッジデータの各々が連結されるリスト構造とされている。エッジデータが連結されてなるデータ群をエッジリストと呼ぶ。もちろん、画像によっては、1つのエッジデータにより構成されるエッジリストもある。   FIG. 6A is a diagram schematically illustrating an example of an edge list corresponding to a scan line having a Y coordinate value of 0 in the XY coordinate system. As shown in FIG. 6A, the edge data constituting the edge list includes a color value color, a start point start of a section in which the pixels of the color value color are continuous, and a section of a section in which the pixels of the color value color are continuous. It has an end point end and an address next indicating the storage destination of the next edge data. If there is no next edge data, NULL is stored in the address next. Thus, in the present embodiment, the edge list format is a list structure in which each edge data for each scan line is linked by the address next to the next edge data. A data group formed by connecting edge data is called an edge list. Of course, depending on the image, there is also an edge list composed of one piece of edge data.

図7(A)は、図7(B)に示す6画素×6画素のパターン画像をエッジリスト形式で表したときのパターン画像情報を模式的に示す図である。エッジリスト形式のパターン画像情報は、各スキャンライン毎のエッジデータと、各スキャンライン毎の先頭のエッジデータへのアドレス(先頭アドレス)を格納する先頭アドレステーブルとにより構成される。   FIG. 7A is a diagram schematically showing pattern image information when the pattern image of 6 pixels × 6 pixels shown in FIG. 7B is represented in an edge list format. The pattern image information in the edge list format is composed of edge data for each scan line and a head address table that stores an address (head address) to the head edge data for each scan line.

図8(A)に示すように、本実施の形態において、エッジデータに含まれる色値colorは、カラーの場合には、上述した4色の色値を並べて表された4バイトの値で表され、始点start及び終点endは、各々2バイトの値で表され、アドレスnextは4バイトの値で表されるため、1つのエッジデータにつき12バイト必要となる。また、本実施の形態において、先頭アドレステーブルの各アドレスは4バイトの値で表される。   As shown in FIG. 8A, in the present embodiment, in the case of color, the color value color included in the edge data is represented by a 4-byte value represented by arranging the above-described four color values. The start point start and the end point end are each represented by a 2-byte value, and the address next is represented by a 4-byte value. Therefore, 12 bytes are required for one edge data. In the present embodiment, each address in the head address table is represented by a 4-byte value.

従って、図8(B)に示すように、幅がwidth、高さがheightのカラーのパターン画像情報をエッジリスト形式で表してメモリ12Bに格納するときのメモリ使用量は、height×4+12×エッジ数(バイト)となる。ここで、エッジ数とは、エッジデータの数をいう。   Accordingly, as shown in FIG. 8B, the amount of memory used when the color pattern image information having the width of width and the height of height is expressed in the edge list format and stored in the memory 12B is height × 4 + 12 × edge. It is a number (bytes). Here, the number of edges refers to the number of edge data.

また、白黒のパターン画像情報をエッジリスト形式で表す場合には、色値colorは1バイトでよいため、図8(B)に示すように、幅がwidth、高さがheightの白黒のパターン画像情報をエッジリスト形式で表してメモリ12Bに格納するときのメモリ使用量は、height×4+9×エッジ数(バイト)となる。   When the monochrome pattern image information is expressed in the edge list format, the color value color may be 1 byte. Therefore, as shown in FIG. 8B, a monochrome pattern image having a width of width and a height of height. The memory usage when the information is expressed in the edge list format and stored in the memory 12B is height × 4 + 9 × number of edges (bytes).

なお、パターン画像情報をエッジリスト形式で表す場合には、パターン画像の画像領域のエッジデータは作成されるが、非画像領域についてはエッジデータは作成されない。従って、塗りつぶし命令を実行するにあたり、パターン画像情報から画像領域の各画素の色値を抽出するためのマスク情報は必要ないが、パターン画像情報をラスタ形式で表す場合には、非画像領域の画素も含めて画素毎の画素値を保持するため、パターン画像情報から画像領域の各画素の色値を抽出するには、マスク情報が必要となる(図2も参照。)。マスク情報により、図4を用いて説明したように、パターン画像情報から画像領域の画素の画素値が抽出されて、ページバッファに書き込まれる。   When the pattern image information is represented in the edge list format, the edge data of the image area of the pattern image is created, but the edge data is not created for the non-image area. Therefore, when executing the fill command, mask information for extracting the color value of each pixel of the image area from the pattern image information is not necessary, but when the pattern image information is expressed in a raster format, the pixel of the non-image area In order to hold the pixel value of each pixel including the pixel information, mask information is required to extract the color value of each pixel in the image area from the pattern image information (see also FIG. 2). Based on the mask information, as described with reference to FIG. 4, the pixel values of the pixels in the image area are extracted from the pattern image information and written to the page buffer.

マスク情報も、パターン画像情報と同様に、ラスタ形式及びエッジリスト形式のいずれかのデータ形式で表される。マスク情報の場合には、各画素の画素値は、色を示す値ではないため、以下では、マスク情報の各画素の画素値を、パターン画像の色値と区別するため、マスク値という。ラスタ形式でマスク情報を作成する場合には、非画像領域の各画素のマスク値を0にし画像領域の各画素のマスク値を1にしてマスク情報を作成する。このようにマスク値は0又は1となるため、本実施の形態ではラスタ形式のマスク情報を1画素1ビットで表すものとする。従って、図5(B)に示すように、幅がwidth、高さがheightのパターン画像に対するマスク情報をラスタ形式で表してメモリ12Bに格納するときのメモリ使用量は、width×height/8(バイト)となる。なお、マスク値は上記0,1に限定されるものではなく、画像領域と非画像領域とが異なるマスク値となっていればよく、例えば、塗りつぶし命令の実行の際にマスク値0の領域の画素値を抽出するように構成する場合には、前記非画像領域の各画素のマスク値を1にし前記画像領域の各画素のマスク値を0にしてもよい。   Similarly to the pattern image information, the mask information is also expressed in either a raster format or an edge list format. In the case of mask information, since the pixel value of each pixel is not a value indicating color, hereinafter, the pixel value of each pixel of the mask information is referred to as a mask value in order to distinguish it from the color value of the pattern image. When creating mask information in a raster format, the mask information is created by setting the mask value of each pixel in the non-image area to 0 and the mask value of each pixel in the image area to 1. Since the mask value is 0 or 1 in this way, in this embodiment, raster format mask information is represented by one bit per pixel. Therefore, as shown in FIG. 5B, the amount of memory used when mask information for a pattern image having a width of width and a height of height is expressed in a raster format and stored in the memory 12B is width × height / 8 ( Byte). Note that the mask value is not limited to the above 0 and 1, and it is sufficient that the image area and the non-image area have different mask values. When configured to extract pixel values, the mask value of each pixel in the non-image area may be set to 1, and the mask value of each pixel in the image area may be set to 0.

また、マスク情報をエッジリスト形式で表す場合には、上記図6(A)で示したエッジデータの色値colorの代わりに、図6(B)に示すように、マスク値maskを用い、該マスク値maskを1にして、スキャンライン毎の画像領域の区間を示すマスク情報を作成する。マスク値0の領域はエッジデータは作成されない。ここでは、エッジデータに含まれるマスク値maskは、1バイトで足りるため、図8(B)に示すように、幅がwidth、高さがheightのパターン画像に対するマスク情報をエッジリスト形式で表してメモリ12Bに格納するときのメモリ使用量は、height×4+9×エッジ数(バイト)となる。なお、マスク値maskは少なくとも1ビットあればよいため、マスク値maskを1ビットで表現してもよい仕様となっている場合には、メモリ使用量は、height×4+9×エッジ数/8(バイト)となるが、本実施の形態では、マスク情報のエッジデータのマスク値maskは1バイト要するものとする。エッジリスト形式においても、マスク値は1に限定されず、予め定められた特定の値とすればよい。   When the mask information is expressed in the edge list format, a mask value mask is used as shown in FIG. 6B instead of the color value color of the edge data shown in FIG. The mask value mask is set to 1, and mask information indicating the section of the image area for each scan line is created. Edge data is not created in the area of mask value 0. Here, since the mask value mask included in the edge data is one byte, mask information for a pattern image having a width of width and a height of height is represented in an edge list format as shown in FIG. 8B. The amount of memory used when storing in the memory 12B is height × 4 + 9 × number of edges (bytes). Since the mask value mask only needs to have at least 1 bit, if the mask value mask has a specification that can be expressed by 1 bit, the memory usage is height × 4 + 9 × number of edges / 8 (bytes). However, in this embodiment, it is assumed that the mask value mask of the edge data of the mask information requires 1 byte. Also in the edge list format, the mask value is not limited to 1, but may be a predetermined specific value.

なお、本実施の形態では、上述したように、始点start、終点end、画素値(色値color又はマスク値mask)、及び次のエッジデータへのアドレスnextにより構成されているものとして説明するが、エッジリストの形式は上記に限定されるものではない。例えば、1つのエッジデータが、始点start、該始点からの(同一の画素値の画素が連続する区間の)長さlength、画素値(色値color又はマスク値mask)及び次のエッジデータへのアドレスnextにより構成されていてもよい。また、上記の始点start、終点end、画素値color、アドレスnextのそれぞれのサイズ(バイト数)は、一例であって、これらに限定されるものではない。   In the present embodiment, as described above, the description will be made assuming that it is configured by the start point start, the end point end, the pixel value (color value color or mask value mask), and the address next to the next edge data. The format of the edge list is not limited to the above. For example, one edge data has a start point start, a length length (in a section in which pixels having the same pixel value continue) from the start point, a pixel value (color value color or mask value mask), and the next edge data. The address next may be used. The sizes (number of bytes) of the start point start, end point end, pixel value color, and address next described above are merely examples, and the present invention is not limited to these.

このように、ラスタ形式とエッジリスト形式とでは、表現方法が異なり、データサイズも異なるため、本実施の形態では、パターン画像に応じて、メモリ12Bにパターン画像情報を格納する際にラスタ形式で格納するか、エッジリスト形式で格納するかを判断して該判断結果に応じたデータ形式でパターン画像情報を格納するものとする。また、マスク情報についても、ラスタ形式で格納するか、エッジリスト形式で格納するかを判断して該判断結果に応じた形式でマスク情報を格納する。   As described above, the raster format and the edge list format have different representation methods and different data sizes. Therefore, in the present embodiment, when storing the pattern image information in the memory 12B according to the pattern image, the raster format is used. It is determined whether the image is stored or in an edge list format, and the pattern image information is stored in a data format corresponding to the determination result. The mask information is also stored in a raster format or an edge list format, and the mask information is stored in a format according to the determination result.

なお、以下では、定義命令により作成される情報をパターン情報という。具体的には、パターン画像情報がラスタ形式でメモリ領域に格納された場合には、マスク情報も作成されるため、パターン画像情報及びマスク情報からなる情報がパターン情報となる。また、パターン画像情報がエッジリスト形式でメモリ領域に格納された場合には、マスク情報は作成されないため、パターン画像情報そのものがパターン情報となる。   In the following, information created by a definition command is referred to as pattern information. Specifically, when the pattern image information is stored in the memory area in the raster format, the mask information is also created, so that the information including the pattern image information and the mask information becomes the pattern information. Further, when the pattern image information is stored in the memory area in the edge list format, the mask information is not created, and therefore the pattern image information itself becomes the pattern information.

ここで、より具体的な例を挙げて本実施の形態の作用について説明する。   Here, the operation of the present embodiment will be described with a more specific example.

図9に示すパターン画像により塗りつぶし範囲を塗りつぶす場合を例に挙げる。図10は、図9に示すパターン画像を定義するための定義命令の疑似コードである。図2に示す疑似コードとは異なるが、描画情報に記述される各命令のコードは、解釈可能な形態であればよく、描画情報を構成する各命令をここで例示した疑似コードに限定するものではない。   An example in which the filling range is filled with the pattern image shown in FIG. FIG. 10 is a pseudo code of a definition instruction for defining the pattern image shown in FIG. Although different from the pseudo code shown in FIG. 2, the code of each instruction described in the drawing information may be in an interpretable form, and each instruction constituting the drawing information is limited to the pseudo code exemplified here. is not.

図10(1)に示すパターン属性定義コマンド(パターン属性定義文と言ってもよい)により、図9(1)に示すように、パターン画像の名称を示すパターン名:PTN1、パターン画像の高さ(pnt_height):6画素、及びパターン画像の幅(pnt_width):6画素、が定義されている。ここでは、パターン画像の始点の座標は(0,0)であるものとして省略されている。   As shown in FIG. 9 (1), a pattern attribute definition command (also referred to as a pattern attribute definition sentence) shown in FIG. (pnt_height): 6 pixels and pattern image width (pnt_width): 6 pixels are defined. Here, the coordinates of the start point of the pattern image are omitted as being (0, 0).

図10(2)に示す描画コマンドにより、図9(2)に示すように、マゼンタ色の3画素×3画素の矩形図形が描画開始位置(0,0)から描画される。図10(3)に示す描画コマンドにより、図9(3)に示すように、シアン色の3画素×3画素の矩形図形が描画開始位置(3,0)から描画される。図10(4)に示す描画コマンドにより、図9(4)に示すように、黒色の3画素×3画素の矩形図形が描画開始位置(3,3)から描画される。   With the drawing command shown in FIG. 10 (2), as shown in FIG. 9 (2), a magenta 3 pixel × 3 pixel rectangular figure is drawn from the drawing start position (0,0). With the drawing command shown in FIG. 10 (3), as shown in FIG. 9 (3), a cyan 3 × 3 pixel rectangular figure is drawn from the drawing start position (3,0). With the drawing command shown in FIG. 10 (4), a black 3 × 3 pixel rectangular figure is drawn from the drawing start position (3, 3) as shown in FIG. 9 (4).

なお、図9(5)に示す座標(3,3)を左上の座標とする3画素×3画素の矩形領域は、色値が指定されていない(データがない)非画像領域となる。   A rectangular area of 3 pixels × 3 pixels with the coordinates (3, 3) shown in FIG. 9 (5) as the upper left coordinates is a non-image area in which no color value is specified (no data is present).

図11は、図9に示すパターン画像をエッジリスト形式で表したパターン画像情報を模式的に示した図である。図11に示すように、各スキャンライン毎に同一の色値の画素が連続する区間及び該色値を含むエッジデータがリスト構造で連結されている。パターン画像情報がエッジリスト形式の場合には、マスク情報が不要なため、パターン情報=パターン画像情報となる。以下、このようにエッジリスト形式のパターン画像情報からなるパターン情報をエッジリスト形式のパターン情報と呼称する。   FIG. 11 is a diagram schematically showing pattern image information representing the pattern image shown in FIG. 9 in an edge list format. As shown in FIG. 11, sections in which pixels having the same color value continue for each scan line and edge data including the color value are connected in a list structure. When the pattern image information is in the edge list format, mask information is unnecessary, and therefore pattern information = pattern image information. Hereinafter, the pattern information including the pattern image information in the edge list format will be referred to as edge list format pattern information.

図12は、図9に示すパターン画像をラスタ形式で表したパターン画像情報及びラスタ形式で表したマスク情報を模式的に示した図である。以下、このようにパターン画像情報及びマスク情報の双方がラスタ形式である場合のパターン情報をラスタ形式のパターン情報と呼称する。   FIG. 12 is a diagram schematically showing pattern image information representing the pattern image shown in FIG. 9 in a raster format and mask information representing the pattern image in a raster format. Hereinafter, the pattern information when both the pattern image information and the mask information are in the raster format is referred to as raster format pattern information.

図13は、図9に示すパターン画像をラスタ形式で表したパターン画像情報及びエッジリスト形式で表したマスク情報を模式的に示した図である。以下、このようにパターン画像情報がラスタ形式であって、マスク情報がエッジリスト形式である場合のパターン情報をハイブリッド形式のパターン情報と呼称する。   FIG. 13 is a diagram schematically showing pattern image information representing the pattern image shown in FIG. 9 in raster format and mask information representing in edge list format. Hereinafter, the pattern information when the pattern image information is in the raster format and the mask information is in the edge list format will be referred to as hybrid format pattern information.

パターン画像情報及びマスク情報をエッジリスト形式で保持するかラスタ形式で保持するかは、例えば、図14に示すように、これら情報をエッジリスト形式で表したときのエッジ数と閾値とを比較し、エッジ数が閾値を超えればラスタ形式で保持し、エッジ数が閾値以下であればエッジリスト形式で保持するようにしてもよい。   Whether the pattern image information and the mask information are held in the edge list format or the raster format is determined by comparing the number of edges when the information is expressed in the edge list format with a threshold as shown in FIG. 14, for example. If the number of edges exceeds the threshold value, it may be held in a raster format, and if the number of edges is less than or equal to the threshold value, it may be held in an edge list format.

図14は、前述した画像処理プログラムで行われる画像処理の一部としての、描画情報に含まれる定義命令を解釈して実行するパターン定義処理の一例を示す概略的なフローチャートである。ステップ50で、例えば前述のパターン属性定義コマンドにより定義されたパターン画像のサイズに基づいて、パターン画像用のメモリ領域を確保し、最初は何ら画像が定義されていないパターン情報をエッジリスト形式で作成して初期化する。具体的には、ここでは、パターン画像のスキャンライン毎の先頭のエッジデータへのアドレス(先頭アドレス)を格納する先頭アドレステーブルを作成してメモリ12Bのパターン画像情報用のメモリ領域に格納する。そして、各アドレスはNULLにして、先頭アドレステーブルを初期化する。先頭アドレスの数は、パターン属性定義コマンドで定義されたパターン画像の高さを示す画素数に等しい。   FIG. 14 is a schematic flowchart showing an example of a pattern definition process that interprets and executes a definition command included in the drawing information as a part of the image process performed by the above-described image processing program. In step 50, for example, based on the size of the pattern image defined by the above-mentioned pattern attribute definition command, a memory area for the pattern image is secured, and pattern information in which no image is defined at first is created in an edge list format. And initialize. Specifically, a head address table for storing an address (head address) to the head edge data for each scan line of the pattern image is created and stored in the memory area for pattern image information in the memory 12B. Each address is set to NULL and the head address table is initialized. The number of head addresses is equal to the number of pixels indicating the height of the pattern image defined by the pattern attribute definition command.

次に、ステップ52で、PDLデータから上記パターン属性定義コマンドに組み合わされて記述されている描画コマンドを読み込む。   Next, in step 52, a drawing command described in combination with the pattern attribute definition command is read from the PDL data.

ステップ54では、この段階でメモリ領域に記憶されているパターン情報のデータ形式を判断する。初期状態においては前述したようにパターン情報はエッジリスト形式で作成されるため、PDLデータの定義命令に描画コマンドが複数ある場合において、最初の描画コマンドが読み込まれた段階では、パターン情報はエッジリスト形式であると判断される。   In step 54, the data format of the pattern information stored in the memory area at this stage is determined. Since the pattern information is created in the edge list format in the initial state as described above, when there are a plurality of drawing commands in the PDL data definition command, the pattern information is stored in the edge list when the first drawing command is read. Judged to be in format.

ステップ54において、パターン情報がエッジリスト形式であると判断された場合には、ステップ56で、読み込んだ描画コマンドに基づいて、エッジリスト形式でパターン画像を描画してパターン画像情報(パターン情報)を作成し、パターン画像用のメモリ領域に格納する。なお、先に読み込まれた描画コマンドにより既にメモリ領域に記憶されているエッジリストがある場合には、該エッジリストに追加挿入する。   If it is determined in step 54 that the pattern information is in the edge list format, in step 56, the pattern image is drawn in the edge list format based on the read drawing command, and the pattern image information (pattern information) is obtained. Created and stored in the memory area for pattern images. If there is an edge list already stored in the memory area by the previously read drawing command, it is additionally inserted into the edge list.

ステップ58では、上記描画コマンドにより作成したパターン画像情報のエッジデータの数(エッジ数)が閾値TH1を超えるか否かを判断する。ステップ58で否定判断した場合には、ステップ72に進む。   In step 58, it is determined whether or not the number of edge data (number of edges) of the pattern image information created by the drawing command exceeds a threshold value TH1. If a negative determination is made in step 58, the process proceeds to step 72.

また、ステップ58で、肯定判断された場合には、ステップ60で、パターン画像情報をエッジリスト形式からラスタ形式に変換してメモリ領域に格納する。描画コマンドにより描画される画像が色数が多く複雑な画像である場合には、エッジデータの数が多くなり、エッジリスト形式よりラスタ形式で表す方がメモリ使用量が抑制されることがある。そこで、ステップ58で閾値TH1と実際に作成されたエッジデータの数とを比較して、比較結果に応じたデータ形式で格納するようにしている。パターン画像をラスタ形式に変換して格納した後は、エッジリスト形式のパターン画像情報は削除される。   If an affirmative determination is made in step 58, the pattern image information is converted from the edge list format to the raster format and stored in the memory area in step 60. If the image drawn by the drawing command is a complex image with a large number of colors, the number of edge data increases, and the memory usage may be suppressed by representing the data in the raster format rather than the edge list format. Therefore, in step 58, the threshold value TH1 is compared with the number of edge data actually created, and stored in a data format corresponding to the comparison result. After the pattern image is converted into the raster format and stored, the pattern image information in the edge list format is deleted.

続いて、ステップ62で、現在メモリ領域に格納されているパターン画像に対するマスク情報をエッジリスト形式で作成してマスク情報のメモリ領域に格納する。そして、ステップ72に進む。   Subsequently, in step 62, mask information for the pattern image currently stored in the memory area is created in the form of an edge list and stored in the memory area of the mask information. Then, the process proceeds to step 72.

ステップ72では、描画コマンドが終了したか否か(次の描画コマンドがPDLデータに記述されているか否か)を判断する。ステップ72で肯定判断された場合には、パターン定義処理は終了する。そして、この時点でメモリ領域に格納されているパターン情報が、後述するパターン塗りつぶし命令で用いられるパターン情報となる。また、ステップ72で否定判断した場合には、ステップ52に戻り、次の描画コマンドを読み込んで、ステップ54に進む。   In step 72, it is determined whether or not the drawing command has ended (whether or not the next drawing command is described in the PDL data). If a positive determination is made in step 72, the pattern definition process ends. Then, the pattern information stored in the memory area at this time becomes pattern information used in a pattern fill command to be described later. If a negative determination is made in step 72, the process returns to step 52, the next drawing command is read, and the process proceeds to step 54.

また、ステップ54で、メモリ領域に記憶されているパターン情報のデータ形式の種類が、ハイブリッド形式(パターン画像情報がラスタ形式で、マスク情報がエッジリスト形式)であると判断した場合には、ステップ64に進む。   If it is determined in step 54 that the data format type of the pattern information stored in the memory area is a hybrid format (pattern image information is in raster format and mask information is in edge list format), Proceed to 64.

ステップ64では、読み込んだ描画コマンドに基づいて、ラスタ形式で画像を描画して、既に作成されメモリ領域に記憶されているパターン画像情報を編集する。更に、編集後のパターン画像情報に対応するようにエッジリスト形式のマスク情報を編集する。   In step 64, an image is drawn in a raster format based on the read drawing command, and the pattern image information already created and stored in the memory area is edited. Further, the mask information in the edge list format is edited so as to correspond to the edited pattern image information.

ステップ66は、マスク情報のエッジ数が閾値HT2を超えるか否かを判断する。ステップ66で肯定判断した場合には、ステップ68で、マスク情報をエッジリスト形式からラスタ形式に変換してメモリ領域に格納する。パターン画像と同様に、マスク情報も、エッジデータの数が多くなるとメモリ使用量が増え、エッジリスト形式よりラスタ形式で表す方がメモリ使用量が抑制される場合がある。そこで、ここでは閾値TH2とエッジデータの数とを比較して、比較結果に応じたデータ形式で格納するようにしている。   Step 66 determines whether or not the number of edges in the mask information exceeds the threshold value HT2. If the determination in step 66 is affirmative, in step 68, the mask information is converted from the edge list format to the raster format and stored in the memory area. Similarly to the pattern image, the mask information also increases in memory usage as the number of edge data increases, and the memory usage may be suppressed when represented in the raster format rather than the edge list format. Therefore, here, the threshold value TH2 and the number of edge data are compared and stored in a data format corresponding to the comparison result.

ステップ66で否定判断した場合、及びステップ68の処理後は、ステップ72に進む。ステップ72の処理は上述したとおりである。   When a negative determination is made at step 66 and after the processing at step 68, the routine proceeds to step 72. The process of step 72 is as described above.

また、ステップ54で、メモリ領域に記憶されているパターン情報のデータ形式の種類が、ラスタ形式(パターン画像情報及びマスク情報が共にラスタ形式)であると判断した場合には、ステップ70に進む。   If it is determined in step 54 that the data format type of the pattern information stored in the memory area is a raster format (both pattern image information and mask information are raster formats), the process proceeds to step 70.

ステップ70では、読み込んだ描画コマンドに基づいて、ラスタ形式で画像を描画して、既に作成されメモリ領域に記憶されているパターン画像情報を編集する。更に、編集後のパターン画像情報に対応するようにラスタ形式のマスク情報を編集する。   In step 70, an image is drawn in a raster format based on the read drawing command, and the pattern image information already created and stored in the memory area is edited. Further, the raster format mask information is edited so as to correspond to the edited pattern image information.

ステップ70の後は、ステップ72に進む。ステップ72の処理は上述したとおりである。   After step 70, the process proceeds to step 72. The process of step 72 is as described above.

なお、ステップ62においてマスク情報を新規に作成した時点でエッジ数が閾値TH2を超えている場合もあることから、ステップ66及びステップ68の処理を、ステップ64の後だけでなくステップ62の後にも実施してもよい。   Since the number of edges may exceed the threshold TH2 when the mask information is newly created in step 62, the processing in step 66 and step 68 is performed not only after step 64 but also after step 62. You may implement.

また、ステップ60(パターン画像情報のラスタ形式への変換)の後にステップ62(マスク情報の生成)を実行する例について説明したが、ステップ60の処理及びステップ62の処理を並行して行ってもよい。例えば、スキャンライン毎に、パターン画像情報のラスタ形式への変換処理及びマスク情報の生成を順次行なう等である。   Moreover, although the example which performs step 62 (generation of mask information) after step 60 (conversion of the pattern image information to the raster format) has been described, the processing of step 60 and the processing of step 62 may be performed in parallel. Good. For example, pattern image information is converted into a raster format and mask information is sequentially generated for each scan line.

塗りつぶし命令は、PDLデータにおいて定義命令の後に記述されている。図15(A)は、パターン塗りつぶし命令の疑似コードである。図2に示す疑似コードとは異なるが、描画情報に記述される各命令のコードは、解釈可能な形態であればよく、描画情報を構成する各命令をここで例示した疑似コードに限定するものではない。   The fill command is described after the definition command in the PDL data. FIG. 15A is a pseudo code of a pattern fill instruction. Although different from the pseudo code shown in FIG. 2, the code of each instruction described in the drawing information may be in an interpretable form, and each instruction constituting the drawing information is limited to the pseudo code exemplified here. is not.

図15(A)の(1)に示す色塗りつぶし命令の塗りつぶしコマンドでは、fillRectに続く(0,0,21,18)により、始点(0,0)から、幅21画素、高さ18画素の矩形領域が塗りつぶし範囲として指定されており、更にwith color(0,255,0,0)により、塗りつぶし範囲を塗りつぶす色(イエロー色)が指定されている。該コマンドを実行することで、出力画像は、図15(B)の(1)に示すように、該指定された塗りつぶし範囲がイエロー色で塗りつぶされる(ページバッファの塗りつぶし範囲にイエロー色の色値が書き込まれる)。   In the fill command of the color fill command shown in (1) of FIG. 15 (A), a width of 21 pixels and a height of 18 pixels from the start point (0,0) by (0,0,21,18) following fillRect. A rectangular area is designated as a fill range, and a color (yellow color) for filling the fill range is designated by with color (0, 255, 0, 0). By executing this command, as shown in (1) of FIG. 15B, the specified fill range is filled with yellow color by the execution of this command (the yellow color value is added to the page buffer fill range). Is written).

続いて、図15(A)の(2)に示すパターン塗りつぶし命令の塗りつぶしコマンドでは、fillRectに続く(3,3,15,12)により、始点(3,3)から、幅15画素、高さ12画素の矩形領域が塗りつぶし範囲として指定されており、更にwith pattern(PTN1)により、塗りつぶし範囲を塗りつぶすパターン画像のパターン名PTN1が指定されている。該コマンドを実行することで、メモリ領域から上記定義命令により定義されたパターン情報を読み出して用い、図15(B)の(2)に示すように、イエロー色の矩形領域の塗りつぶし範囲上にパターン画像が配列され、パターン画像の画像領域の色値がページバッファに上書きされる。なお、前述したように、パターン画像PTN1にはデータなしの領域である非画像領域が含まれているため、該非画像領域は先の塗りつぶしコマンドにより描画された背景のイエロー色が維持される。   Next, in the pattern fill command fill command shown in (2) of FIG. 15A, 15 pixels wide and height from the start point (3,3) by (3,3,15,12) following fillRect. A rectangular area of 12 pixels is designated as a filling range, and a pattern name PTN1 of a pattern image that fills the filling range is designated by with pattern (PTN1). By executing the command, the pattern information defined by the definition command is read from the memory area and used, and the pattern is displayed on the filled area of the yellow rectangular area as shown in (2) of FIG. The images are arranged, and the color value of the image area of the pattern image is overwritten in the page buffer. As described above, since the pattern image PTN1 includes a non-image area that is an area without data, the non-image area maintains the background yellow color drawn by the previous fill command.

上記では簡便なフローチャート及び模式図等によりPDLデータに基づく画像処理について説明したが、以下では、より詳細なフローチャートを用いてPDLデータの処理について具体的に説明する。以下で説明する各処理は、装置制御部12の記憶部12Cに記憶されている画像処理プログラムをCPU12Aが実行することにより実行されるものである。   In the above, image processing based on PDL data has been described with a simple flowchart and schematic diagrams, but the processing of PDL data will be specifically described below using a more detailed flowchart. Each process described below is executed by the CPU 12A executing an image processing program stored in the storage unit 12C of the apparatus control unit 12.

図16は、PDLデータ処理のメインルーチンのフローチャートを示す図である。   FIG. 16 is a flowchart of a main routine of PDL data processing.

ステップ100では、メモリ12Bに、出力画像情報を格納するためのページバッファを作成(確保)する。   In step 100, a page buffer for storing output image information is created (secured) in the memory 12B.

ステップ102では、パターン管理テーブルを作成してメモリ12B内に記憶する。パターン管理テーブルは、定義命令により定義されるパターン画像を管理するためのテーブルである。図17にパターン管理テーブルの一例を示す。図17に例示したパターン管理テーブルには、パターン名(name)、パターン画像の高さ(ptn_height)、パターン画像の幅(ptn_width)、パターン画像についてのパターン情報のデータ形式(type)、パターン情報の記憶領域のアドレスを示す(address)の各々の項目が、対応付けられて記憶される。なお、パターン情報のデータ形式(type)の項目には、前述したように、ラスタ形式raster(パターン画像情報及びマスク情報がラスタ形式)、ハイブリッド形式hybrid(パターン画像情報がラスタ形式でマスク情報がエッジリスト形式)、エッジリスト形式edgelist(パターン画像情報がエッジリスト形式。マスク情報はない)の3つのデータ形式がある。   In step 102, a pattern management table is created and stored in the memory 12B. The pattern management table is a table for managing pattern images defined by definition commands. FIG. 17 shows an example of the pattern management table. The pattern management table illustrated in FIG. 17 includes a pattern name (name), a pattern image height (ptn_height), a pattern image width (ptn_width), a pattern information data format (type), and pattern information Each item of (address) indicating the address of the storage area is stored in association with each other. As described above, the data format (type) item of the pattern information includes raster format raster (pattern image information and mask information are raster format), hybrid format (pattern image information is raster format and mask information is edge). There are three data formats: list format) and edge list format edgelist (pattern image information is edge list format, no mask information).

パターン情報の記憶領域のアドレス(address)の項目には、パターン情報がラスタ形式及びハイブリッド形式の場合には、パターン画像情報及びマスク情報の各々の記憶領域のアドレスが登録され、パターン情報がエッジリスト形式の場合には、パターン画像情報の記憶領域のアドレスが登録される。   If the pattern information is in raster format or hybrid format, the address of each storage area of pattern image information and mask information is registered in the item of address (address) of the pattern information storage area, and the pattern information is stored in the edge list. In the case of the format, the address of the pattern image information storage area is registered.

なお、ステップ102において、パターン管理テーブルを作成した時点では、パターン画像は未定義であるため、パターン管理テーブルには、パターン画像に関する情報が何も記憶されていない状態となっている。   At step 102, when the pattern management table is created, since the pattern image is undefined, no information about the pattern image is stored in the pattern management table.

ステップ104では、PDLデータから命令を1つ読み込む。ステップ106では、読み込んだ命令の種類を判断する。   In step 104, one instruction is read from the PDL data. In step 106, the type of instruction read is determined.

読み込んだ命令が、パターン画像を定義する定義命令である場合には、ステップ108に進み、パターン定義処理を実行する(詳細は後述)。   If the read command is a definition command for defining a pattern image, the process proceeds to step 108 and pattern definition processing is executed (details will be described later).

読み込んだ命令が、定義命令により定義されたパターン画像を指定された範囲に配列して塗りつぶすパターン塗りつぶし命令である場合には、ステップ110に進み、パターン塗りつぶし処理を実行する(詳細は後述)。   When the read command is a pattern fill command for arranging and filling the pattern image defined by the definition command in the specified range, the process proceeds to step 110, and pattern fill processing is executed (details will be described later).

読み込んだ命令が、中間画像データを作成することなく直接ページバッファに描画する描画命令(この描画命令を通常描画命令という)であった場合には、ステップ112で、該描画命令に基づいてページバッファに描画する処理を行なう。なお、前述の色塗りつぶし命令は、通常描画命令に含まれるが、パターン塗りつぶし命令は通常描画命令に含まれない。   If the read command is a drawing command for drawing directly in the page buffer without creating intermediate image data (this drawing command is called a normal drawing command), in step 112, the page buffer is based on the drawing command. The process of drawing is performed. Note that the above-described color painting command is included in the normal drawing command, but the pattern painting command is not included in the normal drawing command.

読み込んだ命令が、ページ出力命令である場合には、ステップ114に進み、ページバッファに格納されている出力画像情報を出力先に出力する。該出力後はページバッファを初期化する。このページ出力命令により、定義命令、パターン塗りつぶし命令、及び通常描画命令等の各命令でページバッファに書き込まれた出力画像情報が出力される。なお、出力画像情報の出力先は、画像形成部16としてもよいが、画像形成部16に出力する前に、何らかの画像処理を行なう場合には、別途設けた画像処理部(不図示)を出力先として、該画像処理部で画像処理を行なわせるようにしてもよい。或いは装置制御部12が画像処理プログラムを実行することにより画像処理を行ない、その後、画像形成部16に出力するようにしてもよい。また、出力画像情報をすぐに印刷せずに、一端、何らかのバッファに蓄積しておく場合には、該バッファを出力先としてもよい。   If the read command is a page output command, the process proceeds to step 114, and the output image information stored in the page buffer is output to the output destination. After the output, the page buffer is initialized. By this page output command, output image information written in the page buffer by each command such as a definition command, a pattern fill command, and a normal drawing command is output. Note that the output destination of the output image information may be the image forming unit 16, but if some image processing is performed before output to the image forming unit 16, an image processing unit (not shown) provided separately is output. First, the image processing unit may perform image processing. Alternatively, the apparatus control unit 12 may perform image processing by executing an image processing program and then output the image processing unit 16 to the image forming unit 16. In addition, when the output image information is not printed immediately but is once stored in some buffer, the buffer may be the output destination.

ステップ108、110、112、及び114のいずれかが終了した後は、ステップ116に進み、PDLデータが終了したか(PDLデータに記述された全ての命令の読み込み及び実行が終了したか)否かを判断する。ステップ116で否定判断した場合には、ステップ104に戻り、次の命令を読み込む。ステップ116で肯定判断した場合には、本PDL処理のルーチンが終了する。   After any of steps 108, 110, 112, and 114 is completed, the process proceeds to step 116, and whether or not the PDL data has been completed (whether reading and execution of all instructions described in the PDL data have been completed). Judging. If a negative determination is made in step 116, the process returns to step 104 and the next instruction is read. If an affirmative determination is made in step 116, the routine for this PDL processing ends.

次に、ステップ108のパターン定義処理について詳細に説明する。   Next, the pattern definition process in step 108 will be described in detail.

図18は、パターン定義処理の流れを示すフローチャートである。   FIG. 18 is a flowchart showing the flow of pattern definition processing.

ステップ150では、定義命令に含まれるパターン属性情報を読み取り取得する。例えば、前述したパターン属性定義コマンドにより指定されたパターン属性情報を取得する。ここで取得されるパターン属性情報には、パターン画像のパターン名の情報と、パターン画像の幅を示す情報と、パターン画像の高さを示す情報とが含まれる。なお、ここでは、パターン画像の幅及び高さはいずれも画素数で表されているものとする。   In step 150, pattern attribute information included in the definition command is read and acquired. For example, the pattern attribute information specified by the pattern attribute definition command described above is acquired. The pattern attribute information acquired here includes information on the pattern name of the pattern image, information indicating the width of the pattern image, and information indicating the height of the pattern image. Here, it is assumed that the width and height of the pattern image are both represented by the number of pixels.

ステップ152では、パターン画像のパターン情報をエッジリスト形式で作成して初期化する。これは、先に図14を用いて説明したステップ50と同様に、パターン画像用のメモリ領域(以下、メモリ領域PA1と呼称する)を確保し、該メモリ領域PA1に何ら画像が定義されていないパターン情報をエッジリスト形式で作成して初期化する。すなわち、パターン画像のスキャンライン毎の先頭のエッジデータへのアドレス(先頭アドレス)を格納する先頭アドレステーブルを作成してメモリ12Bのパターン画像情報用のメモリ領域PA1に記憶する。そして、各アドレスはNULLにして、先頭アドレステーブルを初期化する。先頭アドレスの数(スキャンラインの本数)は、上記取得したパターン属性情報のパターン画像の高さを示す画素数に等しい。   In step 152, pattern information of the pattern image is created in the edge list format and initialized. Similar to step 50 described above with reference to FIG. 14, this reserves a pattern image memory area (hereinafter referred to as memory area PA1), and no image is defined in the memory area PA1. Create and initialize pattern information in edge list format. That is, a head address table for storing the address (head address) to the head edge data for each scan line of the pattern image is created and stored in the memory area PA1 for pattern image information in the memory 12B. Each address is set to NULL and the head address table is initialized. The number of head addresses (the number of scan lines) is equal to the number of pixels indicating the height of the pattern image of the acquired pattern attribute information.

更に、ステップ152では、上記取得したパターン属性情報のパターン画像の幅の値をptn_widthにセットし、パターン画像の高さの値をptn_heightにセットし、エッジリスト形式を示す「edgelist」をtypeにセットする。   Further, in step 152, the width value of the pattern image of the acquired pattern attribute information is set to ptn_width, the height value of the pattern image is set to ptn_height, and “edgelist” indicating the edge list format is set to type. To do.

ステップ154では、定義命令に含まれる描画コマンドを読み込む。   In step 154, a drawing command included in the definition command is read.

ステップ156では、typeの値がedgelistであるか否かを判断する。後述するステップ162でtypeが変更されるまでは、typeの値はedgelistである(すなわち、パターン画像情報はエッジリスト形式で記憶されている)ため、ステップ156では肯定判断されるが、ステップ162でtypeの値が変更された後は否定判断される。   In step 156, it is determined whether or not the value of type is edgelist. Until the type is changed in step 162 described later, since the value of type is edgelist (that is, the pattern image information is stored in the form of an edge list), an affirmative determination is made in step 156, but in step 162 A negative determination is made after the value of type is changed.

ステップ156で肯定判断した場合には、ステップ158に進み、エッジリスト形式のパターン画像に対する描画処理を行なう。この描画処理では、描画コマンドに従って、パターン画像用のメモリ領域にエッジリスト形式で画像を展開(描画)するが、当該定義命令において当該描画コマンドの前に先に別の描画コマンドが実行されていた場合には、該先に実行された描画コマンドにより描画されたエッジリスト形式のパターン画像に対して、当該描画コマンドの画像領域の画像が上書きされるようにパターン画像用のメモリ領域に格納されたエッジリスト形式のパターン画像情報を編集する。本処理の詳細は後述する。   If an affirmative determination is made in step 156, the process proceeds to step 158 to perform drawing processing on the edge list pattern image. In this drawing process, an image is developed (drawn) in the pattern image memory area in accordance with a drawing command in the form of an edge list. However, another drawing command has been executed before the drawing command in the definition command. In this case, the pattern image stored in the pattern image memory area is overwritten with the pattern image in the edge list format drawn by the previously executed drawing command so that the image in the image area of the drawing command is overwritten. Edit pattern image information in edge list format. Details of this processing will be described later.

ステップ160では、パターン画像情報のエッジデータの数が予め定められた閾値TH1を超えたか否かを判断する。ステップ160において、肯定判断した場合には、ステップ162に進み、エッジリスト形式のパターン画像情報をラスタ形式に変換する処理を行なう。なお、ステップ162では、合わせてマスク情報をエッジリスト形式で作成し、マスク情報用のメモリ領域に格納する処理も行われる。更に、パターン情報のtypeの値が、ハイブリッド形式を示すhybridに変更される。なお、マスク情報は、マスク情報のエッジデータの数が閾値TH2を超えた場合には、エッジリスト形式からラスタ形式に変更される。この場合には、パターン情報のtypeの値が、ラスタ形式を示すrasterに変更される。ステップ162の処理の詳細は後述する。ステップ162の後は、ステップ166に進む。   In step 160, it is determined whether or not the number of edge data of the pattern image information exceeds a predetermined threshold TH1. If an affirmative determination is made in step 160, the process proceeds to step 162, and processing for converting the pattern image information in the edge list format into the raster format is performed. In step 162, mask information is also created in the form of an edge list and stored in a memory area for mask information. Furthermore, the value of type of the pattern information is changed to hybrid indicating the hybrid format. Note that the mask information is changed from the edge list format to the raster format when the number of edge data of the mask information exceeds the threshold value TH2. In this case, the type value of the pattern information is changed to raster indicating the raster format. Details of the processing in step 162 will be described later. After step 162, the process proceeds to step 166.

一方、ステップ160において、否定判断した場合には、ステップ162をスキップしてステップ166に進む。   On the other hand, if a negative determination is made in step 160, step 162 is skipped and the process proceeds to step 166.

ステップ166では、定義命令に含まれる描画コマンドを全て処理したか否かを判断する。ステップ166で否定判断した場合には、ステップ154に戻り、次の描画コマンドを読み込む。   In step 166, it is determined whether all drawing commands included in the definition command have been processed. If a negative determination is made in step 166, the process returns to step 154 to read the next drawing command.

ステップ156で否定判断した場合には、当該定義命令において当該描画コマンドの実行前に別の描画コマンドの実行によりメモリ領域に書き込まれたパターン画像情報が、ラスタ形式であることを示している。そこで、ステップ164に進み、該ラスタ形式のパターン画像情報に対する描画処理を行なう。この描画処理では、該ラスタ形式のパターン画像情報に対して、当該描画コマンドにより描画される画像領域の各画素の色値を上書きするようにパターン画像情報を編集する。また、マスク情報もパターン画像情報に応じて編集される。また、エッジリスト形式のマスク情報は、マスク情報のエッジデータの数が閾値TH2を超えた場合に、エッジリスト形式からラスタ形式に変更される。マスク情報がラスタ形式に変更された場合には、typeの値はラスタ形式を示すrasterに変更される。ステップ164の処理の詳細は後述する。   When a negative determination is made in step 156, it is indicated that the pattern image information written in the memory area by execution of another drawing command before execution of the drawing command in the definition command is in the raster format. Accordingly, the process proceeds to step 164, where drawing processing is performed on the raster pattern image information. In this drawing process, the pattern image information is edited so that the color value of each pixel in the image area drawn by the drawing command is overwritten on the pattern image information in the raster format. The mask information is also edited according to the pattern image information. Further, the mask information in the edge list format is changed from the edge list format to the raster format when the number of edge data in the mask information exceeds the threshold value TH2. When the mask information is changed to the raster format, the value of type is changed to raster indicating the raster format. Details of the processing in step 164 will be described later.

続いて、ステップ166に進み、上記と同様に定義命令に含まれる描画コマンドを全て処理したか否かを判断する。ステップ166で否定判断した場合には、ステップ154に戻り、次の描画コマンドを読み込む。   Subsequently, the process proceeds to step 166, where it is determined whether or not all drawing commands included in the definition command have been processed in the same manner as described above. If a negative determination is made in step 166, the process returns to step 154 to read the next drawing command.

また、ステップ166で、肯定判断した場合には、ステップ168で、定義命令により定義されたパターン画像をパターン管理テーブルに登録する。具体的には、上記取得したパターン属性情報に含まれるパターン名をパターン管理テーブルのnameに記憶し、該パターン名に対応付けて、パターン管理テーブルのptn_widthの項目に、パターン画像の幅を示すptn_widthの値を記憶し、パターン管理テーブルのptn_heightの項目に、パターン画像の高さを示すptn_heightの値を記憶する。そして、パターン管理テーブルのtypeの項目には、typeに現時点でセットされている値を記憶する。更にパターン管理テーブルのaddressの項目には、当該定義命令により作成されたパターン情報が記憶されている記憶先(メモリ領域)を示すアドレスが記憶される。   If an affirmative determination is made in step 166, the pattern image defined by the definition command is registered in the pattern management table in step 168. Specifically, the pattern name included in the acquired pattern attribute information is stored in the name of the pattern management table, and is associated with the pattern name, and ptn_width indicating the width of the pattern image is displayed in the ptn_width item of the pattern management table Is stored, and the value of ptn_height indicating the height of the pattern image is stored in the ptn_height item of the pattern management table. In the type item of the pattern management table, the value currently set in type is stored. Further, an address indicating a storage destination (memory area) in which pattern information created by the definition command is stored is stored in the address field of the pattern management table.

次に、上記ステップ158のエッジリスト形式のパターン画像に対する描画処理について詳細に説明する。   Next, the drawing process for the edge list pattern image in step 158 will be described in detail.

図19は、エッジリスト形式のパターン画像に対する描画処理の流れを示すフローチャートである。   FIG. 19 is a flowchart showing a flow of a drawing process for a pattern image in the edge list format.

ステップ180では、読み込んだ描画コマンドの種類を判断する。描画コマンドがイメージ描画コマンドであれば、ステップ182で、イメージ描画コマンドのエッジリスト形式描画処理を実行し、描画コマンドがグラフィックス描画コマンドであれば、ステップ184で、グラフィックス描画コマンドのエッジリスト形式描画処理を実行し、描画コマンドが文字描画コマンドであれば、ステップ186で、文字描画コマンドのエッジリスト形式描画処理を実行する。   In step 180, the type of the read drawing command is determined. If the drawing command is an image drawing command, an edge list format drawing process of the image drawing command is executed in step 182. If the drawing command is a graphics drawing command, an edge list format of the graphics drawing command is executed in step 184. If the drawing process is executed and the drawing command is a character drawing command, an edge list format drawing process of the character drawing command is executed in step 186.

図20は、ステップ182で行われるイメージ描画コマンドのエッジリスト形式描画処理の流れを示すフローチャートである。   FIG. 20 is a flowchart showing the flow of the edge list format drawing process of the image drawing command performed in step 182.

ステップ200では、イメージ描画コマンドにより指定された、イメージ画像のパターン画像における描画開始位置の情報を取得して、(x_offset、 y_offset)にセットすると共に、該イメージ画像の幅・高さの情報を取得して、(width, height)にセットする。描画開始位置(x_offset、 y_offset)は、上記取得したパターン属性情報が示すサイズの矩形領域にイメージ画像を描画するときのイメージ画像の左上の基準点となる位置であり、パターン画像の始点を基準点とした座標値となる。また、幅width及び高さheightは、各々画素数で表されている。(x_offset、 y_offset)から(x_offset+width、 y_offset+height)までの領域が、当該イメージ描画コマンドにより画像が描画される画像領域となる。   In step 200, information on the drawing start position in the pattern image of the image image specified by the image drawing command is acquired and set to (x_offset, y_offset), and information on the width and height of the image image is acquired. And set it to (width, height). The drawing start position (x_offset, y_offset) is the position to be the upper left reference point of the image image when drawing the image image in the rectangular area of the size indicated by the acquired pattern attribute information, and the starting point of the pattern image is the reference point It becomes the coordinate value. The width width and the height height are each represented by the number of pixels. An area from (x_offset, y_offset) to (x_offset + width, y_offset + height) is an image area in which an image is drawn by the image drawing command.

ステップ202では、yに0をセットする。   In step 202, 0 is set to y.

ステップ204では、描画するイメージ画像を示す画像データからエッジの切り出しを行なうここで、エッジとは、同一の画素値の画素が連続する区間の始点及び終点をいう。なお、ここでは、イメージ画像がカラーの場合について説明するが、イメージ画像が白黒の場合には、黒色の画素が連続する区間の始点及び終点がエッジとされる。   In step 204, the edge is cut out from the image data indicating the image image to be drawn. Here, the edge refers to a start point and an end point of a section in which pixels having the same pixel value are continuous. Here, the case where the image image is a color will be described. However, when the image image is black and white, the start point and end point of a section in which black pixels are continuous are used as edges.

図21は、ステップ204で行われるエッジの切り出し処理の流れを示すフローチャートである。   FIG. 21 is a flowchart illustrating the flow of the edge cut-out process performed in step 204.

ステップ230では、イメージ画像の矩形領域の左上を原点(0,0)としたときのY座標値がyのスキャンライン上(以下、単にスキャンラインyという)で、着目する画素(以下、着目画素)のX軸上の位置を示す座標値xを0として、描画するイメージ画像を表す画像データから座標(x,y)に位置する着目画素の色値を抽出し、refcolorにセットする。更に、start_xに0をセットする。   In step 230, the pixel of interest (hereinafter referred to as the pixel of interest) on the scan line whose Y coordinate value is y when the upper left corner of the rectangular area of the image image is the origin (0,0) (hereinafter simply referred to as scan line y). ), The coordinate value x indicating the position on the X-axis is set to 0, and the color value of the pixel of interest located at the coordinates (x, y) is extracted from the image data representing the image to be drawn and set to refcolor. Furthermore, 0 is set to start_x.

ステップ232では、xに1を加算して着目画素を変更する。   In step 232, 1 is added to x to change the target pixel.

ステップ234では、xがwidth未満か否かを判断する。widthは前述したようにイメージ画像の幅を示す画素数である。ステップ234で肯定判断した場合には、colorに、イメージ画像の画像データから座標(x,y)に位置する着目画素の色値を抽出してセットする。   In step 234, it is determined whether x is less than width. As described above, width is the number of pixels indicating the width of the image. If an affirmative determination is made in step 234, the color value of the pixel of interest located at the coordinates (x, y) is extracted from the image data of the image and set in color.

ステップ238では、colorの値とrefcolorの値とが等しいか否かを判断する。ステップ238で肯定判断した場合には、着目画素の色値colorは、少なくとも1つ前に着目された画素の色値refcolorに等しい(同一の色値の画素が連続している)ことを示しているため、ステップ232に戻って、xに1を加算して、着目画素を変更する。   In step 238, it is determined whether the value of color is equal to the value of refcolor. If the determination in step 238 is affirmative, it indicates that the color value color of the target pixel is at least equal to the color value refcolor of the pixel focused on the previous time (pixels having the same color value are continuous). Therefore, returning to step 232, 1 is added to x to change the pixel of interest.

また、ステップ238で否定判断した場合には、着目画素の色値colorは、1つ前に着目された画素の色値refcolorと異なるため、1つ前に着目された画素(その画素位置は、[x-1, y]となる)が、色値refcolorの画素が連続する区間の終点となる。また、ステップ234で否定判断した場合には、1つ前に着目された画素が、スキャンラインy上の終点となるため、1つ前に着目された画素が、色値refcolorの画素が連続する区間の終点となる。   Further, when a negative determination is made in step 238, the color value color of the pixel of interest is different from the color value refcolor of the pixel focused on immediately before, so the pixel focused on the previous pixel (its pixel position is [x−1, y]) is the end point of the section in which the pixels of the color value refcolor are continuous. Further, when a negative determination is made in step 234, the pixel focused on immediately before becomes the end point on the scan line y, and therefore, the pixel focused on the previous pixel continues with pixels of the color value refcolor. The end point of the section.

これに基づき、ステップ240において、色値refcolorの画素が連続する区間を示すエッジデータを作成する。なお、前述のstart_xは、イメージ画像の矩形領域の左上を原点(0,0)としたときの、色値refcolorの画素が連続する区間の始点を表すものであるため、start_xの値にx_offsetの値(イメージ画像の描画開始位置のX座標値)を加算したX座標値を、エッジデータの始点startとし、[x-1]の値にx_offsetの値を加算したX座標値を、エッジデータの終点とする。また、次のエッジデータのアドレスnextはNULLとする(図6も参照。)。すなわち、ステップ240において、下記の如くエッジデータが作成される。   Based on this, in step 240, edge data indicating a section in which pixels having the color value refcolor are continuous is created. The above-mentioned start_x represents the start point of the section in which the pixels of the color value refcolor are continuous when the upper left corner of the rectangular area of the image image is the origin (0,0), so the value of start_x is x_offset The X coordinate value obtained by adding the value (X coordinate value of the drawing start position of the image image) is used as the start point start of the edge data, and the X coordinate value obtained by adding the x_offset value to the value of [x-1] is used as the edge data. The end point. The address next of the next edge data is NULL (see also FIG. 6). That is, in step 240, edge data is created as follows.

(始点start、終点end、色値color、次のエッジデータへのアドレスnext)
=(start_x + x_offset、x - 1 + x_offset、refcolor、NULL)
(Start point start, end point end, color value color, address next to next edge data)
= (Start_x + x_offset, x-1 + x_offset, refcolor, NULL)

続いて、ステップ242では、パターン画像を表したエッジリストにおいて、スキャンライン[y+y_offset]のエッジリストに、ステップ240で作成したエッジデータを追加する。   Subsequently, in step 242, the edge data created in step 240 is added to the edge list of the scan line [y + y_offset] in the edge list representing the pattern image.

図22は、エッジリストへのエッジデータ追加処理の流れを示すフローチャートである。   FIG. 22 is a flowchart showing the flow of edge data addition processing to the edge list.

ステップ280では、着目スキャンライン(ここではスキャンライン[y+y_offset])のエッジリストが空か否か、すなわちエッジデータが1つもないか否かを判断する。以下、着目スキャンラインのエッジリストを着目エッジリストという。ステップ280で肯定判断した場合には、上記作成したエッジデータが該着目エッジリストの先頭のエッジデータであるため、ステップ282に進み、先頭アドレステーブルにおいて、上記作成したエッジデータを記憶した記憶領域のアドレスを、該着目エッジリストの先頭アドレスとして先頭アドレステーブルに格納する。   In step 280, it is determined whether or not the edge list of the target scan line (here, scan line [y + y_offset]) is empty, that is, there is no edge data. Hereinafter, the edge list of the target scan line is referred to as a target edge list. If the determination in step 280 is affirmative, since the created edge data is the first edge data in the target edge list, the process proceeds to step 282, and in the first address table, the storage area storing the created edge data is stored. The address is stored in the start address table as the start address of the target edge list.

一方、パターン画像を定義する定義命令に複数の描画コマンドが含まれている場合には、先に処理された描画コマンドにより、既に着目スキャンラインにエッジデータが作成され、エッジリストとして連結されている場合がある。この場合には、上記ステップ280で否定判断される。ステップ280で否定判断した場合には、ステップ284に進み、エッジ挿入処理を実行する。エッジ挿入処理では、先に作成されたエッジリストに対して、新たに生成したエッジデータを挿入する。図23は、エッジ挿入処理の流れを示すフローチャートである。   On the other hand, when a plurality of drawing commands are included in the definition command for defining the pattern image, the edge data has already been created on the target scan line by the previously processed drawing command and linked as an edge list. There is a case. In this case, a negative determination is made in step 280. If a negative determination is made in step 280, the process proceeds to step 284 to execute edge insertion processing. In the edge insertion processing, newly generated edge data is inserted into the previously created edge list. FIG. 23 is a flowchart showing the flow of edge insertion processing.

ステップ300では、新たに生成したエッジデータ(挿入するエッジデータ)をedgeAで表し、着目エッジリストの先頭のエッジデータをedgeBで表すものとする。そして、図24(A)に示すように、edgeAの始点startの値を、edgeA.startにセットし、edgeAの終点endの値を、edgeA.endにセットし、edgeAの色値colorの値を、edgeA.colorにセットし、edgeAの次のアドレスnextの値(=NULL)を、edgeA.nextにセットする。また、edgeBの始点startの値を、edgeB.startにセットし、edgeBの終点endの値を、edgeB.endにセットし、edgeBの色値colorの値を、edgeB.colorにセットし、edgeBの次のアドレスnextの値を、edgeB.nextにセットする。   In step 300, newly generated edge data (edge data to be inserted) is represented by edgeA, and the top edge data of the target edge list is represented by edgeB. Then, as shown in FIG. 24A, the start value start value of edgeA is set to edgeA.start, the end value end value of edgeA is set to edgeA.end, and the color value color value of edgeA is set. , EdgeA.color, and the value (= NULL) of the next address next to edgeA is set in edgeA.next. Also, the start value start value of edgeB is set to edgeB.start, the end value end value of edgeB is set to edgeB.end, the color value color of edgeB is set to edgeB.color, The value of the next address next is set to edgeB.next.

ステップ302では、edgeA.end<edgeB.startか否かを判断する。edgeA.endがedgeB.startより小さければ、edgeAとedgeBとのX軸方向の位置関係は、図24(B)の(1)に示す位置関係となる。この位置関係にはedgeAとedgeBとが隣接している場合も含まれる。なお、図24(B)では、X軸方向の位置関係が把握しやすいように、Y軸方向の位置をずらしてedgeA及びedgeBを図示しているが、edgeA及びedgeBは同じスキャンライン上のエッジデータであることに注意されたい。   In step 302, it is determined whether edgeA.end <edgeB.start. If edgeA.end is smaller than edgeB.start, the positional relationship between edgeA and edgeB in the X-axis direction is the positional relationship shown in (1) of FIG. This positional relationship includes a case where edgeA and edgeB are adjacent to each other. In FIG. 24B, edgeA and edgeB are illustrated by shifting the position in the Y-axis direction so that the positional relationship in the X-axis direction can be easily grasped, but edgeA and edgeB are edges on the same scan line. Note that this is data.

従って、ステップ302で肯定判断した場合には、ステップ304で、edgeBの区間を変更せずに、edgeBの前にedgeAが挿入されるように、edgeAの次のエッジデータのアドレスnextを、NULLからedgeBの記憶領域を示すアドレスに変更する。なお、edgeA挿入前のedgeBが、先頭エッジデータであった場合には、先頭アドレステーブルの着目スキャンラインに対応する先頭アドレスを、edgeAの記憶領域のアドレスとなるように変更する。edgeA挿入前のedgeBが、先頭エッジデータではなかった場合には、edgeAの挿入前にedgeBの1つ前に連結されていたエッジデータのアドレスnextの値を、edgeAの記憶領域のアドレスに書き換える。   Therefore, if an affirmative determination is made in step 302, the address next of edgeA next to edgeA is set from NULL so that edgeA is inserted before edgeB without changing the section of edgeB in step 304. Change to the address indicating the storage area of edgeB. If edgeB before insertion of edgeA is head edge data, the head address corresponding to the target scan line in the head address table is changed to be the address of the storage area of edgeA. If edgeB before the insertion of edgeA is not the leading edge data, the value of edge data address next linked immediately before edgeB before the insertion of edgeA is rewritten to the address of the storage area of edgeA.

なお、ここでは、図示を省略したが、ステップ302で肯定判断され、edgeAとedgeBとが隣接する位置関係にある場合おいて、edgeA.colorの値とedgeB.colorの値とが等しいときには、後述するステップ310と同様に合成処理される。   Although illustration is omitted here, when an affirmative determination is made in step 302 and edgeA and edgeB are adjacent to each other and edgeA.color and edgeB.color are equal, the value will be described later. The synthesizing process is performed in the same manner as in step 310.

また、ステップ302で、否定判断した場合には、ステップ306に進む。ステップ306では、edgeA.start>edgeB.endか否かを判断する。edgeA.startがedgeB.endより大きければ、edgeAとedgeBとのX軸方向の位置関係は、図24(B)の(2)に示す位置関係となる。この位置関係にはedgeAとedgeBとが隣接している場合も含まれる。この場合には、ステップ306で肯定判断し、ステップ320に進む。   On the other hand, if a negative determination is made in step 302, the process proceeds to step 306. In step 306, it is determined whether edgeA.start> edgeB.end. If edgeA.start is larger than edgeB.end, the positional relationship between edgeA and edgeB in the X-axis direction is the positional relationship shown in (2) of FIG. This positional relationship includes a case where edgeA and edgeB are adjacent to each other. In this case, an affirmative determination is made at step 306 and the process proceeds to step 320.

ステップ320では、edgeB.nextがNULLか否か、すなわち、edgeBの次にエッジデータが連結されていないか否かを判断する。ステップ320で肯定判断した場合には、ステップ322に進み、edgeBの区間を変更せずに、edgeBの後にedgeAが挿入されるように、edgeBの次のエッジデータのアドレスnextを、NULLからedgeAの記憶領域を示すアドレスとなるように変更する。   In step 320, it is determined whether edgeB.next is NULL, that is, whether edge data is not connected next to edgeB. When an affirmative determination is made in step 320, the process proceeds to step 322, and the address next of edgeB next to edgeB is changed from NULL to edgeA so that edgeA is inserted after edgeB without changing the section of edgeB. Change to an address indicating a storage area.

なお、ここでは、図示を省略したが、ステップ320で肯定判断され、edgeAとedgeBとが隣接する位置関係にある場合において、edgeA.colorの値とedgeB.colorの値とが等しいときには、後述するステップ310と同様に合成処理される。   Although illustration is omitted here, when an affirmative determination is made in step 320 and edgeA and edgeB are adjacent to each other and the value of edgeA.color is equal to the value of edgeB.color, it will be described later. Similar to step 310, the composition processing is performed.

さらにまた、ステップ320で、否定判断した場合には、ステップ324に進み、edgeB.nextが示すアドレスに記憶されている次のエッジデータをedgeBとしてステップ302に戻る。   Furthermore, if a negative determination is made in step 320, the process proceeds to step 324, and the next edge data stored at the address indicated by edgeB.next is set as edgeB, and the process returns to step 302.

また、ステップ306で、否定判断した場合には、ステップ308に進む。ステップ306で否定判断した場合には、着目スキャンラインのX軸上において、edgeAの区間(範囲)の一部或いは全体が、edgeBの区間の一部或いは全体と重なっている関係(図24(B)の(3)〜(6)も参照)であることを示す。そこで、ステップ308では、edgeA.colorの値とedgeB.colorの値とが等しいか否かを判断する。ステップ308で、肯定判断した場合には、ステップ310に進み、edgeAとedgeBとを合成する。具体的には、edgeBの始点startを、edgeA.start及びedgeB.startのいずれか小さい方となるように変更し、edgeBの終点endを、edgeA.end及びedgeB.endのいずれか大きい方となるように変更する。その後、edgeAは削除する。また、逆に、edgeAの始点及び終点を上記と同様に変更して、edgeBをedgeAに置き換え、edgeBを削除するようにしてもよい。   If a negative determination is made at step 306, the process proceeds to step 308. If a negative determination is made in step 306, a part or whole of the edgeA section (range) overlaps a part or whole of the edgeB section on the X axis of the target scan line (FIG. 24B ) (See also (3) to (6)). Accordingly, in step 308, it is determined whether the value of edgeA.color is equal to the value of edgeB.color. If an affirmative determination is made in step 308, the process proceeds to step 310 to combine edgeA and edgeB. Specifically, the start point start of edgeB is changed to be the smaller of edgeA.start and edgeB.start, and the end point end of edgeB is the larger of edgeA.end and edgeB.end Change as follows. After that, edgeA is deleted. Conversely, the start point and end point of edgeA may be changed in the same manner as described above, edgeB may be replaced with edgeA, and edgeB may be deleted.

また、ステップ308で、否定判断した場合には、ステップ312に進み、edgeBの範囲を、edgeAと重ならないように変更する。色値colorは変更しない。例えば、図24(B)の(3)に示す位置関係であれば、edgeBの始点startをedgeA.end+1に変更する。また、図24(B)の(4)に示す位置関係であれば、edgeBの終点endをedgeA.start-1に変更する。   If a negative determination is made in step 308, the process proceeds to step 312 and the range of edgeB is changed so as not to overlap edgeA. The color value color is not changed. For example, in the positional relationship shown in (3) of FIG. 24B, the start point start of edgeB is changed to edgeA.end + 1. Also, if the positional relationship is shown in (4) of FIG. 24B, the end point end of edgeB is changed to edgeA.start-1.

また、図24(B)の(5)に示す位置関係であれば、edgeBを元に、edgeB1とedgeB2の2つのエッジデータを作成する。edgeB1の始点startは元のedgeBの始点startとし、edgeB1の終点endは、edgeA.start-1とする。edgeB2の始点startはedgeA.end+1とし、edgeB2の終点endは、元のedgeBの終点endとする。edgeB1及びedgeB2の色値colorは元のedgeBの色値colorとする。そして、edgeB1の次のエッジデータのアドレスnextにedgeAの記憶領域のアドレスをセットし、edgeAの次のエッジデータのアドレスnextにedgeB2の記憶領域のアドレスをセットし、edgeB2の次のエッジデータのアドレスnextにはNULLをセットする。   Also, if the positional relationship is shown in (5) of FIG. 24B, two edge data of edgeB1 and edgeB2 are created based on edgeB. The start point start of edgeB1 is the start point start of the original edgeB, and the end point end of edgeB1 is edgeA.start-1. The start point start of edgeB2 is edgeA.end + 1, and the end point end of edgeB2 is the end point end of the original edgeB. The color value color of edgeB1 and edgeB2 is the color value color of the original edgeB. Then, the address of the storage area of edgeA is set to the address next of the next edge data of edgeB1, the address of the storage area of edgeB2 is set to the address of next edge data of edgeA, the address next to edgeB2, and the address of the next edge data of edgeB2 Next is set to NULL.

また、図24(B)の(6)に示す位置関係であれば、edgeBのエッジデータを削除する。なお、edgeBの削除前に該edgeBが先頭エッジデータであった場合には、先頭アドレステーブルの着目スキャンラインに対応する先頭アドレスを、edgeAの記憶領域のアドレスとなるように変更する。また、edgeBの削除前に該edgeBが先頭エッジデータでなかった場合には、edgeBの削除前にedgeBの1つ前に連結されていたエッジデータのアドレスnextを、edgeAの記憶領域のアドレスとなるように変更する。   If the positional relationship is as shown in (6) of FIG. 24B, the edge data of edgeB is deleted. If edgeB is the leading edge data before deleting edgeB, the leading address corresponding to the target scan line in the leading address table is changed to be the address of the storage area of edgeA. If the edgeB is not the first edge data before the deletion of edgeB, the address next of the edge data linked immediately before edgeB before the deletion of edgeB becomes the address of the storage area of edgeA. Change as follows.

なお、図24(B)の(5)に示すようにedgeBから2つのエッジデータを作成した場合、及び(6)に示すようにedgeBを削除した場合は、下記ステップ314の処理は行わないこととする(図示は省略。)。   When two edge data are created from edgeB as shown in (5) of FIG. 24B and when edgeB is deleted as shown in (6), the processing in step 314 below is not performed. (The illustration is omitted.)

次に、ステップ314では、edgeA.start<edgeB.startか否かを判断する。ステップ314で肯定判断した場合には、edgeAとedgeBとの位置関係は、図24(B)の(3)の変更後の位置関係にあるため、ステップ316で、edgeBの前にedgeAが挿入されるように、edgeAの次のエッジデータのアドレスnextを、NULLからedgeBの記憶領域を示すアドレスに変更する。なお、edgeA挿入前の先頭エッジデータがedgeBであった場合には、先頭アドレステーブルの着目スキャンラインに対応する先頭アドレスを、edgeAの記憶領域のアドレスに変更する。   Next, in step 314, it is determined whether edgeA.start <edgeB.start. If an affirmative determination is made in step 314, the positional relationship between edgeA and edgeB is the positional relationship after the change of (3) in FIG. 24B, so in step 316 edgeA is inserted before edgeB. As described above, the address next of the next edge data of edgeA is changed from NULL to an address indicating the storage area of edgeB. When the leading edge data before the insertion of edgeA is edgeB, the leading address corresponding to the target scan line in the leading address table is changed to the address of the storage area of edgeA.

また、ステップ314で、否定判断した場合には、edgeAとedgeBとの位置関係は、図24(B)の(4)の変更後の位置関係にあるため、ステップ318で、edgeBの後にedgeAが挿入されるように、edgeBの次のエッジデータのアドレスnextを、edgeAの記憶領域を示すアドレスに変更する。   If a negative determination is made in step 314, the positional relationship between edgeA and edgeB is the positional relationship after the change of (4) in FIG. 24B, so in step 318 edgeA is changed after edgeB. In order to be inserted, the address next of edge data next to edgeB is changed to an address indicating the storage area of edgeA.

なお、ここでは、エッジデータedgeAの区間が、先の描画コマンドにより作成された互いに連結する複数のエッジデータの各々の区間の一部又は全体と重複している場合については説明を省略したが、この場合も同様に、該複数のエッジデータの区間の各々とエッジデータedgeAの区間との位置関係に応じて、図24(B)の(3)〜(6)を参照して説明したのと同様に変更或いは削除する。   Here, the description of the case where the section of edge data edgeA overlaps with a part or the whole of each section of a plurality of edge data connected to each other created by the previous drawing command is omitted. Similarly, in this case, the description has been given with reference to (3) to (6) in FIG. 24B according to the positional relationship between each of the plurality of edge data sections and the section of the edge data edgeA. Similarly change or delete.

図22のステップ284で、上記エッジ挿入処理が終了した後は、図21のステップ244に進む。   After the edge insertion process is completed in step 284 in FIG. 22, the process proceeds to step 244 in FIG.

ステップ244では、refcolorに、着目画素の色値colorの値をセットする。更に、start_xにxの値をセットする。xは、着目画素のX軸上の位置である。   In step 244, the value of the color value color of the pixel of interest is set in refcolor. Furthermore, x is set to start_x. x is the position on the X axis of the pixel of interest.

続いて、ステップ246で、xがwidth未満か否かを判断する。ステップ246で肯定判断した場合には、ステップ232に戻り、xに1を加算して、X軸方向の次の画素を着目画素とする。また、ステップ246で否定判断した場合には、イメージ画像の着目スキャンラインのエッジの検出が終了した状態にあるため、エッジ切り出し処理を終了して、図20のステップ206に進む。   Subsequently, in step 246, it is determined whether x is less than width. If an affirmative determination is made in step 246, the process returns to step 232, 1 is added to x, and the next pixel in the X-axis direction is set as the pixel of interest. Further, when a negative determination is made in step 246, since the detection of the edge of the target scan line of the image image has been completed, the edge cut-out process is terminated and the process proceeds to step 206 in FIG.

図20のステップ206では、yに1を加算する。   In step 206 of FIG. 20, 1 is added to y.

続いて、ステップ208では、yがheight未満か否かを判断する。heightは前述したようにイメージ画像の高さを示す画素数である。ステップ208で肯定判断した場合には、ステップ204に戻り、次のスキャンラインについて、上述したようにエッジ切り出し処理を行なう。また、ステップ208で否定判断した場合には、イメージ画像の各スキャンラインのエッジの検出及びエッジデータの作成が終了した状態にあるため、図20のイメージ描画コマンドのエッジリスト形式描画処理を終了する。   In step 208, it is determined whether y is less than height. As described above, height is the number of pixels indicating the height of the image. If the determination in step 208 is affirmative, the process returns to step 204, and the edge cut-out process is performed on the next scan line as described above. If the determination in step 208 is negative, the edge list format drawing process of the image drawing command in FIG. 20 is terminated because the detection of the edge of each scan line of the image image and the creation of edge data are complete. .

次に、ステップ184のグラフィックス描画コマンドのエッジリスト形式描画処理について説明する。図25は、グラフィックス描画コマンドのエッジリスト形式描画処理の流れを示すフローチャートである。   Next, the edge list format drawing process of the graphics drawing command in step 184 will be described. FIG. 25 is a flowchart showing a flow of edge list format drawing processing of a graphics drawing command.

ステップ340では、グラフィックス描画コマンドにより指定された描画色を取得してg_colorにセットする。例えば、図10に示す定義命令に含まれるグラフィック描画コマンドfillRectに対して、with colorで指定された色が描画色である。   In step 340, the drawing color designated by the graphics drawing command is acquired and set in g_color. For example, for the graphic drawing command “fillRect” included in the definition command shown in FIG. 10, the color specified by “with color” is the drawing color.

ステップ342では、グラフィックス描画コマンドにより指定された描画領域(当該グラフィックス描画コマンドにより画像が描画される画像領域)のY座標の範囲を求める。例えば、図10に示す例では、図10の(2)に示す描画コマンドのfillRectに続く(0,0,3,3)において、最初の2つの数値が、パターン画像におけるグラフィックス画像の描画開始位置であり、それに続く2つの数値が、描画するグラフィックス画像の幅及び高さを示す画素数であることから、グラフィックス描画コマンドの描画領域のY座標の最小値は、描画開始位置のY座標0、Y座標値の最大値は、該描画開始位置Y座標0に高さ3を加算した3となる。そして、このY座標の最小値をy_startにセットし、最大値をy_endにセットする。   In step 342, the range of the Y coordinate of the drawing area designated by the graphics drawing command (the image area in which the image is drawn by the graphics drawing command) is obtained. For example, in the example shown in FIG. 10, in (0,0,3,3) following the fill command of the drawing command shown in (2) of FIG. 10, the first two numerical values are the start of drawing a graphics image in the pattern image. Position, and the following two numerical values are the number of pixels indicating the width and height of the graphics image to be drawn. Therefore, the minimum value of the Y coordinate of the drawing area of the graphics drawing command is Y at the drawing start position. The maximum value of coordinate 0 and Y coordinate value is 3, which is obtained by adding height 3 to the drawing start position Y coordinate 0. Then, the minimum value of this Y coordinate is set to y_start, and the maximum value is set to y_end.

ステップ344では、yにy_startの値をセットする。   In step 344, y_start is set to y.

ステップ346では、グラフィックス描画コマンドにより描画するグラフィックス画像について、スキャンラインyにおけるスキャン変換処理(画像のエッジを抽出する処理)を行い、スキャンラインyにおけるX軸上の描画範囲x_start、x_endを求める。   In step 346, scan conversion processing (processing for extracting image edges) on the scan line y is performed on the graphics image drawn by the graphics drawing command to obtain drawing ranges x_start and x_end on the X axis on the scan line y. .

ステップ348では、エッジデータを作成する。具体的には、下記の如くエッジデータが作成される。   In step 348, edge data is created. Specifically, edge data is created as follows.

(始点start、終点end、色値color、次のエッジデータへのアドレスnext)
=(x_start、x_end、g_color、NULL)
(Start point start, end point end, color value color, address next to next edge data)
= (X_start, x_end, g_color, NULL)

ステップ350では、パターン画像を表したエッジリストにおいて、スキャンラインyのエッジリストに、ステップ348で作成したエッジデータを追加する。ステップ350で行われる、エッジリストへのエッジデータの追加処理は、着目スキャンラインをyとして、図22〜図24を用いて説明したように実行する。   In step 350, the edge data created in step 348 is added to the edge list of the scan line y in the edge list representing the pattern image. The processing for adding edge data to the edge list performed in step 350 is performed as described with reference to FIGS.

ステップ352では、yに1を加算する。   In step 352, 1 is added to y.

ステップ354では、yがy_end以下であるか否かを判断する。ステップ354で肯定判断した場合には、グラフィックス画像が描画される描画範囲の全てのスキャンラインについての処理が終了していない状態であるため、ステップ346に戻り、次のスキャンラインについて上記処理を繰り返す。また、ステップ354で否定判断した場合には、グラフィックス画像が描画される描画範囲の全てのスキャンラインについての処理が終了した状態であるため、本グラフィックス描画コマンドのエッジリスト形式描画処理を終了する。   In step 354, it is determined whether y is equal to or less than y_end. If the determination in step 354 is affirmative, the process has not been completed for all the scan lines in the drawing range in which the graphics image is drawn, so the process returns to step 346 and the above process is performed for the next scan line. repeat. If a negative determination is made in step 354, the processing for all the scan lines in the drawing range in which the graphics image is drawn has been completed. Therefore, the edge list drawing processing for this graphics drawing command is finished. To do.

次に、ステップ186の文字描画コマンドのエッジリスト形式描画処理について説明する。図26は、文字描画コマンドのエッジリスト形式描画処理の流れを示すフローチャートである。   Next, the edge list format drawing process of the character drawing command in step 186 will be described. FIG. 26 is a flowchart showing a flow of edge list format drawing processing of a character drawing command.

ステップ370では、文字描画コマンドにより指定された描画色を取得してt_colorにセットする。   In step 370, the drawing color designated by the character drawing command is acquired and set to t_color.

ステップ372では、文字描画コマンドにおいてパターン画像に配置(描画)するよう指定された文字画像の描画開始位置の情報を取得して、(x_offset, y_offset)にセットする。   In step 372, information on the drawing start position of the character image designated to be arranged (drawn) on the pattern image in the character drawing command is acquired and set to (x_offset, y_offset).

ステップ374では、文字が黒色及び白色の二値からなるラスタ形式で表された文字ビットマップデータを取得する。文字描画コマンドには、予め定められたコード体系に従った文字コード情報、フォント名文字の大きさを示すポイント数などを含むフォント情報、上記描画色、及び描画開始位置の情報等が指定されている。このうち文字コード情報及びフォント情報等から、描画する文字をビットマップに展開した文字ビットマップデータを取得する。   In step 374, character bitmap data represented in a raster format in which the character is composed of binary values of black and white is obtained. In the character drawing command, character code information according to a predetermined code system, font information including the number of points indicating the size of the font name character, the drawing color, information on the drawing start position, etc. are specified. Yes. Among these, character bitmap data obtained by expanding a character to be drawn into a bitmap is acquired from character code information and font information.

ステップ376では、char_xに0をセットすると共に、char_yに0をセットする。   In step 376, 0 is set to char_x and 0 is set to char_y.

ステップ378では、上記取得した文字ビットマップデータから文字のエッジ抽出を行なう。図27は、文字のエッジ抽出処理の流れを示すフローチャートである。   In step 378, character edge extraction is performed from the acquired character bitmap data. FIG. 27 is a flowchart showing the flow of character edge extraction processing.

ステップ400では、文字ビットマップデータが表す文字のサイズ(幅及び高さ)の情報を取得して、幅の値をwidthにセットし、高さの値をheightにセットする。なお、幅及び高さは各々画素数で表されているものとする。   In step 400, information on the size (width and height) of the character represented by the character bitmap data is acquired, the width value is set to width, and the height value is set to height. Note that the width and the height are each expressed by the number of pixels.

ステップ402では、edge_xに-1をセットする。   In step 402, -1 is set to edge_x.

ステップ404では、黒座標(黒色画素の座標位置)の検出を行なう。図28は、黒座標の検出処理の流れを示すフローチャートである。   In step 404, black coordinates (coordinate positions of black pixels) are detected. FIG. 28 is a flowchart showing the flow of black coordinate detection processing.

ステップ430では、char_yがheight未満か否かを判断する。ステップ430で肯定判断した場合には、ステップ432に進む。ステップ432では、char_xがwidth未満か否かを判断する。ステップ432で肯定判断した場合には、ステップ436に進む。ステップ436では、座標(char_x, char_y)の位置の文字ビットマップデータが黒色か否かを判断する。   In step 430, it is determined whether or not char_y is less than height. If the determination in step 430 is affirmative, the process proceeds to step 432. In step 432, it is determined whether or not char_x is less than width. If an affirmative determination is made in step 432, the process proceeds to step 436. In step 436, it is determined whether or not the character bitmap data at the position of the coordinates (char_x, char_y) is black.

ステップ436で、肯定判断した場合には、ステップ440に進み、edge_xにchar_xの値をセットし、edge_yにchar_yの値をセットする。そして、ステップ442では、char_xに1を加算した値を、char_xにセットする。   If an affirmative determination is made in step 436, the process proceeds to step 440, where the value of char_x is set in edge_x, and the value of char_y is set in edge_y. In step 442, a value obtained by adding 1 to char_x is set to char_x.

また、ステップ436で、否定判断した場合には、ステップ438に進み、X軸方向の次の画素について黒色か白色かを判断するため、char_xに1を加算して、ステップ432に戻る。   If a negative determination is made in step 436, the process proceeds to step 438, and 1 is added to char_x to determine whether the next pixel in the X-axis direction is black or white, and the process returns to step 432.

一方、ステップ432で否定判断した場合には、ステップ434で、char_yに1を加算し、char_xには0をセットしてステップ430に戻る。すなわち、ステップ432でchar_xがwidth以上であると判断した場合には、文字ビットマップデータの矩形領域の左上を原点(0,0)としたときのスキャンラインchar_y上には、黒色画素が存在しないことを示しているため、ステップ434で、着目するスキャンラインを次のスキャンラインに変更して、ステップ430に戻り、該次のスキャンラインの端の画素から黒色画素を探すようにしている。   On the other hand, if a negative determination is made in step 432, 1 is added to char_y in step 434, 0 is set in char_x, and the flow returns to step 430. That is, when it is determined in step 432 that char_x is equal to or larger than width, there is no black pixel on the scan line char_y when the upper left corner of the rectangular area of the character bitmap data is the origin (0,0). Therefore, in step 434, the target scan line is changed to the next scan line, and the process returns to step 430 to search for a black pixel from pixels at the end of the next scan line.

以上の処理により、文字の幅width及び高さheightの矩形領域の左上座標を原点(0,0)とした場合において、スキャンラインedge_y上で黒色画素が連続する区間の始点(エッジの始点)edge_xが検出される。   With the above processing, when the upper left coordinate of the rectangular area with the width and height of the character is the origin (0,0), the start point (edge start point) edge_x of the section where black pixels continue on the scan line edge_y Is detected.

図27において、ステップ404で黒座標の検出が終了した後は、ステップ406で白座標(白色画素の座標位置)の検出を行なう。この白座標の検出処理において、エッジの終点が検出される。図29は、白座標の検出処理の流れを示すフローチャートである。   In FIG. 27, after the detection of the black coordinate is completed in step 404, the white coordinate (the coordinate position of the white pixel) is detected in step 406. In this white coordinate detection process, the end point of the edge is detected. FIG. 29 is a flowchart showing a flow of white coordinate detection processing.

ステップ460では、edge_xが-1であるか否かを判断する。edge_xが-1である場合には、上記黒座標の検出処理において黒座標が検出されていない状態を示している。エッジの始点が検出されて場合には、終点を検出する必要もない。従って、白座標の検出処理を終了する。   In step 460, it is determined whether edge_x is -1. When edge_x is −1, the black coordinate is not detected in the black coordinate detection process. When the start point of the edge is detected, it is not necessary to detect the end point. Therefore, the white coordinate detection process ends.

一方、ステップ460で、否定判断した場合には、ステップ462で、char_xがwidth未満か否かを判断する。ステップ462で、肯定判断した場合には、ステップ464に進む。ステップ464では、座標(char_x, char_y)の位置にある画素の文字ビットマップデータが黒色か否かを判断する。ステップ464で肯定判断した場合には、char_xに1を加算してステップ462に戻る。   On the other hand, if a negative determination is made in step 460, it is determined in step 462 whether or not char_x is less than width. If an affirmative determination is made at step 462, the process proceeds to step 464. In step 464, it is determined whether or not the character bitmap data of the pixel located at the coordinates (char_x, char_y) is black. If an affirmative determination is made in step 464, 1 is added to char_x, and the flow returns to step 462.

ステップ464で否定判断した場合には、ステップ468で、edge_x_endに[char_x-1]の値をセットする。すなわち、ステップ464で白色の画素が見つかった場合には(否定判断)、該画素のX座標値の1画素前のX座標値の画素が黒色画素が連続する区間の終点となる。従って、ステップ468において、現在着目している画素のX座標値char_xから1を差し引いて、黒色画素が連続する区間の終点を示す座標を求め、edge_x_endにセットしている。   If a negative determination is made in step 464, the value of [char_x-1] is set in edge_x_end in step 468. That is, when a white pixel is found in step 464 (negative determination), the pixel of the X coordinate value one pixel before the X coordinate value of the pixel is the end point of the section where the black pixels are continuous. Accordingly, in step 468, 1 is subtracted from the X coordinate value char_x of the pixel currently focused on to obtain coordinates indicating the end point of the section where the black pixels are continuous, and is set to edge_x_end.

また、ステップ462で、否定判断した場合には、文字ビットマップデータにおいてスキャンラインedge_yにおけるX座標値edge_x以降のX座標値の画素には、白画素が存在しないことを示している。そこで、ステップ470において、edge_x_endに[width-1]の値をセットする。ここで、widthから1を減算しているのは、文字の幅width及び高さheightの矩形領域の左上座標(原点)を(0,0)としているためである。   Further, when a negative determination is made in step 462, it is indicated that no white pixel exists in the pixels of the X coordinate value after the X coordinate value edge_x in the scan line edge_y in the character bitmap data. Therefore, in step 470, the value of [width-1] is set to edge_x_end. Here, 1 is subtracted from the width because the upper left coordinate (origin) of the rectangular area having the width width and height height is (0, 0).

以上の処理により、文字の幅width及び高さheightの矩形領域の左上座標を原点(0,0)とした場合において、スキャンラインedge_y上で黒色画素が連続する区間の終点(エッジの終点)edge_x_endが検出される。   With the above processing, when the upper left coordinate of the rectangular area having the width and height of the character is the origin (0,0), the end point (edge end point) edge_x_end of the section where black pixels continue on the scan line edge_y Is detected.

図27において、ステップ406の白座標の検出処理の後は、ステップ408に進み、edge_xが-1であるか否かを判断する。edge_xが-1である場合には、上記黒座標の検出処理において黒座標が検出されていない状態を示している。従って、ステップ408で肯定判断した場合には、ステップ412で、エッジ抽出が失敗したと結論する。また、ステップ408で否定判断した場合には、ステップ414で、エッジ抽出が成功したと結論する。   In FIG. 27, after the white coordinate detection process in step 406, the process proceeds to step 408 to determine whether edge_x is −1. When edge_x is −1, the black coordinate is not detected in the black coordinate detection process. Therefore, if an affirmative determination is made in step 408, it is concluded in step 412 that edge extraction has failed. If a negative determination is made in step 408, it is concluded in step 414 that the edge extraction is successful.

図26において、ステップ378の文字のエッジ抽出処理が終了した後は、ステップ380に進む。ステップ380では、エッジ抽出が成功したか否かを判断する。ステップ380で肯定判断した場合には、ステップ382に進み、x_startに[edge_x + x_offset]の値をセットし、x_endに[edge_x_end + x_offset]の値をセットし、yに[edge_y + y_offset]の値をセットする。   In FIG. 26, after the character edge extraction process in step 378 is completed, the process proceeds to step 380. In step 380, it is determined whether the edge extraction is successful. If an affirmative determination is made in step 380, the process proceeds to step 382, in which x_start is set to [edge_x + x_offset], x_end is set to [edge_x_end + x_offset], and y is [edge_y + y_offset]. Set.

ステップ384では、エッジデータを作成する。具体的には、下記の如くエッジデータが作成される。   In step 384, edge data is created. Specifically, edge data is created as follows.

(始点start、終点end、色値color、次のエッジデータへのアドレスnext)
=(x_start、x_end、t_color、NULL)
(Start point start, end point end, color value color, address next to next edge data)
= (X_start, x_end, t_color, NULL)

ステップ386では、パターン画像を表したエッジリストにおいて、スキャンラインyのエッジリストに、ステップ384で作成したエッジデータを追加する。ステップ384で行われる、エッジリストへのエッジデータの追加処理は、着目スキャンラインをyとして、図22〜図24を用いて説明したように実行する。   In step 386, the edge data created in step 384 is added to the edge list of the scan line y in the edge list representing the pattern image. The processing of adding edge data to the edge list performed in step 384 is performed as described with reference to FIGS.

ステップ386の後は、ステップ378に戻り、次のエッジの抽出を、上記と同様に行う。ステップ378の処理により、新たなエッジが抽出された場合には、ステップ380で肯定判断されるため、上記ステップ382以降の処理が同様に行われる。また、ステップ378で新たなエッジ抽出されなかった場合には、ステップ380で否定判断され、図26の文字描画コマンドのエッジリスト形式描画処理を終了する。   After step 386, the process returns to step 378, and the next edge is extracted in the same manner as described above. If a new edge is extracted by the process in step 378, an affirmative determination is made in step 380, and thus the processes after step 382 are similarly performed. If a new edge is not extracted in step 378, a negative determination is made in step 380, and the edge list format drawing process of the character drawing command in FIG. 26 is terminated.

次に、図18のステップ160で肯定判断した後に実行されるステップ162のパターン画像をラスタ形式へ変換する変換処理について詳細に説明する。   Next, a detailed description will be given of the conversion process for converting the pattern image in step 162 to the raster format, which is executed after an affirmative determination in step 160 of FIG.

図30は、パターン画像情報をラスタ形式に変換する変換処理の流れを示すフローチャートである。この変換処理では、パターン画像情報の変換と共にマスク情報の作成も行われる。   FIG. 30 is a flowchart showing the flow of conversion processing for converting pattern image information into a raster format. In this conversion process, mask information is created along with conversion of pattern image information.

ステップ500では、ラスタ形式のパターン画像情報を格納するためのパターン画像用のメモリ領域PA2をメモリ12Bに確保する。例えば、カラーの場合には、本実施の形態では、ラスタ形式のパターン画像情報は、1画素4バイト必要となるため、パターン画像の幅×高さ×4バイトのメモリ領域PA2が確保される。   In step 500, a memory area PA2 for pattern images for storing raster pattern image information is secured in the memory 12B. For example, in the case of color, in the present embodiment, since the raster pattern image information requires 4 bytes per pixel, a memory area PA2 of pattern image width × height × 4 bytes is secured.

ステップ502では、上記確保したパターン画像用のメモリ領域PA2を0でクリアする。すなわち、本実施の形態では、パターン画像情報の全画素の色値が0を示すように初期化される。ここでは、各画素の色値が0となるように初期化したが、0に限定するものではなく、何らかの値であればよい。   In step 502, the reserved pattern image memory area PA2 is cleared to zero. That is, in the present embodiment, initialization is performed so that the color values of all the pixels of the pattern image information indicate 0. Here, the color value of each pixel is initialized to be 0, but is not limited to 0 and may be any value.

ステップ504では、マスク情報をエッジリスト形式で作成して初期化する。具体的には、マスク情報用のメモリ領域MA1をメモリ12Bに確保し、マスク情報のスキャンライン毎の先頭のエッジデータへのアドレス(先頭アドレス)を格納する先頭アドレステーブルを作成してメモリ12Bのマスク情報用のメモリ領域MA1に記憶する。そして、各先頭アドレスはNULLにして、先頭アドレステーブルを初期化する。先頭アドレスの数(スキャンラインの本数)は、上記パターン画像の高さを示す画素数に等しい。   In step 504, mask information is created and initialized in an edge list format. Specifically, a memory area MA1 for mask information is secured in the memory 12B, and a head address table for storing an address (head address) to the head edge data for each scan line of the mask information is created, and the memory 12B The information is stored in the memory area MA1 for mask information. Each head address is set to NULL, and the head address table is initialized. The number of head addresses (the number of scan lines) is equal to the number of pixels indicating the height of the pattern image.

ステップ506では、yに0をセットする。   In step 506, 0 is set to y.

ステップ508では、メモリ領域PA1に記憶されているエッジリスト形式のパターン画像情報からスキャンラインyのエッジリストの先頭のエッジデータを取得する。   In step 508, the leading edge data of the edge list of the scan line y is acquired from the pattern image information in the edge list format stored in the memory area PA1.

ステップ510では、スキャンラインyのエッジリストにエッジデータがあるか否かを判断する。ステップ510がステップ508の直後に実行される場合において、ステップ508での取得が成功した(取得すべきエッジデータがあった)ときには、ステップ510では肯定判断され、ステップ508での取得が失敗した(取得すべきエッジデータがなかった)ときには、ステップ510では否定判断される。また、ステップ510が後述するステップ516の直後に実行される場合において、ステップ516での取得が成功した(取得すべきエッジデータがあった)ときには、ステップ510で肯定判断され、ステップ516での取得が失敗した(取得すべきエッジデータがなかった)ときには、ステップ510で否定判断される。   In step 510, it is determined whether there is edge data in the edge list of the scan line y. When step 510 is executed immediately after step 508, if acquisition at step 508 is successful (there is edge data to be acquired), an affirmative determination is made at step 510 and acquisition at step 508 fails ( If there is no edge data to be acquired), a negative determination is made at step 510. When step 510 is executed immediately after step 516, which will be described later, if acquisition at step 516 is successful (there is edge data to be acquired), an affirmative determination is made at step 510 and acquisition at step 516 is performed. Is failed (there is no edge data to be acquired), a negative determination is made at step 510.

ステップ510で肯定判断した場合には、ステップ512で、メモリ領域PA2における、ラスタ形式のパターン画像の、始点(start, y)から終点(end, y)までの範囲の画素の色値(上記初期化により0となっている)を、取得したエッジデータの色値colorの値に変更する(colorの値を書き込む)。ここで、startは取得したエッジデータの始点startの値であり、endは取得したエッジデータの終点endの値である。   If the determination in step 510 is affirmative, in step 512, the color values of the pixels in the range from the start point (start, y) to the end point (end, y) of the raster format pattern image in the memory area PA2 (the above initial value) Is changed to 0 as the color value of the acquired edge data (writes the color value). Here, start is the value of the start point start of the acquired edge data, and end is the value of the end point end of the acquired edge data.

ステップ512の後は、ステップ514で、マスク情報のエッジデータを作成する。ここでは、上記パターン画像情報から取得したエッジデータの始点startの値、及び終点endの値を、マスク情報のエッジデータの始点startの値及び終点endの値とし、マスク情報のエッジデータのマスク値maskの値を1にし、マスク情報のエッジデータのアドレスnextの値はNULLにして作成する。   After step 512, in step 514, edge data of mask information is created. Here, the value of the start point start and the end point end of the edge data acquired from the pattern image information is set as the value of the start point start and the end point end of the edge data of the mask information, and the mask value of the edge data of the mask information The mask value is set to 1, and the edge data address next value of the mask information is set to NULL.

ステップ516では、マスク情報のスキャンラインyのエッジリストに、上記作成したエッジデータを追加する。エッジデータの追加処理は、図22に示した流れで行うが、マスク情報の場合には、どのエッジデータもマスク値が1であるため、図22のステップ284では、図23に示すエッジ挿入処理ではなく、図31に示すエッジ挿入処理を実行する。   In step 516, the created edge data is added to the edge list of the scan line y of the mask information. The process of adding edge data is performed according to the flow shown in FIG. 22. However, in the case of mask information, the mask value is 1 for any edge data, so in step 284 of FIG. 22, the edge insertion process shown in FIG. Instead, the edge insertion process shown in FIG. 31 is executed.

図31は、マスク情報のエッジ挿入処理の流れを示すフローチャートである。ステップ540では、新たに生成したエッジデータ(挿入するエッジデータ)をedgeAで表し、着目エッジリストの先頭のエッジデータをedgeBで表すものとする。そして、edgeAの始点startの値を、edgeA.startにセットし、edgeAの終点endの値を、edgeA.endにセットし、edgeAの次のアドレスnextの値(=NULL)を、edgeA.nextにセットする。また、edgeBの始点startの値を、edgeB.startにセットし、edgeBの終点endの値を、edgeB.endにセットし、edgeBの次のアドレスnextの値を、edgeB.nextにセットする。   FIG. 31 is a flowchart showing the flow of mask information edge insertion processing. In step 540, newly generated edge data (edge data to be inserted) is represented by edgeA, and the top edge data of the target edge list is represented by edgeB. Then, the value of the start point start of edgeA is set to edgeA.start, the value of the end point end of edgeA is set to edgeA.end, the value of the next address next to edgeA (= NULL) is set to edgeA.next set. Also, the value of the start point start of edgeB is set to edgeB.start, the value of the end point end of edgeB is set to edgeB.end, and the value of the next address next to edgeB is set to edgeB.next.

ステップ542では、edgeA.end<edgeB.startか否かを判断する。edgeA.endがedgeB.startより小さければ、edgeAとedgeBとのX軸方向の位置関係は、図24(B)の(1)に示す位置関係となる。従って、ステップ542で肯定判断した場合には、ステップ544で、edgeBの区間を変更せずに、edgeBの前にedgeAが挿入されるように、edgeAの次のエッジデータのアドレスnextを、NULLからedgeBの記憶領域を示すアドレスに変更する。なお、edgeA挿入前のedgeBが、先頭エッジデータであった場合には、先頭アドレステーブルの着目スキャンラインに対応する先頭アドレスを、edgeAの記憶領域のアドレスとなるように変更する。edgeA挿入前のedgeBが、先頭エッジデータではなかった場合には、edgeAの挿入前にedgeBの1つ前に連結されていたエッジデータのアドレスnextの値を、edgeAの記憶領域のアドレスに書き換える。   In step 542, it is determined whether edgeA.end <edgeB.start. If edgeA.end is smaller than edgeB.start, the positional relationship between edgeA and edgeB in the X-axis direction is the positional relationship shown in (1) of FIG. Therefore, if an affirmative determination is made in step 542, the address next of the next edge data of edgeA is changed from NULL so that edgeA is inserted before edgeB without changing the section of edgeB in step 544. Change to the address indicating the storage area of edgeB. If edgeB before insertion of edgeA is head edge data, the head address corresponding to the target scan line in the head address table is changed to be the address of the storage area of edgeA. If edgeB before the insertion of edgeA is not the leading edge data, the value of edge data address next linked immediately before edgeB before the insertion of edgeA is rewritten to the address of the storage area of edgeA.

また、ステップ542で、否定判断した場合には、ステップ546に進む。ステップ546では、edgeA.start>edgeB.endか否かを判断する。edgeA.startがedgeB.endより大きければ、edgeAとedgeBとのX軸方向の位置関係は、図24(B)の(2)に示す位置関係となる。この場合には、ステップ546で肯定判断し、ステップ550に進む。   Further, when a negative determination is made at step 542, the process proceeds to step 546. In step 546, it is determined whether edgeA.start> edgeB.end. If edgeA.start is larger than edgeB.end, the positional relationship between edgeA and edgeB in the X-axis direction is the positional relationship shown in (2) of FIG. In this case, an affirmative determination is made at step 546 and the routine proceeds to step 550.

ステップ550では、edgeB.nextがNULLか否か、すなわち、edgeBの次のエッジデータが連結されていないか否かを判断する。ステップ550で肯定判断した場合には、ステップ552に進み、edgeBの区間を変更せずに、edgeBの後にedgeAが挿入されるように、edgeBの次のエッジデータのアドレスnextを、NULLからedgeAの記憶領域を示すアドレスとなるように変更する。   In step 550, it is determined whether edgeB.next is NULL, that is, whether the next edge data of edgeB is not connected. If an affirmative determination is made in step 550, the process proceeds to step 552, and the address next of edgeB next to edgeB is changed from NULL to edgeA so that edgeA is inserted after edgeB without changing the section of edgeB. Change to an address indicating a storage area.

さらにまた、ステップ550で、否定判断した場合には、ステップ554に進み、edgeB.nextが示すアドレスに記憶されている次のエッジデータをedgeBとしてステップ540に戻る。   Furthermore, when a negative determination is made in step 550, the process proceeds to step 554, and the next edge data stored at the address indicated by edgeB.next is set as edgeB, and the process returns to step 540.

また、ステップ546で、否定判断した場合には、着目スキャンラインのX軸上において、edgeAの区間(範囲)の一部或いは全体が、edgeBの区間の一部或いは全体に重なっている関係であることを示す。そこで、ステップ548に進み、edgeAとedgeBとを合成する。具体的には、edgeBの始点startを、edgeA.start及びedgeB.startのいずれか小さい方となるように変更し、edgeBの終点endにを、edgeA.end及びedgeB.endのいずれか大きい方となるように変更する。その後、edgeAは削除する。また、逆に、edgeAの始点及び終点を上記と同様に変更して、edgeBをedgeAに置き換え、edgeBを削除するようにしてもよい。   Further, when a negative determination is made in step 546, a part or the whole of the edgeA section (range) overlaps a part or the whole of the edgeB section on the X axis of the target scan line. It shows that. Therefore, the process proceeds to step 548, where edgeA and edgeB are synthesized. Specifically, the start point start of edgeB is changed to be the smaller of edgeA.start and edgeB.start, and the end point of edgeB is changed to the larger of edgeA.end and edgeB.end Change to After that, edgeA is deleted. Conversely, the start point and end point of edgeA may be changed in the same manner as described above, edgeB may be replaced with edgeA, and edgeB may be deleted.

エッジ挿入処理の後、ステップ518では、スキャンラインyのエッジリストから次のエッジデータを取得する。具体的には、上記取得したエッジデータのアドレスnextに格納されているアドレスからエッジデータを取得する。ただし、アドレスnextの値がNULLの場合には取得失敗となる。ステップ518の後は、ステップ510に戻る。   After the edge insertion processing, in step 518, the next edge data is acquired from the edge list of the scan line y. Specifically, edge data is acquired from the address stored at the address next of the acquired edge data. However, if the value of the address next is NULL, acquisition fails. After step 518, the process returns to step 510.

ステップ510において、否定判断した場合には、ステップ520に進み、yに1を加算する。そして、ステップ522において、yがパターン画像の高さptn_height未満か否かを判断する。ステップ522で肯定判断した場合には、パターン画像の全てのスキャンラインについてラスタ形式への変換が終了していないことを示しているため、次のスキャンラインのラスタ形式への変換を行なうために、ステップ510に戻る。   If a negative determination is made in step 510, the process proceeds to step 520, and 1 is added to y. In step 522, it is determined whether y is less than the height ptn_height of the pattern image. If the determination in step 522 is affirmative, it indicates that conversion to the raster format has not been completed for all the scan lines of the pattern image, so that the next scan line is converted to the raster format. Return to step 510.

また、ステップ522で否定判断した場合には、パターン画像の全てのスキャンラインについてラスタ形式への変換が終了したことを示しているため、ステップ524に進み、エッジリスト形式のパターン画像情報をメモリ領域PA1から削除し、メモリ領域PA1を解放する。   Further, when a negative determination is made in step 522, it indicates that the conversion to the raster format has been completed for all the scan lines of the pattern image, so the flow proceeds to step 524, and the pattern image information in the edge list format is stored in the memory area. Delete from PA1 and release memory area PA1.

ステップ526では、typeの値を「edgelist」から「hybrid」に変更する。   In step 526, the value of type is changed from “edgelist” to “hybrid”.

次に、図18のステップ164で実行されるラスタ形式のパターン画像に対する描画処理について詳細に説明する。図32は、ラスタ形式のパターン画像に対する描画処理の流れを示すフローチャートである。   Next, the rendering process for the raster format pattern image executed in step 164 of FIG. 18 will be described in detail. FIG. 32 is a flowchart showing the flow of a drawing process for a raster pattern image.

ステップ600では、読み込んだ描画コマンドの種類を判断する。描画コマンドがイメージ描画コマンドであれば、ステップ602で、イメージ描画コマンドのラスタ形式描画処理を実行し、描画コマンドがグラフィックス描画コマンドであれば、ステップ604で、グラフィックス描画コマンドのラスタ形式描画処理を実行し、描画コマンドが文字描画コマンドであれば、ステップ606で、文字描画コマンドのラスタ形式描画処理を実行する。   In step 600, the type of the read drawing command is determined. If the drawing command is an image drawing command, raster drawing processing of the image drawing command is executed in step 602. If the drawing command is a graphics drawing command, raster drawing processing of the graphics drawing command is executed in step 604. If the drawing command is a character drawing command, raster drawing processing of the character drawing command is executed in step 606.

図33は、ステップ602で行われるイメージ描画コマンドのラスタ形式描画処理の流れを示すフローチャートである。   FIG. 33 is a flowchart showing the flow of the raster drawing process of the image drawing command performed in step 602.

ステップ620では、イメージ描画コマンドにより指定された、イメージ画像のパターン画像における描画開始位置の情報を取得して、(x_offset、 y_offset)にセットすると共に、該イメージ画像の幅・高さの情報を取得して、(width, height)にセットする。   In step 620, information on the drawing start position in the pattern image of the image image specified by the image drawing command is acquired and set to (x_offset, y_offset), and information on the width and height of the image image is acquired. And set it to (width, height).

ステップ622では、[x_offset+width]及び[ptn_width-1]のいずれか小さい方の値を、x_endにセットする。ここで、ptn_widthは、前述したように、パターン画像の幅を示す値である。   In step 622, the smaller one of [x_offset + width] and [ptn_width-1] is set to x_end. Here, as described above, ptn_width is a value indicating the width of the pattern image.

更に、ステップ622では、[y_offset+width]及び[ptn_height-1]のいずれか小さい方の値を、y_endにセットする。ここで、ptn_heightは、前述したように、パターン画像の高さを示す値である。   In step 622, the smaller one of [y_offset + width] and [ptn_height-1] is set in y_end. Here, as described above, ptn_height is a value indicating the height of the pattern image.

ステップ624では、yに0をセットする。   In step 624, 0 is set to y.

ステップ626では、[y + y_offset]が、y_endより小さいか否か判断する。パターン画像の矩形領域外の部分に対する描画は不要であり、Y軸方向に不要な描画を行なわないためにステップ626が設けられている。ステップ626で、肯定判断した場合には、ステップ628に進む。   In step 626, it is determined whether [y + y_offset] is smaller than y_end. Drawing is not necessary for a portion outside the rectangular area of the pattern image, and step 626 is provided to prevent unnecessary drawing in the Y-axis direction. If an affirmative determination is made in step 626, the process proceeds to step 628.

ステップ628では、イメージ画像の矩形領域の左上を原点(0,0)としたときのイメージ画像の座標(0, y)から座標(x_end - x_offset, y)までの領域の各画素の色値を、パターン画像の矩形領域の左上を原点(0,0)としたときのパターン画像の座標(x_offset, y + y_offset)から座標(x_end, y + y_offset)までの領域の各画素の色値として、パターン画像用のメモリPA2に書き込む(コピーする)。   In step 628, the color value of each pixel in the region from the coordinate (0, y) of the image image to the coordinate (x_end-x_offset, y) when the upper left corner of the rectangular region of the image image is the origin (0, 0). As the color value of each pixel in the area from the coordinate (x_offset, y + y_offset) to the coordinate (x_end, y + y_offset) when the upper left corner of the rectangular area of the pattern image is the origin (0,0), Write (copy) to the pattern image memory PA2.

ステップ630では、スキャンライン[y + y_offset]におけるx_offsetからx_endまでの範囲がマスク範囲(パターン画像における画像領域)となるように、マスク情報へのマスク範囲の追加処理を行なう。パターン画像用のメモリ領域PA2に新たにイメージ画像が描画されると、描画した画像及び描画位置によってはパターン画像における画像領域が変化することがある。そこで、マスク情報へのマスク範囲を追加する追加処理を行なうようにしている。詳細は後述する。   In step 630, the mask range is added to the mask information so that the range from x_offset to x_end in the scan line [y + y_offset] becomes the mask range (image area in the pattern image). When an image image is newly drawn in the pattern image memory area PA2, the image area in the pattern image may change depending on the drawn image and the drawing position. Therefore, an additional process for adding a mask range to the mask information is performed. Details will be described later.

ステップ630の後は、ステップ632に進み、yに1を加算して、ステップ626に戻り、次のスキャンラインについて、上記と同様に描画処理を行なう。   After step 630, the process proceeds to step 632, 1 is added to y, and the process returns to step 626 to perform the drawing process for the next scan line in the same manner as described above.

なお、ステップ626で否定判断した場合には、本描画処理を終了する。これにより、Y軸方向においてパターン画像の矩形領域外の範囲に対する描画はなされない。   If a negative determination is made in step 626, the drawing process is terminated. As a result, drawing is not performed on a range outside the rectangular area of the pattern image in the Y-axis direction.

次に、上記ステップ630で行われるマスク情報へのマスク範囲の追加処理について説明する。図34は、マスク情報へのマスク範囲の追加処理の流れを示すフローチャートである。   Next, a process for adding a mask range to the mask information performed in step 630 will be described. FIG. 34 is a flowchart showing the flow of processing for adding a mask range to mask information.

ステップ650では、add_yに、追加するマスク範囲のY座標をセットする。本マスク範囲の追加処理ルーチンが図33のイメージ描画コマンドのラスタ形式描画処理ルーチンから呼び出された場合には、add_yには、[y + y_offset]の値がセットされる。本マスク範囲の追加処理ルーチンが、後述するグラフィックス描画コマンドのラスタ形式描画処理ルーチン及び文字描画コマンドのラスタ形式描画処理ルーチンから呼び出された場合には、add_yには、yの値がセットされる。   In step 650, the Y coordinate of the mask range to be added is set in add_y. When this mask range addition processing routine is called from the raster drawing processing routine of the image drawing command in FIG. 33, the value of [y + y_offset] is set to add_y. When this mask range addition processing routine is called from a graphics rendering command raster format rendering processing routine and a character rendering command raster format rendering processing routine, which will be described later, the value y is set in add_y. .

また、ステップ650では、start_xに、追加する範囲のX座標の始点をセットする。本マスク範囲の追加処理ルーチンが図33のイメージ描画コマンドのラスタ形式描画処理ルーチンから呼び出された場合には、start_xには、x_offsetの値がセットされる。本マスク範囲の追加処理ルーチンが、後述するグラフィックス描画コマンドのラスタ形式描画処理ルーチン及び文字描画コマンドのラスタ形式描画処理ルーチンから呼び出された場合には、start_xには、x_startの値がセットされる。   In step 650, the start point of the X coordinate of the range to be added is set in start_x. When this mask range addition processing routine is called from the raster drawing processing routine of the image drawing command of FIG. 33, the value of x_offset is set to start_x. When this mask range addition processing routine is called from the graphics drawing command raster format drawing processing routine and the character drawing command raster format drawing processing routine described later, the value of x_start is set to start_x. .

また、ステップ650では、end_xに、追加する範囲のX座標の終点をセットする。ここでは、end_xには、x_endの値がセットされる。   In step 650, the end point of the X coordinate of the range to be added is set in end_x. Here, the value of x_end is set in end_x.

ステップ652では、typeの値がhybridか否かを判断する。ステップ652で肯定判断した場合には、マスク情報はメモリ領域MA1にエッジリスト形式で保持されているため、ステップ656で、マスク情報のエッジデータを作成する。ここでは、上記start_xの値をエッジデータの始点startの値とし、上記end_xの値をエッジデータの終点endの値とし、エッジデータのマスク値maskの値を1にし、アドレスnextの値はNULLにして作成する。   In step 652, it is determined whether the value of type is hybrid. If the determination in step 652 is affirmative, the mask information is stored in the memory area MA1 in the form of an edge list. Therefore, in step 656, edge data for the mask information is created. Here, the above start_x value is the start data start point start value, the above end_x value is the edge data end point end value, the edge data mask value mask value is 1, and the next address value is NULL. Create.

ステップ658では、マスク情報のスキャンラインadd_yのエッジリストに、上記作成したエッジデータを追加する。ここで行われる、エッジリストへのエッジデータの追加処理は、着目スキャンラインをadd_yとして、図22及び図31を用いて説明したように実行する。   In step 658, the created edge data is added to the edge list of the scan line add_y of the mask information. The processing of adding edge data to the edge list performed here is executed as described with reference to FIGS. 22 and 31 with the target scan line as add_y.

ステップ660では、マスク情報のエッジデータ数が予め定められた閾値TH2を超えたか否かを判断する。ステップ660において、肯定判断した場合には、ステップ662に進み、エッジリスト形式のマスク情報をラスタ形式に変換する処理を行なう。ステップ662の処理は後述する。ステップ662の後は、ステップ664において、typeの値を、ラスタ形式を示すrasterに変更し、マスク範囲追加処理を終了する。。   In step 660, it is determined whether or not the number of edge data of the mask information exceeds a predetermined threshold TH2. If the determination in step 660 is affirmative, the process proceeds to step 662 to perform processing for converting the edge list format mask information into a raster format. The process of step 662 will be described later. After step 662, in step 664, the value of type is changed to raster indicating the raster format, and the mask range adding process is terminated. .

一方、ステップ660において、否定判断した場合には、ステップ662、664をスキップしてマスク範囲追加処理を終了する。   On the other hand, if a negative determination is made in step 660, steps 662 and 664 are skipped and the mask range addition process is terminated.

一方、ステップ652で、否定判断した場合には、マスク情報はラスタ形式で保存されているため、マスク情報における座標(start_x, add_y)から座標(end_x, add_y)までの範囲の各画素のマスク値を1にする。すなわち、ラスタ形式のマスク情報では、1画素が1ビットで表されるため、該ビットを1にする。そして、マスク範囲追加処理を終了する。   On the other hand, if a negative determination is made in step 652, the mask information is stored in a raster format, so the mask value of each pixel in the range from the coordinates (start_x, add_y) to the coordinates (end_x, add_y) in the mask information Set to 1. That is, in the raster format mask information, since one pixel is represented by one bit, the bit is set to one. Then, the mask range addition process ends.

次に、上記ステップ662で行われるマスク情報をラスタ形式に変換する処理について説明する。図35は、マスク情報をラスタ形式に変換する処理の流れを示すフローチャートである。   Next, the process of converting the mask information performed in step 662 into a raster format will be described. FIG. 35 is a flowchart showing a flow of processing for converting mask information into a raster format.

ステップ700では、ラスタ形式のマスク情報を格納するためのマスク情報用のメモリ領域MA2をメモリ12Bに確保する。本実施の形態では、ラスタ形式のマスク情報は、1画素1ビット必要となるため、パターン画像の幅×高さ×1ビットのメモリ領域MA2が確保される。   In step 700, a memory area MA2 for mask information for storing mask information in raster format is secured in the memory 12B. In the present embodiment, since raster format mask information requires one bit per pixel, a memory area MA2 of width × height × 1 bit of the pattern image is secured.

ステップ702では、上記確保したマスク情報用のメモリ領域MA2を0でクリアする。すなわち、本実施の形態では、マスク情報の全画素のマスク値が0を示すように初期化される。   In step 702, the reserved mask information memory area MA2 is cleared to zero. That is, in the present embodiment, initialization is performed so that the mask values of all the pixels of the mask information indicate 0.

ステップ704では、mask_yに0をセットする。   In step 704, 0 is set in mask_y.

ステップ706では、メモリ領域MA1に記憶されているエッジリスト形式のマスク情報からスキャンラインmask_yのエッジリストの先頭のエッジデータを取得する。   In step 706, the edge data at the head of the edge list of the scan line mask_y is obtained from the mask information in the edge list format stored in the memory area MA1.

ステップ708では、スキャンラインmask_yにエッジデータがあるか否かを判断する。ステップ708がステップ706の直後に実行される場合において、ステップ706での取得が成功した(取得すべきエッジデータがあった)ときには、ステップ708で肯定判断され、ステップ706での取得が失敗した(取得すべきエッジデータがなかった)ときには、ステップ708で否定判断される。また、ステップ708が後述するステップ712の直後に実行される場合において、ステップ712での取得が成功した(取得すべきエッジデータがあった)ときには、ステップ708で肯定判断され、ステップ712での取得が失敗した(取得すべきエッジデータがなかった)ときには、ステップ708で否定判断される。   In step 708, it is determined whether there is edge data in the scan line mask_y. When step 708 is executed immediately after step 706, if acquisition in step 706 is successful (there is edge data to be acquired), an affirmative determination is made in step 708 and acquisition in step 706 fails ( If there is no edge data to be acquired, a negative determination is made at step 708. When step 708 is executed immediately after step 712, which will be described later, if the acquisition in step 712 is successful (there is edge data to be acquired), an affirmative determination is made in step 708 and the acquisition in step 712 is performed. Is failed (there is no edge data to be acquired), a negative determination is made at step 708.

ステップ708で肯定判断した場合には、ステップ710で、マスク情報用のメモリ領域MA2における、ラスタ形式のマスク情報の、始点(start, mask_y)から終点(end, mask_y)までの範囲の画素に対するマスク値(上記初期化により0となっている)を、1に変更する(上書きする)。ここで、startは取得したエッジデータの始点startの値であり、endは取得したエッジデータの終点endの値である。   If the determination in step 708 is affirmative, in step 710, the mask for the pixels in the range from the start point (start, mask_y) to the end point (end, mask_y) of the mask information in the raster format in the mask information memory area MA2. Change the value (which is 0 by the above initialization) to 1 (overwrite). Here, start is the value of the start point start of the acquired edge data, and end is the value of the end point end of the acquired edge data.

ステップ712では、スキャンラインmask_yのエッジリストから次のエッジデータを取得する。具体的には、上記取得したエッジデータのアドレスnextに格納されているアドレスからエッジデータを取得する。ただし、アドレスnextの値がNULLの場合には取得失敗となる。ステップ712の後は、ステップ708に戻る。   In step 712, the next edge data is acquired from the edge list of the scan line mask_y. Specifically, edge data is acquired from the address stored at the address next of the acquired edge data. However, if the value of the address next is NULL, acquisition fails. After step 712, the process returns to step 708.

ステップ708において、否定判断した場合には、ステップ714に進み、mask_yに1を加算する。そして、ステップ716において、mask_yがパターン画像の高さptn_height未満か否かを判断する。ステップ716で肯定判断した場合には、全てのスキャンラインについてマスク情報のラスタ形式への変換が終了していないことを示しているため、次のスキャンラインの変換を行なうために、ステップ706に戻る。   If a negative determination is made in step 708, the process proceeds to step 714, and 1 is added to mask_y. In step 716, it is determined whether mask_y is less than the height ptn_height of the pattern image. If the determination in step 716 is affirmative, it indicates that the conversion of the mask information into the raster format has not been completed for all the scan lines, so the process returns to step 706 in order to convert the next scan line. .

また、ステップ716で否定判断した場合には、全てのスキャンラインについてマスク情報のラスタ形式への変換が終了したことを示しているため、ステップ718に進み、エッジリスト形式のマスク情報をメモリ領域MA1から削除し、メモリ領域MA1を解放する。   If a negative determination is made in step 716, it indicates that the conversion of the mask information into the raster format has been completed for all the scan lines. Therefore, the process proceeds to step 718, and the mask information in the edge list format is stored in the memory area MA1. And the memory area MA1 is released.

次に、ステップ604のグラフィックス描画コマンドのラスタ形式描画処理について説明する。図36は、グラフィックス描画コマンドのラスタ形式描画処理の流れを示すフローチャートである。   Next, the raster format drawing process of the graphics drawing command in step 604 will be described. FIG. 36 is a flowchart showing the flow of raster format rendering processing of a graphics rendering command.

ステップ740では、グラフィックス描画コマンドにより指定された描画色を取得してg_colorにセットする。例えば、図10に示す定義命令に含まれるグラフィック描画コマンドfillRectに対して、with colorで指定された色が描画色である。   In step 740, the drawing color designated by the graphics drawing command is acquired and set in g_color. For example, for the graphic drawing command “fillRect” included in the definition command shown in FIG. 10, the color specified by “with color” is the drawing color.

ステップ742では、グラフィックス描画コマンドにより指定された描画領域のY座標の範囲を求める。例えば、図10に示す例では、図10の(2)に示す描画コマンドのfillRectに続く(0,0,3,3)において、最初の2つの数値が、パターン画像におけるグラフィックス画像の描画開始位置であり、それに続く2つの数値が、描画するグラフィックス画像の幅及び高さを示す画素数であることから、グラフィックス描画コマンドの描画領域のY座標の最小値は、描画開始位置のY座標0、Y座標値の最大値は、該描画開始位置Y座標0に高さ3を加算した3となる。そして、このY座標の最小値をy_startにセットし、最大値をy_endにセットする。   In step 742, the range of the Y coordinate of the drawing area designated by the graphics drawing command is obtained. For example, in the example shown in FIG. 10, in (0,0,3,3) following the fill command of the drawing command shown in (2) of FIG. 10, the first two numerical values are the start of drawing a graphics image in the pattern image. Position, and the following two numerical values are the number of pixels indicating the width and height of the graphics image to be drawn. Therefore, the minimum value of the Y coordinate of the drawing area of the graphics drawing command is Y at the drawing start position. The maximum value of coordinate 0 and Y coordinate value is 3, which is obtained by adding height 3 to the drawing start position Y coordinate 0. Then, the minimum value of this Y coordinate is set to y_start, and the maximum value is set to y_end.

ステップ744では、yにy_startの値をセットする。   In step 744, y is set to y_start.

ステップ746では、グラフィックス描画コマンドにより描画するグラフィックス画像について、スキャンラインyにおけるスキャン変換処理(画像のエッジを抽出する処理)を行い、スキャンラインyにおけるX軸上の描画範囲x_start、x_endを求める。   In step 746, scan conversion processing (processing for extracting image edges) on the scan line y is performed on the graphics image drawn by the graphics drawing command, and drawing ranges x_start and x_end on the X axis in the scan line y are obtained. .

ステップ748では、ラスタ形式のパターン画像の、始点(x_start, y)から終点(x_end, y)までの範囲の画素の色値を、描画色g_colorの値に変更する(g_colorの値を書き込む)。   In step 748, the color value of the pixel in the range from the start point (x_start, y) to the end point (x_end, y) of the raster pattern image is changed to the value of the drawing color g_color (the value of g_color is written).

ステップ750では、スキャンラインyにおけるx_startからx_endまでの範囲がマスク範囲となるように、マスク情報へのマスク範囲の追加処理を行なう。このマスク範囲の追加処理は、上記で図34を用いて説明したように実行する。   In step 750, the mask range is added to the mask information so that the range from x_start to x_end in the scan line y becomes the mask range. This mask range addition processing is executed as described above with reference to FIG.

ステップ752では、yに1を加算する。   In step 752, 1 is added to y.

ステップ752では、yがy_end以下であるか否かを判断する。ステップ752で肯定判断した場合には、グラフィックス画像が描画される描画範囲の全てのスキャンラインについての処理が終了していない状態であるため、ステップ746に戻り、次のスキャンラインについて上記処理を繰り返す。また、ステップ752で否定判断した場合には、グラフィックス画像が描画される描画範囲の全てのスキャンラインについての処理が終了した状態であるため、本グラフィックス描画コマンドのラスタ形式描画処理を終了する。   In step 752, it is determined whether y is equal to or less than y_end. If the determination in step 752 is affirmative, the process has not been completed for all the scan lines in the drawing range in which the graphics image is drawn, so the process returns to step 746 and the above process is performed for the next scan line. repeat. If the determination in step 752 is negative, the process for all the scan lines in the drawing range in which the graphics image is drawn has been completed, so the raster drawing process for this graphics drawing command is ended. .

次に、ステップ606の文字描画コマンドのラスタ形式描画処理について説明する。図37は、文字描画コマンドのラスタ形式描画処理の流れを示すフローチャートである。   Next, the raster format rendering process of the character rendering command in step 606 will be described. FIG. 37 is a flowchart showing the flow of raster format rendering processing of a character rendering command.

ステップ770では、文字描画コマンドにより指定された描画色を取得してt_colorにセットする。   In step 770, the drawing color designated by the character drawing command is acquired and set to t_color.

ステップ772では、文字描画コマンドにおいてパターン画像に配置(描画)するよう指定された文字画像の描画開始位置の情報を取得して、(x_offset, y_offset)にセットする。   In step 772, information on the drawing start position of the character image designated to be placed (drawn) on the pattern image in the character drawing command is acquired and set to (x_offset, y_offset).

ステップ774では、文字ビットマップデータを取得する。   In step 774, character bitmap data is obtained.

ステップ776では、char_xに0をセットすると共に、char_yに0をセットする。   In step 776, 0 is set to char_x and 0 is set to char_y.

ステップ778では、上記取得した文字ビットマップデータから文字のエッジ抽出を行なう。具体的には、上記で図27を用いて説明したように実行する。   In step 778, a character edge is extracted from the acquired character bitmap data. Specifically, the processing is performed as described above with reference to FIG.

ステップ778の文字のエッジ抽出処理が終了した後は、ステップ780に進む。ステップ780では、エッジ抽出が成功したか否かを判断する。ステップ780で肯定判断した場合には、ステップ782に進み、x_startに[edge_x + x_offset]の値をセットし、x_endに[edge_x_end + x_offset]の値をセットし、yに[edge_y + y_offset]の値をセットする。   After the character edge extraction process in step 778 is completed, the process proceeds to step 780. In step 780, it is determined whether the edge extraction is successful. If an affirmative determination is made in step 780, the process proceeds to step 782, in which x_start is set to [edge_x + x_offset], x_end is set to [edge_x_end + x_offset], and y is [edge_y + y_offset]. Set.

ステップ784では、ラスタ形式のパターン画像の、始点(x_start, y)から終点(x_end, y)までの範囲の画素の色値を、描画色t_colorの値に変更する(t_colorの値を書き込む)。   In step 784, the color value of the pixel in the range from the start point (x_start, y) to the end point (x_end, y) of the raster pattern image is changed to the value of the drawing color t_color (the value of t_color is written).

ステップ786では、スキャンラインyにおけるx_startからx_endまでの範囲がマスク範囲となるように、マスク情報へのマスク範囲の追加処理を行なう。具体的には、上記で図34を用いて説明したように実行する。   In step 786, the mask range is added to the mask information so that the range from x_start to x_end in the scan line y becomes the mask range. Specifically, the processing is performed as described above with reference to FIG.

ステップ786の後は、ステップ778に戻り、次のエッジの抽出を、上記と同様に行う。ステップ778の処理により、新たなエッジが抽出された場合には、ステップ780で肯定判断されるため、上記ステップ782以降の処理が同様に行われる。また、ステップ778で新たなエッジ抽出されなかった場合には、ステップ780で否定判断され、図37の文字描画コマンドのラスタ形式描画処理を終了する。   After step 786, the process returns to step 778, and the next edge is extracted in the same manner as described above. If a new edge is extracted by the process of step 778, an affirmative determination is made in step 780, and thus the processes after step 782 are similarly performed. If no new edge is extracted in step 778, a negative determination is made in step 780, and the raster drawing process of the character drawing command in FIG. 37 is terminated.

次に、図16のステップ110のパターン塗りつぶし処理について詳細に説明する。   Next, the pattern filling process in step 110 of FIG. 16 will be described in detail.

図38は、パターン塗りつぶし処理の流れを示すフローチャートである。   FIG. 38 is a flowchart showing the flow of pattern fill processing.

ステップ800では、使用するパターン画像に関する情報(幅ptn_width、高さptn_height、データ形式type、及びアドレスaddress)を、パターン画像のパターン名に基づいてパターン管理テーブルから取得する。   In step 800, information on the pattern image to be used (width ptn_width, height ptn_height, data format type, and address address) is acquired from the pattern management table based on the pattern name of the pattern image.

ステップ802では、パターン塗りつぶし命令に含まれる塗りつぶしコマンドにより指定されている塗りつぶし範囲のY座標の範囲の最小値y_start、及び最大値y_endを求め(図3(B)も参照。)、該y_startの値をyにセットする。   In step 802, the minimum value y_start and the maximum value y_end of the Y coordinate range of the paint range specified by the paint command included in the pattern paint command are obtained (see also FIG. 3B), and the value of y_start is obtained. Is set to y.

ステップ804では、スキャンラインyにおけるX軸方向の塗りつぶし範囲の最小値x_start、及び最大値x_endを求め(図3(B)も参照。)、該x_startの値をxにセットする。   In step 804, the minimum value x_start and the maximum value x_end of the fill range in the X-axis direction on the scan line y are obtained (see also FIG. 3B), and the value of x_start is set to x.

ステップ806では、塗りつぶし範囲の開始点(x, y)に対応するパターン画像の開始点(ptn_x, ptn_y)を求める(図3(A)も参照。)。更に、ptn_x_lenに、[ptn_width - ptn_x]及び[x_end - ptn_x]のいずれか小さい方の値をセットする。   In step 806, the start point (ptn_x, ptn_y) of the pattern image corresponding to the start point (x, y) of the filling range is obtained (see also FIG. 3A). Further, ptn_x_len is set to a smaller value of [ptn_width−ptn_x] and [x_end−ptn_x].

ステップ808では、x_nextに、[x_ + ptn_x_len]の値をセットする。x_nextは、塗りつぶし範囲の開始点にパターン画像の開始点を合わせてパターン画像を1つ配置して、ページバッファにパターン画像の色値を書き込んだ後の、次の描画開始点のX座標値である。   In step 808, the value of [x_ + ptn_x_len] is set in x_next. x_next is the X coordinate value of the next drawing start point after placing one pattern image with the start point of the pattern image aligned with the start point of the fill range and writing the color value of the pattern image in the page buffer. is there.

ステップ810では、パターン情報のtypeを判断する。上記パターン管理テーブルから取得したtypeの値が、rasterであれば、ステップ812に進み、ラスタ形式のパターン塗りつぶし処理を行なう。ラスタ形式パターンの塗りつぶし処理では、ラスタ形式のパターン情報を用いて、ページバッファのスキャンラインyにおけるX座標値xから[x + ptn_x_len-1]までの範囲の描画(塗りつぶし)が行われる。   In step 810, the type of pattern information is determined. If the value of type acquired from the pattern management table is raster, the process proceeds to step 812 to perform a raster pattern filling process. In the raster pattern fill process, raster pattern information is used to draw (fill) a range from the X coordinate value x to [x + ptn_x_len-1] on the scan line y of the page buffer.

上記パターン管理テーブルから取得したtypeの値が、edgelistであれば、ステップ814に進み、エッジリスト形式パターンの塗りつぶし処理を行なう。エッジリスト形式パターン塗りつぶし処理では、エッジリスト形式のパターン情報を用いて、ページバッファの、スキャンラインyにおけるX座標値xから[x + ptn_x_len -1]までの範囲の描画(塗りつぶし)が行われる。   If the value of type acquired from the pattern management table is edgelist, the process proceeds to step 814, and edge list format pattern fill processing is performed. In the edge list pattern filling process, drawing (filling) is performed in the range from the X coordinate value x to [x + ptn_x_len −1] on the scan line y in the page buffer, using the edge list pattern information.

上記パターン管理テーブルから取得したtypeの値が、hybridであれば、ステップ816に進み、ハイブリッド形式パターンの塗りつぶし処理を行なう。ハイブリッド形式パターンの塗りつぶし処理では、ハイブリッド形式のパターン情報を用いて、ページバッファの、スキャンラインyにおけるX座標値xから[x + ptn_x_len -1]までの範囲の描画(塗りつぶし)が行われる。   If the value of type acquired from the pattern management table is hybrid, the process proceeds to step 816 to perform a hybrid pattern filling process. In the fill processing of the hybrid pattern, drawing (filling) of the range from the X coordinate value x to [x + ptn_x_len −1] in the scan line y of the page buffer is performed using the hybrid format pattern information.

これら各塗りつぶし処理の詳細については後述する。   Details of each of these painting processes will be described later.

ステップ812,814,及び816のいずれかが終了すると、ステップ818に進み、x_nextがx_end以下か否かを判断する。ステップ818において、否定判断した場合には、ステップ820に進み、xにx_nextの値をセットする。ステップ820の後は、ステップ806に戻り、上記と同様に処理する。   When any of Steps 812, 814, and 816 is completed, the process proceeds to Step 818 to determine whether x_next is equal to or less than x_end. If a negative determination is made in step 818, the process proceeds to step 820, where x_next is set to x. After step 820, the process returns to step 806 and the same processing as described above is performed.

すなわち、ステップ806〜ステップ820の処理を繰り返すことで、塗りつぶし範囲のスキャンラインyにおいて、塗りつぶし範囲のX軸方向の開始点をずらしながら、該開始点の各々を書込み位置として、パターン画像のスキャンラインptn_y上の色値を繰り返し複写する(書き込む)ようにしている。   That is, by repeating the processing of Step 806 to Step 820, the start line of the fill range in the X-axis direction is shifted in the scan line y of the fill range, and each start point is used as the writing position to scan the pattern image. The color value on ptn_y is repeatedly copied (written).

一方、ステップ818で、肯定判断した場合には、スキャンラインyにおけるX軸方向の塗りつぶし範囲の最大値x_endまでの塗りつぶし(描画)が終了した状態であるため、ステップ822に進む。ステップ822に進み、yがy_endより小さいか否かを判断する。ステップ822で否定判断した場合には、塗りつぶし範囲のY座標の範囲の最大値y_endまでの塗りつぶしはまだ終了していない状態であるため、ステップ824に進み、次のスキャンラインの塗りつぶしが行われるように、yに1を加算して、ステップ804に戻り、上記と同様に処理する。   On the other hand, if an affirmative determination is made in step 818, since the filling (drawing) up to the maximum value x_end of the filling range in the X-axis direction on the scan line y has been completed, the process proceeds to step 822. Proceeding to step 822, it is determined whether y is smaller than y_end. When a negative determination is made in step 822, since the filling up to the maximum value y_end of the Y coordinate range of the filling range has not been completed yet, the process proceeds to step 824, and the next scan line is filled. 1 is added to y, and the process returns to step 804 to perform the same processing as described above.

また、ステップ822で肯定判断した場合には、塗りつぶし範囲のY座標の範囲の最大値y_endまでの塗りつぶしが終了した状態、すなわち、塗りつぶし範囲に対するパターン画像の描画処理が終了した状態であるため、本パターン塗りつぶし処理を終了する。   If the determination in step 822 is affirmative, since the painting up to the maximum value y_end of the Y coordinate range of the painting range has been completed, that is, the pattern image drawing process for the painting range has been completed, The pattern fill process ends.

ここで、ステップ812、814、及び816の各塗りつぶし処理について、図39から図42までの各図面を用いて説明する。   Here, each filling process in steps 812, 814, and 816 will be described with reference to FIGS. 39 to 42. FIG.

図39は、塗りつぶし処理を概念的に説明する説明図である。図39(A)は、パターン情報がエッジリスト形式の場合の塗りつぶし処理の説明図であり、図39(B)は、パターン情報がハイブリッド形式の場合の塗りつぶし処理の説明図であり、図39(C)には、パターン情報がラスタ形式の場合の塗りつぶし処理の説明図である。なお、図39では、パターン画像の開始点ptn_xからptn_x+lengthまでの領域が、塗りつぶし範囲に対応するスキャンラインptn_yの領域(タイリング領域)として図示されている。   FIG. 39 is an explanatory diagram for conceptually explaining the painting process. 39A is an explanatory diagram of the filling process when the pattern information is in the edge list format, and FIG. 39B is an explanatory diagram of the painting process when the pattern information is in the hybrid format. C) is an explanatory diagram of a painting process when the pattern information is in a raster format. In FIG. 39, an area from the start point ptn_x to ptn_x + length of the pattern image is illustrated as an area (tiling area) of the scan line ptn_y corresponding to the filled range.

まず最初に、図39(C)及び図40を参照して、ステップ812で行われる、パターン情報がラスタ形式(パターン画像情報及びマスク情報の各々がラスタ形式)の場合の塗りつぶし処理について説明する。   First, with reference to FIG. 39C and FIG. 40, description will be given of the filling processing performed in step 812 when the pattern information is in the raster format (the pattern image information and the mask information are each in the raster format).

図40において、ステップ840では、パターン画像情報から座標(ptn_x, ptn_y)の色値を取得し、ptn_x_colorにセットする。   In FIG. 40, in step 840, the color value of the coordinates (ptn_x, ptn_y) is acquired from the pattern image information and set to ptn_x_color.

ステップ842では、マスク情報から、座標(ptn_x, ptn_y)のマスク値を取得し、ptn_x_maskにセットする。   In step 842, the mask value of coordinates (ptn_x, ptn_y) is acquired from the mask information and set in ptn_x_mask.

ステップ844では、ptn_x_maskが1か否かを判断する。ステップ844で肯定判断した場合には、ステップ846に進み、ptn_x_colorの値をページバッファの座標(x,y)に書き込む(図39(C)も参照。)。   In step 844, it is determined whether ptn_x_mask is 1. When an affirmative determination is made in step 844, the process proceeds to step 846, and the value of ptn_x_color is written in the coordinates (x, y) of the page buffer (see also FIG. 39C).

一方、ステップ844で、否定判断した場合には、座標(ptn_x, ptn_y)のマスク値が、非画像領域の画素であることを示す0であるため、ステップ846の書込みを行なわずに(図39(C)も参照。)、ステップ848に進む。   On the other hand, if a negative determination is made in step 844, the mask value of the coordinates (ptn_x, ptn_y) is 0 indicating that it is a pixel in the non-image area, so the writing in step 846 is not performed (FIG. 39). (See also (C).), Go to step 848.

ステップ848では、ptn_x_lenから1を減算し、ptn_xに1を加算し、xに1を加算して、ステップ850に進む。   In step 848, 1 is subtracted from ptn_x_len, 1 is added to ptn_x, 1 is added to x, and the flow proceeds to step 850.

ステップ850では、ptn_x_lenが0より大きいか否かを判断する。ステップ850で、肯定判断した場合には、ステップ840に戻り、次の画素について上記と同様に書込みを行なう。また、ステップ850で否定判断した場合には、本塗りつぶし処理を終了する。   In step 850, it is determined whether ptn_x_len is greater than zero. If an affirmative determination is made in step 850, the process returns to step 840 and writing is performed for the next pixel in the same manner as described above. On the other hand, if a negative determination is made in step 850, the fill process is terminated.

次に、図39(A)及び図41を参照して、ステップ814で行われる、パターン情報がエッジリスト形式(パターン画像情報がエッジリスト形式)の場合の塗りつぶし処理について説明する。   Next, with reference to FIG. 39 (A) and FIG. 41, the painting process performed in step 814 when the pattern information is in the edge list format (pattern image information is in the edge list format) will be described.

ステップ870では、パターン画像情報のスキャンラインptn_yのエッジリストの先頭エッジデータptn_edgeを取得する。   In step 870, the first edge data ptn_edge of the edge list of the scan line ptn_y of the pattern image information is acquired.

ステップ872では、エッジデータptn_edgeの始点startの値を、ptn_edge_sxにセットし、ptn_edgeの終点endの値を、ptn_edge_exにセットし、ptn_edgeの色値colorの値を、ptn_edge_colorにセットする。   In step 872, the value of the start point start of the edge data ptn_edge is set to ptn_edge_sx, the value of the end point end of ptn_edge is set to ptn_edge_ex, and the color value color of ptn_edge is set to ptn_edge_color.

ステップ874では、[ptn_x + ptn_x_len - 1]の値が、取得したエッジデータの始点ptn_edge_sxの値より小さいか否かを判断する。すなわち、パターン画像のスキャンラインptn_yにおける描画範囲(図39のタイリング領域)の終点が、取得したエッジデータの始点より小さければ、該エッジデータの区間はパターン画像の描画範囲外であることを示している。更に、エッジデータは、X軸方向に順に連結されるため、これ以降のエッジデータも、描画範囲外となる。従って、ここで肯定判断された場合には、本塗りつぶし処理が終了する。なお、図示は省略するが、もともとスキャンラインptn_yにエッジデータが存在せず、ステップ870でエッジデータが取得されなかった場合も、本塗りつぶし処理は終了する。   In step 874, it is determined whether the value of [ptn_x + ptn_x_len−1] is smaller than the value of the start point ptn_edge_sx of the acquired edge data. That is, if the end point of the drawing range (the tiling area in FIG. 39) in the scan line ptn_y of the pattern image is smaller than the start point of the acquired edge data, it indicates that the section of the edge data is outside the drawing range of the pattern image. ing. Further, since the edge data is sequentially connected in the X-axis direction, the subsequent edge data is also outside the drawing range. Therefore, when an affirmative determination is made here, the main filling process ends. Although illustration is omitted, this fill processing is also ended when no edge data originally exists in the scan line ptn_y and no edge data is acquired in step 870.

一方、ステップ874で、否定判断した場合には、ステップ876に進む。ステップ876では、パターン画像におけるX軸上の開始点ptn_x(パターン画像のスキャンラインptn_yにおける描画範囲の始点)が、取得したエッジデータの終点ptn_edge_exより大きいか否かを判断する。すなわち、パターン画像のスキャンラインptn_yにおける描画範囲の始点が、取得したエッジデータの終点より大きければ、取得したエッジデータの区間は、X軸方向においてパターン画像の描画範囲外に存在することとなる。従って、ステップ876で肯定判断された場合には、次のエッジデータを取得するため、ステップ888に進む。ステップ888については後述する。   On the other hand, if a negative determination is made in step 874, the process proceeds to step 876. In step 876, it is determined whether or not the start point ptn_x on the X axis in the pattern image (the start point of the drawing range on the scan line ptn_y of the pattern image) is greater than the end point ptn_edge_ex of the acquired edge data. That is, if the starting point of the drawing range on the scan line ptn_y of the pattern image is larger than the end point of the acquired edge data, the acquired edge data section exists outside the drawing range of the pattern image in the X-axis direction. Accordingly, if an affirmative determination is made in step 876, the process proceeds to step 888 to acquire the next edge data. Step 888 will be described later.

一方、ステップ876で否定判断した場合には、取得したエッジデータの区間の一部又は全体が、パターン画像におけるスキャンラインptn_y上の描画範囲の一部又は全体と重複していることを示している。例えば、図39(A)に示すように、edge1及びedge2の各区間は、パターン画像におけるスキャンラインptn_y上の描画範囲の一部と重複している。このような位置関係の場合には、ステップ876で否定判断されるため、ステップ878に進む。   On the other hand, when a negative determination is made in step 876, it indicates that a part or the whole of the acquired edge data section overlaps a part or the whole of the drawing range on the scan line ptn_y in the pattern image. . For example, as shown in FIG. 39A, each section of edge1 and edge2 overlaps a part of the drawing range on the scan line ptn_y in the pattern image. In the case of such a positional relationship, since a negative determination is made in step 876, the process proceeds to step 878.

ステップ878では、パターン画像におけるX軸上の開始点ptn_xが、取得したエッジデータの始点ptn_edge_sxより小さいか否かを判断する。ここで肯定判断した場合には、パターン画像におけるスキャンラインptn_y上の開始点ptn_xに対して、取得したエッジデータの区間の始点が、例えば図39(A)のedge2に示す位置関係となっていることを示している。そこで、ステップ878で、肯定判断した場合には、ステップ880に進む。   In step 878, it is determined whether the start point ptn_x on the X axis in the pattern image is smaller than the start point ptn_edge_sx of the acquired edge data. If an affirmative determination is made here, the start point of the acquired edge data section with respect to the start point ptn_x on the scan line ptn_y in the pattern image has, for example, a positional relationship indicated by edge2 in FIG. It is shown that. Therefore, if an affirmative determination is made in step 878, the process proceeds to step 880.

ステップ880では、ptn_xから[ptn_edge_sx -1]までの範囲は描画しない(色値を書き込まない)ため、描画の開始点をptn_edge_sxに変更する。具体的には、xに[ptn_edge_sx - ptn_x]の値を加算し、ptn_x_lenから[ptn_edge_sx - ptn_x]の値を減算し、ptn_xに、ptn_edge_sxの値をセットする。そして、ステップ882に進む。   In step 880, since the range from ptn_x to [ptn_edge_sx-1] is not drawn (color value is not written), the drawing start point is changed to ptn_edge_sx. Specifically, the value of [ptn_edge_sx−ptn_x] is added to x, the value of [ptn_edge_sx−ptn_x] is subtracted from ptn_x_len, and the value of ptn_edge_sx is set to ptn_x. Then, the process proceeds to Step 882.

一方、ステップ878で否定判断した場合には、パターン画像におけるスキャンラインptn_y上の開始点ptn_xに対して、取得したエッジでデータの区間の始点が、例えば図39(A)のedge1に示す位置関係となっていることを示している。従って、ptn_xから描画されるよう、ステップ880をスキップしてステップ882に進む。   On the other hand, if a negative determination is made in step 878, the start point of the data section at the acquired edge with respect to the start point ptn_x on the scan line ptn_y in the pattern image is, for example, the positional relationship indicated by edge1 in FIG. It is shown that. Therefore, step 880 is skipped and the process proceeds to step 882 so that drawing is performed from ptn_x.

ステップ882では、draw_lenに、[ptn_x_len]及び[ptn_edge_ex - ptn_edge_sx +1]のいずれか小さい方の値をセットする。draw_lenはX軸上の描画する範囲の長さを示している。   In step 882, draw_len is set to a smaller one of [ptn_x_len] and [ptn_edge_ex−ptn_edge_sx + 1]. draw_len indicates the length of the drawing range on the X axis.

ステップ884では、イメージバッファの座標(x, y)から座標(x + draw_len - 1, y)までの範囲へ、ptn_edge_colorの値を書き込む(図39の(A)も参照。)。   In step 884, the value of ptn_edge_color is written in the range from the coordinates (x, y) to the coordinates (x + draw_len−1, y) in the image buffer (see also FIG. 39A).

ステップ886では、xにdraw_lenの値を加算し、ptn_x_lenからdraw_lenの値を減算し、ptn_xに、draw_lenの値を加算する。すなわち、[ptn_x + draw_len - 1]まで描画したので、次の描画の開始点を[ptn_x + draw_len]に移動する。   In step 886, the value of draw_len is added to x, the value of draw_len is subtracted from ptn_x_len, and the value of draw_len is added to ptn_x. That is, since [ptn_x + draw_len−1] is drawn, the starting point of the next drawing is moved to [ptn_x + draw_len].

ステップ886の処理後、及びステップ876で肯定判断した場合には、ステップ888に進む。   After the processing of step 886 and when an affirmative determination is made in step 876, the process proceeds to step 888.

ステップ888では、ptn_x_lenが0より大きく、かつ、次のエッジデータが存在するか否かを判断する。ステップ888で肯定判断した場合には、ステップ890で、エッジデータptn_edgeのアドレスnextに格納されているアドレスが示す記憶領域から、次のエッジデータを取得し、新たに取得したエッジデータを、エッジデータptn_edgeとして用いて、ステップ872に戻り、上記処理を繰り返す。また、ステップ888で否定判断した場合には、パターン画像のスキャンラインptn_yにおける描画が終了したことを示しているため、本塗りつぶし処理が終了する。   In step 888, it is determined whether ptn_x_len is greater than 0 and whether the next edge data exists. If the determination in step 888 is affirmative, in step 890, the next edge data is acquired from the storage area indicated by the address stored in the address next of the edge data ptn_edge, and the newly acquired edge data is converted into the edge data. Using as ptn_edge, the process returns to step 872 and the above processing is repeated. In addition, when a negative determination is made in step 888, this indicates that drawing on the scan line ptn_y of the pattern image has ended, and thus the main filling process ends.

次に、図39(B)及び図42を参照して、ステップ816で行われる、パターン情報がハイブリッド形式(パターン画像情報がラスタ形式でマスク情報がエッジリスト形式)の場合の塗りつぶし処理について説明する。   Next, with reference to FIGS. 39B and 42, a description will be given of the filling process performed in step 816 when the pattern information is in the hybrid format (the pattern image information is in the raster format and the mask information is in the edge list format). .

ステップ900では、マスク情報のスキャンラインptn_yのエッジリストの先頭エッジデータptn_edgeを取得する。   In step 900, the first edge data ptn_edge of the edge list of the scan line ptn_y of the mask information is acquired.

ステップ902では、エッジデータptn_edgeの始点startの値を、ptn_edge_sxにセットし、ptn_edgeの終点endの値を、ptn_edge_exにセットする。   In step 902, the value of the start point start of the edge data ptn_edge is set to ptn_edge_sx, and the value of the end point end of ptn_edge is set to ptn_edge_ex.

ステップ904では、[ptn_x + ptn_x_len - 1]の値が、取得したエッジデータの始点ptn_edge_sxの値より小さいか否かを判断する。すなわち、パターン画像のスキャンラインptn_yにおける描画範囲(図39のタイリング領域)の終点が、取得したエッジデータの始点より小さければ、該エッジデータの区間はパターン画像の描画範囲外であることを示している。更に、エッジデータは、X軸方向に順に連結されるため、これ以降のエッジデータも、描画範囲外となる。従って、ここで肯定判断された場合には、本塗りつぶし処理が終了する。なお、図示は省略するが、もともとスキャンラインptn_yにエッジデータが存在せず、ステップ900でエッジデータが取得されなかった場合も、本塗りつぶし処理は終了する。   In step 904, it is determined whether the value of [ptn_x + ptn_x_len−1] is smaller than the value of the start point ptn_edge_sx of the acquired edge data. That is, if the end point of the drawing range (the tiling area in FIG. 39) in the scan line ptn_y of the pattern image is smaller than the start point of the acquired edge data, it indicates that the section of the edge data is outside the drawing range of the pattern image. ing. Further, since the edge data is sequentially connected in the X-axis direction, the subsequent edge data is also outside the drawing range. Therefore, when an affirmative determination is made here, the main filling process ends. Although illustration is omitted, this fill processing is also ended when no edge data originally exists in the scan line ptn_y and no edge data is acquired in step 900.

一方、ステップ904で、否定判断した場合には、ステップ906に進む。ステップ906では、パターン画像におけるX軸上の開始点ptn_xが、取得したエッジデータの終点ptn_edge_exより大きいか否かを判断する。すなわち、パターン画像のスキャンラインptn_yにおける描画範囲(図39のタイリング領域)の始点が、取得したエッジデータの終点より大きければ、取得したエッジデータの区間は、X軸方向においてパターン画像の描画範囲外に存在することとなる。従って、ステップ904で肯定判断された場合には、次のエッジデータを取得するため、ステップ918に進む。ステップ918については後述する。   On the other hand, if a negative determination is made in step 904, the process proceeds to step 906. In step 906, it is determined whether the start point ptn_x on the X axis in the pattern image is larger than the end point ptn_edge_ex of the acquired edge data. That is, if the start point of the drawing range (the tiling area in FIG. 39) in the scan line ptn_y of the pattern image is larger than the end point of the acquired edge data, the acquired edge data interval is the drawing range of the pattern image in the X-axis direction. It will exist outside. Therefore, if an affirmative determination is made in step 904, the process proceeds to step 918 to obtain the next edge data. Step 918 will be described later.

一方、ステップ906で否定判断した場合には、取得したエッジデータの区間の一部又は全体が、パターン画像におけるスキャンラインptn_y上の描画範囲の一部又は全体と重複していることを示している。例えば、図39(B)に示すように、edge3及びedge4の各区間は、パターン画像におけるスキャンラインptn_y上の描画範囲の一部又は全体と重複している。このような位置関係の場合には、ステップ906で否定判断されるため、ステップ908に進む。   On the other hand, if a negative determination is made in step 906, it indicates that a part or the whole of the acquired edge data section overlaps a part or the whole of the drawing range on the scan line ptn_y in the pattern image. . For example, as shown in FIG. 39B, each section of edge3 and edge4 overlaps a part or the whole of the drawing range on the scan line ptn_y in the pattern image. In the case of such a positional relationship, a negative determination is made in step 906, and thus the process proceeds to step 908.

ステップ908では、パターン画像におけるX軸上の開始点ptn_xが、取得したエッジデータの始点ptn_edge_sxより小さいか否かを判断する。ここで肯定判断した場合には、パターン画像におけるスキャンラインptn_y上の開始点ptn_xに対して、取得したエッジデータの区間の始点が、例えば図39(B)のedge4に示す位置関係となっていることを示している。そこで、ステップ908で、肯定判断した場合には、ステップ910に進む。   In step 908, it is determined whether the start point ptn_x on the X axis in the pattern image is smaller than the start point ptn_edge_sx of the acquired edge data. If an affirmative determination is made here, the start point of the acquired edge data section with respect to the start point ptn_x on the scan line ptn_y in the pattern image has, for example, a positional relationship indicated by edge4 in FIG. It is shown that. Therefore, if an affirmative determination is made in step 908, the operation proceeds to step 910.

ステップ910では、ptn_xから[ptn_edge_sx -1]までの範囲は描画しない(画素値を書き込まない)ため、描画の開始点をptn_edge_sxに変更する。具体的には、xに[ptn_edge_sx - ptn_x]の値を加算し、ptn_x_lenから[ptn_edge_sx - ptn_x]の値を減算し、ptn_xに、ptn_edge_sxの値をセットする。そして、ステップ912に進む。   In step 910, since the range from ptn_x to [ptn_edge_sx-1] is not drawn (pixel value is not written), the drawing start point is changed to ptn_edge_sx. Specifically, the value of [ptn_edge_sx−ptn_x] is added to x, the value of [ptn_edge_sx−ptn_x] is subtracted from ptn_x_len, and the value of ptn_edge_sx is set to ptn_x. Then, the process proceeds to Step 912.

一方、ステップ908で否定判断した場合には、パターン画像におけるスキャンラインptn_y上の開始点ptn_xに対して、取得したエッジでデータの区間の始点が、例えば図39(B)のedge3に示す位置関係となっていることを示している。従って、ptn_xから描画されるよう、ステップ910をスキップしてステップ912に進む。   On the other hand, if a negative determination is made in step 908, the start point of the data section at the acquired edge with respect to the start point ptn_x on the scan line ptn_y in the pattern image is, for example, the positional relationship indicated by edge3 in FIG. It is shown that. Therefore, step 910 is skipped and the process proceeds to step 912 so that drawing is performed from ptn_x.

ステップ912では、draw_lenに、[ptn_x_len]及び[ptn_edge_ex - ptn_edge_sx +1]のいずれか小さい方の値をセットする。draw_lenはX軸上の描画する範囲の長さを示している。   In step 912, the smaller one of [ptn_x_len] and [ptn_edge_ex−ptn_edge_sx + 1] is set in draw_len. draw_len indicates the length of the drawing range on the X axis.

ステップ914では、パターン画像情報の(ptn_x, ptn_y)から(ptn_x + draw_len -1, ptn_y)までの各画素の色値を、イメージバッファの(x, y)から(x + draw_len - 1, y)までの範囲に書き込む(図39の(B)も参照。)。   In step 914, the color value of each pixel from (ptn_x, ptn_y) to (ptn_x + draw_len-1, ptn_y) of the pattern image information is changed from (x, y) to (x + draw_len-1, y) of the image buffer. (See also FIG. 39B).

ステップ916では、xにdraw_lenの値を加算し、ptn_x_lenからdraw_lenの値を減算し、ptn_xに、draw_lenの値を加算する。すなわち、[ptn_x + draw_len - 1]まで描画したので、次の描画の開始点を[ptn_x + draw_len]に移動する。   In step 916, the value of draw_len is added to x, the value of draw_len is subtracted from ptn_x_len, and the value of draw_len is added to ptn_x. That is, since [ptn_x + draw_len−1] is drawn, the starting point of the next drawing is moved to [ptn_x + draw_len].

ステップ916の処理後、及びステップ906で肯定判断した場合には、ステップ918に進む。   After the process of step 916 and when an affirmative determination is made at step 906, the process proceeds to step 918.

ステップ918では、ptn_x_lenが0より大きく、かつ、次のエッジデータが存在するか否かを判断する。ステップ918で肯定判断した場合には、ステップ920で、エッジデータptn_edgeのアドレスnextに格納されているアドレスが示す記憶領域から、次のエッジデータを取得し、新たに取得したエッジデータを、エッジデータptn_edgeとして用いて、ステップ912に戻り、上記処理を繰り返す。また、ステップ918で否定判断した場合には、パターン画像のスキャンラインptn_yにおける描画が終了したことを示しているため、本塗りつぶし処理が終了する。   In step 918, it is determined whether ptn_x_len is greater than 0 and whether the next edge data exists. If the determination in step 918 is affirmative, in step 920, the next edge data is acquired from the storage area indicated by the address stored in the address next of the edge data ptn_edge, and the newly acquired edge data is converted into the edge data. Using as ptn_edge, the process returns to step 912 to repeat the above processing. If a negative determination is made in step 918, it indicates that the drawing of the pattern image on the scan line ptn_y has ended, and thus the main filling process ends.

ここでフローチャートの説明は終了するが、上記ではパターン画像情報をエッジリスト形式からラスタ形式に変換するか否かの判断に用いた閾値TH1、及びマスク情報をエッジリスト形式からラスタ形式に変換するか否かの判断に用いた閾値TH2の具体例については、何ら言及しなかったが、各閾値については以下のように予め設定して用いるようにしてもよい。   Although the description of the flowchart ends here, in the above, the threshold TH1 used for determining whether or not the pattern image information is converted from the edge list format to the raster format, and whether the mask information is converted from the edge list format to the raster format. Although a specific example of the threshold value TH2 used for the determination of whether or not is not mentioned at all, each threshold value may be preset and used as follows.

まず、閾値TH1であるが、例えば、ラスタ形式で表したパターン画像情報のサイズ(データ量)がエッジリスト形式で表したパターン画像情報のサイズ(データ量)より小さくなるように閾値TH1を求めればよい。例えば、以下の(1)式を用いる。   First, the threshold TH1 is obtained. For example, if the threshold TH1 is obtained so that the size (data amount) of the pattern image information expressed in the raster format is smaller than the size (data amount) of the pattern image information expressed in the edge list format. Good. For example, the following equation (1) is used.

width×height×4 < height×4+edge×12 …(1)  width × height × 4 <height × 4 + edge × 12 (1)

(1)式において、widthがパターン画像の幅、heightが高さ、edgeがエッジデータの数である。なお、(1)式の左辺は、図5で例示したラスタ形式で表したカラーのパターン画像情報のサイズを示しており、(1)式の右辺は、図8で例示したエッジリスト形式で表したパターン画像情報のサイズを示している。この(1)式を変形すると、下記(2)式が得られる。   In equation (1), width is the width of the pattern image, height is the height, and edge is the number of edge data. The left side of equation (1) indicates the size of the color pattern image information represented in the raster format illustrated in FIG. 5, and the right side of equation (1) is represented in the edge list format illustrated in FIG. The size of the pattern image information is shown. When this equation (1) is modified, the following equation (2) is obtained.

edge > {(width-1)×height}/3 …(2)   edge> {(width-1) × height} / 3 (2)

(2)式の右辺の値は、ラスタ形式で表したパターン画像情報のサイズ(データ量)とエッジリスト形式で表したパターン画像情報のサイズ(データ量)とが等しくなるときのエッジデータの数であり、これを閾値TH1として用い、(2)式の条件を満たした場合に、パターン画像情報をエッジリスト形式からラスタ形式に変換してメモリ領域に記憶するようにすればよい。   The value on the right side of the expression (2) is the number of edge data when the size (data amount) of the pattern image information expressed in the raster format is equal to the size (data amount) of the pattern image information expressed in the edge list format. When this is used as the threshold value TH1 and the condition of equation (2) is satisfied, the pattern image information may be converted from the edge list format to the raster format and stored in the memory area.

次に、閾値TH2であるが、例えば、ラスタ形式で表したマスク情報のサイズ(データ量)がエッジリスト形式で表したマスク情報のサイズ(データ量)より小さくなるように閾値TH2を求めればよい。例えば、以下の(3)式を用いる。   Next, regarding the threshold value TH2, for example, the threshold value TH2 may be obtained so that the size (data amount) of the mask information represented in the raster format is smaller than the size (data amount) of the mask information represented in the edge list format. . For example, the following equation (3) is used.

width×height/8 < height×4+edgem×9 …(3) width × height / 8 <height × 4 + edge m × 9… (3)

(3)式において、widthがパターン画像の幅、heightが高さ、edgemがマスク情報のエッジデータの数である。(3)式を変形すると、下記(4)式が得られる。 In equation (3), width is the width of the pattern image, height is the height, and edge m is the number of edge data in the mask information. When the equation (3) is modified, the following equation (4) is obtained.

edgem> {(width - 32)×height} / 72 …(4) edge m > {(width-32) x height} / 72 ... (4)

(4)式の右辺の値は、ラスタ形式で表したマスク情報のサイズ(データ量)とエッジリスト形式で表したマスク情報のサイズ(データ量)とが等しくなるときのエッジデータの数であり、これを閾値TH2として用い、(4)式の条件を満たした場合に、マスク情報をエッジリスト形式からラスタ形式に変換してメモリ領域に記憶するようにすればよい。   The value on the right side of the expression (4) is the number of edge data when the size (data amount) of the mask information expressed in the raster format is equal to the size (data amount) of the mask information expressed in the edge list format. When this is used as the threshold value TH2 and the condition of the expression (4) is satisfied, the mask information may be converted from the edge list format to the raster format and stored in the memory area.

このように、(2)式により得られた閾値TH1及び(4)式により得られた閾値TH2を用いることで、パターン画像情報のメモリ使用量及びマスク情報のメモリ使用量の各々を個別に判断して、ラスタ形式及びエッジリスト形式のうち、各々のメモリ使用量が小さくなるほうのデータ形式で記憶されるが、パターン画像情報をラスタ情報に変換する場合には、エッジリスト形式の場合には必要なかったマスク情報が作成されるため、パターン情報全体でメモリ使用量が効率化されるように、閾値TH1を求めてもよい。例えば、下記(5)式を用いる。   As described above, by using the threshold TH1 obtained by the equation (2) and the threshold TH2 obtained by the equation (4), each of the memory usage of the pattern image information and the memory usage of the mask information is individually determined. In the raster format and the edge list format, each memory usage is stored in the smaller data format. However, when converting the pattern image information to the raster information, in the case of the edge list format, Since unnecessary mask information is created, the threshold value TH1 may be obtained so that the memory usage is made efficient in the entire pattern information. For example, the following formula (5) is used.

(width×height×4)+(height×4+edgem×9) < height×4+edge×12 …(5) (width × height × 4) + (height × 4 + edge m × 9) <height × 4 + edge × 12… (5)

(5)式の左辺は、図5で例示したラスタ形式で表したパターン画像情報のサイズと、エッジリスト形式で表したマスク情報のサイズとの合計値を示しており、(5)式の右辺は、図8で例示したエッジリスト形式で表したパターン画像情報のサイズを示している。   The left side of the equation (5) indicates the total value of the size of the pattern image information represented in the raster format illustrated in FIG. 5 and the size of the mask information represented in the edge list format, and the right side of the equation (5) Indicates the size of the pattern image information represented in the edge list format illustrated in FIG.

なお、左辺のedgemは、マスク情報をエッジリスト形式で表したときのエッジデータの数である。マスク情報のエッジ数は、パターン画像のエッジ数以上にはならないため、
edgem≦edge
が成立する。図23、図24,及び図31を用いて説明したように、パターン画像の場合には、区間が隣接する或いは区間の少なくとも一部が重なる複数のエッジデータは、同色でないと合成されないが、マスク情報の場合には、エッジデータのマスク値は全て同じ値”1”であるため、色に関わりなく合成されるためである。
Note that edge m on the left side is the number of edge data when the mask information is represented in an edge list format. Since the number of edges in the mask information does not exceed the number of edges in the pattern image,
edge m ≤ edge
Is established. As described with reference to FIGS. 23, 24, and 31, in the case of a pattern image, a plurality of edge data adjacent to each other or overlapping at least a part of the intervals are not combined unless they are the same color. This is because, in the case of information, the mask values of edge data are all the same value “1”, so that they are combined regardless of the color.

従って、edgemを、edgemが取り得る最大値であるedgeに置き換えて、(5)式を変形すると、下記(6)式が得られる。 Therefore, by replacing edge m with edge which is the maximum value that edge m can take and transforming equation (5), the following equation (6) is obtained.

edge > width × height × 4 / 3 …(6)   edge> width × height × 4/3 (6)

(6)式の右辺を閾値TH1として用い、(6)式の条件を満たした場合に、パターン画像情報をエッジリスト形式からラスタ形式に変換してメモリ領域に記憶するようにすればよい。   The right side of equation (6) is used as the threshold value TH1, and when the condition of equation (6) is satisfied, the pattern image information may be converted from the edge list format to the raster format and stored in the memory area.

また、上記実施の形態では、パターン定義の際に、パターン画像情報毎、及びマスク情報毎にデータ形式を切替えて記憶する例について説明したが、これに限定されず、例えば、パターン画像情報及びマスク情報ともに、スキャンライン毎にデータ形式を判断して、スキャンライン毎に判断結果に応じたデータ形式でデータを記憶するようにしてもよい。この場合には、閾値TH1に代えて、上記閾値TH1をheightで除算した閾値TH1'をスキャンライン単位の閾値として用いればよい。例えば、下記(7)又は(8)の右辺の値を閾値TH1'とすればよい。   In the above-described embodiment, the example in which the data format is switched and stored for each pattern image information and for each mask information at the time of pattern definition has been described. However, the present invention is not limited to this. For both information, the data format may be determined for each scan line, and the data may be stored in a data format corresponding to the determination result for each scan line. In this case, instead of the threshold value TH1, a threshold value TH1 ′ obtained by dividing the threshold value TH1 by height may be used as a threshold value in units of scan lines. For example, the value on the right side of (7) or (8) below may be set as the threshold TH1 ′.

edge > (width-1)/3 …(7)
edge > width × 4 / 3 …(8)
edge> (width-1) / 3 (7)
edge> width × 4/3 (8)

また、マスク情報の各スキャンラインのデータ形式を判断するための閾値TH2'も、上記閾値TH2をheightで除算して求めればよい。例えば、下記(9)式の右辺の値を閾値TH2'とすればよい。   Further, the threshold TH2 ′ for determining the data format of each scan line of the mask information may be obtained by dividing the threshold TH2 by height. For example, the value on the right side of the following equation (9) may be set as the threshold value TH2 ′.

edgem> (width - 32)/ 72 …(9) edge m > (width-32) / 72 (9)

なお、スキャンライン単位で形式を切替えて記憶する際、上記実施の形態と同様に、定義命令に、描画コマンドが複数含まれる場合、且つ先に実行された描画コマンドにより既に描画されているスキャンラインが存在する場合において、該スキャンラインのデータ形式がラスタ形式で記憶されているときは、上記と同様に、閾値による判断をせずに、そのスキャンラインをラスタ形式で描画する。パターン画像だけでなく、マスク情報も同様である。   When the format is switched and stored in units of scan lines, as in the case of the above-described embodiment, when a plurality of drawing commands are included in the definition command, the scan lines that have already been drawn by the previously executed drawing command If the data format of the scan line is stored in the raster format, the scan line is drawn in the raster format without making a determination based on the threshold value as described above. The same applies to mask information as well as pattern images.

また、上記では画像処理のプログラムの一例としてのプログラムが装置制御部12の記憶部12Cに記憶される態様を説明したが、これに限定されず、該プログラムを、CD−ROMやDVD−ROM等の記録媒体に記録されている形態で提供することも可能である。   In the above description, an example in which a program as an example of an image processing program is stored in the storage unit 12C of the device control unit 12 is described. However, the present invention is not limited thereto, and the program may be a CD-ROM, a DVD-ROM, or the like. It is also possible to provide it in the form recorded on the recording medium.

10 画像形成装置
12 装置制御部
12A CPU
12B メモリ
12C 記憶部
16 画像形成部
DESCRIPTION OF SYMBOLS 10 Image forming apparatus 12 Apparatus control part 12A CPU
12B Memory 12C Storage unit 16 Image forming unit

Claims (10)

パターン画像を定義するための定義命令と、前記定義命令により定義されたパターン画像を指定された範囲に配列して塗りつぶす塗りつぶし命令とを含む描画情報を解釈して実行する際に、
前記定義命令により定義された前記パターン画像を、ライン毎に同一の画素値の画素が連続する区間及び該画素値を示すエッジデータを有する第1の形式で表したときの前記エッジデータの数が第1の閾値以下となる場合には、前記パターン画像を前記第1の形式で表したパターン画像情報を第1の記憶手段に記憶するように処理し、前記パターン画像を前記第1の形式で表したときのエッジデータの数が前記第1の閾値を超える場合には、画素毎に画素値を有する第2の形式で前記パターン画像を表したパターン画像情報を前記第1の記憶手段に記憶するように処理する第1の記憶処理手段と、
前記第1の記憶手段に記憶されるパターン画像情報が前記第2の形式の場合に、前記第2の形式の前記パターン画像情報から前記塗りつぶし命令の塗りつぶしに使用される画素値を抽出するためのマスク情報を作成し、前記マスク情報を前記第1の形式で表したときのエッジデータの数が第2の閾値以下となる場合には、前記マスク情報を前記第1の形式で表して第2の記憶手段に記憶するように処理し、前記マスク情報を前記第1の形式で表したときのエッジデータの数が前記第2の閾値を超える場合には、前記マスク情報を前記第2の形式で表して前記第2の記憶手段に記憶するように処理する第2の記憶処理手段と、
前記第1の記憶手段に記憶したパターン画像情報が前記第1の形式の場合には、該パターン画像情報を用いて前記塗りつぶし命令を実行し、前記第1の記憶手段に記憶したパターン画像情報が前記第2の形式の場合には、該パターン画像情報と共に前記第2の記憶手段に記憶した前記マスク情報も用いて前記塗りつぶし命令を実行する実行手段と、
を備えた画像処理装置。
When interpreting and executing drawing information including a definition command for defining a pattern image and a fill command for arranging and filling the pattern image defined by the definition command in a specified range,
The number of the edge data when the pattern image defined by the definition command is expressed in a first format having a section in which pixels having the same pixel value continue for each line and edge data indicating the pixel value is represented by If it is less than or equal to the first threshold, the pattern image information representing the pattern image in the first format is processed so as to be stored in a first storage means , and the pattern image is processed in the first format. If the number of edge data when represented exceeds the first threshold value, pattern image information representing the pattern image in the second format having a pixel value for each pixel is stored in the first storage means . First storage processing means for processing to
When the pattern image information stored in the first storage means is in the second format, the pixel value used for filling the fill command is extracted from the pattern image information in the second format. When mask information is created and the number of edge data when the mask information is expressed in the first format is equal to or less than a second threshold value, the mask information is expressed in the first format and second If the number of edge data when the mask information is expressed in the first format exceeds the second threshold value, the mask information is stored in the second format. Second storage processing means for processing to be stored in the second storage means represented by
When the pattern image information stored in the first storage means is in the first format, the paint command is executed using the pattern image information, and the pattern image information stored in the first storage means In the case of the second format, execution means for executing the paint command using the mask information stored in the second storage means together with the pattern image information;
An image processing apparatus.
前記第2の閾値を、前記マスク情報を前記第1の形式で表したときのデータ量と、前記マスク情報を前記第2の形式で表したときのデータ量と、が等しくなるときのエッジデータの数となるように設定した
請求項1記載の画像処理装置。
Edge data when the data amount when the mask information is expressed in the first format and the data amount when the mask information is expressed in the second format are equal to the second threshold value The image processing apparatus according to claim 1, wherein the image processing apparatus is set so as to satisfy the following number.
前記第1の閾値を、前記パターン画像を前記第1の形式で表したときの前記パターン画像情報のデータ量と、前記パターン画像を前記第2の形式で表したときの前記パターン画像情報のデータ量と、が等しくなるときのエッジデータの数となるように設定した
請求項1又は請求項2に記載の画像処理装置。
The first threshold value is a data amount of the pattern image information when the pattern image is expressed in the first format, and data of the pattern image information when the pattern image is expressed in the second format. The image processing apparatus according to claim 1, wherein the image processing apparatus is set to be the number of edge data when the amount is equal.
前記第1の閾値を、前記パターン画像を前記第1の形式で表したときの前記パターン画像情報のデータ量と、前記パターン画像を前記第2の形式で表したときの前記パターン画像情報のデータ量に前記マスク情報を前記第2の形式で表したときのデータ量を加算した加算データ量と、が等しくなるときの前記パターン画像情報のエッジデータの数となるように設定した
請求項1又は請求項2に記載の画像処理装置。
The first threshold value is a data amount of the pattern image information when the pattern image is expressed in the first format, and data of the pattern image information when the pattern image is expressed in the second format. The amount of edge data of the pattern image information when the added data amount obtained by adding the data amount when the mask information is expressed in the second format to the amount is equal to the amount is set. The image processing apparatus according to claim 2.
前記第1の記憶処理手段は、ライン単位で前記パターン画像を前記第1の形式で表したときのエッジデータの数が前記第1の閾値以下となるか否かを判断し、前記パターン画像を前記第1の形式で表したときのエッジデータの数が前記第1の閾値以下となるラインについては、前記第1の形式で表したパターン画像情報を前記第1の記憶手段に記憶するように処理し、前記パターン画像を前記第1の形式で表したときのエッジデータの数が前記第1の閾値を超えるラインについては、前記第2の形式で表したパターン画像情報を前記第1の記憶手段に記憶するように処理し、
前記第2の記憶処理手段は、ライン単位で前記マスク情報を前記第2の形式で表したときのエッジデータの数が前記第2の閾値以下となるか否かを判断し、前記マスク情報を前記第1の形式で表したときのエッジデータの数が前記第2の閾値以下となるラインについては、前記第1の形式で表したマスク情報を前記第2の記憶手段に記憶するように処理し、前記マスク情報を前記第1の形式で表したときのエッジデータの数が前記第2の閾値を超えるラインについては、前記第2の形式で表した前記マスク情報を前記第2の記憶手段に記憶するように処理する
請求項1に記載の画像処理装置。
The first storage processing unit determines whether or not the number of edge data when the pattern image is expressed in the first format in units of lines is equal to or less than the first threshold value, and the pattern image is The pattern image information expressed in the first format is stored in the first storage means for the line in which the number of edge data expressed in the first format is not more than the first threshold value. For the line where the number of edge data when the pattern image is processed and expressed in the first format exceeds the first threshold, the pattern image information expressed in the second format is stored in the first storage. Process to memorize the means ,
The second storage processing means determines whether or not the number of edge data when the mask information is expressed in the second format in units of lines is equal to or less than the second threshold, and the mask information is For lines in which the number of edge data when expressed in the first format is less than or equal to the second threshold, the mask information expressed in the first format is stored in the second storage means. The mask information expressed in the second format is stored in the second storage means for a line whose number of edge data exceeds the second threshold when the mask information is expressed in the first format. The image processing apparatus according to claim 1, wherein the processing is performed so as to be stored in a storage.
前記第2の閾値を、前記マスク情報を前記第1の形式で表したときの1ライン分データ量と、前記マスク情報を前記第2の形式で表したときの1ライン分のデータ量と、が等しくなるときのエッジデータの数となるように設定した
請求項5記載の画像処理装置。
The second threshold, the data amount for one line when the mask information is expressed in the first format, the data amount for one line when the mask information is expressed in the second format, The image processing device according to claim 5, wherein the number of edge data is set to be equal to each other.
前記第1の閾値を、前記パターン画像を前記第1の形式で表したときの1ライン分のデータ量と、前記パターン画像を前記第2の形式で表したときの1ライン分のデータ量と、が等しくなるときのエッジデータの数となるように設定した
請求項5又は請求項6に記載の画像処理装置。
The first threshold value is a data amount for one line when the pattern image is expressed in the first format, and a data amount for one line when the pattern image is expressed in the second format. The image processing apparatus according to claim 5, wherein the image processing apparatus is set so as to be the number of edge data when.
前記第1の閾値を、前記パターン画像を前記第1の形式で表したときの1ライン分のデータ量と、前記パターン画像を前記第2の形式で表したときの1ライン分のデータ量に前記マスク情報を前記第2の形式で表したときの1ライン分のデータ量を加算した加算データ量と、が等しくなるときの前記パターン画像情報のエッジデータの数となるように設定した
請求項6又は請求項7に記載の画像処理装置。
The first threshold value is a data amount for one line when the pattern image is expressed in the first format, and a data amount for one line when the pattern image is expressed in the second format. The set amount of edge data of the pattern image information is set to be equal to an added data amount obtained by adding a data amount of one line when the mask information is expressed in the second format. The image processing apparatus according to claim 6 or 7.
請求項1〜請求項8のいずれか1項記載の画像処理装置と、
前記画像処理装置により前記塗りつぶし命令が実行されて生成された出力画像情報に基づいて画像を形成する画像形成手段と、
を備えた画像形成装置。
The image processing apparatus according to any one of claims 1 to 8,
Image forming means for forming an image based on output image information generated by executing the paint command by the image processing device;
An image forming apparatus.
コンピュータを、
パターン画像を定義するための定義命令と、前記定義命令により定義されたパターン画像を指定された範囲に配列して塗りつぶす塗りつぶし命令とを含む描画情報を解釈して実行する際に、
前記定義命令により定義された前記パターン画像を、ライン毎に同一の画素値の画素が連続する区間及び該画素値を示すエッジデータを有する第1の形式で表したときの前記エッジデータの数が第1の閾値以下となる場合には、前記パターン画像を前記第1の形式で表したパターン画像情報を第1の記憶手段に記憶するように処理し、前記パターン画像を前記第1の形式で表したときのエッジデータの数が前記第1の閾値を超える場合には、画素毎に画素値を有する第2の形式で前記パターン画像を表したパターン画像情報を前記第1の記憶手段に記憶するように処理する第1の記憶処理手段、
前記第1の記憶手段に記憶されるパターン画像情報が前記第2の形式の場合に、前記第2の形式の前記パターン画像情報から前記塗りつぶし命令の塗りつぶしに使用される画素値を抽出するためのマスク情報を作成し、前記マスク情報を前記第1の形式で表したときのエッジデータの数が第2の閾値以下となる場合には、前記マスク情報を前記第1の形式で表して第2の記憶手段に記憶するように処理し、前記マスク情報を前記第1の形式で表したときのエッジデータの数が前記第2の閾値を超える場合には、前記マスク情報を前記第2の形式で表して前記第2の記憶手段に記憶するように処理する第2の記憶処理手段、及び
前記第1の記憶手段に記憶したパターン画像情報が前記第1の形式の場合には、該パターン画像情報を用いて前記塗りつぶし命令を実行し、前記第1の記憶手段に記憶したパターン画像情報が前記第2の形式の場合には、該パターン画像情報と共に前記第2の記憶手段に記憶した前記マスク情報も用いて前記塗りつぶし命令を実行する実行手段と、
として機能させるためのプログラム。
Computer
When interpreting and executing drawing information including a definition command for defining a pattern image and a fill command for arranging and filling the pattern image defined by the definition command in a specified range,
The number of the edge data when the pattern image defined by the definition command is expressed in a first format having a section in which pixels having the same pixel value continue for each line and edge data indicating the pixel value is represented by If it is less than or equal to the first threshold, the pattern image information representing the pattern image in the first format is processed so as to be stored in a first storage means , and the pattern image is processed in the first format. If the number of edge data when represented exceeds the first threshold value, pattern image information representing the pattern image in the second format having a pixel value for each pixel is stored in the first storage means . First storage processing means for processing to
When the pattern image information stored in the first storage means is in the second format, the pixel value used for filling the fill command is extracted from the pattern image information in the second format. When mask information is created and the number of edge data when the mask information is expressed in the first format is equal to or less than a second threshold value, the mask information is expressed in the first format and second If the number of edge data when the mask information is expressed in the first format exceeds the second threshold value, the mask information is stored in the second format. Second storage processing means for processing to be stored in the second storage means represented by
When the pattern image information stored in the first storage means is in the first format, the paint command is executed using the pattern image information, and the pattern image information stored in the first storage means In the case of the second format, execution means for executing the paint command using the mask information stored in the second storage means together with the pattern image information;
Program to function as.
JP2011132415A 2011-06-14 2011-06-14 Image processing apparatus, image forming apparatus, and program Expired - Fee Related JP5760728B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011132415A JP5760728B2 (en) 2011-06-14 2011-06-14 Image processing apparatus, image forming apparatus, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011132415A JP5760728B2 (en) 2011-06-14 2011-06-14 Image processing apparatus, image forming apparatus, and program

Publications (2)

Publication Number Publication Date
JP2013005105A JP2013005105A (en) 2013-01-07
JP5760728B2 true JP5760728B2 (en) 2015-08-12

Family

ID=47673226

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011132415A Expired - Fee Related JP5760728B2 (en) 2011-06-14 2011-06-14 Image processing apparatus, image forming apparatus, and program

Country Status (1)

Country Link
JP (1) JP5760728B2 (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3089906B2 (en) * 1993-07-02 2000-09-18 富士ゼロックス株式会社 Drawing equipment
JPH0939312A (en) * 1995-07-27 1997-02-10 Canon Inc Printer, printing method and printing mechanism
JP3450961B2 (en) * 1996-04-09 2003-09-29 ブラザー工業株式会社 Printing apparatus and control method thereof
JP2001296857A (en) * 2000-04-17 2001-10-26 Fuji Xerox Co Ltd Data preserving method and data transform device
JP2002358175A (en) * 2001-06-01 2002-12-13 Canon Inc Printing controller and printing control method and printing system
JP2004030386A (en) * 2002-06-27 2004-01-29 Canon Inc Image processing method and image processor
JP2006012059A (en) * 2004-06-29 2006-01-12 Canon Inc Information processor, information processing method, program and storage medium
JP2010099973A (en) * 2008-10-24 2010-05-06 Kyocera Mita Corp Image forming apparatus and image forming program

Also Published As

Publication number Publication date
JP2013005105A (en) 2013-01-07

Similar Documents

Publication Publication Date Title
JP5121599B2 (en) Image processing apparatus, image processing method, program thereof, and storage medium
JP4468404B2 (en) Information processing apparatus control method, information processing apparatus, and program
JP5920135B2 (en) Image processing apparatus and program
US20070109322A1 (en) Print control program product
KR101679681B1 (en) Image forming apparatus and image forming method
JP3008943B1 (en) Image processing apparatus and image processing method
JP5063501B2 (en) Image forming apparatus, control method, and control program
JP5397678B2 (en) Image processing apparatus, image forming apparatus, image processing method, and program
US20090115867A1 (en) Image processing apparatus, image processing method, image processing program, and program recording medium
JP2014171219A (en) Mechanism for top coat processing
JP5867790B2 (en) Image processing device
JP5760728B2 (en) Image processing apparatus, image forming apparatus, and program
JP6904717B2 (en) Image processing equipment, its control method, and programs
JP2011175629A (en) System and method for rendering of printable data
JP2007122188A (en) Image forming device, image processing method and program
JP6414475B2 (en) Computer program and control device
JP2008107970A (en) Image forming device
JP6357907B2 (en) Image processing apparatus and program
JP5603295B2 (en) Rendering data in the correct Z order
JP2010214905A (en) Image forming apparatus, image forming method, and program
JP2019192087A (en) Information processing device, program, and information processing method
JP2019197327A (en) Image processing apparatus, image processing method, and program
JP2023086279A (en) printer
JP4764730B2 (en) Image forming apparatus and image forming method
US7675642B2 (en) Print apparatus and print method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140520

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150129

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150203

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150330

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150525

R150 Certificate of patent or registration of utility model

Ref document number: 5760728

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees