Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with this
Accompanying drawing in bright embodiment, is clearly and completely described the technical scheme in the embodiment of the present invention,
Obviously, described embodiment is a part of embodiment of the present invention rather than whole embodiments.Based on
Embodiment in the present invention, those of ordinary skill in the art are obtained under not making creative work premise
The every other embodiment obtained, broadly falls into the scope of protection of the invention.
The flow chart of the electronic brush pen form of a stroke or a combination of strokes processing method that Fig. 1 provides for the embodiment of the present invention one, this enforcement
The described method that example provides can be performed by a processing means, and this processing means is integrally disposed in user's
In electronic equipment.As it is shown in figure 1, the method includes:
The current of the brush pen form of a stroke or a combination of strokes that step 101, collection acquisition user operate on electronic device touchscreen touches
Touch the coordinate of coordinate a little and touch point before, described before before touch point includes described current touch point
The first two touch point of one touch point and described current touch point.
Specifically, when user needs the font writing out the brush pen form of a stroke or a combination of strokes on the touch screen of electronic equipment,
User can carry out touch operation on the touchscreen, and accordingly, processing means such as processor can detect
The position, touch point that user operates on this touch screen.
The present embodiment does not limit the specific algorithm detecting this position, touch point, and those skilled in the art are permissible
Select or design the detection algorithm of required precision the most voluntarily.
In the present embodiment, touch point coordinate sequence can be formed during user operation, these touch points sit
Mark is sequentially connected with, and constitutes handwriting trace.Assuming that current touch point is the n-th touch point, wherein n is
Integer more than or equal to 1.Gather each touch point formed during obtaining user operation successively, and
Each touch point carries out follow-up deformation characteristics parameter calculate and form of a stroke or a combination of strokes profile calculating process.
Wherein, for current touch point, before its above two needs to use it during calculating
The coordinate information of touch point.What deserves to be explained is, if current touch point is first or second touch point
Time, its calculation will be explained below explanation, and for other touch points in addition to these 2,
The present embodiment subsequent step all can be used to process.
Step 102, according between coordinate and the coordinate of described previous touch point of described current touch point
Distance between distance, and the coordinate of described previous touch point and the coordinate of the first two touch point described, really
The deformation characteristics parameter of fixed described current touch point.
The first two touch point of current touch point, the previous touch point of current touch point and current touch point are three
The most adjacent individual touch point.Assume: the coordinate of current touch point is Pn=(xn,yn,tn), current touch point
The coordinate of previous touch point be Pn-1=(xn-1,yn-1,tn-1), the coordinate of the first two touch point of current touch point is
Pn-2=(xn-2,yn-2,tn-2).Wherein, tn、tn-1And tn-2It is respectively the touch time of corresponding touch point.
Specifically, according between coordinate and the coordinate of described previous touch point of described current touch point
Distance between distance, and the coordinate of described previous touch point and the coordinate of the first two touch point described, really
The deformation characteristics parameter of fixed described current touch point, including:
According to formula Determine the deformation of current touch point
Characteristic parameter wn, wherein, W is form of a stroke or a combination of strokes width reference value, can be preset as a constant, and e is nature
The truth of a matter, asAnd bsFor shifted matching coefficient, span be [0 ,+∞), Δ t is adjacent touch point
Touch time interval.
What deserves to be explained is, when first touch point is for current touch point, now, first
The deformation characteristics parameter of individual touch point is set equal to W.Second touch point is for current touch point
Situation, now, the deformation characteristics parameter of second touch point is such as according to formulaDetermine, i.e. come really according to the distance between second touch point and first touch point
Fixed.
Step 103, according to the coordinate of described current touch point and the deformation characteristics of described current touch point
Parameter, determines the form of a stroke or a combination of strokes profile of described current touch point.
When carrying out brush writing, the person's handwriting write has one fixed width, corresponding next with certain unicursal
Saying, this stroke includes multiple touch point, and each touch point has the profile size of a bit, all tactile
Touch profile a little merge and carry out rendering display, then constitute the form of a stroke or a combination of strokes effect of this stroke.
Therefore, the present embodiment needs the profile of each touch point is calculated.Specifically, according to
The coordinate of described current touch point and the deformation characteristics parameter of described current touch point, determine described currently
The form of a stroke or a combination of strokes profile of touch point, including:
First, according to the coordinate of current touch point, the form of a stroke or a combination of strokes boundary curve side that current touch point is corresponding is determined
Cheng Zuwei:
Wherein, described a, b and c are preset constant, yOnCorresponding form of a stroke or a combination of strokes upper bound curvilinear equation, yUnderCorresponding pen
Shape lower bound curvilinear equation, yRightThe corresponding form of a stroke or a combination of strokes right boundary curvilinear equation.
For each touch point, its form of a stroke or a combination of strokes profile can determine according to form of a stroke or a combination of strokes boundary curve, first,
The form of a stroke or a combination of strokes boundary curve of each touch point includes three boundary curves upper and lower, right.
Secondly, solve above-mentioned form of a stroke or a combination of strokes boundary curve equation group, obtain the surrounded closed sides of form of a stroke or a combination of strokes boundary curve
The set M of the point in boundary, where it is assumed that N (x'i,y'i) it is the coordinate of any point in this set M.
Again, formula is usedTo the some N (x' on set Mi,y'i) enter
Row scaling, obtains constituting the set M of the point of the form of a stroke or a combination of strokes profile of current touch pointw.Thus, by current touch
The set M of the point of the form of a stroke or a combination of strokes profile of pointwConstitute the form of a stroke or a combination of strokes profile of current touch point.Wherein,For with coordinate points N (x'i,y'i) corresponding set MwIn the coordinate of point.
Every bit in border set M and set MwIn each point one_to_one corresponding, and, gather MwIn
Certain point be set M in corresponding point contract according to the coordinate of this point and the deformation characteristics parameter of this point
Obtain after putting.
Step 104, render the form of a stroke or a combination of strokes profile area defined of described current touch point.
After the profile of a touch point determines, can be with will this profile area defined carry out
Render, such as fill black ink effect, show in real time.
In the present embodiment, by with the distance between adjacent multiple brush pen form of a stroke or a combination of strokes touch points as foundation, come really
Determine the deformation characteristics parameter of current touch point, and then according to this deformation characteristics parameter and current touch point
Coordinate determines the form of a stroke or a combination of strokes profile of current touch point, the like, along with little by little describing of user, meeting
Form the form of a stroke or a combination of strokes profile of each touch point in real time, thus step by step the form of a stroke or a combination of strokes profile of each touch point is covered
Cover region territory is filled with rendering, to demonstrate the described person's handwriting form of a stroke or a combination of strokes.By in the technical program with often
The deformation characteristics parameter of individual touch point calculates the mode of the form of a stroke or a combination of strokes profile of each touch point, can be at electronics
The form of a stroke or a combination of strokes effect that on equipment, effectively simulation brush pen produces because of deformation in writing process so that the brush pen of simulation
The form of a stroke or a combination of strokes is greatly improved with the similarity of brush writing effect, it is possible to reflect writing of writer more truly
Being intended to, brush writing sense is strong, and stroke simulation degree is higher.
The flow chart of the electronic brush pen form of a stroke or a combination of strokes processing method that Fig. 2 provides for the embodiment of the present invention two, such as figure
Shown in 2, on the basis of embodiment illustrated in fig. 1, after step 103, it is also possible to include as follows
Step:
Step 201, judge between the coordinate of described current touch point and the coordinate of described previous touch point
Whether distance is more than predetermined threshold value, if being more than, then performs step 202-205, otherwise performs above-mentioned steps
104。
If the distance between the coordinate of the coordinate of current touch point and its previous touch point is more than presetting threshold
Value, illustrates to have between the profile of the two touch point the biggest space, in order to ensure form of a stroke or a combination of strokes effect and true hair
The form of a stroke or a combination of strokes of writing process has more preferable similarity, needs to carry out auxiliary point insertion between this two touch point.
Step 202, insert between described current touch point and described previous touch point at least one supplement
Point, and determine described auxiliary point according to the coordinate of described current touch point and the coordinate of described previous touch point
Coordinate.
Assume: N is the number of the auxiliary point inserted, and N is the integer more than or equal to 1.Wherein, N can
Think preset constant, it is also possible to by the function with current touch point and previous touch point spacing being negative correlation
Determine.
Specifically, the seat of auxiliary point is determined according to the coordinate of current touch point and the coordinate of previous touch point
Mark, comprises determining that the coordinate of each auxiliary point is:
Wherein, j=1,2, N.
Step 203, according to the deformation characteristics parameter of described current touch point and the shape of described previous touch point
Become characteristic parameter, determine the deformation characteristics parameter of described auxiliary point.
Specifically, according to deformation characteristics parameter and the deformation characteristics ginseng of previous touch point of current touch point
Number, determines the deformation characteristics parameter of auxiliary point, comprises determining that the deformation characteristics parameter of each auxiliary point is:
Wherein, wn-1Deformation characteristics parameter for previous touch point;wnFor working as
The deformation characteristics parameter of front touch point.
Step 204, according to the coordinate of described auxiliary point and the deformation characteristics parameter determination institute of described auxiliary point
State the form of a stroke or a combination of strokes profile of auxiliary point.
Specifically, according to the coordinate of auxiliary point and the pen of the deformation characteristics parameter determination auxiliary point of auxiliary point
Shape profile, including:
Use formulaDetermine the form of a stroke or a combination of strokes profile constituting each auxiliary point
The set M' of pointw;Wherein, For with Qj(xj,yj) corresponding set M'wIn the coordinate of point.By often
The set M' of the point of the form of a stroke or a combination of strokes profile of individual auxiliary pointwConstitute the form of a stroke or a combination of strokes profile of each auxiliary point.And then, all
Auxiliary point the most calculated as above, obtain the form of a stroke or a combination of strokes profile of each auxiliary point.
Step 205, render the form of a stroke or a combination of strokes profile of described current touch point and the form of a stroke or a combination of strokes profile of described auxiliary point
Area defined.
By all of touch point, and the profile of the auxiliary point inserted between two adjacent touch points melts
Close, i.e. constitute the profile of the person's handwriting form of a stroke or a combination of strokes of user operation, carry out in the region that this form of a stroke or a combination of strokes profile surrounds
Render filling, i.e. can be shown that final form of a stroke or a combination of strokes effect.
In the present embodiment, when adjacent two touch point spacings are bigger, carry out the insertion of auxiliary point,
And by calculating insertion coordinate position and the deformation characteristics parameter of each auxiliary point, calculate each supplementing
The form of a stroke or a combination of strokes profile of point so that the form of a stroke or a combination of strokes between two distant touch points also is able to more life-like in truly
Brush writing effect so that the brush pen form of a stroke or a combination of strokes of simulation is greatly improved with the similarity of brush writing effect, energy
Enough writers of reflection more truly write intention, and brush writing sense is strong, and stroke simulation degree is higher.
The structural representation of the electronic brush pen form of a stroke or a combination of strokes processing means that Fig. 3 provides for the embodiment of the present invention three,
As it is shown on figure 3, this device includes:
Acquisition module 11, obtains the brush pen form of a stroke or a combination of strokes that operates on electronic device touchscreen of user for gathering
The coordinate of the coordinate of current touch point and before touch point, described before touch point include described current touch
The previous touch point of point and the first two touch point of described current touch point;
First deformation characteristics computing module 12, for according to the coordinate of described current touch point and described previous
Distance between the coordinate of touch point, and the coordinate of described previous touch point and the first two touch point described
Distance between coordinate, determines the deformation characteristics parameter of described current touch point;
First form of a stroke or a combination of strokes profile processing module 13, for according to the coordinate of described current touch point and described work as
The deformation characteristics parameter of front touch point, determines the form of a stroke or a combination of strokes profile of described current touch point;
Rendering module 14, for rendering the form of a stroke or a combination of strokes profile area defined of described current touch point.
Further, described first deformation characteristics computing module 12 is additionally operable to:
According to formula Determine described current touch point
Deformation characteristics parameter wn, wherein, the coordinate of described current touch point is Pn=(xn,yn,tn), described previous tactile
Touching coordinate a little is Pn-1=(xn-1,yn-1,tn-1), the coordinate of the first two touch point described is Pn-2=(xn-2,yn-2,tn-2),
W is form of a stroke or a combination of strokes width reference value, and e is the nature truth of a matter, asAnd bsFor shifted matching coefficient, span be [0,
+ ∞), Δ t is the touch time interval of adjacent touch point, tn、tn-1And tn-2Respectively to corresponding touch point
The touch time.
Further, described first form of a stroke or a combination of strokes profile processing module 13 is additionally operable to:
According to the coordinate of described current touch point, determine the form of a stroke or a combination of strokes boundary curve that described current touch point is corresponding
Equation group is:
Wherein, described a, b and c are preset constant, yOnCorresponding form of a stroke or a combination of strokes upper bound curvilinear equation, yUnderCorresponding pen
Shape lower bound curvilinear equation, yRightThe corresponding form of a stroke or a combination of strokes right boundary curvilinear equation;
Solve described form of a stroke or a combination of strokes boundary curve equation group, obtain described the surrounded Close edges of form of a stroke or a combination of strokes boundary curve
On the set M of point;
Use formulaTo the some N (x' on described set Mi,y'i) carry out
Scaling, obtains constituting the set M of the point of the form of a stroke or a combination of strokes profile of described current touch pointw;By described current touch
The set M of the point of the form of a stroke or a combination of strokes profile of pointwConstitute the form of a stroke or a combination of strokes profile of described current touch point.
Wherein, N (x'i,y'i) it is the coordinate of any point in described set M,For with described N (x'i,y'i) corresponding described set MwIn the seat of point
Mark.
The electronic brush pen form of a stroke or a combination of strokes processing means of the present embodiment may be used for performing embodiment of the method shown in Fig. 1
Technical scheme, it is similar with technique effect that it realizes principle, and here is omitted.
The structural representation of the electronic brush pen form of a stroke or a combination of strokes processing means that Fig. 4 provides for the embodiment of the present invention four, as
Shown in Fig. 4, on the basis of embodiment illustrated in fig. 3, this device also includes:
Judge module 21, for judging coordinate and the coordinate of described previous touch point of described current touch point
Between distance whether more than predetermined threshold value;
Auxiliary point processing module 22, is used for when described judge module determines described distance more than predetermined threshold value,
At least one auxiliary point is inserted between described current touch point and described previous touch point, and according to described
The coordinate of current touch point and the coordinate of described previous touch point determine the coordinate of described auxiliary point;
Second deformation characteristics computing module 23, for according to the deformation characteristics parameter of described current touch point and
The deformation characteristics parameter of described previous touch point, determines the deformation characteristics parameter of described auxiliary point;
Second form of a stroke or a combination of strokes profile processing module 24, for according to the coordinate of described auxiliary point and described auxiliary point
The form of a stroke or a combination of strokes profile of auxiliary point described in deformation characteristics parameter determination;
Described rendering module 14, is additionally operable to render the form of a stroke or a combination of strokes profile of described current touch point and described supplements
The form of a stroke or a combination of strokes profile area defined of point.
Further, described auxiliary point processing module 22 is additionally operable to: the coordinate determining described auxiliary point is:
Wherein, j=1,2, N, N are the benefit inserted
Filling number a little, N is the integer more than or equal to 1;
Described second deformation characteristics computing module 23 is additionally operable to: determine the deformation characteristics parameter of described auxiliary point
For:
Wherein, wn-1Deformation characteristics parameter for described previous touch point;
Described second form of a stroke or a combination of strokes profile processing module 24 is additionally operable to: use formulaDetermine the set of the point of the form of a stroke or a combination of strokes profile constituting described auxiliary point
M'w;Wherein,
For with Qj(xj,yj) corresponding described set M'wIn the coordinate of point;By the form of a stroke or a combination of strokes profile of described auxiliary point
The set M' of pointwConstitute the form of a stroke or a combination of strokes profile of described auxiliary point.
The electronic brush pen form of a stroke or a combination of strokes processing means of the present embodiment may be used for performing embodiment of the method shown in Fig. 2
Technical scheme, it is similar with technique effect that it realizes principle, and here is omitted.
One of ordinary skill in the art will appreciate that: realize all or part of step of said method embodiment
Can be completed by the hardware that programmed instruction is relevant, aforesaid program can be stored in a computer-readable
Taking in storage medium, this program upon execution, performs to include the step of said method embodiment;And it is aforementioned
Storage medium include: various Jie that can store program code such as ROM, RAM, magnetic disc or CD
Matter.
Last it is noted that above example is only in order to illustrate technical scheme, rather than to it
Limit;Although the present invention being described in detail with reference to previous embodiment, the ordinary skill of this area
Personnel it is understood that the technical scheme described in foregoing embodiments still can be modified by it, or
Person carries out equivalent to wherein portion of techniques feature;And these amendments or replacement, do not make corresponding skill
The essence of art scheme departs from the spirit and scope of various embodiments of the present invention technical scheme.