IP Library Granted Patent US 9,001,127
Granted Patent B2
US 9,001,127 · App. 13/254,399 · Granted Apr 7, 2015

Method and device for processing vector graphics

Inventors: Chenguang Ma (Zhuhai, CN); Yunbo Bai (Zhuhai, CN)
Assignee: Actions Semiconductor Co., Ltd.
G06T11/203G06T11/40
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,001,127
App. No.
13/254,399
Granted
Apr 7, 2015
Kind
B2
Abstract

A method and a device for reducing the waste of the central process unit (CPU) resource during the filling process of a vector graphic, and the method includes: parsing the vector graphic to obtain a series of polygons; mapping the polygons into a new drawing coordinate whose unit is 1/2 n pixel using a transform parameter and a transform matrix, while updating an original drawing window into the new drawing coordinate at the same time, wherein the transform parameter is A, A=2 n /K, n is a shift parameter, the unit of the vertex coordinate of the polygon is 1/K pixel, and n, K are valued for natural numbers; obtaining the portions of the polygons located in the new drawing window in the new drawing coordinate; transforming the portions of the polygons located in the new drawing window in the new drawing coordinate into a group of scan segments; and shifting the original code of the coordinate of the scan segments to right by n bit, and rendering the pixels of the shifted scan segments. In the embodiment of the present invention, when the pixels covered by the scanning line are rendered, and the division operations are replaced with the manner of shifting the coordinate values, and the generated polygon cutting error is transferred to the calculating process before the rendering, the division operation is reduced in the precondition of ensuring the result is correct, so that the occupation of the CPU resource is reduced.

Claims (123)

1. A method for processing a vector graph, comprising:

parsing the vector graph into a series of polygons;

mapping the polygons into a new drawing coordinate system in 1/2 n pixel by using a transformation parameter and a transformation matrix, and updating an original drawing window into the new drawing coordinate system, wherein, the transformation parameter is represented by A and A=2 n /K, wherein, n is a shift parameter, vertex coordinates of each of the polygons are in 1/K pixel, and n and K are natural numbers;

acquiring, in a new drawing window, a part of each of the polygons in the new drawing coordinate system;

converting the part of the polygon in the new drawing coordinate system in the new drawing window into a set of scan segments; and

shifting true forms of coordinates of the scan segments by n bits to the right, and coloring pixels on shifted scan segments.

2. The method of claim 1 , wherein, the polygons are mapped into the new drawing coordinate system in 1/2 n pixel by the transformation parameter and the transformation matrix via the following formula:

[

x

y

1

]

=

α

T

[

x

y

1

]

Wherein, the transformation matrix is represented by T and

T

=

[

S

x

R

y

T

x

R

x

S

y

T

y

0

0

1

]

,

 and

wherein, S x is a scale factor in the direction x, S y is a scale factor in the direction y, R x , is a twiddle factor in the direction x, R y is a twiddle factor in the direction y, T x is a shift factor in the direction x, T y is a shift factor in the direction y, (x, y) are original coordinates, and (x′, y′) are transformed coordinates.

3. The method of claim 1 , wherein, the polygons are mapped into the new drawing coordinate system in 1/2 n pixel by the transformation parameter and the transformation matrix in a single-cycle instruction among user defined instructions.

4. The method of claim 1 , further comprising: before acquiring, in the new drawing window, a part of the polygon in the new drawing coordinate system,

calculating and storing slopes of each edge of the polygon from vertex coordinates of the polygon in the new drawing coordinate system, where, slopes of each edge of the polygon are stored for use in a tailoring process and a scanning and converting progress.

5. The method of claim 1 , wherein, acquiring, in the new drawing window, a part of the polygon in the new drawing coordinate system comprises:

acquiring an encircling rectangle of the polygon; and

determining whether the polygon needs to be tailored from a positional relationship between the encircling rectangle and the new drawing window, and acquiring directly the polygon if the polygon is not to be tailored; otherwise, tailoring the polygon to acquire a part of the polygon in the new drawing window.

6. The method of claim 5 , wherein, determining whether the polygon needs to be tailored from the positional relationship between the encircling rectangle and the new drawing window comprises:

determining the polygon not be tailored when the encircling rectangle is in the new drawing window and determining the polygon to be tailored when the encircling rectangle intersects a part of the new drawing window.

7. The method of claim 5 , wherein, tailoring the polygon comprises:

acquiring a data structure of each edge of the polygon sequentially, and tailoring the edge with respect to the new drawing window in a tailoring algorithm, wherein, when the edge of the polygon is in the new drawing window, coordinates of endpoints of the edge keep unchanged after tailoring; and when the edge of the polygon intersects the new drawing window, coordinates of an intersection are calculated after tailoring and coordinate values in the data structure are updated.

8. The method of claim 5 , wherein, acquiring the encircling rectangle of the polygon comprises:

