WO2009090726A1 - 図形描画装置及び図形描画方法 - Google Patents

図形描画装置及び図形描画方法 Download PDF

Info

Publication number
WO2009090726A1
WO2009090726A1 PCT/JP2008/050350 JP2008050350W WO2009090726A1 WO 2009090726 A1 WO2009090726 A1 WO 2009090726A1 JP 2008050350 W JP2008050350 W JP 2008050350W WO 2009090726 A1 WO2009090726 A1 WO 2009090726A1
Authority
WO
WIPO (PCT)
Prior art keywords
distance information
edge
pixel
curve
information
Prior art date
Application number
PCT/JP2008/050350
Other languages
English (en)
French (fr)
Inventor
Yoshiyuki Kato
Akira Torii
Hiroyasu Negishi
Ryohei Ishida
Masaki Hamada
Original Assignee
Mitsubishi Electric Corporation
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 Mitsubishi Electric Corporation filed Critical Mitsubishi Electric Corporation
Priority to US12/810,192 priority Critical patent/US8520007B2/en
Priority to PCT/JP2008/050350 priority patent/WO2009090726A1/ja
Priority to EP08703214.0A priority patent/EP2230642B1/en
Priority to JP2009549917A priority patent/JP4937359B2/ja
Priority to CN2008801248219A priority patent/CN101911123B/zh
Publication of WO2009090726A1 publication Critical patent/WO2009090726A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/22Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the display of characters or indicia using display control signals derived from coded signals representing the characters or indicia, e.g. with a character-code memory
    • G09G5/24Generation of individual character patterns
    • G09G5/28Generation of individual character patterns for enhancement of character form, e.g. smoothing

