CN103136777B - Electronics paintbrush generation method and device, electronics paintbrush and electronic equipment - Google Patents

Electronics paintbrush generation method and device, electronics paintbrush and electronic equipment Download PDF

Info

Publication number
CN103136777B
CN103136777B CN201110396020.1A CN201110396020A CN103136777B CN 103136777 B CN103136777 B CN 103136777B CN 201110396020 A CN201110396020 A CN 201110396020A CN 103136777 B CN103136777 B CN 103136777B
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.)
Active
Application number
CN201110396020.1A
Other languages
Chinese (zh)
Other versions
CN103136777A (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

Abstract

The present invention discloses a kind of electronics paintbrush generation method and device, electronics paintbrush and electronic equipment, relates to computer drawing field, can obtain the anti-aliasing lines that user thinks, promotes user's satisfaction. The scheme that the embodiment of the present invention provides, by determine the polygon of arbitrary shape, arbitrary size according to the polygon vertex coordinate of user's input, calculates the color weight of each pixel of described polygonal external frame, obtains polygon paintbrush. The scheme that the embodiment of the present invention provides adopts while being applicable to describe person's handwriting lines.

Description

Electronics paintbrush generation method and device, electronics paintbrush and electronic equipment
Technical field
The present invention relates to computer drawing field, relate in particular to a kind of electronics paintbrush generation method and device,Electronics paintbrush and electronic equipment.
Background technology
In computer graphical place field of drawing, in order to make the lines of drafting more smooth, in the time drawing electronics lines,Be all on lines, to get multiple discrete coordinate points, then adopt many line segments head and the tail to connect, realize linesDraw. The line segment that described many head and the tail connect is called anti-aliasing line segment.
In prior art, conventionally adopt the mode of arda sampling to draw anti-aliasing line segment, by adopting a baseThis anti-aliasing circular paintbrush, here, the diameter of the circular paintbrush of employing is the width of line, then with oneFixed step-length moves to terminal from the starting point of line segment, and the line segment of brushing is exactly the anti-aliasing line segment that need to draw.
But while adopting prior art to draw anti-aliasing line segment, the shape of the paintbrush of employing is all fixed,Can not obtain the anti-aliasing lines that user thinks, reduce user's satisfaction.
Summary of the invention
Embodiments of the invention provide electronics paintbrush generation method and device, electronics paintbrush and electronic equipment, canTo obtain the electronics paintbrush of arbitrary shape, adopt this electronics paintbrush to draw out the anti-aliasing lines that 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, 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, obtainObtain polygon paintbrush.
The device that electronization brush generates, comprising:
Determining unit, for determining arbitrary shape, arbitrary size according to the polygon vertex coordinate of user's inputPolygon;
Polygon paintbrush obtains unit, for according to described polygon, calculates described polygonal external frameThe color weight of each pixel, obtains polygon paintbrush.
Draw an electronics paintbrush for electronics lines, the color of the each pixel in central area of described electronics paintbrushWeights are greater than the color weight of the each pixel outside the central area of described electronics paintbrush, and described electronicsThe color weight of the each pixel in central area of paintbrush equates, each outside the central area of described electronics paintbrushThe color weight of pixel is directly proportional to the beeline at the edge of electronics paintbrush to corresponding described pixel;
Wherein, the central area of described electronics paintbrush is that pixel is large to the beeline at the edge of electronics paintbrushIn or equal the region of the pixel composition of default value.
A kind of electronic equipment, comprises trace input device and display screen, according to moving of described trace input deviceThe moving sampled point that obtains, adopts electronics paintbrush as claimed in claim 11 that described sampled point is connected successively, obtainsMust form the anti-aliasing line segment of electronics lines, and at anti-aliasing line segment described in 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, calculateThe color weight of each pixel of described polygonal external frame, obtains polygon paintbrush. With prior artWhen the anti-aliasing line segment of middle drafting, the shape of the paintbrush of employing is all fixed, and can not obtain anti-that user thinksThe lines that lose shape, the satisfaction that has reduced user first than, the scheme that the embodiment of the present invention provides obtains arbitrary shapeElectronics paintbrush, adopt this electronics paintbrush to draw out the anti-aliasing lines that user thinks, promote user's satisfactionDegree.
Brief description of the drawings
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, below will be to implementingIn example or description of the Prior Art, the accompanying drawing of required use is briefly described, and apparently, the following describesIn accompanying drawing be only some embodiments of the present invention, for those of ordinary skill in the art, do not payingGo out under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
The flow chart 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 flow chart of the another kind of electronics paintbrush generation method that Fig. 3 provides for the embodiment of the present invention 1;
The flow chart 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 signal that the rgb value of each pixel that Fig. 5 provides for the embodiment of the present invention 1 formsFigure;
The mouse that Fig. 6 provides for the embodiment of the present invention 1 moves the pass between sampled point and the institute's trace obtainingThe figure of system;
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.
Detailed description of the invention
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 carried out clearlyChu, intactly description, obviously, described embodiment is only the present invention's part embodiment, instead ofWhole embodiment. Based on the embodiment in the present invention, those of ordinary skill in the art are not making creationThe every other embodiment obtaining under property work prerequisite, belongs to the scope of protection of the invention.
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, determines the polygon of arbitrary shape, arbitrary size according to the polygon vertex coordinate of user's inputShape;
The polygonal apex coordinate that polygonal shape can be inputted by user is definite, for example, if user wantsA self-defined polygon paintbrush shape as shown in Figure 2, user will input A, B, C, tetra-summits of DCoordinate information.
The apex coordinate of inputting due to user is that polygonal size is for determining polygonal shapeDetermined by developed width. Therefore the not limit of polygon size that each summit that user provides formsSystem, as long as each summit is by connecting in turn the shape that can form the defined polygon paintbrush of user.
Further, as shown in Figure 3, according to the polygon vertex coordinate of user input determine arbitrary shape,The polygon of arbitrary size comprises following sub-step:
Step 1011, according to the polygon vertex coordinate of user's input, determines polygonal centre coordinate;
For example, the polygonal apex coordinate of user's input is (657,157), (621,200), and (683,220),(696,181), polygonal center is actually and can chooses arbitrarily, and the application is with polygonal center of gravityAs center, according to above-mentioned 4 apex coordinates, can obtain polygonal centre coordinate for (664.25,189.5)。
Step 1012, according to polygon vertex coordinate and the described centre coordinate of user's input, determines described manyLimit shape apex coordinate is with respect to the deviant at described center;
Polygon vertex coordinate comprises abscissa and two skews of ordinate with respect to the deviant at described center,For example,, according to above-mentioned 4 apex coordinates and definite centre coordinate, definite polygonal each summitDeviant is (7.25 ,-32.5), (43.25,10.5), (18.75,30.5), (31.75 ,-8.5).
Step 1013, determines arbitrary shape according to described centre coordinate and described deviant with respect to described centerThe polygon of shape, arbitrary size;
The actual coordinate on polygonal each summit can be according to the deviant on centre coordinate, each summit and realityBorder width determines, original width is determined by the skew with respect to center here, the width arranging by peripheryWeights change original width, the developed width of wanting to reach user.
It should be noted that, polygonal position is that centre coordinate is determined by the position of central point, polygonShape determined by the skew at each relative center, summit, polygonal size is determined by developed width.
Step 102, according to described polygon, calculates the color of each pixel of described polygonal external frameWeights, obtain polygon paintbrush;
Further, as shown in Figure 3, according to described polygon, calculate the each of described polygonal external frameThe color weight of individual pixel, obtains polygon paintbrush, specifically comprises following sub-step:
Step 1021, according to described polygon, determines described polygonal external frame;
Polygonal external frame is the square that comprises polygonal level minimum, according on polygonal limitThe coordinate of pixel is determined. This square is made up of the pixel of several row of several row, because at computerIn system, the unit of coordinate is pixel, so these foursquare four apex coordinates are all integers.
Step 1022, according to described polygonal external frame, determines each pixel of the described external frame of compositionColor weight;
Under normal circumstances, after polygonal shape and size are determined, in the time of polygon translation integer coordinate,The also same distance of translation accordingly of the external frame of its square, now polygon and its external frame soRelative position do not change, so the weights of the each pixel in external frame do not change.So in the situation that polygonal shape and size are definite, when the fractional part of centre coordinate is determined, and wholePolygonal shape determines again, and the weights of each pixel of so external frame just can uniquely have been determined.
It should be noted that, in advance the pixel weight storage of polygonal external frame is become to template, use a numberGroup is stored the weights of all pixels in an external frame, wherein, and corresponding one an of element in arrayThe weights of pixel.
In the time of actual storage, the precision set of the fractional part of transverse and longitudinal coordinate is 0.25, i.e. transverse and longitudinal coordinate decimalPart respectively has 0,0.25, and 0.5,0.75 four kind, so in the certain situation of width, determined by fractional partCentre coordinate have 16 kinds of positions, in reading template, can search the fractional part of centre coordinateThat template approaching.
4 apex coordinates that above-mentioned user is set are asked the template of paintbrush, and store in internal memory and go, toolBody ground, sets taking 0.25 as interval, and 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 are the integers that there is no practical significance, in the time of concrete application, only useFractional part wherein.
Particularly, as shown in Figure 4, in the case of the shape of polygon paintbrush and size certain, polygonObtaining by following sub-step of the color weight of the each pixel in external frame:
Step 401, obtains the coordinate of a pixel of the described external frame of composition; For example, the pixel of external frameThe coordinate of point is (x, y), wherein, x, y is integer;
Step 402, judges that whether the coordinate of described pixel is at described outside of polygon;
Particularly, whether judgement (x, y), at described outside of polygon, is actually and judges with (x, y)For whether ray of starting point and total number of polygon intersection point are even number, when total number of intersection point isWhen even number, the point that (x, y) is outside of polygon is described; In the time that total number of intersection point is odd number, illustrate (x,Y) be the point of polygon inside;
Step 403, when the coordinate of described pixel is during at described outside of polygon, determines the face of described pixelLook weights are 0;
Step 404, when the coordinate of described pixel is in the time that described polygon is inner, calculates the seat of described pixelMark is to described polygonal distance;
Particularly, calculate the coordinate of described pixel to described polygonal each back gauge, determine described pictureThe coordinate of vegetarian refreshments is to distance minimum in described polygonal each back gauge, described in the distance of described minimum isThe coordinate of pixel is to described polygonal distance.
Step 405, to the ratio of described polygonal distance and preset value whether the coordinate that judges described pixelBe greater than 1;
Wherein, described preset value rule of thumb can select 6, or other positive integers, and this value has determined pictureThe color depth on the border of brush.
Step 406, when the coordinate of described pixel is greater than 1 to described polygonal distance and the ratio of preset valueTime, the color weight of determining described pixel is 1;
Step 407, in the time that described coordinate is less than 1 to described polygonal distance with the ratio of preset value, determinesThe color weight of the described pixel ratio with preset value that is described coordinate to described polygonal distance.
Can determine the weights of each pixel of the described external frame of composition according to said method. What calculate is manyThe weights of the each pixel in the external frame of limit shape, just form the array that ranks are equal. Certain at developed widthSituation under, a center can, in the hope of a corresponding array, so just can obtain 16 arrays,It is saved in internal memory.
In the time reading, fractional part and the developed width size of the centre coordinate obtaining according to Practical Calculation,In internal memory, inquire about corresponding template. For example, actual centre coordinate is (200.07,321.46), abscissaIn fractional part be 0.07 and 0.0 the most approaching, the fractional part of abscissa gets 0.0 so, ordinate littleFractional part is 0.46 and 0.5 the most approaching, and the fractional part of ordinate gets 0.5 so, then stores from internal memory16 templates in search template corresponding to (0.0,0.5), just can obtain external frame each of correspondenceThe weights of pixel.
Step 1023, the color weight of each pixel described in resolving, the RGB of each pixel described in obtainingValue, the rgb value of described each pixel forms polygon paintbrush;
RGB (red, green, blue) value is for being used the RGB component that RGB model is each pixel in image to distributeColouring intensity value in 0 to 255 scope. Rgb color pattern be by red (Red), green (Greed),Variation and their stacks each other of blue (Blue) three Color Channels obtain color miscellaneous.
According to the polygon paintbrush of the rgb value formation of each pixel as shown in Figure 5, the paintbrush effect in figureFigure is the design sketch after amplifying 8 times.
The embodiment of the present invention provides a kind of electronics paintbrush generation method, by pushing up according to the polygon of user's inputPoint coordinates is determined the polygon of arbitrary shape, arbitrary size, calculates each picture of described polygonal external frameThe weights of vegetarian refreshments, obtain polygon paintbrush. In the prior art, adopt prior art to determine anti-aliasing line segmentTime, the shape of the paintbrush of employing is all fixed, and can not obtain the anti-aliasing lines that user thinks, has reducedThe polygonal shape that user's satisfaction is first set according to user oneself than, the scheme that the embodiment of the present invention providesShape is drawn anti-aliasing line segment, can obtain the anti-aliasing lines that user thinks, promotes user's satisfaction.
As shown in Figure 5, the present invention also provides a kind of electronics that adopts above-mentioned electronics paintbrush generation method to generatePaintbrush, the color weight of the each pixel in central area of described electronics paintbrush is fixed value, as 1; Described electronicsThe color weight of the each pixel in the paintbrush outside the central area of paintbrush is less than above-mentioned fixed value, as is less than1, and color weight and the corresponding described pixel of each pixel outside the central area of described electronics paintbrushBeeline to the edge of electronics paintbrush is directly proportional, i.e. each picture outside the central area of described electronics paintbrushThe color weight of vegetarian refreshments is along with this pixel reduces to the reducing of beeline at the edge of electronics paintbrush.
Wherein, the central area of described electronics paintbrush is that pixel is large to the beeline at the edge of electronics paintbrushIn or equal the region of the pixel composition of default value. Described preset value rule of thumb can select 6, orOther positive integers, this value has determined the color depth on the border of paintbrush.
The electronics paintbrush that the embodiment of the present invention provides, the polygonal shape of setting according to user oneself can be paintedMake anti-aliasing line segment, and this anti-aliasing line segment is successively thin out according to polygonal shape, curve lines are smooth,Promote user's satisfaction.
The present invention also provides a kind of electronic equipment that adopts above-mentioned electronics paintbrush to draw electronics lines, described electricitySubset comprises trace input device and display screen, and trace input device can be mouse or pointer or finger,For inputting the coordinate information of lines; Display screen is for showing the electronics lines of drafting. When concrete drafting, electricitySubset, according to the mobile sampled point that obtains of trace input device, adopts above-mentioned polygon paintbrush by described samplingPoint connects successively, obtains the anti-aliasing line segment of composition electronics lines, then described in described demonstration screen displayAnti-aliasing line segment.
Particularly, move the sampled point of acquisition according to current mouse, and three sampled points are before as three BFour control points of batten, calculate a curvilinear equation, this curvilinear equation and the curve of trying to achieve beforeBe smoothly connected. It should be noted that, B batten is a kind of special representation of SPL, and it is BThe linear combination of spline Basis curve. 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. SoAfter on the current curve calculating, get a little with certain step-length, here, step-length is to obtain based on experience value, the curve lines of the less final formation of step-length are more smooth, but operand is larger simultaneously, therefore generally gets 4To 5 length in pixels.
As shown in Figure 6, p0 in figure, p1, p2, p3 moves from mouse the sampled point obtaining, and p3 is currentMouse moves the sampled point of acquisition, p2, and p1, p0 is the sampled point obtaining before it successively, a-b in curveThe curve that section has been finished before being, b-c section is current that section of curve will drawing, wherein c0, c1, the points such as c2Got series of points, with anti-aliasing line segment b-c0, c0-c1, c1-c2 ... couple together. Due to what getDot spacing is smaller, and these line segments are all shorter, and this section of broken line seems to be exactly a smooth curve, thisIndividual curve and a-b section are to be smoothly connected at b point, so whole lines smoother.
It should be noted that, draw anti-aliasing line segment, be actually with a polygon paintbrush and move to from starting pointTerminal and the track that forms,, from the starting point of line segment, move to terminal with certain step-length 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 time line segment finishes, the length of SDegree is the distance of this step-length not, and next line segment at first, is offset one section from the starting point of line segment to terminalDistance (L-S), L is got step-length here. As shown in Figure 7, for according to method provided by the inventionThe anti-aliasing line segment drawing eventually.
The embodiment of the present invention provides a kind of electronic equipment, by adopting the polygon shape of setting according to user oneselfShape obtains polygon paintbrush and draws out anti-aliasing line segment, and shows. With the existing skill of available technology adoptingWhen art is determined anti-aliasing line segment, the shape of the paintbrush of employing is all fixed, and can not obtain anti-that user thinksThe lines that lose shape, the satisfaction that has reduced user first than, the scheme that the embodiment of the present invention provides is according to user oneselfThe polygonal shape of setting is drawn anti-aliasing line segment, can obtain the anti-aliasing lines that user thinks, promotes and usesThe satisfaction at family.
Embodiment 2
A kind of electronics paintbrush generation method providing in order to realize the embodiment of the present invention, the embodiment of the present invention providesA kind of electronics paintbrush generating apparatus, as shown in Figure 8, this device comprises: determining unit 801, polygon paintbrushObtain unit 802;
Determining unit 801, for determining arbitrary shape, large arbitrarily according to the polygon vertex coordinate of user's inputLittle polygon;
Further, as shown in Figure 9, determining unit 801 comprises centre coordinate determination module 8011, skewValue determination module 8012, polygon determination module 8013;
Centre coordinate determination module 8011, for according to the polygon vertex coordinate of user's input, determines polygonThe centre coordinate of shape;
According to the polygon vertex coordinate of user's input and definite described centre coordinate, deviant determination module8012, determine the deviant of described polygon vertex coordinate with respect to described center;
According to described centre coordinate and the described deviant with respect to described center, polygon determination module 8013Determine the polygon of arbitrary shape, arbitrary size;
Determining after polygon, according to described polygon, as shown in Figure 8, polygon paintbrush obtains unit802, calculate the color weight of each pixel of described polygonal external frame, obtain polygon paintbrush; ToolBody ground, described polygon paintbrush obtains unit 802 and comprises external frame determination module 8021, weights determination module8022, polygon paintbrush obtains module 8023;
External frame determination module 8021, for according to described polygon, determines described polygonal external frame;
According to described polygonal external frame, weights determination module 8022, determines the each of the described external frame of compositionThe color weight of individual pixel;
Further, as shown in figure 10, described weights determination module 8022 comprises and obtains submodule 1001,Judge the definite submodule 1003 of submodule 1002, the first, calculating sub module 1004, the second is determined submodule1005, the three determine submodule 1006;
Obtain submodule 1001, for obtaining the coordinate of a pixel that forms described external frame;
Judge submodule 1002, for the coordinate that judges described pixel whether at described outside of polygon;
First determines submodule 1003, for when the coordinate of described pixel is during at described outside of polygon, trueThe color weight of fixed described pixel is 0;
Calculating sub module 1004, for when the coordinate of described pixel is in the time that described polygon is inner, calculates instituteState the coordinate of pixel to described polygonal distance; Particularly, described in the coordinate that calculates described pixel arrivesPolygonal each back gauge, the coordinate of determining described pixel in described polygonal each back gaugeLittle distance, the coordinate that the distance of described minimum is described pixel is to described polygonal distance;
In the time that the coordinate of described pixel is greater than 1 to described polygonal distance with the ratio of preset value, secondDetermine submodule 1005, the color weight of determining described pixel is 1;
In the time that described coordinate is less than 1 to described polygonal distance with the ratio of preset value, the 3rd determines submodulePiece 1006, the color weight of determining described pixel is that described coordinate is to described polygonal distance and preset valueRatio, wherein, described preset value rule of thumb can select 6, or other positive integers, this is worth decisionThe color depth on border of paintbrush.
The weights of described each pixel are resolved, and polygon paintbrush obtains module 8023, described in obtainingThe rgb value of each pixel, the rgb value of described each pixel forms polygon paintbrush.
The device that the embodiment of the present invention provides a kind of electronics paintbrush to generate, inputs according to user by determining unitPolygon vertex coordinate determine the polygon of arbitrary shape, arbitrary size, polygon paintbrush obtains unit meterCalculate the color weight of each pixel of described polygonal external frame, obtain polygon paintbrush. With existing skillWhile adopting prior art to determine anti-aliasing line segment in art, the shape of the paintbrush of employing is all fixed, and can not obtainThe anti-aliasing lines thought of user, the satisfaction that has reduced user is first than, the side that the embodiment of the present invention providesThe polygonal shape that case is set according to user oneself is drawn anti-aliasing line segment, can obtain that user thinks counter walkLine-transect bar, lifting user's satisfaction.
The above be only the specific embodiment of the present invention, but protection scope of the present invention is not limited toThis, any be familiar with those skilled in the art the present invention disclose technical scope in, can expect easilyChange or replace, within all should being encompassed in protection scope of the present invention. Therefore, protection scope of the present invention shouldThe described protection domain with claim is as the criterion.

Claims (10)

1. an electronics paintbrush generation method, is characterized in that, comprising:
According to the polygon vertex coordinate of user's input, determine polygonal centre coordinate, and with polygonCentered by the center of gravity of shape;
According to polygon vertex coordinate and the described centre coordinate of user's input, determine described polygon vertexCoordinate is with respect to the deviant at described center;
Determine arbitrary shape, arbitrarily according to described centre coordinate and described deviant with respect to described centerThe polygon of size;
According to described polygon, calculate the color weight of each pixel of described polygonal external frame,Obtain polygon paintbrush.
2. electronics paintbrush generation method according to claim 1, is characterized in that described basisDescribed polygon, calculates the color weight of each pixel of described polygonal external frame, obtains polygonShape paintbrush comprises:
According to described polygon, determine described polygonal external frame;
According to described polygonal external frame, determine the color power of each pixel of the described external frame of compositionValue;
Resolve the color weight of described each pixel, obtain the rgb value of described each pixel, described inThe rgb value of each pixel forms polygon paintbrush.
3. electronics paintbrush generation method according to claim 2, is characterized in that, described definiteThe color weight that forms each pixel of described external frame comprises:
Obtain the coordinate of a pixel of the described external frame of composition;
Judge that whether the coordinate of described pixel is at described outside of polygon;
When the coordinate of described pixel is during at described outside of polygon, determine the color weight of described pixelBe 0;
When the coordinate of described pixel is in the time that described polygon is inner, calculate the coordinate of described pixel to instituteState polygonal distance; When the coordinate of described pixel to described polygonal distance the ratio with preset valueBe greater than at 1 o'clock, the color weight of determining described pixel is 1; When described coordinate is to described polygonal distanceFrom being less than at 1 o'clock with the ratio of preset value, the color weight of determining described pixel is described in described coordinate arrivesThe ratio of polygonal distance and preset value.
4. electronics paintbrush generation method according to claim 3, is characterized in that described calculatingThe coordinate of described pixel comprises to described polygonal distance:
The coordinate that calculates described pixel is to described polygonal each back gauge, determines described pixelCoordinate is to distance minimum in described polygonal each back gauge, and the distance of described minimum is described pixelThe coordinate of point is to described polygonal distance.
5. an electronization brush generating apparatus, is characterized in that, comprising:
Determining unit, for determining arbitrary shape, large arbitrarily according to the polygon vertex coordinate of user's inputLittle polygon;
Polygon paintbrush obtains unit, for according to described polygon, calculates described polygonal external frameThe color weight of each pixel, obtain polygon paintbrush;
Described determining unit comprises:
Centre coordinate determination module, for according to the polygon vertex coordinate of user's input, determines polygonCentre coordinate;
Deviant determination module, for sitting according to the polygon vertex coordinate of user's input and described centerMark, determines the deviant of described polygon vertex coordinate with respect to described center;
Polygon determination module, for according to described centre coordinate and the described skew with respect to described centerValue is determined the polygon of arbitrary shape, arbitrary size.
6. electronization brush generating apparatus according to claim 5, is characterized in that, described polygonShape paintbrush obtains unit and comprises:
External frame determination module, for according to described polygon, determines described polygonal external frame;
Weights determination module, for according to described polygonal external frame, determines composition described external frameThe color weight of each pixel;
Polygon paintbrush obtains module, for resolving the color weight of described each pixel, described in acquisitionThe rgb value of each pixel, the rgb value of described each pixel forms polygon paintbrush.
7. electronization brush generating apparatus according to claim 6, is characterized in that described weightsDetermination module comprises:
Obtain submodule, for obtaining the coordinate of a pixel that forms described external frame;
Judge submodule, for the coordinate that judges described pixel whether at described outside of polygon;
First determines submodule, for when the coordinate of described pixel is during at described outside of polygon, definiteThe color weight of described pixel is 0;
Calculating sub module, for when the coordinate of described pixel is in the time that described polygon is inner, described in calculatingThe coordinate of pixel is to described polygonal distance; Second determine submodule, for when described pixelCoordinate is greater than at 1 o'clock to described polygonal distance and the ratio of preset value, determines the color of described pixelWeights are 1; The 3rd determines submodule, for arriving described polygonal distance and preset value when described coordinateRatio be less than at 1 o'clock, the color weight of determining described pixel is described coordinate to described polygonal distanceFrom with the ratio of preset value.
8. electronization brush generating apparatus according to claim 7, is characterized in that described calculatingSubmodule specifically for:
The coordinate that calculates described pixel is to described polygonal each back gauge, determines described pixelCoordinate is to distance minimum in described polygonal each back gauge, and the distance of described minimum is described pixelThe coordinate of point is to described polygonal distance.
9. an electronics paintbrush, is characterized in that, the each pixel in central area of described electronics paintbrushColor weight is greater than the color weight of the each pixel outside the central area of described electronics paintbrush, and instituteThe color weight of stating the each pixel in central area of electronics paintbrush equates, the central area of described electronics paintbrushOutside the color weight of each pixel and the shortest to the edge of electronics paintbrush of corresponding described pixelDistance is directly proportional;
Wherein, the central area of described electronics paintbrush is the beeline of pixel to the edge of electronics paintbrushBe more than or equal to the region of the pixel composition of default value.
10. an electronic equipment, comprises trace input device and display screen, according to described track input dressThe mobile sampled point that obtains of putting, is characterized in that, adopts electronics paintbrush as claimed in claim 9 by instituteState sampled point and connect successively, obtain the anti-aliasing line segment of composition electronics lines, and aobvious on described display screenShow described anti-aliasing line segment.
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 CN103136777A (en) 2013-06-05
CN103136777B true 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)

Families Citing this family (1)

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

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

Also Published As

Publication number Publication date
CN103136777A (en) 2013-06-05

Similar Documents

Publication Publication Date Title
US10220569B2 (en) Generating support material for three-dimensional printing
CN107610200B (en) Character library rapid generation method based on characteristic template
CN103310474A (en) Method and system for implementing original handwriting
CN102999321B (en) Brush pen electronics paintbrush arranges device and brush pen electronics paintbrush
CN112819947A (en) Three-dimensional face reconstruction method and device, electronic equipment and storage medium
CN106486044A (en) Display device and its method of operating and the mobile device for including the display device
CN105512265A (en) Method and device for displaying data through figure
US20200279415A1 (en) Efficiently Computed Distance Fields
US10573013B2 (en) System and method for rendering smooth color gradients across multiple shapes
CN106126140B (en) A kind of method, apparatus and electronic equipment of rendering type
CN103810750A (en) Human body section ring based parametric deformation method
CN111142770A (en) Method for generating pen point and processing device
WO2017219643A1 (en) 3d effect generation method and system for input text, and 3d display method and system for input text
CN103136777B (en) Electronics paintbrush generation method and device, electronics paintbrush and electronic equipment
CN104637075A (en) Automatic rapid mapping method for sand body
TWI587275B (en) Driving method for in-cell touch display and mobile device using the same
Limberger et al. Evaluation of sketchiness as a visual variable for 2.5 d treemaps
CN102999931A (en) Method and device for drawing electronic handwriting
CN107689083B (en) Self-adaptive geometric surface information labeling method and device for geographic information system
CN109492540A (en) Face exchange method, apparatus and electronic equipment in a kind of image
Xiao et al. Towards a multiobjective view of cartographic design
CN105741287B (en) Tooth three-dimensional grid data segmentation method and apparatus
US11809701B2 (en) Handwriting forming method and apparatus, and electronic device
CN114820968A (en) Three-dimensional visualization method and device, robot, electronic device and storage medium
CN104794134A (en) Chinese character display method and device

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