acquiring extremums among vertex coordinates of the polygon and delimiting the encircling rectangle with maximum and minimum abscissas and ordinates among the vertex coordinates.

9. The method of claim 1 , wherein, converting the part of the polygon in the new drawing coordinate system in the new drawing window into the set of scan segments comprises:

acquiring a scan segment corresponding to a scan line in the new drawing window when an ordinate of the scan line is an integer multiply of 2 n , wherein, the scan segment is a part of the scan line common with the part of the polygon in the new drawing coordinate system in the new drawing window.

10. The method of claim 1 , wherein, K=20.

11. A device comprising:

one or more processors configured to:

to parse a vector graph into a series of polygons;

map the polygons into a new drawing coordinate system in 1/2 n pixel by a transformation matrix multiplied by a transformation parameter, and to update an original drawing window into the new drawing coordinate system, wherein, the transformation parameter is represented by A and A=2 n /K, and wherein, n is a shift parameter, vertex coordinates of each of the polygons are in 1/K pixel, and n and K are natural numbers;

acquire, in a new drawing window, a part of the polygon in the new drawing coordinate system;

convert the part of the polygon in the new drawing coordinate system in the new drawing window into a set of scan segments;

shift true forms of coordinates of the scan segments by n bits to the right; and

color pixels on shifted scan segments.

12. The device of claim 11 , wherein the one or more processors are configured to map the polygons into the new drawing coordinate system in 1/2 n pixel by the transformation parameter and the transformation matrix via the following formula:

[

x

y

1

]

=

α

T

[

x

y

1

]

wherein, the transformation matrix is represented by T and

T

=

[

S

x

R

y

T

x

R

x

S

y

T

y

0

0

1

]

,

and wherein, S X is a scale factor in the direction x, S y is a scale factor in the direction y, R x is a twiddle factor in the direction x, R y is a twiddle factor in the direction y, T x is a shift factor in the direction x, T y is a shift factor in the direction y, (x, y) are original coordinates, and (x′, y′) are transformed coordinates.

13. The device of claim 11 , wherein the one or more processors are configured to map the polygons into the new drawing coordinate system in 1/2 n pixel by the transformation parameter and the transformation matrix in a single-cycle instruction among user defined instructions.

14. The device according to claim 11 , wherein the one or more processors are configured to:

calculate a slope of each edge of each of the polygons from vertex coordinates of the polygon in the new drawing coordinate system; and

store the slope of the edge of the polygon to be provided for use in a tailoring process and a scanning and converting process.

15. The device of claim 11 , wherein the one or more processors are configured to

acquire an encircling rectangle of the polygon; and

determine whether the polygon needs to be tailored from a positional relationship between the encircling rectangle and the new drawing window and to acquire directly the polygon if the polygon is not to be tailored; otherwise, to tailor the polygon to acquire a part of the polygon in the new drawing window.

16. The device of claim 15 , wherein the one or more processors are configured to determine the polygon not be tailored when the encircling rectangle is in the new drawing window and to determine the polygon to be tailored when the encircling rectangle intersects a part of the new drawing window.

17. The device of claim 15 , wherein the one or more processors are configured to acquire a data structure of each edge of the polygon sequentially, and to tailor the edge with respect to the new drawing window in a tailoring algorithm, wherein, when the edge of the polygon is in the new drawing window, coordinates of endpoints of the edge keep unchanged after tailoring; and when the edge of the polygon intersects the new drawing window, coordinates of an intersection are calculated after tailoring and coordinate values in the data structure are updated.

18. The device of claim 15 , wherein the one or more processors are configured to acquire extremums among vertex coordinates of the polygon and to delimit the encircling rectangle with maximum and minimum abscissas and ordinates among the vertex coordinates.

19. The device of claim 11 , wherein the one or more processors are configured to acquire a scan segment corresponding to a scan line in the new drawing window when an ordinate of the scan line is an integer multiply of 2 n , wherein, the scan segment is a part of the scan line common with the part of the polygon in the new drawing coordinate system in the new drawing window.

Assignments (3)
CHANGE OF NAME Recorded Feb 9, 2024
From: ACTIONS(ZHUHAI)TECHNOLOGY CO., LIMITED
To: ACTIONS TECHNOLOGY CO., LTD.
Reel/Frame 066550/0874 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 22, 2016
From: ACTIONS SEMICONDUCTOR CO., LTD
To: ACTIONS (ZHUHAI) TECHNOLOGY CO., LIMITED
Reel/Frame 038057/0128 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 12, 2011
From: MA, CHENGUANG; BAI, YUNBO
To: ACTIONS SEMICONDUCTOR CO., LTD.
Reel/Frame 026885/0481 →
Priority Claims (1)
CN 2009 1 0203728 · Jun 10, 2009 · national
Continuity (1)
Related Publication 20110316875A1 · Dec 29, 2011