Definitions

  • the present invention relates to a graphic drawing apparatus and a graphic drawing method for performing anti-alias drawing by expanding a two-dimensional object defined in a vector format into a distance field.
  • Two-dimensional objects defined in vector format are given by mathematical formulas such as Bezier curves and spline curves, so high-quality graphics can be drawn without jaggies even if they are enlarged or reduced like bitmap images.
  • TrueType outline fonts SVG (Scalable Vector Graphics) by W3C, and the like are one form of this vector graphics processing.
  • SVG Scalable Vector Graphics
  • OpenVG the specification of OpenVG has been established, and a graphics library and hardware corresponding to OpenVG have been developed.
  • anti-aliasing drawing is necessary to smoothly display jaggy in the contour portion.
  • a method of anti-aliasing drawing a pixel is divided into a plurality of sub-pixels, and a super-sampling method (for example, see Patent Document 1) that calculates a luminance value based on an area occupancy rate, or a luminance value depending on a distance from the center of the pixel.
  • a method for example, refer to Patent Document 2 for calculating.
  • a pixel is divided into smaller sub-pixels, and a pixel value is determined by an average value of the sub-pixels. For example, one pixel is divided into 16 4 ⁇ 4 pixels, drawing is performed for each of the virtual 16 subpixels, and finally the average value of the subpixels is set as the final value of the pixel. . Therefore, with this method, since the drawing time increases in proportion to the number of subpixels, real-time high-speed drawing is difficult. Therefore, in order to realize high-speed drawing, it is necessary to perform subpixel arithmetic processing in parallel, and the hardware scale increases.
  • the luminance value cannot be expressed steplessly (in this case, only 16 gradations can be expressed). Therefore, since a luminance value to be drawn accurately is not calculated, a smooth contour line cannot be drawn. As a result, the occurrence of jaggy cannot be reliably prevented, and the display image may be deteriorated.
  • the present invention has been made to solve the above-described problems, and obtains a graphic drawing apparatus and a graphic drawing method capable of realizing accurate anti-aliasing drawing with a small amount of calculation without causing deterioration of a display image. For the purpose.
  • the figure drawing apparatus comprises: distance information generating means for generating a distance information corresponding to a pixel of a display by rasterizing a minute line segment divided by the curve dividing means with a combination of straight cells and corner cells; An edge rasterizing means for rasterizing edge information of the minute line segment divided by the dividing means, and the mapping means performs the inside / outside determination of the pixel using the edge information rasterized by the edge rasterizing means, and the determination of the inside / outside determination According to the result, the distance information generated by the distance information generating means is mapped to the antialiasing intensity of the component included in the pixel.
  • FIG. 1 It is a block diagram which shows the figure drawing apparatus by Embodiment 1 of this invention. It is a flowchart which shows the figure drawing method by Embodiment 1 of this invention. It is explanatory drawing which shows a quadratic Bezier curve PCQ. It is explanatory drawing which shows a mode that a minute line segment is rasterized by the combination of a linear cell and a corner cell. It is explanatory drawing which shows a straight cell. It is explanatory drawing which shows the inside / outside determination process about the edge of a minute line segment. It is explanatory drawing which shows the inside / outside determination process about the edge of star-shaped path data.
  • FIG. 1 is a block diagram showing a graphic drawing apparatus according to Embodiment 1 of the present invention.
  • vector data 1 is a graphic object (arbitrary object) composed of arbitrary path data such as a Bezier curve, a spline curve, and a straight line. Closed curved surface, arbitrary stroke).
  • the curve dividing unit 2 performs matrix conversion on vertex coordinates and control point coordinates of a curve expressed by the vector data 1 (here, “curve” is a concept including a straight line in addition to a so-called curve), and after the matrix conversion A process of dividing the curve into minute line segments is performed.
  • the curve dividing unit 2 constitutes a curve dividing unit.
  • the parameter setting unit 3 performs processing for setting an external cutoff and an internal cutoff as an anti-aliasing setting parameter for specifying an anti-aliasing strength applied to path data constituting the vector data 1.
  • the distance information generating unit 4 uses the anti-aliasing setting parameter set by the parameter setting unit 3 to rasterize the minute line segment divided by the curve dividing unit 2 with a combination of a straight cell and a corner cell to each pixel 12 of the display.
  • Corresponding distance information 5 (distance information 5 is a value in the range from “ ⁇ 1” to “1”, the value on the contour line is represented by a value of “0”, and a negative number indicates that the pixel is an object Execute the process to generate (indicating that it is outside).
  • the distance buffer 6 is a memory that stores the distance information 5 generated by the distance information generation unit 4.
  • the parameter setting unit 3, the distance information generation unit 4, and the distance buffer 6 constitute a distance information generation unit.
  • the edge rasterizing unit 7 rasterizes the edge information of the minute line segment divided by the curve dividing unit 2 and stores the edge information 8 after the rasterization in the edge buffer 9.
  • the edge buffer 9 is a memory for storing the edge information 8 rasterized by the edge rasterizing unit 7.
  • the edge rasterizing unit 7 and the edge buffer 9 constitute edge rasterizing means.
  • the mapping unit 10 performs the inside / outside determination of each pixel 12 using the edge information 8 stored in the edge buffer 9, and uses the distance information 5 stored in the distance buffer 6 according to the determination result of the inside / outside determination. A process of mapping to the anti-aliasing intensity 11 of the component 13 included in the pixel 12 is performed.
  • the mapping unit 10 constitutes mapping means.
  • Pixel 12 may include one or more components 13 (eg, in the case of “RGB” type output devices, typically red, blue and green components).
  • the anti-aliased pixel intensity can be rendered on a display such as a CRT or LCD as part of the image.
  • each of the curve dividing unit 2, the parameter setting unit 3, the distance information generating unit 4, the edge rasterizing unit 7 and the mapping unit 10 which are components of the graphic drawing apparatus is provided with dedicated hardware (for example, MPU).
  • dedicated hardware for example, MPU
  • the curve dividing unit 2, the parameter setting unit 3, the distance information generating unit 4, and the edge rasterizing are assumed.
  • the graphic drawing program describing the processing contents of the unit 7 and the mapping unit 10 may be stored in a memory of a computer, and the CPU of the computer may execute the graphic drawing program stored in the memory.
  • FIG. 2 is a flowchart showing a figure drawing method according to Embodiment 1 of the present invention.
  • the curve dividing unit 2 performs matrix conversion on the vertex coordinates and control point coordinates of the curve represented by the vector data 1 (step ST1). As a result, processing such as enlarging, reducing, rotating, and translating the path data constituting the vector data 1 can be performed. If, for example, a 4 ⁇ 4 matrix is used as the matrix, projective transformation is possible, and the effect of three-dimensional bird's-eye display can be achieved.
  • the curve dividing unit 2 performs matrix conversion on the vertex coordinates and control point coordinates of the curve represented by the vector data 1, and divides the matrix-converted curve into minute line segments (step ST2). That is, the curve dividing unit 2 performs a process of approximately dividing the curve after matrix conversion into a plurality of minute line segments.
  • the number of divisions is determined by the curvature and size of the curve, and the minimum number of divisions that is visually necessary and sufficient is determined.
  • the Bezier curve is defined in the following parametric format using a parameter t (0 ⁇ t ⁇ 1).
  • P (x0, y0) and Q (x2, y2) are vertex coordinates
  • C (x1, y1) is control point coordinates.
  • the midpoint M (xm, ym) on the Bezier curve is as follows.
  • the midpoint H (xh, yh) of the straight line PQ is as follows.
  • the parameter setting unit 3 sets an external cutoff and an internal cutoff as anti-aliasing setting parameters that specify the anti-aliasing strength applied to the path data constituting the vector data 1. For example, if the cut-off value is increased, the blur of the contour portion can be increased, and if the cut-off value is decreased, the blur can be reduced. If the cut-off value is set to “0”, it is equivalent to that without anti-aliasing, and a contour with jaggy can be obtained. Further, if the external cut-off value is made larger than the internal cut-off value, the effect of fattening the whole can be obtained. On the other hand, if the external cut-off value is made smaller than the internal cut-off value, an effect of thinning the whole can be obtained.
  • the distance information generating unit 4 uses the anti-aliasing setting parameters set by the parameter setting unit 3 to convert the divided minute line segments into straight cells. Rasterization is performed with a combination of corner cells to generate distance information 5 corresponding to each pixel 12 of the display, and the distance information 5 is stored in the distance buffer 6 (step ST3).
  • the distance information 5 is a value in the range from “ ⁇ 1” to “1”
  • the value on the contour line is represented by the value “0”
  • a negative number indicates that the pixel is outside the object. It is shown that.
  • FIG. 4 is an explanatory diagram showing a state in which a minute line segment is rasterized by a combination of straight cells and corner cells.
  • the straight cell is composed of a rectangle ABEF on the outer cutoff side and a rectangle BCDE on the inner cutoff side.
  • the width of the rectangle ABEF and the rectangle BCDE the larger one is selected by comparing the external cutoff value and the internal cutoff value.
  • a point on the minute line segment is expressed as a distance value “0”.
  • the distance value of the cut-off side vertex is uniformly set to “ ⁇ 1”.
  • the distance value of each vertex of the rectangle ABEF is defined as “ ⁇ 1, 0, 0, ⁇ 1”
  • the distance value of each vertex of the rectangle BCDE is defined as “0, ⁇ 1, ⁇ 1, 0”. .
  • distance information 5 is generated for each pixel by rasterization processing. In the rasterization process, the distance value can be calculated at high speed by previously obtaining an increment value of the distance value in the X direction and the Y direction and performing linear interpolation processing in the scan line direction.
  • the corner cell is formed by a perfect circle having a radius that is an external cutoff value or an internal cutoff value.
  • the distance value at the center point of the circle is expressed as “0”, and the distance value on the circumference is expressed as “ ⁇ 1”.
  • the distance from the pixel to the center point can be calculated using the following formula, but can be calculated at high speed by approximation calculation using a lookup table.
  • the straight cell and the corner cell are superposed on the distance buffer 6 in units of pixels by overlapping each other. Therefore, in order to write the largest distance value into the distance buffer 6, when the distance information generating unit 4 writes the distance value into the distance buffer 6, the distance value is compared between the source and the destination, and the larger one (0 The distance value that is closer to () is written. In this way, the path data constituting the vector data 1 is divided into minute line segments by the optimum division number N for the shape, and the minute line segments are rasterized by a combination of straight cells and corner cells, thereby achieving anti-aliasing processing. Necessary accurate distance information 5 can be generated at high speed without a gap even at a connecting portion between minute line segments.
  • the edge rasterizing unit 7 rasterizes the edge information of the divided minute line segments and stores the edge information 8 after rasterization in the edge buffer 9. (Step ST4).
  • the coordinates to be drawn are calculated from the start point coordinates and end point coordinates of the minute line segment.
  • the mapping unit 10 reads the distance information 5 and the edge information 8 from the distance buffer 6 and the edge buffer 9 one pixel at a time.
  • the mapping unit 10 performs the inside / outside determination of the pixel 12 using the edge information 8 (step ST5), and the component 13 included in the pixel 12 includes the distance information 5 according to the determination result of the inside / outside determination. Is mapped to the anti-aliasing intensity 11 (step ST6).
  • the inside / outside determination processing of the pixel 12 is performed as shown in FIGS. 6 and 7, for example.
  • 6 shows a case where the edge of the minute line segment shown in FIG. 4 is processed
  • FIG. 7 shows a case where the edge of the star-shaped path data is processed.
  • the counter used for the inside / outside determination has an initial value of “0”, and values 601 and 701 read from the edge buffer 9 are sequentially added to the counter (see 602 and 702).
  • the fill winding rule is a non-zero rule (non-zero rule)
  • a pixel with a counter value of “0” is determined to be external, and a pixel with a counter value other than “0” is determined to be internal.
  • the winding rule is the even-odd rule (even odd rule)
  • it is determined that the pixel having the least significant bit “0” of the counter value is outside, and the pixel having the least significant bit “1” is inside. (See 604 and 704).
  • the counter is reset to “0”.
  • the negative distance value read from the distance buffer 6 is subjected to inversion processing of the sign of the distance value as shown in FIG. 4C for the area determined to be inside. If the external cutoff value is different from the internal cutoff value, the range from the distance value “ ⁇ 1” to “1” is not directly mapped to the anti-aliasing intensity 11, and the effective distance value range corresponding to the cutoff value is set. Mapping to anti-aliasing intensity 11
  • the luminance correction processing that is optimal for the display display is performed on the gradient straight line by, for example, gamma correction (see FIG. 4D). In this way, the inside / outside determination process is performed on the edge information read from the edge buffer 9, and the distance information 5 read from the distance buffer 6 is converted based on the inside / outside determination result, thereby anti-aliasing.
  • the intensity 11 can be calculated accurately.
  • the size of the distance buffer 6 and the edge buffer 9 may be a capacity capable of storing the distance information 5 and the edge information 8 for the entire screen, or a capacity capable of storing a partial area of the screen. But you can.
  • the rasterizing process in the distance information generating unit 4 and the edge rasterizing unit 7 and the mapping process in the mapping unit 10 are executed a plurality of times according to the divided areas.
  • the size of the distance buffer 6 and the edge buffer 9 is small, there is an advantage that a memory capable of high-speed access can be used. This is a capacity that can be accommodated in the on-chip cache when processing by the CPU, and can be processed only by a small-capacity built-in memory without using an external memory even when processing by dedicated hardware.
  • the inside / outside determination process including the painting winding rule is not required.
  • the straight line cell is decomposed into two rectangles having a width obtained by adding 1/2 of the line width and the cutoff, and the distance value is rasterized.
  • the corner cell rasterizes the distance value of a circle having a radius obtained by adding 1/2 of the line width and the cutoff value.
  • the anti-aliasing intensity is calculated using only the rasterized distance value. Therefore, for example, when drawing a stroke font defined only by a skeleton, anti-aliasing can be performed without performing edge rasterization processing, and an edge buffer is not required.
  • the minute line segment divided by the curve dividing unit 2 is rasterized by the combination of the straight cell and the corner cell, and the distance information 5 corresponding to the pixel 12 of the display is displayed.
  • the distance information 5 generated by the distance information generation unit 4 is mapped to the anti-aliasing intensity 11 of the component 13 included in the pixel 12 according to the determination result of the inside / outside determination. So that accurate anti-aliasing is possible without causing deterioration of the displayed image. An effect that can be achieved be drawn with a small amount of calculation.
  • FIG. FIG. 9 is a block diagram showing a graphic drawing apparatus according to Embodiment 2 of the present invention.
  • the texture reading unit 21 reads texture data (image data to be pasted on a two-dimensional object).
  • the color value calculation unit 22 performs a color gradation calculation and a texture calculation from the texture data read by the texture reading unit 21 to calculate a color value 23 of the component 13 included in the pixel 12. .
  • the texture reading unit 21 and the color value calculation unit 22 constitute color value calculation means.
  • the mapping unit 24 maps the distance information 5 to the anti-aliasing intensity in the same manner as the mapping unit 10 in FIG. 1, and alpha blends the color value 23 calculated by the color value calculating unit 22 using the anti-aliasing intensity after mapping. .
  • the mapping unit 24 constitutes mapping means.
  • the second embodiment shows a technique for expanding the first embodiment to perform more general-purpose vector graphics processing.
  • the color value calculation unit 22 performs color gradation calculation from the texture data read by the texture reading unit 21.
  • the texture calculation is performed to calculate the color value 23 of the component 13 included in the pixel 12.
  • FIG. 10 is a flowchart showing specific processing contents of the color value calculation unit 22.
  • an address 101 necessary for reading out the texture color 103 which is sampling data from the texture data 102 is calculated from the X and Y coordinates of the path data. Texture matrix information is also used to calculate the X and Y coordinates.
  • color gradation calculation is performed. Examples of gradation include the following types. ⁇ Flat type, linear type, radial type
  • the flat type is a process of painting with a single color.
  • the color of an arbitrary point is linearly interpolated by the distance from the two points.
  • the radial type is set to an arbitrary point P (x, The color value at y) is calculated with the gradient d1 / d2 between the FQs.
  • a plurality of texture colors 103 read from the texture data 102 are filtered.
  • a filter bilinear, mipmap, bicubic, or the like is used.
  • the blending process of the gradation color calculated in 110 and the texture color filtered in 120 is performed.
  • the access latency can be concealed by calculating the texture address at the stage of the rasterizing process in the distance information generating unit 4 and prefetching the texture memory.
  • the latency can be shortened by implementing the texture cache.
  • the mapping unit 24 maps the distance information 5 to the anti-aliasing intensity in the same manner as the mapping unit 10 in FIG. 1, the color value 23 calculated by the color value calculating unit 22 is alpha blended using the anti-aliasing intensity after mapping. The result is the final color 25.
  • the anti-alias drawing of the vector data 1 it is possible to display a gradation color and paste a texture image on an arbitrary figure, and there is an effect that a high-quality realistic expression can be realized.
  • FIG. 12 is a block diagram showing a figure drawing apparatus according to Embodiment 3 of the present invention.
  • the information converting unit 31 converts the distance information 5 generated by the distance information generating unit 4 into density information 32 and stores the density information 32 in the density buffer 33.
  • the density buffer 33 is a memory that stores the density information 32 converted by the information conversion unit 31.
  • the information conversion unit 31 and the density buffer 33 constitute information conversion means.
  • the mapping unit 34 performs the inside / outside determination of each pixel 12 using the edge information 8 stored in the edge buffer 9, and uses the density information 32 stored in the density buffer 33 according to the determination result of the inside / outside determination.
  • the anti-aliasing intensity 11 of the component 13 included in the pixel 12 is mapped, and the color value 23 calculated by the color value calculating unit 22 is alpha-blended using the anti-aliasing intensity after mapping.
  • the mapping unit 34 constitutes mapping means.
  • the mapping units 10 and 24 map the distance information 5 stored in the distance buffer 6 to the anti-aliasing strength 11 of the component 13 included in the pixel 12.
  • the distance information 5 may be converted into density information 32, and instead of the distance information 5, the density information 32 may be mapped to the anti-aliasing intensity 11 of the component 13 included in the pixel 12.
  • the information conversion unit 31 converts the distance information 5 generated by the distance information generation unit 4 into density information 32 and stores the density information 32 in the density buffer 33.
  • the larger density information is written by comparing the size between the source and the destination.
  • mapping unit 34 When the mapping unit 34 performs the internal / external determination of each pixel 12 in the same manner as the mapping units 10 and 24 of FIGS. 1 and 9, the density information stored in the density buffer 33 according to the determination result of the internal / external determination. 32 is mapped to the anti-aliasing intensity 11 of the component 13 included in the pixel 12. Similarly to the mapping unit 24 in FIG. 9, the color value 23 calculated by the color value calculation unit 22 is alpha-blended using the anti-aliasing intensity after mapping.
  • the capacity of the density buffer 33 can be significantly reduced as compared with the distance buffer 6, and the hardware scale and power consumption can be reduced. Is possible. Thereby, especially in a mobile phone, a portable information device, etc., there exists an effect which can lengthen the duration of a battery.
  • FIG. 13 is a block diagram showing a graphics drawing apparatus that enables high-speed processing by a flag buffer.
  • the graphic drawing apparatus according to the third embodiment is implemented, and high-speed processing is enabled by a flag buffer.
  • the glyph engine 51 When the vector data 1 is input, the glyph engine 51 performs matrix conversion on the path data constituting the vector data 1 and divides the curve into minute line segments. The glyph engine 51 calculates straight line cells, corner cells, edge vertex data and parameters from the divided minute line segments.
  • a programmable processor such as a DSP, SIMD processor, or shader processor (vertex shader or pixel shader used in three-dimensional graphics) can be used.
  • the glyph engine 51 constitutes a hinting means, and provides automatic hinting for rendering a high-quality font with good visibility even with a small character size by utilizing distance information.
  • FIG. 14 is a flowchart showing the processing content of automatic hinting.
  • a process of aligning a straight cell and a corner cell to a grid of pixels is performed (see 140).
  • the direction of the distance gradient is then used to detect pixels on the left and bottom edges of the object (see 141).
  • contrast on the left and lower edges without changing the apparent stroke centroid by darkening the detected pixels (see 142) and thinning the pixels on the opposite edge (see 143).
  • the distance gradient is used to improve the contrast for slanted character bodies and thin lines. That is, pixels on these thin regions are darkened by detecting abrupt changes in the gradient direction (see 144). Note that these are merely examples of automatically providing visual hints using distance information. Distance information can also be used to provide optimal character spacing and uniform stroke centroids.
  • the straight cell rasterizer 52 and the corner cell rasterizer 53 rasterize into the density buffer 56 through the buffer RAM controller 55.
  • the edge rasterizer 54 rasterizes the edge buffer 57. For example, in the case of a straight cell as shown in FIG. 5, the pixel movement order of rasterization moves from the true contour line in both the left and right directions, and in the case of a circle, it moves in the left and right direction from the Y direction diameter.
  • the buffer RAM control unit 55 performs double buffer control of the density buffer 56, the edge buffer 57, and the flag buffer 58.
  • drawing from each rasterizer and reading by the traverse blender 63 can be processed in parallel. Thereby, the throughput can be improved by a factor of two.
  • the flag buffer 58 is a buffer for storing a writing occurrence state in the density buffer 56 at a low resolution. For example, 1-bit information is held in 4 ⁇ 4 pixels, and when writing occurs in the pixels in this area, the corresponding bit is set to “1”.
  • the traverse blender 63 reads density information from the density buffer 56, only the necessary pixel density information of the drawn area is read. As a result, it is possible to determine the area of the path data drawn in the density buffer 56 and efficiently calculate the antialiasing strength.
  • the texture cache 60 caches texel data stored in the texture memory 59 and reduces access latency.
  • the texture engine 61 calculates a texture address, reads sampling data from the texture cache 60, and performs a filtering process.
  • the gradation engine 62 performs color gradation calculation and texture blend processing.
  • the traverse blender 63 reads data from the density buffer 56, the edge buffer 57, and the flag buffer 58, calculates a final color value based on the internal / external determination processing result, and writes the final color value to the frame buffer 64. I do.
  • the graphic drawing apparatus is suitable for developing a two-dimensional object defined in a vector format in a distance field and realizing accurate anti-aliasing drawing with a small amount of calculation.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

 曲線分割部2により分割された微小線分を直線セルとコーナーセルの組み合わせでラスタライズして、ディスプレイのピクセル12に対応する距離情報5を生成する距離情報生成部4と、曲線分割部2により分割された微小線分のエッジ情報をラスタライズするエッジラスタライズ部7とを設け、マッピング部10がエッジラスタライズ部7によりラスタライズされたエッジ情報8を用いてピクセル12の内外判定を実施し、その内外判定の判定結果にしたがって、距離情報生成部4により生成された距離情報5をピクセル12に含まれているコンポーネント13のアンチエイリアス強度11にマッピングする。

Description

図形描画装置及び図形描画方法
 この発明は、ベクター形式で定義されている2次元オブジェクトを距離フィールドに展開して、アンチエイリアス描画を行う図形描画装置及び図形描画方法に関するものである。
 ベクター形式で定義されている2次元オブジェクトは、ベジエ曲線やスプライン曲線などの数式で与えられるため、ビットマップ画像のように拡大縮小してもジャギーが発生することなく、高品質な図形描画ができるという特徴がある。
 例えば、TrueTypeのアウトラインフォントや、W3CによるSVG(Scalable Vector Graphics)などは、このベクターグラフィックス処理の一形態である。
 また、ベクターグラフィックスのローレベルAPI(Application Programming Interface)として、OpenVGの仕様が策定され、OpenVGに対応するグラフィックスライブラリやハードウェアが開発されている。
 ベクターグラフィックスでは、輪郭部のジャギーを滑らかに表示するために、アンチエイリアス描画が必要である。
 アンチエイリアス描画の手法として、ピクセルを複数のサブピクセルに分割して、面積の占有率により輝度値を算出するスーパーサンプリング手法(例えば、特許文献1を参照)や、ピクセルの中心からの距離により輝度値を算出する手法(例えば、特許文献2を参照)などがある。
 スーパーサンプリングやマルチサンプルの手法では、ピクセルを更に小さなサブピクセルに分割し、それらのサブピクセルの平均値によりピクセルの値を決定する。
 例えば、1ピクセルを4×4の16個に分割し、それぞれの仮想的な16個のサブピクセルに対して描画を行い、最終的に、それらのサブピクセルの平均値をピクセルの最終値とする。
 そのため、この手法では、描画時間がサブピクセルの数に比例して増加することから、リアルタイムな高速描画が困難である。
 したがって、高速描画を実現するには、サブピクセルの演算処理を並列に行う必要があり、ハードウェア規模が増加する。
 さらに、この手法では、輝度値を無段階に表現することができない(今回の場合では、16階調しか表現することができない)。したがって、正確に描画されるべき輝度値が計算されないため、滑らかな輪郭線を描画することができない。その結果、ジャギーの発生を確実に防止することができず、表示画像が劣化することがある。
 一方、ピクセルの中心からの距離により輝度値を算出する手法では、ピクセル毎に直線までの距離を算出しなければならない。また、ベクター形式で定義された曲線などのアンチエイリアス描画では、曲線から微小線分に分割した後、多数の微小線分までの距離の中から最短であるものを選択しなくてはならない。
 そのため、描画すべきピクセルの中心から分割された全ての微小線分までの距離をあらかじめ算出しておく必要がある。
 以下の特許文献2では、直線のアンチエイリアスについてしか述べられていないが、オブジェクトが複雑な曲線である場合、距離算出の演算量が膨大になる。
PCT WO03/096275A2 特開平6-274641号公報(段落番号[0014]、図1)
 従来の図形描画装置は以上のように構成されているので、リアルタイムな高速描画を実現するには、サブピクセルの演算処理を並列に行う必要があり、ハードウェア規模が増加する課題があった。また、滑らかな輪郭線を描画することができないため、ジャギーの発生を確実に防止することができず、表示画像が劣化することがある課題があった。
 この発明は上記のような課題を解決するためになされたもので、表示画像の劣化を招くことなく、正確なアンチエイリアス描画を少ない演算量で実現することができる図形描画装置及び図形描画方法を得ることを目的とする。
 この発明に係る図形描画装置は、曲線分割手段により分割された微小線分を直線セルとコーナーセルの組み合わせでラスタライズして、ディスプレイのピクセルに対応する距離情報を生成する距離情報生成手段と、曲線分割手段により分割された微小線分のエッジ情報をラスタライズするエッジラスタライズ手段とを設け、マッピング手段がエッジラスタライズ手段によりラスタライズされたエッジ情報を用いてピクセルの内外判定を実施し、その内外判定の判定結果にしたがって、距離情報生成手段により生成された距離情報をピクセルに含まれているコンポーネントのアンチエイリアス強度にマッピングするようにしたものである。
 このことによって、表示画像の劣化を招くことなく、正確なアンチエイリアス描画を少ない演算量で実現することができる効果がある。
この発明の実施の形態1による図形描画装置を示す構成図である。 この発明の実施の形態1による図形描画方法を示すフローチャートである。 2次のベジエ曲線PCQを示す説明図である。 微小線分が直線セルとコーナーセルの組み合わせでラスタライズ処理される様子を示す説明図である。 直線セルを示す説明図である。 微小線分のエッジについての内外判定処理を示す説明図である。 星型のパスデータのエッジについての内外判定処理を示す説明図である。 直線セルが線幅の1/2とカットオフを加算した幅をもつ2つの長方形に分解されている様子を示す説明図である。 この発明の実施の形態2による図形描画装置を示す構成図である。 カラー値算出部22の具体的な処理内容を示すフロー図である。 放射状型のグラデーションを示す説明図である。 この発明の実施の形態3による図形描画装置を示す構成図である。 フラグバッファにより高速な処理を可能とする図形描画装置を示す構成図である。 自動ヒンティングの処理内容を示すフロー図である。
 以下、この発明をより詳細に説明するために、この発明を実施するための最良の形態について、添付の図面に従って説明する。
実施の形態1.
 図1はこの発明の実施の形態1による図形描画装置を示す構成図であり、図において、ベクターデータ1は例えばベジエ曲線、スプライン曲線、直線などの任意のパスデータで構成された図形オブジェクト(任意閉曲面、任意ストローク)である。
 曲線分割部2はベクターデータ1が表現する曲線(ここでの「曲線」は、いわゆる曲線のほかに、直線を含む概念である)の頂点座標と制御点座標をマトリクス変換し、マトリクス変換後の曲線を微小線分に分割する処理を実施する。なお、曲線分割部2は曲線分割手段を構成している。
 パラメータ設定部3はベクターデータ1を構成するパスデータに施されるアンチエイリアス強度を指定するアンチエイリアス設定パラメータとして、外部カットオフと内部カットオフを設定する処理を実施する。
 距離情報生成部4はパラメータ設定部3により設定されたアンチエイリアス設定パラメータを用いて、曲線分割部2により分割された微小線分を直線セルとコーナーセルの組み合わせでラスタライズし、ディスプレイの各ピクセル12に対応する距離情報5(距離情報5は、“-1”から“1”までの範囲の値であり、輪郭線上の値は“0”の値で表現され、負の数はそのピクセルがオブジェクトの外部にあることを示す)を生成する処理を実施する。
 距離バッファ6は距離情報生成部4により生成された距離情報5を格納するメモリである。
 なお、パラメータ設定部3、距離情報生成部4及び距離バッファ6から距離情報生成手段が構成されている。
 エッジラスタライズ部7は曲線分割部2により分割された微小線分のエッジ情報をラスタライズし、ラスタライズ後のエッジ情報8をエッジバッファ9に格納する。
 エッジバッファ9はエッジラスタライズ部7によりラスタライズされたエッジ情報8を格納するメモリである。
 なお、エッジラスタライズ部7及びエッジバッファ9からエッジラスタライズ手段が構成されている。
 マッピング部10はエッジバッファ9に格納されているエッジ情報8を用いて、各ピクセル12の内外判定を実施し、その内外判定の判定結果にしたがって、距離バッファ6に格納されている距離情報5をピクセル12に含まれているコンポーネント13のアンチエイリアス強度11にマッピングする処理を実施する。
 なお、マッピング部10はマッピング手段を構成している。
 ピクセル12は1つ又は複数のコンポーネント13(例えば、「RGB」型の出力デバイスの場合、通常、赤、青及び緑のコンポーネント)を含むことができる。
 アンチエイリアシングされたピクセル強度は、イメージの一部として、CRTやLCDのようなディスプレイ上に描画されることが可能である。
 図1の例では、図形描画装置の構成要素である曲線分割部2、パラメータ設定部3、距離情報生成部4、エッジラスタライズ部7及びマッピング部10のそれぞれが専用のハードウェア(例えば、MPUを実装している半導体回路基板)で構成されているものを想定しているが、図形描画装置がコンピュータで構成される場合、曲線分割部2、パラメータ設定部3、距離情報生成部4、エッジラスタライズ部7及びマッピング部10の処理内容を記述している図形描画プログラムをコンピュータのメモリに格納し、当該コンピュータのCPUが当該メモリに格納されている図形描画プログラムを実行するようにしてもよい。
 図2はこの発明の実施の形態1による図形描画方法を示すフローチャートである。
 次に動作について説明する。
 曲線分割部2は、ベクターデータ1を入力すると、そのベクターデータ1が表現する曲線の頂点座標と制御点座標をマトリクス変換する(ステップST1)。
 これにより、ベクターデータ1を構成するパスデータを拡大、縮小、回転、平行移動するなどの処理を実施することができる。
 マトリクスとして、例えば、4×4のマトリクス行列を使用すれば、射影変換も可能となり、3次元的な鳥瞰表示の効果をだすことができる。
 曲線分割部2は、ベクターデータ1が表現する曲線の頂点座標と制御点座標をマトリクス変換すると、マトリクス変換後の曲線を微小線分に分割する(ステップST2)。
 即ち、曲線分割部2は、マトリクス変換後の曲線を複数の微小線分に近似分割する処理を実施する。
 分割数は、曲線の曲率や大きさにより決定されるものであり、視覚的に必要十分な最小の分割数が決定される。
 例えば、図3に示すような2次のベジエ曲線PCQの場合、ベジエ曲線は、パラメータt(0≦t≦1)を用いて、以下のパラメトリック形式で定義される。ただし、P(x0,y0)、Q(x2,y2)は頂点座標であり、C(x1,y1)は制御点座標である。
x(t)=(1-t)2×x0+2×(1-t)×t×x1+t2×x2
y(t)=(1-t)2×y0+2×(1-t)×t×y1+t2×y2
 したがって、ベジエ曲線上の中点M(xm,ym)は、以下のようになる。
Figure JPOXMLDOC01-appb-M000001
 また、直線PQの中点H(xh,yh)は、以下のようになる。
Figure JPOXMLDOC01-appb-M000002
 分割数Nは、中点M(xm,ym)から中点H(xh,yh)までの距離Dを用いて、次のように決定される。
 ただし、Tは定数であり、T=0とすれば、分割数は∞となり、真の曲線処理を行うことに等しい。
Figure JPOXMLDOC01-appb-M000003
 パラメータ設定部3は、ベクターデータ1を構成するパスデータに施されるアンチエイリアス強度を指定するアンチエイリアス設定パラメータとして、外部カットオフと内部カットオフを設定する。
 例えば、カットオフ値を大きくすれば、輪郭部のボケを大きくすることができ、カットオフ値を小さくすれば、ボケを小さくすることができる。
 カットオフ値を“0”にすれば、アンチエイリアスなしと同等であり、ジャギー付きの輪郭にすることができる。
 また、外部カットオフ値を内部カットオフ値より大きくすれば、全体を太らせる効果を出すことができる。一方、外部カットオフ値を内部カットオフ値より小さくすれば、全体を細らせる効果を出すことができる。
 距離情報生成部4は、曲線分割部2がマトリクス変換後の曲線を微小線分に分割すると、パラメータ設定部3により設定されたアンチエイリアス設定パラメータを用いて、分割された微小線分を直線セルとコーナーセルの組み合わせでラスタライズして、ディスプレイの各ピクセル12に対応する距離情報5を生成し、その距離情報5を距離バッファ6に格納する(ステップST3)。
 ここで、距離情報5は、“-1”から“1”までの範囲の値であり、輪郭線上の値は“0”の値で表現され、負の数はそのピクセルがオブジェクトの外部にあることを示している。
 図4は微小線分が直線セルとコーナーセルの組み合わせでラスタライズ処理される様子を示す説明図である。
 図4の例では、直線セルは、外部カットオフ側の長方形ABEFと内部カットオフ側の長方形BCDEから構成されている。
 長方形ABEFと長方形BCDEの幅は、外部カットオフ値と内部カットオフ値を比較して、大きい方が選択される。
 微小線分は、真の輪郭線でもあるので、微小線分上の点は、距離値が“0”として表現される。
 このステージでは、オブジェクトの内外判定が未解決であるので、カットオフ側頂点の距離値が一律に“-1”とされている。
 したがって、長方形ABEFの各頂点の距離値は“-1,0,0,-1”と定義され、長方形BCDEの各頂点の距離値は“0,-1,-1,0”と定義される。
 長方形ABDEと長方形BCDEが決定されたらラスタライズ処理によりピクセル単位に距離情報5(距離値)が生成される。
 ラスタライズ処理では、予め、X方向及びY方向について、距離値の増分値を求め、スキャンライン方向へ線形補間処理することにより、高速に距離値を算出することができる。
 一方、コーナーセルは、外部カットオフ値又は内部カットオフ値を半径とする真円で構成される。
 円の中心点における距離値は“0”、円周上の距離値は“-1”として表現される。
 ピクセルから中心点までの距離は、下記の式を用いて算出することができるが、ルックアップテーブルを用いた近似計算により高速に算出することができる。
Figure JPOXMLDOC01-appb-M000004
 直線セルとコーナーセルは、お互い重なり合いながら距離バッファ6へラピクセル単位にスタライズされる。
 そこで、最も大きな距離値を距離バッファ6に書き込むために、距離情報生成部4が距離値を距離バッファ6に書き込む際、ソースとデスティネーション間で距離値の大小比較を実施し、大きな方(0に近い方)の距離値を書き込むようにする。
 このように、ベクターデータ1を構成するパスデータを形状に最適な分割数Nで微小線分へ分割し、その微小線分を直線セルとコーナーセルの組み合わせでラスタライズ処理することにより、アンチエイリアス処理に必要な正確な距離情報5を微小線分同士の連結部においても隙間なく高速に生成することができる。
 エッジラスタライズ部7は、曲線分割部2がマトリクス変換後の曲線を微小線分に分割すると、分割された微小線分のエッジ情報をラスタライズし、ラスタライズ後のエッジ情報8をエッジバッファ9に格納する(ステップST4)。
 エッジ情報8のラスタライズは、例えば、DDA(Digital Differential Analyzer:デジタル微分解析器)を用いて、微小線分の始点座標と終点座標から描画すべき座標を算出する。
 図6及び図7に示すように、エッジが上向きの場合は、エッジバッファ9に格納されているエッジデータ(ラスタライズが実施されている途中のエッジ情報8)に“+1”の加算処理を実施し、エッジが下向きの場合は、エッジバッファ9に格納されているエッジデータに“-1”の減算処理を実施する。
 例えば、同一座標におけるエッジの重なりが128回までと定義されている場合には、エッジバッファ9の深さ方向のビット幅として、8bit(27=128+符号ビット)が必要である。
 マッピング部10は、1個分のパスデータのラスタライズ処理が終了すると、距離バッファ6及びエッジバッファ9から、1ピクセルずつ、距離情報5とエッジ情報8の読み出しを行う。
 マッピング部10は、そのエッジ情報8を用いて、当該ピクセル12の内外判定を実施し(ステップST5)、その内外判定の判定結果にしたがって、その距離情報5をピクセル12に含まれているコンポーネント13のアンチエイリアス強度11にマッピングする(ステップST6)。
 ピクセル12の内外判定処理は、例えば、図6及び図7のように行われる。
 図6は図4で示された微小線分のエッジを処理する場合を示し、図7は星型のパスデータのエッジを処理する場合を示している。
 内外判定に用いるカウンタは、初期値が“0”であり、エッジバッファ9から読み出された値601,701がカウンタに対して順次加算される(602,702を参照)。
 塗りつぶしのワインディング規則がNon-Zeroルール(非ゼロ規則)である場合、カウンタ値が“0”のピクセルは外部であると判断され、カウンタ値が“0”以外のピクセルは内部であると判断される(603,703を参照)。
 一方、ワインディング規則がEven-Oddルール(奇偶規則)である場合、カウンタ値の最下位ビットが“0”のピクセルは外部であると判断され、最下位ビットが“1”のピクセルは内部であると判断される(604,704を参照)。
 1スキャンライン分の処理が終了したら、カウンタは“0”にリセットされる。
 距離バッファ6から読み出された負の距離値は、内部と判定された領域については、図4(c)に示すように、距離値の符号の反転処理が行われる。
 外部カットオフ値と内部カットオフ値が異なる場合は、距離値“-1”から“1”までの範囲をアンチエイリアス強度11に直接マッピングせず、カットオフ値に対応する有効な距離値の範囲をアンチエイリアス強度11にマッピングする。
 また、勾配直線に対して、例えば、ガンマ補正などにより表示ディスプレイに最適な輝度補正処理を施すようにする(図4(d)を参照)。
 このように、エッジバッファ9から読み出されたエッジ情報で内外判定処理を実施し、その内外判定結果に基づいて距離バッファ6から読み出された距離情報5の変換処理を実施することにより、アンチエイリアス強度11を正確に算出することができる。
 なお、距離バッファ6及びエッジバッファ9のサイズは、全画面分の距離情報5及びエッジ情報8を格納することができる容量でもよいし、画面の一部の領域を格納することができる容量のどちらでもよい。
 領域の一部を格納する場合には、分割された領域に応じて、距離情報生成部4及びエッジラスタライズ部7におけるラスタライズ処理と、マッピング部10におけるマッピング処理を複数回実行する。
 この場合、距離バッファ6及びエッジバッファ9のサイズが小容量で足りるため、高速アクセスが可能なメモリを使用することができるメリットがある。
 これは、CPUで処理する場合は、オンチップキャッシュに収まる容量であるし、専用ハードウェアで処理する場合においても外部メモリを用いることなく、小容量の内蔵メモリのみで処理することができる。
 また、ベクターデータが任意パスデータで囲まれた閉曲面ではなく、任意パスデータで指定された線幅をもつストロークの場合、塗りつぶしのワインディング規則を含む内外判定処理が不要となる。
 図8に示すように、直線セルを線幅の1/2とカットオフを加算した幅をもつ2つの長方形に分解し、距離値をラスタライズする。同様に、コーナーセルも線幅の1/2とカットオフ値を加算した半径をもつ円の距離値をラスタライズする。
 その後、ラスタライズされた距離値だけを用いて、アンチエイリアス強度を算出する。したがって、例えば、骨格だけで定義されたストロークフォントを描画する場合は、エッジのラスタライズ処理を行わずにアンチエイリアス描画が可能で、エッジバッファも不要となる。
 以上で明らかなように、この実施の形態1によれば、曲線分割部2により分割された微小線分を直線セルとコーナーセルの組み合わせでラスタライズして、ディスプレイのピクセル12に対応する距離情報5を生成する距離情報生成部4と、曲線分割部2により分割された微小線分のエッジ情報をラスタライズするエッジラスタライズ部7とを設け、マッピング部10がエッジラスタライズ部7によりラスタライズされたエッジ情報8を用いてピクセル12の内外判定を実施し、その内外判定の判定結果にしたがって、距離情報生成部4により生成された距離情報5をピクセル12に含まれているコンポーネント13のアンチエイリアス強度11にマッピングするように構成したので、表示画像の劣化を招くことなく、正確なアンチエイリアス描画を少ない演算量で実現することができる効果を奏する。
実施の形態2.
 図9はこの発明の実施の形態2による図形描画装置を示す構成図であり、図において、図1と同一符号は同一または相当部分を示すので説明を省略する。
 テクスチャ読み出し部21はテクスチャデータ(2次元オブジェクトに貼り付けるためのイメージデータ)の読み出し処理を実施する。
 カラー値算出部22はテクスチャ読み出し部21により読み出されたテクスチャデータから色のグラデーション演算とテクスチャ演算を実施して、ピクセル12に含まれているコンポーネント13のカラー値23を算出する処理を実施する。
 なお、テクスチャ読み出し部21及びカラー値算出部22からカラー値算出手段が構成されている。
 マッピング部24は図1のマッピング部10と同様にして、距離情報5をアンチエイリアス強度にマッピングし、マッピング後のアンチエイリアス強度を用いて、カラー値算出部22により算出されたカラー値23をアルファブレンドする。
 なお、マッピング部24はマッピング手段を構成している。
 この実施の形態2は、上記実施の形態1を拡張して、より汎用なベクターグラフィックスの処理を行う手法を示したものである。
 上記実施の形態1と同様にして、1個分のパスデータの距離情報とエッジ情報をラスタライズ処理した後、カラー値算出部22がテクスチャ読み出し部21により読み出されたテクスチャデータから色のグラデーション演算とテクスチャ演算を実施して、ピクセル12に含まれているコンポーネント13のカラー値23を算出する。
 ここで、図10はカラー値算出部22の具体的な処理内容を示すフロー図である。
 図10において、100では、テクスチャデータ102からサンプリングデータであるテクスチャカラー103を読み出すために必要なアドレス101をパスデータのX,Y座標から計算する。X,Y座標の計算にはテクスチャマトリクスの情報も使用される。
 110ではカラーグラデーション演算を行う。グラデーションとしては、例えば、以下の種類がある。
・フラット型
・線形型
・放射状型
 フラット型は、単一カラーで塗りつぶす処理である。
 線形型は、2点のカラー値が指定された場合、任意の点のカラーを2点からの距離で線形補間するものである。
 放射状型は、図11に示すように、中心点C(cx,cy)のカラー値、注目点F(fx,fy)のカラー値、半径rが指定された場合、任意の点P(x,y)におけるカラー値がFQ間の勾配d1/d2で算出される。
 120ではテクスチャデータ102から読み出された複数のテクスチャカラー103をフィルタ処理する。フィルタとしては、バイリニア、ミップマップ、バイキュービックなどが使用される。
 130では110で算出されたグラデーションカラーと、120でフィルタ処理されたテクスチャカラーのブレンディング処理を行う。
 ハードウェアで実装する場合、一般的にテクスチャデータ102からテクスチャカラー103を読み出すまでのレイテンシが大きい。
 そのため、距離情報生成部4におけるラスタライズ処理の段階でテクスチャアドレスを算出し、テクスチャメモリに対してプリフェッチをかけることにより、アクセスレイテンシを隠蔽することが可能である。
 また、テクスチャキャッシュを実装することにより、レイテンシを短縮することもできる。
 マッピング部24は、図1のマッピング部10と同様にして、距離情報5をアンチエイリアス強度にマッピングすると、マッピング後のアンチエイリアス強度を用いて、カラー値算出部22により算出されたカラー値23をアルファブレンドし、その結果を最終カラー25とする。
 このように、ベクターデータ1のアンチエイリアス描画において、任意図形に対してグラデーションカラーの表示とテクスチャイメージの貼り付けが可能となり、高品質なリアリスティックな表現を実現することができる効果を奏する。
実施の形態3.
 図12はこの発明の実施の形態3による図形描画装置を示す構成図であり、図において、図9と同一符号は同一または相当部分を示すので説明を省略する。
 情報変換部31は距離情報生成部4により生成された距離情報5を濃度情報32に変換し、その濃度情報32を濃度バッファ33に格納する処理を実施する。
 濃度バッファ33は情報変換部31により変換された濃度情報32を格納するメモリである。
 なお、情報変換部31及び濃度バッファ33から情報変換手段が構成されている。
 マッピング部34はエッジバッファ9に格納されているエッジ情報8を用いて、各ピクセル12の内外判定を実施し、その内外判定の判定結果にしたがって、濃度バッファ33に格納されている濃度情報32をピクセル12に含まれているコンポーネント13のアンチエイリアス強度11にマッピングし、また、マッピング後のアンチエイリアス強度を用いて、カラー値算出部22により算出されたカラー値23をアルファブレンドする。
 なお、マッピング部34はマッピング手段を構成している。
 上記実施の形態1,2では、マッピング部10,24が距離バッファ6に格納されている距離情報5をピクセル12に含まれているコンポーネント13のアンチエイリアス強度11にマッピングするものについて示したが、その距離情報5を濃度情報32に変換し、その距離情報5の代わりに、その濃度情報32をピクセル12に含まれているコンポーネント13のアンチエイリアス強度11にマッピングするようにしてもよい。
 いかなるスケーリングにおいても、正確なアンチエイリアス描画を行うためには、十分な精度の距離情報5を確保する必要がある。
 このため、距離バッファ6のフォーマットとして、固定小数点フォーマット、または、浮動小数点フォーマットのいずれを用いる場合でも、32bit前後のデータビット長が必要となる。
 一方、距離情報5の代わりに、ディスプレイに対応する濃度情報32を用いれば、少ないデータビット長でも十分な精度を維持することができる。
 例えば、ディスプレイの階調が256段階であれば、8bitのデータビット長で正確なアンチエイリアス描画が可能である。
 そこで、この実施の形態3では、情報変換部31が距離情報生成部4により生成された距離情報5を濃度情報32に変換し、その濃度情報32を濃度バッファ33に格納する。
 濃度バッファ33に対する濃度情報32の書き込み処理は、距離バッファ6と同様に、ソースとデスティネーション間で大小比較して、大きな方の濃度情報を書き込むようにする。
 マッピング部34は、図1及び図9のマッピング部10,24と同様にして、各ピクセル12の内外判定を実施すると、その内外判定の判定結果にしたがって、濃度バッファ33に格納されている濃度情報32をピクセル12に含まれているコンポーネント13のアンチエイリアス強度11にマッピングする。また、図9のマッピング部24と同様にして、マッピング後のアンチエイリアス強度を用いて、カラー値算出部22により算出されたカラー値23をアルファブレンドする。
 このように、距離情報5の代わりに濃度情報32を用いることにより、距離バッファ6よりも、濃度バッファ33の容量を大幅に抑えることができるようになり、ハードウェア規模や消費電力を小さくすることが可能になる。これにより、特に携帯電話や携帯型情報機器などでは、バッテリーの持続時間を長くすることができる効果を奏する。
実施の形態4.
 図13はフラグバッファにより高速な処理を可能とする図形描画装置を示す構成図である。
 この実施の形態4では、上記実施の形態3による図形描画装置を具現化して、フラグバッファにより高速な処理を可能とするものである。
 グリフエンジン51は、ベクターデータ1を入力すると、そのベクターデータ1を構成するパスデータをマトリクス変換して、曲線を微小線分に分割する。
 また、グリフエンジン51は、分割した微小線分から直線セル、コーナーセル、エッジの頂点データ及びパラメータを算出する。
 なお、グリフエンジン51としては、DSP,SIMDプロセッサ、シェーダープロセッサ(3次元グラフィックスで使用される頂点シェーダ、ピクセルシェーダ)などのプログラマブルなプロセッサを使用することができる。
 また、グリフエンジン51は、ヒンティング手段を構成しており、距離情報を活用することにより、小さい文字サイズでも視認性の良い高品質なフォント描画をするための自動ヒンティングを提供する。
 ここで、図14は自動ヒンティングの処理内容を示すフロー図である。
 ヒンティングでは、最初に、直線セルとコーナーセルからピクセルのグリッドに揃える処理を行う(140を参照)。
 次に、距離勾配の方向を用いて、オブジェクトの左及び下のエッジ上のピクセルを検出する(141を参照)。
 次に、検出したピクセルを濃くし(142を参照)、対向するエッジ上のピクセルを薄くすることによって(143を参照)、見かけ上のストローク重心を変えずに、左及び下のエッジ上のコントラストを高くする。
 さらに、距離勾配を用いて、斜めの文字本体や細いセリフに対するコントラストを良くする。つまり、勾配方向の急激な変化を検出することにより、これらの薄い領域上のピクセルを濃くする(144を参照)。
 なお、これらは、距離情報を用いて、視覚的なヒントを自動的に提供する一例にすぎない。距離情報は、最適な文字間隔及び一様なストローク重心を提供するためにも使用可能である。
 直線セルラスタライザ52及びコーナーセルラスタライザ53は、バッファRAM制御部55を通して、濃度バッファ56へラスタライズする。
 エッジラスタライザ54は、エッジバッファ57へラスタライズする。
 ラスタライズのピクセル移動順序は、例えば、図5に示すような直線セルの場合、真の輪郭線から左右両方向へ移動し、円の場合、Y方向直径から左右両方向へ移動する。
 バッファRAM制御部55は、濃度バッファ56、エッジバッファ57及びフラグバッファ58のダブルバッファ制御を実施する。
 ダブルバッファ方式を採用することにより、各ラスタライザからの描画とトラバースブレンダ63による読み出しを並列に処理することが可能になる。
 これにより、スループットを2倍に向上させることができる。
 フラグバッファ58は、濃度バッファ56への書き込み発生状況を低解像度で格納するためのバッファである。例えば、4×4ピクセルで1bitの情報を保持し、この領域のピクセルに書き込みが発生したら、対応するビットを“1”とする。
 そして、トラバースブレンダ63が濃度バッファ56から濃度情報を読み出すときは、描画された領域の必要なピクセル濃度情報のみを読み出すようにする。
 これにより、濃度バッファ56へ描画されたパスデータの領域を判定し、アンチエイリアス強度を効率良く算出することが可能になる。
 テクスチャキャッシュ60は、テクスチャメモリ59に格納されたテクセルデータをキャッシングし、アクセスレイテンシを低減する。
 テクスチャエンジン61は、テクスチャアドレスを算出して、テクスチャキャッシュ60からサンプリングデータを読み出してフィルタ処理を行う。
 グラデーションエンジン62は、カラーグラデーション演算とテクスチャブレンド処理を行う。
 最後に、トラバースブレンダ63は、濃度バッファ56、エッジバッファ57及びフラグバッファ58からデータを読み出し、内外判定処理結果に基づいて最終カラー値を算出して、その最終カラー値をフレームバッファ64に書き込む処理を行う。
 このように、グリフエンジン51により自動ヒンティングが可能となり、従来必要であったフォントのヒント情報が不要となる。
 また、濃度バッファ56、エッジバッファ57などをダブルバッファ構成にすることにより、描画と読み出しを並列に処理することが可能になり、スループットを向上させることができる。
 さらに、フラグバッファ58により必要な領域の情報のみを効率良く読み出して、アンチエイリアス強度の算出を高速に処理することが可能になる。
 以上のように、この発明に係る図形描画装置は、ベクター形式で定義されている2次元オブジェクトを距離フィールドに展開して、正確なアンチエイリアス描画を少ない演算量で実現するものに適している。

Claims (7)

  1.  ベクターデータが表現する曲線の頂点座標と制御点座標をマトリクス変換し、マトリクス変換後の曲線を微小線分に分割する曲線分割手段と、上記曲線分割手段により分割された微小線分を直線セルとコーナーセルの組み合わせでラスタライズして、ディスプレイのピクセルに対応する距離情報を生成する距離情報生成手段と、上記曲線分割手段により分割された微小線分のエッジ情報をラスタライズするエッジラスタライズ手段と、上記エッジラスタライズ手段によりラスタライズされたエッジ情報を用いて上記ピクセルの内外判定を実施し、上記内外判定の判定結果にしたがって上記距離情報生成手段により生成された距離情報を上記ピクセルに含まれているコンポーネントのアンチエイリアス強度にマッピングするマッピング手段とを備えた図形描画装置。
  2.  テクスチャデータから色のグラデーション演算とテクスチャ演算を実施して、ピクセルに含まれているコンポーネントのカラー値を算出するカラー値算出手段を設け、マッピング手段がマッピング後のアンチエイリアス強度を用いて、上記カラー値算出手段により算出されたカラー値をアルファブレンドすることを特徴とする請求項1記載の図形描画装置。
  3.  距離情報生成手段により生成された距離情報を濃度情報に変換する情報変換手段を設け、マッピング手段が上記距離情報生成手段により生成された距離情報の代わりに、上記情報変換手段により変換された濃度情報をピクセルに含まれているコンポーネントのアンチエイリアス強度にマッピングすることを特徴とする請求項1記載の図形描画装置。
  4.  距離情報生成手段により生成された距離情報を用いて、ベクターデータをヒンティングするヒンティング手段を設けたことを特徴とする請求項1記載の図形描画装置。
  5.  濃度バッファに対する濃度情報の書き込み発生状況を格納するフラグバッファを設けたことを特徴とする請求項3記載の図形描画装置。
  6.  濃度バッファ及びフラグバッファをダブルバッファで構成することを特徴とする請求項5記載の図形描画装置。
  7.  曲線分割手段が、ベクターデータが表現する曲線の頂点座標と制御点座標をマトリクス変換し、マトリクス変換後の曲線を微小線分に分割する曲線分割ステップと、距離情報生成手段が上記曲線分割手段により分割された微小線分を直線セルとコーナーセルの組み合わせでラスタライズして、ディスプレイのピクセルに対応する距離情報を生成する距離情報生成ステップと、エッジラスタライズ手段が上記曲線分割手段により分割された微小線分のエッジ情報をラスタライズするエッジラスタライズステップと、マッピング手段が上記エッジラスタライズ手段によりラスタライズされたエッジ情報を用いて上記ピクセルの内外判定を実施し、上記内外判定の判定結果にしたがって上記距離情報生成手段により生成された距離情報を上記ピクセルに含まれているコンポーネントのアンチエイリアス強度にマッピングするマッピングステップとを備えた図形描画方法。
PCT/JP2008/050350 2008-01-15 2008-01-15 図形描画装置及び図形描画方法 WO2009090726A1 (ja)

Priority Applications (5)

Application Number Priority Date Filing Date Title
US12/810,192 US8520007B2 (en) 2008-01-15 2008-01-15 Graphic drawing device and graphic drawing method
PCT/JP2008/050350 WO2009090726A1 (ja) 2008-01-15 2008-01-15 図形描画装置及び図形描画方法
EP08703214.0A EP2230642B1 (en) 2008-01-15 2008-01-15 Graphic drawing device and graphic drawing method
JP2009549917A JP4937359B2 (ja) 2008-01-15 2008-01-15 図形描画装置及び図形描画方法
CN2008801248219A CN101911123B (zh) 2008-01-15 2008-01-15 图形描绘装置以及图形描绘方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2008/050350 WO2009090726A1 (ja) 2008-01-15 2008-01-15 図形描画装置及び図形描画方法

Publications (1)

Publication Number Publication Date
WO2009090726A1 true WO2009090726A1 (ja) 2009-07-23

Family

ID=40885137

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2008/050350 WO2009090726A1 (ja) 2008-01-15 2008-01-15 図形描画装置及び図形描画方法

Country Status (5)

Country Link
US (1) US8520007B2 (ja)
EP (1) EP2230642B1 (ja)
JP (1) JP4937359B2 (ja)
CN (1) CN101911123B (ja)
WO (1) WO2009090726A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015103226A (ja) * 2013-11-28 2015-06-04 株式会社Screenホールディングス データ演算方法、データ演算装置および欠陥検査装置
US10885681B2 (en) 2015-09-11 2021-01-05 Samsung Electronics Co., Ltd. Method and apparatus for performing path stroking

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102646281B (zh) * 2011-02-16 2015-02-11 富士通株式会社 用于对椭圆弧进行栅格化的方法和系统
JPWO2012165238A1 (ja) * 2011-05-30 2015-02-23 アイシン精機株式会社 描画装置、描画方法及びプログラム
CN102819853B (zh) * 2011-06-10 2015-11-25 富士通株式会社 曲线渲染方法和系统
CN102651137B (zh) * 2012-04-01 2014-05-07 浙江大学 一种基于像素精度的代数曲线光栅化方法
EP2985735B1 (en) 2014-08-11 2019-12-04 Samsung Electronics Co., Ltd Method and apparatus for performing tile-based path rendering
US9804709B2 (en) 2015-04-28 2017-10-31 Samsung Display Co., Ltd. Vector fill segment method and apparatus to reduce display latency of touch events
KR101666131B1 (ko) * 2015-05-29 2016-10-14 경북대학교 산학협력단 서브 픽셀의 패턴을 고려한 벡터 글꼴의 렌더링 방법
EP3347893B1 (en) * 2016-08-04 2020-11-18 Apple Inc. Display with pixel dimming for curved edges
US11100700B2 (en) * 2017-08-28 2021-08-24 Will Dobbie System and method for rendering a graphical shape
WO2019043562A1 (en) * 2017-08-28 2019-03-07 Will Dobbie METHOD AND APPARATUS FOR REPRESENTING A VISUAL REPRESENTATION OF A POLICE GLYPHE
CN109724617B (zh) * 2017-10-31 2021-12-24 腾讯科技(深圳)有限公司 一种导航路线的绘制方法以及相关设备
US11257275B2 (en) * 2018-10-31 2022-02-22 Facebook Technologies, Llc. Dual distance field color palette
CN111443864B (zh) * 2020-04-14 2023-03-07 重庆赋比兴科技有限公司 基于iOS的曲线绘制方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07296176A (ja) * 1992-05-19 1995-11-10 Uin Syst:Kk 多角形塗りつぶし情報出力方式
JPH1131233A (ja) * 1997-07-10 1999-02-02 Yamaha Corp 多角形描画方法及び装置
JP2000235383A (ja) * 1999-02-15 2000-08-29 Fuji Xerox Co Ltd 文字処理装置および文字処理方法
JP2003006675A (ja) * 2001-02-22 2003-01-10 Sega Corp 画像表示制御方法及びその装置、並びに画像表示制御方法が記録された記録媒体及びゲーム機
JP2007529788A (ja) * 2004-03-16 2007-10-25 ミツビシ・エレクトリック・リサーチ・ラボラトリーズ・インコーポレイテッド 合成グリフの領域をレンダリングする方法

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5155822A (en) * 1987-08-13 1992-10-13 Digital Equipment Corporation High performance graphics workstation
JPH06274641A (ja) 1993-03-19 1994-09-30 Fujitsu Ltd アンチエイリアシング直線表示装置
JPH08146936A (ja) * 1994-11-21 1996-06-07 Fujitsu Ltd アウトラインフォントデータの処理方法および装置
US6700672B1 (en) * 1999-07-30 2004-03-02 Mitsubishi Electric Research Labs, Inc. Anti-aliasing with line samples
US7131907B2 (en) * 2001-02-22 2006-11-07 Kabushiki Kaisha Sega System and method for superimposing an image on another image in a video game
CN1653488A (zh) 2002-05-10 2005-08-10 比特波伊斯有限责任公司 显示驱动器ic、显示模块以及合并有图形引擎的电子装置
US6982724B2 (en) * 2003-03-25 2006-01-03 Mitsubishi Electric Research Labs, Inc. Method for antialiasing an object represented as a two-dimensional distance field in object-order
US6917369B2 (en) * 2003-03-25 2005-07-12 Mitsubishi Electric Research Labs, Inc. Method and apparatus for rendering cell-based distance fields using texture mapping
US7006110B2 (en) * 2003-04-15 2006-02-28 Nokia Corporation Determining a coverage mask for a pixel
JP4157569B2 (ja) * 2006-05-11 2008-10-01 株式会社東芝 描画装置、描画方法及び描画プログラム

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07296176A (ja) * 1992-05-19 1995-11-10 Uin Syst:Kk 多角形塗りつぶし情報出力方式
JPH1131233A (ja) * 1997-07-10 1999-02-02 Yamaha Corp 多角形描画方法及び装置
JP2000235383A (ja) * 1999-02-15 2000-08-29 Fuji Xerox Co Ltd 文字処理装置および文字処理方法
JP2003006675A (ja) * 2001-02-22 2003-01-10 Sega Corp 画像表示制御方法及びその装置、並びに画像表示制御方法が記録された記録媒体及びゲーム機
JP2007529788A (ja) * 2004-03-16 2007-10-25 ミツビシ・エレクトリック・リサーチ・ラボラトリーズ・インコーポレイテッド 合成グリフの領域をレンダリングする方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015103226A (ja) * 2013-11-28 2015-06-04 株式会社Screenホールディングス データ演算方法、データ演算装置および欠陥検査装置
US10885681B2 (en) 2015-09-11 2021-01-05 Samsung Electronics Co., Ltd. Method and apparatus for performing path stroking

Also Published As

Publication number Publication date
EP2230642A1 (en) 2010-09-22
CN101911123B (zh) 2012-09-26
JP4937359B2 (ja) 2012-05-23
US8520007B2 (en) 2013-08-27
US20100271382A1 (en) 2010-10-28
EP2230642B1 (en) 2022-05-18
EP2230642A4 (en) 2014-11-19
JPWO2009090726A1 (ja) 2011-05-26
CN101911123A (zh) 2010-12-08

Similar Documents

Publication Publication Date Title
JP4937359B2 (ja) 図形描画装置及び図形描画方法
JP6476327B2 (ja) ラスタライズパラメータを変更することによりスクリーン位置による有効解像度の変化
JP4693660B2 (ja) 描画装置、描画方法及び描画プログラム
JP5006412B2 (ja) 効率的な2d及び3dグラフィックス処理
EP3129974B1 (en) Gradient adjustment for texture mapping to non-orthonormal grid
US8704830B2 (en) System and method for path rendering with multiple stencil samples per color sample
JP5232358B2 (ja) アウトラインフォントのレンダリング
JP4157569B2 (ja) 描画装置、描画方法及び描画プログラム
EP1958162B1 (en) Vector graphics anti-aliasing
US20030142104A1 (en) Batch processing of primitives for use with a texture accumulation buffer
US10140736B2 (en) Graphics processing systems
US7928984B1 (en) Efficient data packaging for rendering bézier curves on a GPU
JP2010092481A (ja) グラフィックス処理システム
US7679620B2 (en) Image processing using saltating samples
KR20180060198A (ko) 그래픽 프로세싱 장치 및 그래픽스 파이프라인에서 텍스처를 처리하는 방법
JP4801088B2 (ja) 画素サンプリングの方法及び装置
KR20180037839A (ko) 그래픽스 프로세싱 장치 및 인스트럭션의 실행 방법
JP2008299642A (ja) 図形描画装置
JP5207989B2 (ja) 図形描画装置及び図形描画プログラム
JP2011028641A (ja) 画像処理装置及び画像処理方法
WO2024112961A1 (en) Interactive computer graphics system and methods for single-pass path rendering and batching of strokes and fills

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 200880124821.9

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 08703214

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2009549917

Country of ref document: JP

WWE Wipo information: entry into national phase

Ref document number: 12810192

Country of ref document: US

WWE Wipo information: entry into national phase

Ref document number: 2008703214

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE