JP5885827B2 - Drawing control apparatus and drawing control program - Google Patents
Drawing control apparatus and drawing control program Download PDFInfo
- Publication number
- JP5885827B2 JP5885827B2 JP2014500561A JP2014500561A JP5885827B2 JP 5885827 B2 JP5885827 B2 JP 5885827B2 JP 2014500561 A JP2014500561 A JP 2014500561A JP 2014500561 A JP2014500561 A JP 2014500561A JP 5885827 B2 JP5885827 B2 JP 5885827B2
- Authority
- JP
- Japan
- Prior art keywords
- pixel
- value
- scissor
- allowable range
- area
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 claims description 16
- 238000010586 diagram Methods 0.000 description 3
- 238000009877 rendering Methods 0.000 description 3
- 239000004065 semiconductor Substances 0.000 description 3
- 101000911772 Homo sapiens Hsc70-interacting protein Proteins 0.000 description 2
- 239000000470 constituent Substances 0.000 description 2
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/60—Editing figures and text; Combining figures or text
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Generation (AREA)
Description
この発明は、複数のシザー領域に図形を描画する描画制御装置及び描画制御プログラムに関するものである。 The present invention relates to a drawing control apparatus and a drawing control program for drawing a figure in a plurality of scissor areas.
従来より、図形を描画する際、複数の領域が組み合わされた領域内に存在する図形部分だけを描画するような複数領域のシザリングに対応するグラフィクスシステムが提案されている。
例えば、以下の特許文献1には、1つのシザリング領域(以下、「シザー領域」と称する)毎に画素値を書き込み、各シザー領域内の画素のシザー値を更新することによって、任意の数のシザー領域に対して、順々にシザリングを実行するシザリング方式を採用している描画制御装置が開示されている。
なお、各々のシザー領域毎に、最大値及び最小値で規定される描画許容範囲が設定されており、当該シザー領域に対する画素の書き込みを行うか否かを判定するために、図形の内部に含まれる画素の座標値が当該シザー領域の描画許容範囲内に含まれているか否かを判定する比較器などが、シザー領域毎に設けられている。2. Description of the Related Art Conventionally, there has been proposed a graphics system corresponding to scissoring of a plurality of areas in which only a figure portion existing in an area where a plurality of areas are combined is drawn when a figure is drawn.
For example, in
Note that a drawing allowable range defined by the maximum value and the minimum value is set for each scissor area, and is included in the figure to determine whether or not to write a pixel to the scissor area. A comparator for determining whether or not the coordinate value of the pixel to be included is included in the drawing allowable range of the scissor area is provided for each scissor area.
従来の描画制御装置は以上のように構成されているので、一部のシザー領域を使用しない場合、当該シザー領域の比較器は使用されない。しかし、未使用の比較器を他の用途(例えば、図形の内部に含まれる画素のカラー値やα値(透明度)が、当該シザー領域の描画許容範囲内に含まれているか否かを判定するために使用する用途)で使用することができず、資源の有効活用を図ることができない課題があった。 Since the conventional drawing control apparatus is configured as described above, when a part of the scissor area is not used, the comparator of the scissor area is not used. However, an unused comparator is used for other purposes (for example, whether or not the color value or alpha value (transparency) of a pixel included in the figure is included in the drawing allowable range of the scissor area). Therefore, there is a problem that resources cannot be used effectively and resources cannot be effectively used.
この発明は上記のような課題を解決するためになされたもので、装置内の資源を各種の用途で使用できるようにして、資源の有効活用を図ることができる描画制御装置及び描画制御プログラムを得ることを目的とする。 The present invention has been made to solve the above-described problems, and provides a drawing control apparatus and a drawing control program capable of using resources in the apparatus for various purposes and effectively utilizing the resources. The purpose is to obtain.
この発明に係る描画制御装置は、複数のシザー領域に描画する図形の設定情報にしたがって、図形の内部に含まれる画素の座標値と画素値を算出する座標値・画素値算出手段と、各々のシザー領域の描画許容範囲を記憶する記憶手段と、座標値・画素値算出手段により算出された図形の内部に含まれる画素の座標値又は画素値を比較対象値に設定し、図形の内部に含まれる画素毎に、当該画素の比較対象値が記憶手段により記憶されたシザー領域の描画許容範囲内に含まれているか否かを判定する描画許容範囲内判定手段と、描画許容範囲内判定手段の判定結果に基づいて、図形の内部に含まれる画素の中から、描画対象の画素を判別する描画対象画素判別手段と、描画対象画素判別手段の判別結果に基づいて、座標値・画素値算出手段により算出された図形の内部に含まれる画素の画素値をフレームバッファに書き込むフレームバッファ更新手段とを設け、描画許容範囲内判定手段が、座標値・画素値算出手段により算出された座標値を選択する旨を示す選択情報が入力された場合、座標値を比較対象値に設定し、座標値・画素値算出手段により算出された画素値を選択する旨を示す選択情報が入力された場合、画素値を比較対象値に設定するようにしたものである。 The drawing control apparatus according to the present invention includes a coordinate value / pixel value calculating unit for calculating a pixel coordinate value and a pixel value included in the figure according to setting information of the figure to be drawn in a plurality of scissor areas, The storage means for storing the drawing allowable range of the scissor area and the coordinate value or pixel value of the pixel included in the figure calculated by the coordinate value / pixel value calculation means is set as the comparison target value and included in the figure. Each of the pixels to be compared includes a drawing allowable range determination unit that determines whether the comparison target value of the pixel is included in the drawing allowable range of the scissor area stored by the storage unit, and a drawing allowable range determination unit A drawing target pixel discriminating unit for discriminating a drawing target pixel from pixels included in the figure based on the determination result, and a coordinate value / pixel value calculating unit based on the discrimination result of the drawing target pixel discriminating unit By The pixel values of the pixels contained within the calculated figure provided a frame buffer update means for writing into the frame buffer, drawing allowable range judging means, selects a coordinate value calculated by the coordinate value, the pixel value calculation unit If the selection information indicating that the coordinate value is set as the comparison target value and the pixel value calculated by the coordinate value / pixel value calculating means is selected, the pixel value is input. Is set as a comparison target value.
この発明によれば、座標値・画素値算出手段により算出された図形の内部に含まれる画素の座標値又は画素値を比較対象値に設定し、図形の内部に含まれる画素毎に、当該画素の比較対象値が記憶手段により記憶されたシザー領域の描画許容範囲内に含まれているか否かを判定する描画許容範囲内判定手段と、描画許容範囲内判定手段の判定結果に基づいて、図形の内部に含まれる画素の中から、描画対象の画素を判別する描画対象画素判別手段と、描画対象画素判別手段の判別結果に基づいて、座標値・画素値算出手段により算出された図形の内部に含まれる画素の画素値をフレームバッファに書き込むフレームバッファ更新手段とを設け、描画許容範囲内判定手段が、座標値・画素値算出手段により算出された座標値を選択する旨を示す選択情報が入力された場合、座標値を比較対象値に設定し、座標値・画素値算出手段により算出された画素値を選択する旨を示す選択情報が入力された場合、画素値を比較対象値に設定するように構成したので、座標値・画素値算出手段により算出された座標値だけでなく、画素値も比較対象値に設定して描画許容範囲内判定手段を使用することができる。そのため、資源の有効活用を図ることができる効果がある。 According to this invention, the coordinate value or pixel value of the pixel included in the figure calculated by the coordinate value / pixel value calculating means is set as the comparison target value, and for each pixel included in the figure, the pixel comparison object value is a drawing tolerance in the determining means for determining whether or not included in the drawing tolerance of the stored sheet-user area by memorize means, based on the determination result of the drawing allowable range judging means The figure calculated by the coordinate value / pixel value calculating means based on the determination result of the drawing target pixel determining means for determining the pixel to be drawn from the pixels included in the figure and the drawing target pixel determining means the pixel values of pixels included therein is provided a frame buffer update means for writing the frame buffer, drawing allowable range judging means, indicating to select the coordinate value calculated by the coordinate value, the pixel value calculation unit If the selection information is input, the coordinate value is set as the comparison target value, and the selection information indicating that the pixel value calculated by the coordinate value / pixel value calculation means is selected is input. Since it is configured to set the value, not only the coordinate value calculated by the coordinate value / pixel value calculating means but also the pixel value can be set as the comparison target value and the drawing allowable range determining means can be used. Therefore, there is an effect that the resources can be effectively used.
以下、この発明をより詳細に説明するため、この発明を実施するための形態について、添付の図面に従って説明する。
実施の形態1.
図1はこの発明の実施の形態1による描画制御装置を示す構成図である。
図1において、CPU(Central Processing Unit)1は描画制御装置2とCPUバス3を介して接続されており、複数のシザー領域に対して図形の描画を開始する際、その図形の設定情報(例えば、図形の座標(例えば、図形の頂点の座標)や、描画色などを示す情報)を含む描画命令を描画制御装置2に出力する処理を実施する。
また、CPU1は描画命令を描画制御装置2に出力する際、各々のシザー領域の描画許容範囲を規定する最大値及び最小値を示す最大最小情報、各々のシザー領域の設定フラグ(シザー領域の使用の有無を示すフラグ)、各々のシザー領域の条件判定フラグ(シザー領域の「内部が有効」であるのか、「外部が有効」であるのかを示すフラグ)、比較対象データを指定する設定モード(選択情報)などを描画制御装置2に出力する処理を実施する。
なお、これらのフラグや情報は、CPU1が描画命令に含めて出力するようにしてもよい。Hereinafter, in order to describe the present invention in more detail, modes for carrying out the present invention will be described with reference to the accompanying drawings.
FIG. 1 is a block diagram showing a drawing control apparatus according to
In FIG. 1, a CPU (Central Processing Unit) 1 is connected to a drawing control device 2 via a
Further, when the
Note that the
描画制御装置2の描画処理部11は例えばMPU(Micro Processing Unit)を実装している半導体集積回路、あるいは、ワンチップマイコンなどから構成されており、CPU1から出力された描画命令に含まれている図形の設定情報にしたがって、その図形の内部に含まれる画素の座標値(x,y)と、カラー値やα値(透明度)などの画素値を算出する処理を実施する。なお、描画処理部11は座標値・画素値算出手段を構成している。
The
描画対象画素判別部12は描画処理部11により算出された座標値(x,y)やカラー値などに基づいて、図形の内部に含まれる画素の中から、描画対象の画素を判別する処理を実施する。
描画対象画素判別部12の最大値・最小値設定レジスタ13はシザー領域毎に用意されており、CPU1から出力された最大最小情報が示す最大値及び最小値を記憶するメモリである。なお、最大値・最小値設定レジスタ13は最大値・最小値記憶手段を構成している。The drawing target pixel discriminating unit 12 performs processing for discriminating a drawing target pixel from among pixels included in the figure based on the coordinate value (x, y), the color value and the like calculated by the
The maximum / minimum
設定フラグレジスタ14はシザー領域毎に用意されており、CPU1から出力された当該シザー領域の設定フラグを記憶するメモリである。
条件判定フラグレジスタ15はシザー領域毎に用意されており、CPU1から出力された当該シザー領域の条件判定フラグを記憶するメモリである。The
The condition
比較器16はシザー領域毎に用意されており、セレクタ16aと比較処理部16bから構成されている。
比較器16のセレクタ16aはCPU1から出力された設定モードが、当該シザー領域の比較対象値として、座標値を選択する旨を示していれば、描画処理部11により算出された座標値(x,y)を比較対象値に設定して比較処理部16bに出力し、当該シザー領域の比較対象値として、カラー値を選択する旨を示していれば、描画処理部11により算出されたカラー値を比較対象値に設定して比較処理部16bに出力し、当該シザー領域の比較対象値として、α値を選択する旨を示していれば、描画処理部11により算出されたα値を比較対象値に設定して比較処理部16bに出力する処理を実施する。
比較処理部16bは描画する図形の内部に含まれる画素毎に、当該画素の比較対象値が最大値・最小値設定レジスタ13により記憶された最大値及び最小値から規定される当該シザー領域の描画許容範囲内に含まれているか否かを判定する処理を実施する。
なお、比較器16は描画許容範囲内判定手段を構成している。The
If the setting mode output from the
For each pixel included in the figure to be drawn, the
The
描画対象画素判別処理部17は例えばMPUを実装している半導体集積回路、あるいは、ワンチップマイコンなどから構成されており、比較器16の判定結果に基づいて、図形の内部に含まれる画素の中から、描画対象の画素を判別する処理を実施する。
例えば、設定フラグレジスタ14により記憶された設定フラグが、全てのシザー領域が使用される旨を示しており、条件判定フラグレジスタ15により記憶された条件判定フラグが、全てのシザー領域が「内部が有効」である旨を示している場合、図形の内部に含まれる画素の中から、比較器16によって、比較対象値が全てのシザー領域の描画許容範囲内に含まれていると判定された画素を特定して、その画素を描画対象の画素であると判別する。
条件判定フラグレジスタ15により記憶された条件判定フラグが、全てのシザー領域が「内部が有効」である旨を示している場合において、設定フラグレジスタ14により記憶された設定フラグが、一部のシザー領域が使用されない旨を示している場合、比較器16によって、比較対象値が未使用のシザー領域を除く全てのシザー領域の描画許容範囲内に含まれていると判定された画素を特定して、その画素を描画対象の画素であると判別する。The drawing target pixel
For example, the setting flag stored in the
When the condition determination flags stored by the condition
また、条件判定フラグレジスタ15により記憶された条件判定フラグが、「内部が有効」であるシザー領域と「外部が有効」であるシザー領域とが混在している旨を示している場合、比較器16の判定結果を参照して、「内部が有効」であるシザー領域に対しては、比較対象値が描画許容範囲内に含まれている条件を満足し、「領域の外部」が有効であるシザー領域に対しては、比較対象値が描画許容範囲内に含まれていない条件を満足している画素を特定して、その画素を描画対象の画素であると判別する。
なお、描画対象画素判別処理部17は描画対象画素判別手段を構成している。Further, when the condition determination flag stored by the condition
The drawing target pixel
メモリ制御部18は例えばMPUを実装している半導体集積回路、あるいは、ワンチップマイコンなどから構成されており、描画処理部11により算出された図形の内部に含まれる画素の画素値(カラー値、α値など)のうち、描画対象画素判別処理部17により判別された描画対象の画素の画素値だけをフレームバッファ19に書き込む処理を実施する。なお、メモリ制御部18はフレームバッファ更新手段を構成している。
The
図1の例では、描画制御装置の構成要素である描画処理部11、最大値・最小値設定レジスタ13、設定フラグレジスタ14、条件判定フラグレジスタ15、比較器16、描画対象画素判別処理部17及びメモリ制御部18のそれぞれが専用のハードウェアで構成されているものを想定しているが、描画制御装置がコンピュータ(コンピュータには、例えば、パソコンのほかに、後述する描画制御プログラムを実行することが可能な携帯電話、携帯情報端末やカーナビゲーション装置なども含まれる)で構成されていてもよい。
描画制御装置がコンピュータで構成される場合、最大値・最小値設定レジスタ13、設定フラグレジスタ14及び条件判定フラグレジスタ15をコンピュータのメモリ上に構成するとともに、描画処理部11、比較器16、描画対象画素判別処理部17及びメモリ制御部18の処理内容が記述されている描画制御プログラムを当該コンピュータのメモリに格納し、当該コンピュータのCPUが当該メモリに格納されている描画制御プログラムを実行するようにすればよい。
図2はこの発明の実施の形態1による描画制御装置の処理内容を示すフローチャートである。In the example of FIG. 1, the
When the drawing control device is configured by a computer, the maximum value / minimum
FIG. 2 is a flowchart showing the processing contents of the drawing control apparatus according to
次に動作について説明する。
まず、CPU1は、複数のシザー領域に対して、図形の描画を開始する際、その図形の設定情報を含む描画命令を描画制御装置2に出力する。
図形の設定情報には、例えば、図形の座標(例えば、図形の頂点の座標)や、描画色などを示す情報が含まれている。
例えば、描画対象の図形が三角形であれば、三角形の3つの頂点の座標が設定情報に含まれ、また、3つの頂点の描画色として、カラー値やα値(透明度)などが設定情報に含まれる。Next, the operation will be described.
First, when the
The graphic setting information includes, for example, information indicating the coordinates of the graphic (for example, the coordinates of the vertex of the graphic) and the drawing color.
For example, if the figure to be drawn is a triangle, the coordinates of the three vertices of the triangle are included in the setting information, and the color information, α value (transparency), etc. are included in the setting information as the drawing color of the three vertices It is.
また、CPU1は、描画命令を描画制御装置2に出力する際、各々のシザー領域の最大最小情報、各々のシザー領域の設定フラグ、各々のシザー領域の条件判定フラグ、各々のシザー領域の設定モードなどを描画制御装置2に出力する。
ここで、最大最小情報は、シザー領域における描画許容範囲の最大値と最小値を示す情報であり、描画許容範囲が座標値に関するものであれば、描画許容範囲は、例えば、X座標の値xがx1<x<x2の範囲内にあり、かつ、Y座標の値yがy1<y<y2の範囲内にある画素だけを描画対象とするための範囲となる。
また、描画許容範囲が画素値に関するものであれば、描画許容範囲は、例えば、画素値cがc1<c<c2の範囲内にある画素だけを描画対象とするための範囲となる。
この場合、x1,y1,c1などが描画許容範囲の最小値であり、x2,y2,c2などが描画許容範囲の最大値である。
なお、描画許容範囲はシザー領域毎に設定され、あるシザー領域については座標値に関する描画許容範囲が設定され、あるシザー領域については画素値に関する描画許容範囲が設定されていてもよい。言うまでもないが、全てのシザー領域について、同様の描画許容範囲(例えば、座標値に関する描画許容範囲)が設定されていてもよい。Further, when the
Here, the maximum / minimum information is information indicating the maximum value and the minimum value of the drawing allowable range in the scissor area. If the drawing allowable range is related to the coordinate value, the drawing allowable range is, for example, the value x of the X coordinate. Is within the range of x1 <x <x2 and the Y coordinate value y is within the range of y1 <y <y2.
Further, if the drawing allowable range relates to the pixel value, the drawing allowable range is a range for drawing only pixels whose pixel value c is in the range of c1 <c <c2, for example.
In this case, x1, y1, c1, etc. are the minimum values of the drawing allowable range, and x2, y2, c2, etc. are the maximum values of the drawing allowable range.
The drawing allowable range may be set for each scissor area, the drawing allowable range related to the coordinate value may be set for a certain scissor area, and the drawing allowable range related to the pixel value may be set for a certain scissor area. Needless to say, a similar drawing allowable range (for example, a drawing allowable range related to coordinate values) may be set for all scissor areas.
シザー領域の設定フラグは、シザー領域の使用の有無を示すフラグであり、このフラグが「使用しない」旨を示しているシザー領域については、シザー領域として取り扱わないようにするものである。
例えば、N個のシザー領域が存在するとき、N−2個のシザー領域の設定フラグが「使用する」旨を示し、残りの2個のシザー領域の設定フラグが「使用しない」旨を示していれば、残りの2個のシザー領域については、シザー領域として取り扱わず、N−2個のシザー領域に対して、図形の描画処理を行うようにする。The scissor area setting flag is a flag indicating whether or not the scissor area is used. The scissor area indicating that this flag is “not used” is not handled as a scissor area.
For example, when there are N scissor areas, the setting flags for the N-2 scissor areas indicate “use” and the setting flags for the remaining two scissor areas indicate “not use”. Thus, the remaining two scissor areas are not handled as scissor areas, and a graphic drawing process is performed on N-2 scissor areas.
シザー領域の条件判定フラグは、当該シザー領域の「内部が有効」であるのか、「外部が有効」であるのかを示すフラグであり、「内部が有効」であるシザー領域については、シザー領域の内部に図形の描画を許可し、「外部が有効」であるシザー領域については、シザー領域の外部に図形の描画を許可するものである。
設定モードは、比較器16のセレクタ16aが、比較対象データとして、座標値、カラー値、α値のいずれを選択するかを示す選択情報であり、例えば、座標値に関する描画許容範囲の最大値と最小値が設定されるシザー領域については、比較対象データとして、座標値を選択する旨を示す設定モードが与えられ、カラー値に関する描画許容範囲の最大値と最小値が設定されるシザー領域については、比較対象データとして、カラー値を選択する旨を示す設定モードが与えられる。The scissor area condition determination flag is a flag indicating whether “inside is valid” or “outside is valid” of the scissor area. For a scissor area where “inside is valid”, the scissor area For the scissor area in which drawing of the figure is permitted and “external is valid”, drawing of the figure is permitted to the outside of the scissor area.
The setting mode is selection information indicating whether the
なお、CPU1から出力された最大最小情報が示すシザー領域における描画許容範囲の最大値及び最小値は、シザー領域毎に用意されている最大値・最小値設定レジスタ13に格納される。
CPU1から出力されたシザー領域の設定フラグは、シザー領域毎に用意されている設定フラグレジスタ14に格納される。
また、CPU1から出力されたシザー領域の条件判定フラグは、シザー領域毎に用意されている条件判定フラグレジスタ15に格納される。Note that the maximum value and the minimum value of the drawing allowable range in the scissor area indicated by the maximum / minimum information output from the
The scissor area setting flag output from the
The scissor area condition determination flag output from the
描画処理部11は、CPU1から描画命令を受けると(図2のステップST1)、その描画命令に含まれている図形の設定情報にしたがって、その図形の内部に含まれる画素の座標値(x,y)と、カラー値やα値(透明度)などの画素値を算出する(ステップST2)。
例えば、描画対象の図形が三角形であれば、図3に示すように、三角形の3つの頂点P1,P2,P3の座標(x1,y1),(x2,y2),(x3,y3)が図形の設定情報に含まれているので、これらの座標を用いて、各頂点を結ぶ線分L1,L2,L3を求め、3つの線分L1,L2,L3で囲まれている領域(三角形)を特定することで、三角形の内部に含まれる各画素の座標値(x,y)を算出する。
例えば、線分L1は、頂点P1,P2の座標(x1,y1),(x2,y2)を下記に示す連立方程式に代入することで求めることができる。
y1=a・x1+b
y2=a・x2+b
ただし、aは線分L1の傾き、bは定数である。When the
For example, if the figure to be drawn is a triangle, as shown in FIG. 3, the coordinates (x1, y1), (x2, y2), (x3, y3) of the three vertices P1, P2, P3 of the triangle are the figures. Therefore, using these coordinates, line segments L1, L2, and L3 connecting the vertices are obtained, and an area (triangle) surrounded by the three line segments L1, L2, and L3 is obtained. By specifying, the coordinate value (x, y) of each pixel included in the inside of the triangle is calculated.
For example, the line segment L1 can be obtained by substituting the coordinates (x1, y1) and (x2, y2) of the vertices P1, P2 into the simultaneous equations shown below.
y1 = a · x1 + b
y2 = a · x2 + b
Here, a is the slope of the line segment L1, and b is a constant.
カラー値やα値については、例えば、描画対象の図形が三角形であれば、三角形の3つの頂点P1,P2,P3のカラー値が図形の設定情報に含まれているので、例えば、頂点P1と頂点P2の中間に位置している画素のカラー値の場合、頂点P1のカラー値と頂点P2のカラー値との中間値を、当該画素のカラー値として算出する。α値についても同様である。
ただし、頂点P1と頂点P2の中間に位置している画素が、頂点P1と頂点P2の中点ではなく、頂点P1までの距離と、頂点P2までの距離とが異なる場合、頂点P1から頂点P2までカラー値等が段階的に変化(グラデーション)するように、上記距離を考慮して、カラー値等を算出する。Regarding the color value and α value, for example, if the figure to be drawn is a triangle, the color values of the three vertices P1, P2, and P3 of the triangle are included in the figure setting information. In the case of a color value of a pixel located in the middle of the vertex P2, an intermediate value between the color value of the vertex P1 and the color value of the vertex P2 is calculated as the color value of the pixel. The same applies to the α value.
However, when the pixel located between the vertex P1 and the vertex P2 is not the midpoint of the vertex P1 and the vertex P2, but the distance to the vertex P1 and the distance to the vertex P2 are different, the vertex P1 to the vertex P2 The color value and the like are calculated in consideration of the distance so that the color value and the like gradually change (gradation).
描画対象画素判別部12は、描画処理部11が図形の内部に含まれる画素の座標値(x,y)、カラー値やα値などを算出すると、画素の座標値(x,y)やカラー値等に基づいて、図形の内部に含まれる画素の中から、描画対象の画素を判別する。
具体的には、以下の通りである。When the
Specifically, it is as follows.
描画対象画素判別部12は、シザー領域毎に用意されている比較器16のうち、「使用する」シザー領域に対応する比較器16だけを使用して、「使用しない」シザー領域に対応する比較器16を使用しないようにするため、各々のシザー領域に対応する設定フラグレジスタ14に記憶されている設定フラグ(CPU1から出力されたシザー領域の設定フラグ)を参照して、各々のシザー領域が、「使用する」シザー領域であるか否かを判定する(ステップST3)。
描画対象画素判別部12は、「使用する」シザー領域を特定すると、そのシザー領域に対応する比較器16を起動する(ステップST4)。The drawing target pixel determination unit 12 uses only the
When the “used” scissor area is specified, the drawing target pixel determination unit 12 activates the
起動された比較器16のセレクタ16aは、CPU1から出力された設定モードが、当該シザー領域の比較対象値として、座標値を選択する旨を示していれば、描画処理部11により算出された描画対象の図形に含まれる画素の座標値(x,y)を比較対象値に設定して、その比較対象値を比較処理部16bに出力する(ステップST5)。
また、セレクタ16aは、CPU1から出力された設定モードが、当該シザー領域の比較対象値として、カラー値を選択する旨を示していれば、描画処理部11により算出された描画対象の図形に含まれる画素のカラー値を比較対象値に設定して、その比較対象値を比較処理部16bに出力し、当該シザー領域の比較対象値として、α値を選択する旨を示していれば、描画処理部11により算出された描画対象の図形に含まれる画素のα値を比較対象値に設定して、その比較対象値を比較処理部16bに出力する(ステップST5)。If the setting mode output from the
If the setting mode output from the
起動された比較器16の比較処理部16bは、セレクタ16aから比較対象値を受けると、最大値・最小値設定レジスタ13に記憶されている最大値及び最小値を取得して、当該シザー領域における描画許容範囲を特定する。
比較処理部16bは、シザー領域における描画許容範囲を特定すると、描画する図形の内部に含まれる画素毎に、当該画素の比較対象値が上記の描画許容範囲内に含まれているか否かを判定する(ステップST6)。When the
When the drawing allowable range in the scissor area is specified, the
描画対象画素判別処理部17は、比較器16が、図形の内部に含まれる画素毎に、当該画素の比較対象値が描画許容範囲内に含まれているか否かを判定すると、その判定結果に基づいて、図形の内部に含まれる画素の中から、描画対象の画素を判別する。
即ち、描画対象画素判別処理部17は、比較対象値が描画許容範囲内に含まれていると判定された画素については、条件判定フラグレジスタ15に記憶されている各々のシザー領域条件判定フラグ(「使用する」シザー領域に対応するシザー領域条件判定フラグ)を参照して、各々のシザー領域が、「内部が有効」のシザー領域である否かを判定する(ステップST7)。
そして、描画対象画素判別処理部17は、「内部が有効」のシザー領域を「Pass領域」に設定し(ステップST8)、「外部が有効」のシザー領域を「Fail領域」に設定する(ステップST9)。When the drawing target pixel
That is, the drawing target pixel
Then, the drawing target pixel
また、描画対象画素判別処理部17は、比較対象値が描画許容範囲内に含まれていないと判定された画素については、条件判定フラグレジスタ15に記憶されている各々のシザー領域条件判定フラグ(「使用する」シザー領域に対応するシザー領域条件判定フラグ)を参照して、各々のシザー領域が、「外部が有効」のシザー領域である否かを判定する(ステップST10)。
そして、描画対象画素判別処理部17は、「外部が有効」のシザー領域を「Pass領域」に設定し(ステップST8)、「内部が有効」のシザー領域を「Fail領域」に設定する(ステップST9)。
なお、設定フラグレジスタ14に記憶されている設定フラグが、「使用しない」旨を示しているシザー領域については、上述したように、シザー領域として取り扱わないため、このシザー領域を「Pass領域」に設定する。In addition, the drawing target pixel
Then, the drawing target pixel
Note that the scissor area whose setting flag stored in the setting
描画対象画素判別処理部17は、図形の内部に含まれる画素毎に、当該画素に対する全てのシザー領域が「Pass領域」であるか否かを判定し(ステップST11)、全てのシザー領域が「Pass領域」であれば、当該画素は描画対象の画素であると判別する(ステップST12)。
一方、当該画素に対するシザー領域のいずれか1つでも「Fail領域」であれば、当該画素は描画対象の画素でないと判別する(ステップST13)。The drawing target pixel
On the other hand, if any one of the scissor areas for the pixel is a “Fail area”, it is determined that the pixel is not a pixel to be rendered (step ST13).
なお、ステップST5〜ST13の処理は画素毎に実施されるものであり、未だ描画対象の画素であるか否かが判別されていない画素が残っていれば、ステップST5の処理に戻り、ステップST5〜ST13の処理を繰り返し実施する(ステップST14)。
描画対象の図形に含まれる全ての画素について、描画対象の画素であるか否かの判別が行われると、ステップST15の処理に移行する。Note that the processing in steps ST5 to ST13 is performed for each pixel, and if there remains a pixel for which it is not yet determined whether or not it is a drawing target pixel, the processing returns to step ST5, and step ST5 is performed. To ST13 are repeatedly performed (step ST14).
When it is determined whether all the pixels included in the drawing target graphic are the drawing target pixels, the process proceeds to step ST15.
ここで、図4は描画対象の画素の一例を示す説明図である。
図4(a)では、「内部が有効」である3個のシザー領域A,B,Cが存在している例を示している。このため、描画対象の図形である三角形内の画素のうち、3個のシザー領域A,B,Cの全てに含まれている画素だけが描画対象の画素に設定されており、例えば、シザー領域A,Cには含まれているが、シザー領域Bには含まれていない画素は描画対象の画素に設定されていない。
図4(b)の例では、シザー領域A,Bは「内部が有効」であるが、シザー領域Cは「外部が有効」である例を示している。このため、描画対象の図形である三角形内の画素のうち、シザー領域A,Bに含まれており、かつ、シザー領域Cに含まれていない画素だけが描画対象の画素に設定されている。Here, FIG. 4 is an explanatory diagram illustrating an example of a drawing target pixel.
FIG. 4A shows an example in which there are three scissor areas A, B, and C whose “inside is valid”. Therefore, only the pixels included in all three scissor areas A, B, and C among the pixels in the triangle that is the drawing target graphic are set as the drawing target pixels. For example, the scissor area Pixels that are included in A and C but not included in the scissor area B are not set as drawing target pixels.
In the example of FIG. 4B, the scissor areas A and B are “internally valid”, but the scissor area C is “externally valid”. For this reason, only the pixels included in the scissor areas A and B and not included in the scissor area C among the pixels in the triangle that is the drawing target graphic are set as the drawing target pixels.
メモリ制御部18は、描画対象画素判別処理部17が描画対象の画素を判別すると、描画処理部11により算出された描画対象の図形に含まれる画素の画素値(カラー値、α値など)のうち、描画対象の画素の画素値だけをフレームバッファ19に書き込む処理を実施する(ステップST15)。
When the drawing target pixel
以上で明らかなように、この実施の形態1によれば、描画処理部11により算出された図形の内部に含まれる画素の座標値又は画素値(カラー値、α値など)を比較対象値に設定し、図形の内部に含まれる画素毎に、当該画素の比較対象値が最大値・最小値設定レジスタ13により記憶された最大値及び最小値から規定される各々のシザー領域の描画許容範囲内に含まれているか否かを判定する比較器16と、比較器16の判定結果に基づいて、図形の内部に含まれる画素の中から、描画対象の画素を判別する描画対象画素判別処理部17とを設け、メモリ制御部18が、描画処理部11により算出された描画対象の図形に含まれる画素の画素値(カラー値、α値など)のうち、描画対象の画素の画素値だけをフレームバッファ19に書き込むように構成したので、描画処理部11により算出された座標値だけでなく、画素値(カラー値、α値など)も比較対象値に設定して、比較器16を使用することができる。そのため、資源の有効活用を図ることができる効果を奏する。
As apparent from the above, according to the first embodiment, the coordinate value or pixel value (color value, α value, etc.) of the pixel included in the figure calculated by the
即ち、シザー領域毎に用意されている比較器16が、セレクタ16aと比較処理部16bから構成されており、CPU1から出力された設定モードにしたがって、描画処理部11により算出された座標値、カラー値、α値などの中から、比較対象値を選択するようにしているので、比較対象値として座標値を用いる一般的なシザー処理を行う際には、座標値の最大値・最小値を最大値・最小値設定レジスタ13に格納して、セレクタ16aが描画処理部11により算出された座標値を選択すればよい。
一方、カラー値やα値などの最大値・最小値を最大値・最小値設定レジスタ13に格納して、セレクタ16aが描画処理部11により算出されたカラー値やα値などを選択するようにすれば、一般的なシザー処理だけでなく、比較対象値としてカラー値、α値などを用いるシザー処理も実施することができるようになる。
したがって、比較器16を一般的なシザー処理以外にも使用することができるため、資源の有効活用を図ることができる。That is, the
On the other hand, a maximum value / minimum value such as a color value or an α value is stored in the maximum value / minimum
Therefore, since the
なお、この実施の形態1の描画制御装置の応用例としては、以下のような用途が考えられる。
例えば、図5に示すように、アイコンをバイリニアフィルタで拡大する場合、アイコンの境界(輪郭)部分には、アイコンの色と透過色との中間色が混ざり合うため、通常、1つの透過色を指定するだけでは、綺麗に透過させることができない。
これに対して、図1の描画制御装置を使用する場合、カラー値に関する描画許容範囲(最大値、最小値)を設定して、描画許容範囲のカラー値だけを透過させることが可能であるため、アイコンをバイリニアフィルタで拡大する場合でも、綺麗に透過させることができる。
また、グラフィクスウィンドウとビデオウィンドウの重ね合わせが可能な描画処理システムにおいては、シザー領域の設定レジスタと、ビデオウィンドウ領域の設定レジスタとを共用化することで、回路規模を削減するような用途にも適用可能である。Note that the following uses are conceivable as application examples of the drawing control apparatus of the first embodiment.
For example, as shown in FIG. 5, when enlarging an icon with a bilinear filter, an intermediate color between the icon color and the transparent color is mixed in the boundary (contour) portion of the icon, so normally one transparent color is designated. It is not possible to make it transparent through just doing.
On the other hand, when the drawing control apparatus of FIG. 1 is used, it is possible to set a drawing allowable range (maximum value, minimum value) relating to color values and transmit only the color values within the drawing allowable range. Even when the icon is enlarged with a bilinear filter, it can be transmitted clearly.
Also, in a drawing processing system that can superimpose a graphics window and a video window, by sharing the scissor area setting register and the video window area setting register, the circuit size can be reduced. Applicable.
なお、本願発明はその発明の範囲内において、実施の形態の任意の構成要素の変形、もしくは実施の形態の任意の構成要素の省略が可能である。 In the present invention, any constituent element of the embodiment can be modified or any constituent element of the embodiment can be omitted within the scope of the invention.
この発明に係る描画制御装置は、例えば、民生・産業機器向けの制御パネル等に適用することができる。 The drawing control apparatus according to the present invention can be applied to, for example, a control panel for consumer / industrial equipment.
1 CPU、2 描画制御装置、3 CPUバス、11 描画処理部(座標値・画素値算出手段)、12 描画対象画素判別部、13 最大値・最小値設定レジスタ(最大値・最小値記憶手段)、14 設定フラグレジスタ、15 条件判定フラグレジスタ、16 比較器(描画許容範囲内判定手段)、16a セレクタ、16b 比較処理部、17 描画対象画素判別処理部(描画対象画素判別手段)、18 メモリ制御部(フレームバッファ更新手段)、19 フレームバッファ。
DESCRIPTION OF
Claims (5)
各々のシザー領域の描画許容範囲を記憶する記憶手段と、
上記座標値・画素値算出手段により算出された図形の内部に含まれる画素の座標値又は画素値を比較対象値に設定し、上記図形の内部に含まれる画素毎に、当該画素の比較対象値が上記記憶手段により記憶されたシザー領域の描画許容範囲内に含まれているか否かを判定する描画許容範囲内判定手段と、
上記描画許容範囲内判定手段の判定結果に基づいて、上記図形の内部に含まれる画素の中から、描画対象の画素を判別する描画対象画素判別手段と、
上記描画対象画素判別手段の判別結果に基づいて、上記座標値・画素値算出手段により算出された図形の内部に含まれる画素の画素値をフレームバッファに書き込むフレームバッファ更新手段とを備え、
上記描画許容範囲内判定手段は、上記座標値・画素値算出手段により算出された座標値を選択する旨を示す選択情報が入力された場合、上記座標値を比較対象値に設定し、上記座標値・画素値算出手段により算出された画素値を選択する旨を示す選択情報が入力された場合、上記画素値を比較対象値に設定することを特徴とする描画制御装置。 Coordinate values and pixel value calculating means for calculating pixel coordinate values and pixel values included in the figure according to setting information of the figure to be drawn in a plurality of scissor areas;
Storage means for storing a drawing allowable range of each scissor area;
The coordinate value or pixel value of the pixel included in the figure calculated by the coordinate value / pixel value calculation means is set as the comparison target value, and the comparison target value of the pixel is set for each pixel included in the figure. A drawing allowable range determination means for determining whether or not is included within the drawing allowable range of the scissor area stored by the storage means;
Based on the determination result of the drawing allowable range determination unit, a drawing target pixel determining unit that determines a pixel to be drawn from among pixels included in the figure;
A frame buffer update unit that writes the pixel value of the pixel included in the figure calculated by the coordinate value / pixel value calculation unit to the frame buffer based on the determination result of the drawing target pixel determination unit;
When the selection information indicating that the coordinate value calculated by the coordinate value / pixel value calculation unit is selected is input, the drawing allowable range determination unit sets the coordinate value as a comparison target value, and A drawing control apparatus, wherein selection information indicating that a pixel value calculated by a value / pixel value calculation unit is selected is set as a comparison target value.
記憶手段が、各々のシザー領域の描画許容範囲を記憶する記憶処理手順と、
描画許容範囲内判定手段が、上記座標値を選択する旨を示す選択情報が入力された場合、上記座標値を比較対象値に設定し、上記画素値を選択する旨を示す選択情報が入力された場合、上記画素値を比較対象値に設定し、上記図形の内部に含まれる画素毎に、当該画素の比較対象値が上記記憶手段により記憶されたシザー領域の描画許容範囲内に含まれているか否かを判定する描画許容範囲内判定処理手順と、
描画対象画素判別手段が、上記描画許容範囲内判定手段の判定結果に基づいて、上記図形の内部に含まれる画素の中から、描画対象の画素を判別する描画対象画素判別処理手順と、
フレームバッファ更新手段が、上記描画対象画素判別手段の判別結果に基づいて、上記座標値・画素値算出手段により算出された図形の内部に含まれる画素の画素値をフレームバッファに書き込むフレームバッファ更新処理手順と
をコンピュータに実行させるための描画制御プログラム。 A coordinate value / pixel value calculation means for calculating a coordinate value and a pixel value of a pixel included in the graphic in accordance with setting information of the graphic to be drawn in a plurality of scissor areas;
A storage processing procedure for storing a drawing allowable range of each scissor area;
When selection information indicating that the drawing allowable range determination unit selects the coordinate value is input, the coordinate value is set as a comparison target value and selection information indicating that the pixel value is selected is input. The pixel value is set as a comparison target value, and for each pixel included in the graphic, the comparison target value of the pixel is included in the drawing allowable range of the scissor area stored by the storage unit. A drawing allowable range determination processing procedure for determining whether or not
A drawing target pixel determining unit for determining a drawing target pixel from among pixels included in the figure based on a determination result of the drawing allowable range determining unit;
Frame buffer update processing in which the frame buffer update unit writes the pixel values of the pixels included in the figure calculated by the coordinate value / pixel value calculation unit to the frame buffer based on the determination result of the drawing target pixel determination unit A drawing control program for causing a computer to execute procedures and.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2012/001206 WO2013124894A1 (en) | 2012-02-22 | 2012-02-22 | Rendering control device and rendering control program |
Publications (2)
Publication Number | Publication Date |
---|---|
JPWO2013124894A1 JPWO2013124894A1 (en) | 2015-05-21 |
JP5885827B2 true JP5885827B2 (en) | 2016-03-16 |
Family
ID=49005122
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014500561A Active JP5885827B2 (en) | 2012-02-22 | 2012-02-22 | Drawing control apparatus and drawing control program |
Country Status (3)
Country | Link |
---|---|
JP (1) | JP5885827B2 (en) |
TW (1) | TW201335883A (en) |
WO (1) | WO2013124894A1 (en) |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4585298B2 (en) * | 2004-12-09 | 2010-11-24 | 穣 高山 | Drawing method and apparatus |
US8269792B2 (en) * | 2006-11-21 | 2012-09-18 | Qualcomm Incorporated | Efficient scissoring for graphics application |
-
2012
- 2012-02-22 WO PCT/JP2012/001206 patent/WO2013124894A1/en active Application Filing
- 2012-02-22 JP JP2014500561A patent/JP5885827B2/en active Active
- 2012-06-15 TW TW101121489A patent/TW201335883A/en unknown
Also Published As
Publication number | Publication date |
---|---|
WO2013124894A1 (en) | 2013-08-29 |
TW201335883A (en) | 2013-09-01 |
JPWO2013124894A1 (en) | 2015-05-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20180374195A1 (en) | Varying effective resolution by screen location by changing active color sample count within multiple render targets | |
JP5657671B2 (en) | Tessellation engine and its application | |
JP6495378B2 (en) | Selective rasterization | |
US9449421B2 (en) | Method and apparatus for rendering image data | |
JP2016212859A (en) | Method of rendering on binocular disparity images and apparatus therefor | |
KR102381945B1 (en) | Graphic processing apparatus and method for performing graphics pipeline thereof | |
US20100066739A1 (en) | Image generating apparatus and image generating method | |
US20160125649A1 (en) | Rendering apparatus and rendering method | |
US20180089890A1 (en) | Tessellation Edge Shaders | |
KR102251444B1 (en) | Graphic processing unit, graphic processing system comprising the same, antialiasing method using the same | |
US8525843B2 (en) | Graphic system comprising a fragment graphic module and relative rendering method | |
JP2013045401A (en) | Animation drawing device | |
JP2010175638A (en) | Display device and method for display in display device | |
US9019284B2 (en) | Input output connector for accessing graphics fixed function units in a software-defined pipeline and a method of operating a pipeline | |
JP6364066B2 (en) | Graphic processing using multiple primitives | |
US11302054B2 (en) | Varying effective resolution by screen location by changing active color sample count within multiple render targets | |
WO2010089805A1 (en) | Graphical user interface device and method for realizing graphical user interface | |
CN117151973A (en) | Special effect template generation method and device, electronic equipment and storage medium | |
JP5885827B2 (en) | Drawing control apparatus and drawing control program | |
US20190108814A1 (en) | Method for improving system performance, device for improving system performance, and display apparatus | |
US20160321835A1 (en) | Image processing device, image processing method, and display device | |
US20150062127A1 (en) | Rendering method and apparatus | |
CN110264393B (en) | Information processing method, terminal and storage medium | |
JP4152383B2 (en) | Navigation system | |
JP6036072B2 (en) | Image processing device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20150707 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20150904 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20151006 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20151120 |
|
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: 20160112 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20160209 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5885827 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |