CN103034968B - Cut out the method for two-dimension vector graphics - Google Patents

Cut out the method for two-dimension vector graphics Download PDF

Info

Publication number
CN103034968B
CN103034968B CN201110294719.7A CN201110294719A CN103034968B CN 103034968 B CN103034968 B CN 103034968B CN 201110294719 A CN201110294719 A CN 201110294719A CN 103034968 B CN103034968 B CN 103034968B
Authority
CN
China
Prior art keywords
vector graphics
shade
value
viewing area
cutting out
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
Application number
CN201110294719.7A
Other languages
Chinese (zh)
Other versions
CN103034968A (en
Inventor
纪富中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ali Corp
Original Assignee
Ali Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ali Corp filed Critical Ali Corp
Priority to CN201110294719.7A priority Critical patent/CN103034968B/en
Publication of CN103034968A publication Critical patent/CN103034968A/en
Application granted granted Critical
Publication of CN103034968B publication Critical patent/CN103034968B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Generation (AREA)

Abstract

The invention discloses a kind of method of cutting out two-dimension vector graphics, be applicable to the two-dimension vector graphics hardware accelerator with shade function, the method comprises the following steps: determine at least one cut out rectangle and each cut out rectangle convert vector graphics path corresponding to its rectangular edges to; Store each vector graphics path; Set the multiple shade values corresponding to a viewing area, in viewing area, be set as nonzero value by the shade value of described vector graphics path enclosing region, in viewing area, the shade value of non-enclosing region is set as null value; The shade function of enable two-dimension vector graphics hardware accelerator, the new picture that original image is produced corresponding to viewing area by the frame buffering of multiple shade value; And describe new picture in viewing area.The present invention is not when changing hardware structure/condition, and the number of cutting out rectangle can at random increase, and effectively can solve tradition needs the extra problem of cutting out circuit.

Description

Cut out the method for two-dimension vector graphics
Technical field
The present invention relates to the disposal route of a kind of vector (Vector) figure, particularly relate to a kind of cut-out method using two-dimension vector graphics cleanup standard function storehouse (OpenVG).
Background technology
OpenVG specification organizes by Khronos a kind of application programming interface (the Application Programming Interface presiding over lower exploitation, API) specification, be used in hardware-accelerated two dimension (Two-dimension, 2D) vector dot pattern.By open, standard, unified specification, hardware manufacturer can go out two-dimension vector graphics hardware accelerator (hardware-accelerator) according to its specifications design, also can accelerate the speed of 2D vector graphics technology for revealing and hardware accelerator vertical integration simultaneously.
But, still have weak point according to current OpenVG specification.Not about the hardware definition cutting out (scissoring) function in OpenVG specification, therefore so-called preferred circuit also be there is no for the circuit cutting out function.Ge Jia manufacturer differs for the way of the circuit cutting out function, because OpenVG specification has regulation at least to need support 32 to cut out, rectangle (scissor rectangle) just can declare that this circuit meets OpenVG cuts out specification again, therefore the chamber of commerce of Ge Jia manufacturing plant designs one and is exclusively used in the circuit cut out, and is used for support 32 to cut out rectangle.For being exclusively used in the circuit cut out, part manufacturer takes to cut out impact damper (scissoring buffer) unit, but this mode can increase circuit cost extraly; In addition, Ye You manufacturer takes pattern impact damper (stencil buffer) unit for trivector figure, wherein pattern impact damper is the impact damper for the treatment of color, the degree of depth, but the drafting for two-dimension vector graphics does not need the problem for the treatment of depth, therefore allowing pattern impact damper waste one's talent on a petty job also can increase cost.In principle, designed circuit of cutting out can be cut out rectangle along with support is more multiple and the cost of this circuit and complicacy also and then be increased.
Generally speaking, the circuit of cutting out cutting out function if having only supports 32 when cutting out rectangle, and that cuts out rectangle for needs 64 cuts out figure, then this cuts out circuit and just cannot cut out.How the two-dimension vector graphics of OpenVG specification is cut out and can support any number cut out rectangle, and do not need extra to cut out circuit, this is one problem to be overcome.
Summary of the invention
In view of this, the present invention proposes the cut-out method that one meets two-dimension vector graphics cleanup standard function storehouse (OpenVG) specification, and does not need extra to cut out circuit, uses the problem solving prior art and address.
The present invention proposes the method for cutting out two-dimension vector graphics, be applicable to the two-dimension vector graphics hardware accelerator with shade function, the method comprises: (a) determine at least one cut out rectangle and each cut out rectangle convert vector graphics path corresponding to its rectangular edges to; B () stores each vector graphics path; C () setting is corresponding to multiple shade values of a viewing area, in viewing area, be set as nonzero value by the shade value of described vector graphics path enclosing region, in viewing area, the shade value of non-enclosing region is set as null value; The shade function of (d) enable two-dimension vector graphics hardware accelerator, the new picture that original image is produced corresponding to viewing area by the frame buffering of multiple shade value; And (e) describes new picture in viewing area.
In one embodiment of this invention, each in step (a) is cut out rectangle and be can be the rectangle differed in size.Step (a) comprises the following steps: each to cut out rectangle and converts its a pair vector graphics path corresponding to rectangular edges to, and both in wherein said a pair vector graphics path are parallel to each other but direction is contrary.
In one embodiment of this invention, step (c) comprises the following steps: all shade values to be removed as null value; And in viewing area, correspond to and inserted nonzero value by the shade value of described vector graphics path enclosing region.
In one embodiment of this invention, when step (d) comprises the following steps: the frame buffering by multiple shade value, the coverage values of pixel data each in original image is multiplied by corresponding shade value to obtain each coverage values in new picture.
In one embodiment of this invention, step (e) comprises the following steps: to describe according to the coverage values of each pixel data in new picture, wherein describes for the pixel belonging to nonzero value in new picture, and does not describe the pixel belonging to null value.
Based on above-mentioned, the shade function that the present invention mainly adopts OpenVG to define.Utilize shade function setting corresponding to the shade value in all vector graphics paths, and utilize shade function to make original image by after the frame of multiple shade value buffering, produce the new picture of corresponding viewing area.At original two-dimension vector graphics hardware accelerator when not changing hardware structure/condition, the present invention can also extend to 64 cut out rectangle, 128 cut out rectangle, even 128 cut out more than rectangle cut out application.So the present invention can solve tradition effectively need the extra problem of cutting out circuit, and hardware cost can also be saved.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to better understand technological means of the present invention, and can be implemented according to the content of instructions, coordinates accompanying drawing to be described in detail as follows below with preferred embodiment of the present invention.
Accompanying drawing explanation
Fig. 1 is the schematic diagram that original image carries out shade function.
Fig. 2 is two-dimensional display area according to one embodiment of the invention and multiple schematic diagram cutting out rectangle.
Fig. 3 is the schematic diagram in the vector graphics path of Fig. 2.
Fig. 4 is the schematic diagram of the vector graphics path enclosing region of Fig. 3.
Fig. 5 is the schematic diagram setting shade value according to Fig. 4.
Fig. 6 is original image according to one embodiment of the invention and multiple schematic diagram cutting out rectangle.
Fig. 7 describes new picture in viewing area.
Fig. 8 illustrates the method flow diagram cutting out two-dimension vector graphics for one embodiment of the invention.
Drawing reference numeral:
10,12,14,16,18,20,22: cut out rectangle
110: original image
120: shade buffer unit
130: new picture
200: viewing area
600: original image
700: new picture
E1, E2: vector graphics path
S801 ~ S809: each step of method of cutting out two-dimension vector graphics
Embodiment
For making the object, technical solutions and advantages of the present invention clearly understand, below in conjunction with accompanying drawing, the embodiment of the present invention is described in further details.At this, schematic description and description of the present invention is for explaining the present invention, but not as a limitation of the invention.
Based on meeting two-dimension vector graphics cleanup standard function storehouse (OpenVG) specification, in OpenVG specification, only define shade impact damper (mask buffer) unit, but undefined other cut out impact damper or the impact damper for three-dimensional.The embodiment of the present invention is effectively solve tradition to need the extra problem of cutting out circuit, takes the framework not changing two-dimension vector graphics hardware accelerator (hardware-accelerator).Framework about two-dimension vector graphics hardware accelerator comprises shade buffer unit.Therefore, neither use in various embodiments of the present invention need additional designs cut out impact damper (scissoring buffer) unit, do not use pattern impact damper (stencil buffer) unit of trivector figure yet.
Fig. 1 is the schematic diagram that original image carries out shade function.Please refer to Fig. 1.If original image 110 is the two-dimension picture of 64 pixels (8 × 8 pixel), this original image 110 has 64 coverage values (coverage value).When shade function is opened, utilize the shade impact damper that OpenVG specification defines, shade buffer unit 120 can be used to store the shade value corresponding to 64 pixels, and the shade value wherein for mask regions is nonzero value, and the shade value in remaining non-masking region is null value.Then, original image 510 is cushioned by the frame of corresponding 64 pixels, that is carries out man-to-man coverage values to each pixel of original image 510 and be multiplied with shade value, can obtain new picture 530.Note that pixel size and the corresponding pixel size of shade buffer unit of original image of the present invention, but be not restricted to this.
Fig. 2 is two-dimensional display area according to one embodiment of the invention and multiple schematic diagram cutting out rectangle.Fig. 3 is the schematic diagram in the vector graphics path of Fig. 2.Fig. 4 is the schematic diagram of the vector graphics path enclosing region of Fig. 3.Fig. 5 is the schematic diagram setting shade value according to Fig. 4.Please merge with reference to Fig. 2 to Fig. 5.
First, set in the viewing area 200 of Fig. 2 and multiplely cut out rectangle (scissor rectangle) 10,12,14,16,18,20,22.Viewing area 200 can be the pixel of 640 × 480, but not as limit.In Fig. 2, each is cut out rectangle and can be the rectangle differed in size.Note that the present embodiment depicts 7 and cuts out rectangle and be only used for when presenting a demonstration, the quantity of cutting out rectangle is not limited with the present embodiment.In OpenVG specification, designed two-dimension vector graphics hardware accelerator at least needs support 32 to cut out rectangle, for the present embodiment can support 32 cut out rectangle, 64 cut out rectangle, 128 cut out rectangle, or more (more than 128) cut out rectangle.Then, please refer to Fig. 3, cut out rectangle according to each of Fig. 2, each is cut out rectangle and convert vector graphics path corresponding to its rectangular edges to.Each vector graphics path of cutting out rectangle that Fig. 3 illustrates is centered around its rectangular edges in a counterclockwise manner, wherein around direction also can be defined as clock-wise fashion.Then, please refer to Fig. 4, each vector graphics path enclosing region of cutting out in rectangle 10,12,14 is separate.The vector graphics path enclosing region of cutting out rectangle 16,18,20 and 22 is then overlapped, and the right half part wherein cut out in the vector graphics path enclosing region of rectangle 22 has exceeded outside viewing area 100.Then, please refer to Fig. 5, the hatched example areas that Fig. 5 illustrates is each vector graphics path enclosing region corresponding to Fig. 4, and the shade value being wherein set in hatched example areas is nonzero value (such as shade value is 1), and the shade value setting non-hatched example areas is null value.
Fig. 6 is original image according to one embodiment of the invention and multiple schematic diagram cutting out rectangle.Fig. 7 describes new picture in viewing area.Please merge with reference to Fig. 2 to Fig. 7.That cuts out that rectangle is same as Fig. 2 due to Fig. 6 multiple cuts out rectangle, is not repeated herein.The shade function of similar Fig. 1 produces new pictorial manner, the new picture 700 that original image 600 can be produced corresponding to viewing area by the frame buffering of multiple shade value, that is each pixel of original image 600 is multiplied to the corresponding shade value of Fig. 5 and obtains the new picture 700 after cutting out.Then, the new picture 700 after cutting out is illustrated in viewing area 200.Viewing area 200 can for being equal to size with new picture 700, the pixel of such as 640 × 480, but not as limit.The pixel of vector graphics path enclosing region is only described in viewing area 200.In new picture 700 after cutting out non-for vector graphics path enclosing region because of coverage values be null value, so present black.
Based on above-mentioned, the embodiment of the present invention is applicable to use the standard two-dimensional vector graphics hardware accelerator meeting OpenVG specification.The shade function that the method for cutting out two-dimension vector graphics of the present embodiment mainly adopts OpenVG to define.Utilize shade function setting corresponding to the shade value in all vector graphics paths, and utilize shade function to make original image by after the frame of multiple shade value buffering, produce the new picture of corresponding viewing area.At original two-dimension vector graphics hardware accelerator when not changing hardware structure/condition, can also support the number of cutting out rectangle is the multiple of 32.So tradition effectively can be solved need the extra problem of cutting out circuit.
Based on above-described embodiment disclose the content of teaching, can converge whole go out a kind of general method of cutting out two-dimension vector graphics.Clearer, Fig. 8 illustrates the method flow diagram cutting out two-dimension vector graphics for one embodiment of the invention.Please refer to Fig. 8, the method for cutting out two-dimension vector graphics of the present embodiment can comprise the following steps:
First as shown in step S801, determine at least one cut out rectangle and each cut out rectangle convert vector graphics path corresponding to its rectangular edges to, wherein each is cut out rectangle and can be the rectangle differed in size, the quantity of cutting out rectangle without particular limitation of, all are looked closely actual design demand and discuss;
Then, as shown in step S803, each vector graphics path is stored;
Next as shown in step S805, set the multiple shade values corresponding to a viewing area, in viewing area, be set as nonzero value (such as shade value is 1) by the shade value of described vector graphics path enclosing region, in viewing area, the shade value of non-enclosing region is set as null value;
Next as shown in step S807, the shade function of enable two-dimension vector graphics hardware accelerator, original image produces the new picture (that is carry out man-to-man coverage values to each pixel of original image be multiplied with shade value) corresponding to viewing area by the frame of multiple shade value buffering; And
Last as shown in step S809, describe new picture in viewing area.
Clearer, step S801 can comprise the following steps: each to cut out rectangle and convert its a pair vector graphics path corresponding to rectangular edges to, and both wherein in a pair vector graphics path are parallel to each other but direction is contrary.Such as Fig. 3 illustrates, E1 and E2 is parallel to each other in vector graphics path, and E1 direction is for downward and E2 direction is upwards.Step S805 comprises the following steps: all shade values to be removed as null value; And in viewing area, correspond to and inserted nonzero value by the shade value of vector graphics path enclosing region.When step S807 comprises the following steps: the frame buffering by multiple shade value, the coverage values of pixel data each in original image is multiplied by corresponding shade value to obtain each coverage values in the new picture after cutting out, pixel data wherein in new picture can be nonzero value corresponding to by the coverage values of vector graphics path enclosing region, and pixel data in new picture is decided to be null value corresponding to the coverage values one of non-enclosing region.Step S809 comprises the following steps: to describe according to the coverage values of each pixel data in the new picture after cutting out, and wherein describes for the pixel belonging to nonzero value in new picture, and does not describe the pixel belonging to null value.
In sum, the present invention's shade function of mainly adopting OpenVG to define.Utilize shade function setting corresponding to the shade value in all vector graphics paths, and utilize shade function to make original image by after the frame of multiple shade value buffering, produce the new picture of corresponding viewing area.At original two-dimension vector graphics hardware accelerator when not changing hardware structure/condition, the present invention can support 32 and cut out rectangle, can also extend to 64 cut out rectangle, 128 cut out rectangle, even 128 cut out more than rectangle cut out application, so the number of cutting out rectangle can at random increase.On the other hand, the present invention does not need extra to cut out circuit, so can effectively solve traditional problem, and can also save hardware cost.
The above, it is only preferred embodiment of the present invention, not any pro forma restriction is done to the present invention, although the present invention discloses as above with preferred embodiment, but and be not used to limit the present invention, any those skilled in the art, do not departing within the scope of technical solution of the present invention, when the structure and technology contents that can utilize above-mentioned announcement are made a little change or be modified to the Equivalent embodiments of equivalent variations, but every content not departing from technical solution of the present invention, according to any simple modification that technical spirit of the present invention is done above embodiment, equivalent variations and modification, all still belong in the scope of technical solution of the present invention.

Claims (6)

1. cut out a method for two-dimension vector graphics, it is characterized in that, be applicable to the two-dimension vector graphics hardware accelerator with shade function, described method comprises:
A () determines at least onely cut out rectangle and convert vector graphics path corresponding to its rectangular edges to by cutting out rectangle described in each;
B () stores each vector graphics path;
C () setting, corresponding to multiple shade values of a viewing area, be set as nonzero value, and in described viewing area, the shade value of non-enclosing region is set as null value in described viewing area by the shade value of described vector graphics path enclosing region;
The shade function of (d) enable described two-dimension vector graphics hardware accelerator, the new picture that original image is produced corresponding to described viewing area by the frame buffering of described multiple shade value; And
E () describes described new picture in described viewing area,
Wherein, described method do not need to change described two-dimension vector graphics hardware accelerator framework, do not use additional designs cut out buffer unit, do not use the pattern buffer unit of trivector figure yet.
2. method of cutting out two-dimension vector graphics according to claim 1, is characterized in that, cuts out rectangle and can be the rectangle differed in size described in each in step (a).
3. method of cutting out two-dimension vector graphics according to claim 1, it is characterized in that, step (a) comprises the following steps: to convert its a pair vector graphics path corresponding to rectangular edges to by cutting out rectangle described in each, and both in wherein said a pair vector graphics path are parallel to each other but direction is contrary.
4. method of cutting out two-dimension vector graphics according to claim 1, it is characterized in that, step (c) comprises the following steps:
All shade values are removed for null value; And
In described viewing area, correspond to and inserted nonzero value by the shade value of described vector graphics path enclosing region.
5. method of cutting out two-dimension vector graphics according to claim 4, it is characterized in that, step (d) comprises the following steps:
When being cushioned by the frame of described multiple shade value, the coverage values of pixel data each in described original image is multiplied by corresponding shade value to obtain each coverage values in described new picture.
6. method of cutting out two-dimension vector graphics according to claim 5, it is characterized in that, step (e) comprises the following steps:
Coverage values according to each pixel data in described new picture is described, and wherein describes for the pixel belonging to nonzero value in described new picture, and does not describe the pixel belonging to null value.
CN201110294719.7A 2011-09-29 2011-09-29 Cut out the method for two-dimension vector graphics Active CN103034968B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110294719.7A CN103034968B (en) 2011-09-29 2011-09-29 Cut out the method for two-dimension vector graphics

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110294719.7A CN103034968B (en) 2011-09-29 2011-09-29 Cut out the method for two-dimension vector graphics

Publications (2)

Publication Number Publication Date
CN103034968A CN103034968A (en) 2013-04-10
CN103034968B true CN103034968B (en) 2015-07-29

Family

ID=48021837

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110294719.7A Active CN103034968B (en) 2011-09-29 2011-09-29 Cut out the method for two-dimension vector graphics

Country Status (1)

Country Link
CN (1) CN103034968B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105320783A (en) * 2014-07-01 2016-02-10 北京华大九天软件有限公司 Three-dimensional vector object representation method based on two-dimensional SVG vector graphics in integrated circuit design tool
CN112837328B (en) 2021-02-23 2022-06-03 中国石油大学(华东) Rectangular window clipping and drawing method for two-dimensional polygonal primitive

Also Published As

Publication number Publication date
CN103034968A (en) 2013-04-10

Similar Documents

Publication Publication Date Title
KR101922482B1 (en) Varying effective resolution by screen location by changing active color sample count within multiple render targets
CN109413403B (en) Rendering method for rendering geometric structure of 3D scene and graphic processing system
JP4266939B2 (en) Drawing processing apparatus and drawing data compression method
CN106204712B (en) Piecewise linearity irregularly rasterizes
US8115783B2 (en) Methods of and apparatus for processing computer graphics
KR20160130821A (en) Gradient adjustment for texture mapping for multiple render targets with resolution that varies by screen location
KR20160051154A (en) Rendering method and apparatus, and electronic apparatus
US20160048980A1 (en) Bandwidth reduction using texture lookup by adaptive shading
CN104751507B (en) Graphical content rendering intent and device
EP1756769A4 (en) Method and system for a general instruction raster stage that generates programmable pixel packets
CN101071508A (en) Image processing apparatus, image processing method, and image processing program
KR101338370B1 (en) Batch rendering method using graphic processing unit of two dimension vector graphics
CN103729190B (en) The method that various kinds of media analytic uniform shows on mobile terminals
JP3892016B2 (en) Image processing apparatus and image processing method
CN103034968B (en) Cut out the method for two-dimension vector graphics
CN107430783A (en) Texture mapping unit, texture mapping method and program
CN106897043A (en) It is applied to the data superelevation point display system and display methods of mosaic screen
CN103136169A (en) Method and device of displaying characters
CN110992462A (en) Batch processing drawing method for 3D simulation scene image based on edge calculation
JP4664169B2 (en) Graphic drawing apparatus and graphic drawing program
CN109155074B (en) System and method for seamlessly rendering points
JPWO2016092588A1 (en) Drawing apparatus and drawing method
CN101739703A (en) Method and system for rasterizing triangle
CN103337089A (en) Method for achieving marquee effect of text in 3D (three-dimensional) space
US20100171760A1 (en) Method and apparatus for presenting overlay images

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant