CN103136777A - Electronic brush generation method and device, electronic brush and electronic device - Google Patents

Electronic brush generation method and device, electronic brush and electronic device Download PDF

Info

Publication number
CN103136777A
CN103136777A CN2011103960201A CN201110396020A CN103136777A CN 103136777 A CN103136777 A CN 103136777A CN 2011103960201 A CN2011103960201 A CN 2011103960201A CN 201110396020 A CN201110396020 A CN 201110396020A CN 103136777 A CN103136777 A CN 103136777A
Authority
CN
China
Prior art keywords
pixel
polygon
coordinate
paintbrush
polygonal
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.)
Granted
Application number
CN2011103960201A
Other languages
Chinese (zh)
Other versions
CN103136777B (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.)
Hanwang Technology Co Ltd
Original Assignee
Hanwang Technology Co Ltd
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 Hanwang Technology Co Ltd filed Critical Hanwang Technology Co Ltd
Priority to CN201110396020.1A priority Critical patent/CN103136777B/en
Publication of CN103136777A publication Critical patent/CN103136777A/en
Application granted granted Critical
Publication of CN103136777B publication Critical patent/CN103136777B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Generation (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses an electronic brush generation method, an electronic brush generation device, an electronic brush and an electronic device and relates to the field of computer graphic processing. A user can obtain an anti-aliasing line which is wanted by the user, and satisfaction of the user is improved. The technical scheme includes that polygon of random shapes and random sizes are determined according to a coordinate of the polygon inputted by the user, color weight of each pixel point of an outer connected frame of the polygon is calculated, and the polygon brush is obtained. Due to the technical scheme, the electronic brush generation method, the electronic brush generation device, the electronic brush and the electronic device are suitable for being applied when handwriting lines are depicted.

Description

Electronics paintbrush generation method and device, electronics paintbrush and electronic equipment
Technical field
The present invention relates to the computer graphical process field, relate in particular to a kind of electronics paintbrush generation method and device, electronics paintbrush and electronic equipment.
Background technology
In the computer graphical process field, for the lines that make drafting more smooth, when drawing the electronics lines, be all to get a plurality of discrete coordinate points on lines, then adopt many line segments to connect from beginning to end, realize the drafting of lines.The line segment that described many head and the tail connect is called anti-aliasing line segment.
Usually adopt the mode of arda sampling to draw anti-aliasing line segment in prior art, namely by adopting a basic anti-aliasing circular paintbrush, here, the diameter of the circular paintbrush that adopts is the width of line, then move to terminal point with the starting point of certain step-length from line segment, the line segment of brushing is exactly the anti-aliasing line segment that need to draw.
Yet when adopting prior art to draw anti-aliasing line segment, the shape of the paintbrush of employing is all fixed, and can not obtain the anti-aliasing lines that the user thinks, has reduced user's satisfaction.
Summary of the invention
Embodiments of the invention provide electronics paintbrush generation method and device, electronics paintbrush and electronic equipment, can obtain the electronics paintbrush of arbitrary shape, adopt this electronics paintbrush to draw out the anti-aliasing lines that the user thinks, promote user's satisfaction.
For achieving the above object, embodiments of the invention adopt following technical scheme:
A kind of electronics paintbrush generation method comprises:
Determine the polygon of arbitrary shape, arbitrary size according to the polygon vertex coordinate of user's input;
According to described polygon, calculate the color weight of each pixel of described polygonal external frame, obtain the polygon paintbrush.
The device that a kind of electronization brush generates comprises:
Determining unit is for determine the polygon of arbitrary shape, arbitrary size according to the polygon vertex coordinate of user's input;
The polygon paintbrush obtains the unit, is used for according to described polygon, calculates the color weight of each pixel of described polygonal external frame, obtains the polygon paintbrush.
A kind of electronics paintbrush of drawing the electronics lines, the color weight of each pixel of central area of described electronics paintbrush is greater than the color weight of each pixel outside the central area of described electronics paintbrush, and the color weight of each pixel of central area of described electronics paintbrush is equal, and the color weight of each pixel outside the central area of described electronics paintbrush is directly proportional to the bee-line of corresponding described pixel to the edge of electronics paintbrush;
Wherein, the central area of described electronics paintbrush is pixel to zone that the bee-line at the edge of electronics paintbrush forms more than or equal to the pixel of default value.
A kind of electronic equipment, comprise trace input device and display screen, the mobile sampled point that obtains according to described trace input device, adopt electronics paintbrush as claimed in claim 11 that described sampled point is connected successively, obtain to form the anti-aliasing line segment of electronics lines, and at the described anti-aliasing line segment of described demonstration screen display.
The embodiment of the present invention provides a kind of electronics paintbrush generation method and device, electronics paintbrush and electronic equipment, by determine the polygon of arbitrary shape, arbitrary size according to the polygon vertex coordinate of user's input, calculate the color weight of each pixel of described polygonal external frame, obtain the polygon paintbrush.When drawing anti-aliasing line segment in prior art, the shape of the paintbrush that adopts is all fixed, can not obtain the anti-aliasing lines that the user thinks, the satisfaction that has reduced the user first than, the scheme that the embodiment of the present invention provides obtains the electronics paintbrush of arbitrary shape, adopt this electronics paintbrush to draw out the anti-aliasing lines that the user thinks, promote user's satisfaction.
Description of drawings
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, the below will do to introduce simply to the accompanying drawing of required use in embodiment or description of the Prior Art, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain according to these accompanying drawings other accompanying drawing.
The process flow diagram of a kind of electronics paintbrush generation method that Fig. 1 provides for the embodiment of the present invention 1;
The polygon schematic diagram that the user that Fig. 2 provides for the embodiment of the present invention 1 inputs;
The process flow diagram of the another kind of electronics paintbrush generation method that Fig. 3 provides for the embodiment of the present invention 1;
The process flow diagram of the color weight that obtains the external frame of polygon that Fig. 4 provides for the embodiment of the present invention 1;
The polygon paintbrush schematic diagram that the rgb value of each pixel that Fig. 5 provides for the embodiment of the present invention 1 consists of;
The mouse that Fig. 6 provides for the embodiment of the present invention 1 moves the sampled point that obtains and the graph of a relation between institute's trace;
The schematic diagram of the final anti-aliasing line segment that Fig. 7 provides for the embodiment of the present invention 1;
The block diagram of a kind of electronics paintbrush generating apparatus that Fig. 8 provides for the embodiment of the present invention 2;
The block diagram of the another kind of electronics paintbrush generating apparatus that Fig. 9 provides for the embodiment of the present invention 2;
The block diagram of the color weight determination module that Figure 10 provides for the embodiment of the present invention 2.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Based on the embodiment in the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
Embodiment 1
The embodiment of the present invention provides a kind of electronics paintbrush generation method, and as shown in Figure 1, the method comprises:
Step 101 is determined the polygon of arbitrary shape, arbitrary size according to the polygon vertex coordinate of user input;
Polygonal shape can be determined by the polygonal apex coordinate of user input, and for example, if the user wants a self-defined polygon paintbrush shape as shown in Figure 2, the user will input the coordinate information on four summits of A, B, C, D.
The apex coordinate of inputting due to the user just is used for definite polygonal shape, and polygonal size is to be determined by developed width.Therefore the not restriction of polygon size that consists of of each summit of providing of user is as long as each summit is by connecting in turn the shape that can consist of the defined polygon paintbrush of user.
Further, as shown in Figure 3, determine that according to the polygon vertex coordinate of user's input the polygon of arbitrary shape, arbitrary size comprises following substep:
Step 1011 according to the polygon vertex coordinate of user's input, is determined polygonal centre coordinate;
For example, the polygonal apex coordinate of user's input is (657,157), (621,200), (683,220), (696,181), polygonal center are actually and can choose arbitrarily, the application with polygonal center of gravity as the center, according to above-mentioned 4 apex coordinates, can obtain polygonal centre coordinate and be (664.25,189.5).
Step 1012 according to polygon vertex coordinate and the described centre coordinate of user's input, determines that described polygon vertex coordinate is with respect to the off-set value at described center;
The polygon vertex coordinate comprises horizontal ordinate and two skews of ordinate with respect to the off-set value at described center, for example, according to above-mentioned 4 apex coordinates and the centre coordinate determined, the off-set value on each summit of determinate multitudes limit shape is (7.25 ,-32.5), (43.25,10.5), (18.75,30.5), (31.75 ,-8.5).
Step 1013 is determined the polygon of arbitrary shape, arbitrary size according to described centre coordinate and described off-set value with respect to described center;
The actual coordinate on polygonal each summit can be determined according to off-set value and the developed width on centre coordinate, each summit, here original width is determined by the skew with respect to the center, the width weights that arrange by the periphery change original width, the developed width of wanting to reach the user.
Need to prove, polygonal position is that centre coordinate is determined by the position of central point, and polygonal shape is by the skew decision at each relative center, summit, and polygonal size is determined by developed width.
Step 102 according to described polygon, is calculated the color weight of each pixel of described polygonal external frame, obtains the polygon paintbrush;
Further, as shown in Figure 3, according to described polygon, calculate the color weight of each pixel of described polygonal external frame, obtain the polygon paintbrush, specifically comprise following substep:
Step 1021 according to described polygon, is determined described polygonal external frame;
Polygonal external frame is the square that comprises polygonal level minimum, determines according to the coordinate of the pixel on polygonal limit.This square is comprised of the pixel of several row of several row, because in computer system, the unit of coordinate is pixel, so these foursquare four apex coordinates are all integers.
Step 1022 according to described polygonal external frame, is determined the color weight of each pixel of the described external frame of composition;
Generally, after polygonal shape and size are determined, when a polygon translation integer coordinate time, the also same distance of translation accordingly of its square external frame so, this moment, the relative position of polygon and its external frame did not change, so the weights of each pixel in external frame do not change.So in the situation that polygonal shape and size determine, when the fraction part of center coordinate is determined, and whole polygonal shape is determined, the weights of each pixel of so external frame just can uniquely have been determined.
Need to prove, the pixel weight storage with polygonal external frame becomes template in advance, stores the weights of all pixels in an external frame with an array, wherein, and the weights of the corresponding pixel of an element in array.
When actual storage, the precision set of the fraction part of transverse and longitudinal coordinate is 0.25, be that transverse and longitudinal coordinate fraction part respectively has 0,0.25,0.5,0.75 four kind, so in the certain situation of width, the centre coordinate that is determined by fraction part has 16 kinds of positions, can search immediate that template of fraction part of centre coordinate when reading template.
4 apex coordinates that above-mentioned user sets are asked the template of paintbrush, and store in internal memory and go, particularly, set take 0.25 as the interval, its centre coordinate has 16 kinds of positions, is respectively:
(100,100),(100,100.25),(100,100.5),(100,100.75);
(100.25,100),(100.25,100.25),(100.25,100.5),(100.25,100.75);
(100.50,100),(100.50,100.25),(100.50,100.5),(100.50,100.75);
(100.75,100),(100.75,100.25),(100.75,100.5),(100.75,100.75);
Here, 100 in 16 centre coordinates is the integers that there is no practical significance, only uses fraction part wherein when concrete the application.
Particularly, as shown in Figure 4, in the situation that the shape of polygon paintbrush and size are certain, the obtaining by following substep of the color weight of each pixel in the external frame of polygon:
Step 401 is obtained the coordinate of a pixel that forms described external frame; For example, the coordinate of the pixel of external frame is (x, y), and wherein, x, y are integer;
Step 402 judges that whether the coordinate of described pixel is at described outside of polygon;
Particularly, whether judgement (x, y) is at described outside of polygon, be actually judgement take (x, y) as starting point ray and total number of polygon intersection point whether be even number, when total number of intersection point is even number, illustrate that (x, y) is for the point of outside of polygon; When total number of intersection point is odd number, illustrate that (x, y) is the point of polygon inside;
Step 403, during at described outside of polygon, the color weight of determining described pixel is 0 when the coordinate of described pixel;
Step 404 when described polygon is inner, is calculated the coordinate of described pixel to described polygonal distance when the coordinate of described pixel;
Particularly, calculate the coordinate of described pixel to described polygonal each back gauge, the coordinate of determining described pixel minimum distance in described polygonal each back gauge, the distance of described minimum are that the coordinate of described pixel is to described polygonal distance.
Step 405, the coordinate that judges described pixel to the ratio of described polygonal distance and preset value whether greater than 1;
Wherein, described preset value rule of thumb can select 6, perhaps other positive integers, and this value has determined the color depth on the border of paintbrush.
Step 406, when the coordinate of described pixel to the ratio of described polygonal distance and preset value greater than 1 the time, the color weight of determining described pixel is 1;
Step 407, when described coordinate to the ratio of described polygonal distance and preset value less than 1 the time, the color weight of determining described pixel is that described coordinate is to the ratio of described polygonal distance with preset value.
Can determine to form the weights of each pixel of described external frame according to said method.The weights of each pixel in the polygonal external frame that calculates just form the array that ranks equate.In the situation that developed width is certain, a center can so just can obtain 16 arrays in the hope of the array of a correspondence, and it is saved in internal memory.
When reading, fraction part and the developed width size of the centre coordinate that obtains according to actual computation, template corresponding to inquiry in internal memory.For example, actual centre coordinate is (200.07,321.46), fraction part in horizontal ordinate is 0.07 and 0.0 the most approaching, and the fraction part of horizontal ordinate gets 0.0 so, and the fraction part of ordinate is 0.46 and 0.5 the most approaching, the fraction part of ordinate gets 0.5 so, search template corresponding to (0.0,0.5) in 16 templates of storing again from internal memory, just can obtain the weights of each pixel of corresponding external frame.
Step 1023, the color weight of described each pixel of parsing, the rgb value of described each pixel of acquisition, the rgb value of described each pixel consists of the polygon paintbrush;
RGB (red, green, blue) value is for using the RGB model to be the colouring intensity value in 0 to 255 scope of RGB component distribution of each pixel in image.The rgb color pattern is to obtain color miscellaneous by variation and their stacks each other to red (Red), green (Greed), blue (Blue) three Color Channels.
The polygon paintbrush that consists of according to the rgb value of each pixel as shown in Figure 5, the paintbrush design sketch in figure is the design sketch after amplifying 8 times.
The embodiment of the present invention provides a kind of electronics paintbrush generation method, by determine the polygon of arbitrary shape, arbitrary size according to the polygon vertex coordinate of user's input, calculates the weights of each pixel of described polygonal external frame, obtains the polygon paintbrush.In the prior art, when adopting prior art to determine anti-aliasing line segment, the shape of the paintbrush that adopts is all fixed, can not obtain the anti-aliasing lines that the user thinks, the satisfaction that has reduced the user first than, the scheme that the embodiment of the present invention provides is drawn anti-aliasing line segment according to the polygonal shape that user oneself sets, and can obtain the anti-aliasing lines that the user thinks, promotes user's satisfaction.
As shown in Figure 5, the present invention also provides a kind of electronics paintbrush that adopts above-mentioned electronics paintbrush generation method to generate, and the color weight of each pixel of central area of described electronics paintbrush is fixed value, as 1; The color weight of each pixel on the paintbrush outside the central area of described electronics paintbrush is less than above-mentioned fixed value, as less than 1, and the color weight of each pixel outside the central area of described electronics paintbrush is directly proportional to the bee-line of corresponding described pixel to the edge of electronics paintbrush, and namely the color weight of each pixel outside the central area of described electronics paintbrush is along with this pixel reduces to the reducing of bee-line at the edge of electronics paintbrush.
Wherein, the central area of described electronics paintbrush is pixel to zone that the bee-line at the edge of electronics paintbrush forms more than or equal to the pixel of default value.Described preset value rule of thumb can select 6, perhaps other positive integers, and this value has determined the color depth on the border of paintbrush.
The electronics paintbrush that the embodiment of the present invention provides can draw out anti-aliasing line segment according to the polygonal shape that user oneself sets, and this anti-aliasing line segment is successively thin out according to polygonal shape, and the curve lines are smooth, promoted user's satisfaction.
The present invention also provides a kind of electronic equipment that adopts above-mentioned electronics paintbrush to draw the electronics lines, and described electronic equipment comprises trace input device and display screen, and trace input device can be mouse or pointer or finger, is used for the coordinate information of input lines; Display screen is used for showing the electronics lines of drawing.During concrete the drafting, electronic equipment adopts above-mentioned polygon paintbrush that described sampled point is connected successively according to the mobile sampled point that obtains of trace input device, obtains to form the anti-aliasing line segment of electronics lines, then at the described anti-aliasing line segment of described demonstration screen display.
Particularly, move the sampled point of acquisition according to current mouse, and three sampled points before calculate a curvilinear equation as four reference mark of cubic B-spline, this curvilinear equation is smoothly connected with the curve of trying to achieve before.Need to prove, the B batten is a kind of special representation of SPL, and it is the linear combination of B spline Basis curve.The B batten is a kind of vague generalization of Bezier curve, can further be extended to non-uniform rational B-spline (NURBS), makes us to build accurate model to how general solid.Then get a little with certain step-length on the current curve that calculates, here, step-length rule of thumb is worth and obtains, and the curve lines of the less final formation of step-length are more smooth, but operand is larger simultaneously, therefore generally gets 4 to 5 length in pixels.
As shown in Figure 6, p0 in figure, p1, p2, p 3 move from mouse the sampled point that obtains, and p3 is the sampled point that current mouse moves acquisition, p2, p1, p0 are the sampled point that obtained before it successively, the curve that in curve, the a-b section has been finished before being, the b-c section is current that section curve that will draw, wherein c0, c1, the points such as c2 are the series of points of getting, with anti-aliasing line segment b-c0, c0-c1, c1-c2 ... couple together.Because the dot spacing of getting is smaller, these line segments are all shorter, and this section broken line seems to be exactly a smooth curve, and this curve and a-b section are to be smoothly connected at the b point, so whole lines smoother.
Need to prove, draw anti-aliasing line segment, be actually with a polygon paintbrush and move to terminal point and the track that forms from starting point, move to terminal point with certain step-length from the starting point of line segment at the center of paintbrush, general line segment can not be the integral multiple of step-length, a bit of apart from S to also having when line segment finishes, the length of S is the distance of this step-length not, and next line segment at first, be offset a segment distance (L-S) from the starting point of line segment to terminal point, L is the step-length of getting here.As shown in Figure 7, the anti-aliasing line segment for finally drawing according to method provided by the invention.
The embodiment of the present invention provides a kind of electronic equipment, draws out anti-aliasing line segment by adopting the polygonal shape of setting according to user oneself to obtain the polygon paintbrush, and shows.When determining anti-aliasing line segment with the available technology adopting prior art, the shape of the paintbrush that adopts is all fixed, can not obtain the anti-aliasing lines that the user thinks, the satisfaction that has reduced the user first than, the scheme that the embodiment of the present invention provides is drawn anti-aliasing line segment according to the polygonal shape that user oneself sets, can obtain the anti-aliasing lines that the user thinks, promote user's satisfaction.
Embodiment 2
For a kind of electronics paintbrush generation method that realizes that the embodiment of the present invention provides, the embodiment of the present invention provides a kind of electronics paintbrush generating apparatus, and as shown in Figure 8, this device comprises: determining unit 801, and the polygon paintbrush obtains unit 802;
Determining unit 801 is for determine the polygon of arbitrary shape, arbitrary size according to the polygon vertex coordinate of user's input;
Further, as shown in Figure 9, determining unit 801 comprises centre coordinate determination module 8011, off-set value determination module 8012, polygon determination module 8013;
Centre coordinate determination module 8011 is used for the polygon vertex coordinate according to user's input, determines polygonal centre coordinate;
According to the polygon vertex coordinate of user's input and the described centre coordinate of determining, off-set value determination module 8012 determines that described polygon vertex coordinate is with respect to the off-set value at described center;
According to described centre coordinate and described off-set value with respect to described center, polygon determination module 8013 is determined the polygon of arbitrary shape, arbitrary size;
After having determined polygon, according to described polygon, as shown in Figure 8, the polygon paintbrush obtains unit 802, calculates the color weight of each pixel of described polygonal external frame, obtains the polygon paintbrush; Particularly, described polygon paintbrush obtains unit 802 and comprises external frame determination module 8021, weights determination module 8022, and the polygon paintbrush obtains module 8023;
External frame determination module 8021 is used for according to described polygon, determines described polygonal external frame;
According to described polygonal external frame, weights determination module 8022, definite color weight that forms each pixel of described external frame;
Further, as shown in figure 10, described weights determination module 8022 comprises and obtains submodule 1001, and judgement submodule 1002, the first is determined submodule 1003, and calculating sub module 1004, the second determines that submodule 1005, the three determines submodule 1006;
Obtain submodule 1001, be used for obtaining the coordinate of a pixel that forms described external frame;
Judgement submodule 1002 is used for judging that whether the coordinate of described pixel is at described outside of polygon;
First determines submodule 1003, and when being used for coordinate when described pixel at described outside of polygon, the color weight of determining described pixel is 0;
Calculating sub module 1004 is used for coordinate when described pixel when described polygon is inner, and the coordinate that calculates described pixel arrives described polygonal distance; Particularly, calculate the coordinate of described pixel to described polygonal each back gauge, the coordinate of determining described pixel minimum distance in described polygonal each back gauge, the distance of described minimum are that the coordinate of described pixel is to described polygonal distance;
When the coordinate of described pixel to the ratio of described polygonal distance and preset value greater than 1 the time, second determines submodule 1005, the color weight of determining described pixel is 1;
When described coordinate to the ratio of described polygonal distance and preset value less than 1 the time, the 3rd determines submodule 1006, the color weight of determining described pixel is that described coordinate is to the ratio of described polygonal distance with preset value, wherein, described preset value rule of thumb can select 6, perhaps other positive integers, this value has determined the color depth on the border of paintbrush.
The weights of described each pixel are resolved, and the polygon paintbrush obtains module 8023, is used for obtaining the rgb value of described each pixel, and the rgb value of described each pixel consists of the polygon paintbrush.
The device that the embodiment of the present invention provides a kind of electronics paintbrush to generate, determine the polygon of arbitrary shape, arbitrary size according to the polygon vertex coordinate of user's input by determining unit, the polygon paintbrush obtains the color weight that the unit calculates each pixel of described polygonal external frame, obtains the polygon paintbrush.When determining anti-aliasing line segment with the available technology adopting prior art, the shape of the paintbrush that adopts is all fixed, can not obtain the anti-aliasing lines that the user thinks, the satisfaction that has reduced the user first than, the scheme that the embodiment of the present invention provides is drawn anti-aliasing line segment according to the polygonal shape that user oneself sets, can obtain the anti-aliasing lines that the user thinks, promote user's satisfaction.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited to this, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, within all should being encompassed in protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion by described protection domain with claim.

Claims (12)

1. an electronics paintbrush generation method, is characterized in that, comprising:
Determine the polygon of arbitrary shape, arbitrary size according to the polygon vertex coordinate of user's input;
According to described polygon, calculate the color weight of each pixel of described polygonal external frame, obtain the polygon paintbrush.
2. electronics paintbrush generation method according to claim 1, is characterized in that, described polygon vertex coordinate according to user's input determines that the polygon of arbitrary shape, arbitrary size comprises:
According to the polygon vertex coordinate of user's input, determine polygonal centre coordinate;
According to polygon vertex coordinate and the described centre coordinate of user's input, determine that described polygon vertex coordinate is with respect to the off-set value at described center;
Determine the polygon of arbitrary shape, arbitrary size according to described centre coordinate and described off-set value with respect to described center.
3. electronics paintbrush generation method according to claim 2, is characterized in that, and is described according to described polygon, calculates the color weight of each pixel of described polygonal external frame, obtains the polygon paintbrush and comprises:
According to described polygon, determine described polygonal external frame;
According to described polygonal external frame, determine the color weight of each pixel of the described external frame of composition;
Resolve the color weight of described each pixel, obtain the rgb value of described each pixel, the rgb value of described each pixel consists of the polygon paintbrush.
4. electronics paintbrush generation method according to claim 3, is characterized in that, the color weight of each pixel of the described external frame of described definite composition comprises:
Obtain the coordinate of a pixel that forms described external frame;
Judge that whether the coordinate of described pixel is at described outside of polygon;
During at described outside of polygon, the color weight of determining described pixel is 0 when the coordinate of described pixel;
When described polygon is inner, calculate the coordinate of described pixel to described polygonal distance when the coordinate of described pixel; When the coordinate of described pixel to the ratio of described polygonal distance and preset value greater than 1 the time, the color weight of determining described pixel is 1; When described coordinate to the ratio of described polygonal distance and preset value less than 1 the time, the color weight of determining described pixel is that described coordinate is to the ratio of described polygonal distance with preset value.
5. electronics paintbrush generation method according to claim 4, is characterized in that, the coordinate of the described pixel of described calculating comprises to described polygonal distance:
The coordinate that calculates described pixel is to described polygonal each back gauge, and the coordinate of determining described pixel minimum distance in described polygonal each back gauge, the distance of described minimum are that the coordinate of described pixel is to described polygonal distance.
6. an electronization brush generating apparatus, is characterized in that, comprising:
Determining unit is for determine the polygon of arbitrary shape, arbitrary size according to the polygon vertex coordinate of user's input;
The polygon paintbrush obtains the unit, is used for according to described polygon, calculates the color weight of each pixel of described polygonal external frame, obtains the polygon paintbrush.
7. electronization brush generating apparatus according to claim 6, is characterized in that, described determining unit comprises:
The centre coordinate determination module is used for the polygon vertex coordinate according to user's input, determines polygonal centre coordinate;
The off-set value determination module is used for polygon vertex coordinate and described centre coordinate according to user's input, determines that described polygon vertex coordinate is with respect to the off-set value at described center;
The polygon determination module is used for determining according to described centre coordinate and described off-set value with respect to described center the polygon of arbitrary shape, arbitrary size.
8. electronization brush generating apparatus according to claim 7, is characterized in that, described polygon paintbrush obtains the unit and comprises:
External frame determination module is used for according to described polygon, determines described polygonal external frame;
The weights determination module is used for according to described polygonal external frame, determines the color weight of each pixel of the described external frame of composition;
The polygon paintbrush obtains module, is used for resolving the color weight of described each pixel, obtains the rgb value of described each pixel, and the rgb value of described each pixel consists of the polygon paintbrush.
9. electronization brush generating apparatus according to claim 8, is characterized in that, described weights determination module comprises:
Obtain submodule, be used for obtaining the coordinate of a pixel that forms described external frame;
The judgement submodule is used for judging that whether the coordinate of described pixel is at described outside of polygon;
First determines submodule, and when being used for coordinate when described pixel at described outside of polygon, the color weight of determining described pixel is 0;
Calculating sub module is used for coordinate when described pixel when described polygon is inner, and the coordinate that calculates described pixel arrives described polygonal distance; Second determines submodule, is used for ratio that coordinate when described pixel arrives described polygonal distance and preset value greater than 1 the time, and the color weight of determining described pixel is 1; The 3rd determines submodule, be used for when described coordinate to the ratio of described polygonal distance and preset value less than 1 the time, the color weight of determining described pixel is the ratio that described coordinate arrives described polygonal distance and preset value.
10. electronization brush generating apparatus according to claim 9, is characterized in that, described calculating sub module specifically is used for:
The coordinate that calculates described pixel is to described polygonal each back gauge, and the coordinate of determining described pixel minimum distance in described polygonal each back gauge, the distance of described minimum are that the coordinate of described pixel is to described polygonal distance.
11. electronics paintbrush, it is characterized in that, the color weight of each pixel of central area of described electronics paintbrush is greater than the color weight of each pixel outside the central area of described electronics paintbrush, and the color weight of each pixel of central area of described electronics paintbrush is equal, and the color weight of each pixel outside the central area of described electronics paintbrush is directly proportional to the bee-line of corresponding described pixel to the edge of electronics paintbrush;
Wherein, the central area of described electronics paintbrush is pixel to zone that the bee-line at the edge of electronics paintbrush forms more than or equal to the pixel of default value.
12. electronic equipment, comprise trace input device and display screen, the mobile sampled point that obtains according to described trace input device, it is characterized in that, adopt electronics paintbrush as claimed in claim 11 that described sampled point is connected successively, obtain to form the anti-aliasing line segment of electronics lines, and at the described anti-aliasing line segment of described demonstration screen display.
CN201110396020.1A 2011-12-02 2011-12-02 Electronics paintbrush generation method and device, electronics paintbrush and electronic equipment Active CN103136777B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110396020.1A CN103136777B (en) 2011-12-02 2011-12-02 Electronics paintbrush generation method and device, electronics paintbrush and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110396020.1A CN103136777B (en) 2011-12-02 2011-12-02 Electronics paintbrush generation method and device, electronics paintbrush and electronic equipment

Publications (2)

Publication Number Publication Date
CN103136777A true CN103136777A (en) 2013-06-05
CN103136777B CN103136777B (en) 2016-05-25

Family

ID=48496563

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110396020.1A Active CN103136777B (en) 2011-12-02 2011-12-02 Electronics paintbrush generation method and device, electronics paintbrush and electronic equipment

Country Status (1)

Country Link
CN (1) CN103136777B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104463939A (en) * 2014-11-28 2015-03-25 项天 Anti-aliasing method for graphic rendering and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101178816A (en) * 2007-12-07 2008-05-14 桂林电子科技大学 Body drafting visual method based on surface sample-taking
CN101414382A (en) * 2007-10-16 2009-04-22 联发科技股份有限公司 Thick line drawing method and apparatus thereof
CN102999321A (en) * 2011-09-15 2013-03-27 汉王科技股份有限公司 Writing brush electronic paintbrush setting device and writing brush electronic paintbrush

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101414382A (en) * 2007-10-16 2009-04-22 联发科技股份有限公司 Thick line drawing method and apparatus thereof
CN101178816A (en) * 2007-12-07 2008-05-14 桂林电子科技大学 Body drafting visual method based on surface sample-taking
CN102999321A (en) * 2011-09-15 2013-03-27 汉王科技股份有限公司 Writing brush electronic paintbrush setting device and writing brush electronic paintbrush

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104463939A (en) * 2014-11-28 2015-03-25 项天 Anti-aliasing method for graphic rendering and system
CN104463939B (en) * 2014-11-28 2018-07-24 苏州速显微电子科技有限公司 The antialiasing method and system rendered for figure

Also Published As

Publication number Publication date
CN103136777B (en) 2016-05-25

Similar Documents

Publication Publication Date Title
CN107564087B (en) A kind of Three-D linear symbol rendering method based on screen
CN103310474A (en) Method and system for implementing original handwriting
CN107610200B (en) Character library rapid generation method based on characteristic template
CN102999321B (en) Brush pen electronics paintbrush arranges device and brush pen electronics paintbrush
CN104463925B (en) Based on the digital camouflage method for designing of spotting template Automatic Combined
US10573013B2 (en) System and method for rendering smooth color gradients across multiple shapes
CN106096524A (en) The acquisition methods of a kind of Chinese character aesthetics and device
WO2017219643A1 (en) 3d effect generation method and system for input text, and 3d display method and system for input text
CN101216944A (en) A method and device for morphing shading in the process of typeset
JP2006018811A (en) Appropriately rendering graphical object when corresponding outline lacks control point
CN110322538B (en) Text display method, text display device, storage medium and processor
CN102999931A (en) Method and device for drawing electronic handwriting
CN102999930B (en) A kind of electronic handwriting lines plotting method and device
CN103838429A (en) Method and system for conducting drawing on touch screen to achieve writing brush effect
CN107689083B (en) Self-adaptive geometric surface information labeling method and device for geographic information system
CN106023317B (en) A kind of weighted Voronoi diagrams drawing generating method for big data test
CN103136777A (en) Electronic brush generation method and device, electronic brush and electronic device
CN104008122A (en) Dynamic multi-stage pie chart display method of layering data
CN102651137B (en) Algebraic curve rasterization method based on pixel precision
CN103279965A (en) Generation method for two-value stipple effect picture and video
US11809701B2 (en) Handwriting forming method and apparatus, and electronic device
CN106471446B (en) Drawing pen, electronic equipment and drawing practice
CN106873875B (en) Graphical display method and device of data and computing equipment
CN110211113A (en) A kind of detection algorithm and calculating equipment of groove exception
CN105184869B (en) Building line draws the method that data show three-dimensional perspective effect in two-dimensional stage

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