WO2004100071A1 - Method for manipulating vectorial curves - Google Patents

Method for manipulating vectorial curves Download PDF

Info

Publication number
WO2004100071A1
WO2004100071A1 PCT/IT2003/000281 IT0300281W WO2004100071A1 WO 2004100071 A1 WO2004100071 A1 WO 2004100071A1 IT 0300281 W IT0300281 W IT 0300281W WO 2004100071 A1 WO2004100071 A1 WO 2004100071A1
Authority
WO
WIPO (PCT)
Prior art keywords
curve
point
deformed
deformation
stroke
Prior art date
Application number
PCT/IT2003/000281
Other languages
French (fr)
Inventor
Vincenzo Vennarini
Fabrizio Morciano
Gian Marco Todesco
Original Assignee
Digital Video S.R.L.
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 Digital Video S.R.L. filed Critical Digital Video S.R.L.
Priority to PCT/IT2003/000281 priority Critical patent/WO2004100071A1/en
Priority to EP03727944A priority patent/EP1623384A1/en
Priority to AU2003233189A priority patent/AU2003233189A1/en
Publication of WO2004100071A1 publication Critical patent/WO2004100071A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves

Definitions

  • stroke One of the most important functions of the just described processing programs is that associated with the modification of a drawing tract or curve, usually called "stroke".
  • each tract of a drawing is represented as a primitive curve or a combination of primitive curves, for example parabolas, circumferences or more complex curves.
  • Each primitive curve is described by a respective mathematic equation based upon parameters apt to detect it univocally and usually called control points.
  • the vectorial mode requires a limited memory occupation with respect to other representation modes, such as for example the so-called "raster" mode which instead consists in a pixel matrix representation of images.
  • raster a representation mode
  • the curve control points have to be made "invisible" to the program end users and a correspondence must be established between the operations performed by the artist on the drawn tract and the relative necessary modification of the control points which describe the tract itself.
  • control points necessary for a satisfying approximation of a drawn tract depends, to an important extent, upon the need of obtaining a fine control of the tract deformation and such number is as much larger as better such control must be.
  • a large number of control points involve a huge memory occupation and a less execution speed - the resources being the same - of the drawing and manipulation functions.
  • the present invention also provides a program for graphic processing according to claim 22.
  • the present invention provides some important advantages.
  • the main advantage lies in the fact that by adding local control points only at the portion of the curve involved by the deformation and only for the duration of the actual deformation step, a fine control of the manipulation is allowed, but with a limited - and only temporary - increase in the necessary memory resources and without sacrifying the execution speed of operations.
  • n 2 and wherein by are (n+l) control points which belong to the bidimensional set of real numbers 9 ⁇ 2 and B"(t) are Bernstein polynomials explicitly defined as:
  • a quadratic Bezier curve is wholly defined and identified by three control points, here designated as P 0 , Pi and P 2 , respectively.
  • each control point is defined by the values of two coordinates, that is X-axis coordinate and 7-axis coordinate with respect to a predetermined reference system.
  • Another variable utilized to define the stroke is the length of the latter from the start until a certain point, which will be called s and which, thus, represents a curvilinear coordinate on the stroke itself.
  • a first method step provides indeed that the user select on the screen the image portion, that is in the present example the stroke tract, to be modified. Such selection is performed by detecting the D point of the portion itself which will have to undergo the maximum deformation or a point on the screen in the proximity thereof.
  • the method also provides the automatic addition of one or preferably more local control points of the curve or curves which locally approximate the stroke, that is the addition of control points about the stroke maximum deformation point.
  • the specific adding modes of such control points provided in the present embodiment will be now illustrated in detail.
  • the method provides the use of an / function for adding control points which receives as input variables an identifier of the specific K stroke to be deformed (and thus the relative approximating equations), the above-mentioned w m i Vietnamese coordinate (or the corresponding value of s min curvilinear coordinate) and a so-called def deforming function which will be defined shortly.
  • the output of the / function is the mathematic expression approximating an "enriched" K' stroke defined as a function of the input parameters, that is:
  • K.' f(K, w min , def)
  • Such def deformer further provides as pre-set parameter - and which can be modified by the user before the deformation - the (maximum) size of the region involved by the deformation, which can be defined as "tool size" TS.
  • the TS variable defines the length of the stroke portion about the D point involved by the deformation.
  • Another parameter provided by the def deformer is the mindw minimum entity of percentage deformation of the stroke, expressed for example in terms of variation of the relative w parameter, for which it is necessary to add a local control point.
  • the value of such parameter which is generally constant for a given modification tool, typically varies from tool to tool. Such value can also be set in an empiric way by means of a tool using test of the kind usually carried out by a person skilled in the art.
  • the effect of applying the above mentioned pinch tool to the K stroke is represented in a schematic way and by simple way of example, such figure, the Do and Di points on the K stroke define the edges of the region involved by the deformation.
  • the method provides, by means of the / function, the calculation of an appropriate running pitch ? of the K stroke in order to add local control points.
  • pitch p is proportional to the pixel size on the screen and in particular it depends upon the specific display modes of the stroke. If, for example, the manipulation tool is applied on the stroke while it is displayed in so- called “zoom out", that is with reduced sizes, the curve can be sampled with a relative large pitch, as it is required a less precision in the deformation, and viceversa if, on the contrary, the image displayed is being enlarged by a "zoom in".
  • the K curve is then scanned with a sampling rate p, calculating the deformation difference between a sampled point and the subsequent point in terms of dw difference of percentage variation of parameter w between the two points of the stroke after the deformation. If such difference is greater than mindw, it is then necessary to add a local control point at a point with curvilinear coordinate comprised between (s ⁇ Ads) and (sn+ds+p), wherein so designates the curvilinear X- axis of the D selected point.
  • ds ' findMinDs(def, K, sp, ds, ds+p, ⁇ ).
  • defines thus an e ⁇ or and the value thereof can be set in an arbitrary way by the program according to the tool kind to be implemented.
  • the ⁇ value can also be made modifiable by the user and/or adaptively modifiable by the program to obtain a better approximation.
  • the method provides the generation of a new local confrol point corresponding, indeed, to the point with curvilinear coordinate (so+ds ").
  • the De Casteljeu algorithm is used, well known to a skilled in the art.
  • the K' enriched stroke is actually deformed, the absolute entity of the deformation being determined by the user.
  • the pinch tool such entity co ⁇ esponds to the entity of the space on the screen covered by the cursor driven by the user.
  • the I arrow at full tract schematizes indeed such user's input, provided, as said above, by dragging the mouse while keeping pressed the button.
  • the added local control points are eliminated by re-sampling and interpolating the curve, i case of the pinch tool considered sofar, such elimination step starts with the releasing of the mouse button by the user at the end of dragging.
  • the elimination of the control points is carried out by means of a function which receives as input the descriptive equations of the K' enriched stroke and the coordinates of the two points D 0 and Di on the stroke which define the edges of the region involved by the deformation and which thus represent the points within which the reduction has to be made.
  • the function detects the sub-sequence of quadratic curves approximating the K' stroke in the segment comprised between D 0 and Di.
  • D 0 and Di will lie on the stroke near intermediate points of two quadratics which constitute the stroke.
  • the involved quadratics are then divided into two quadratics, by utilizing the already mentioned De Casteljeu algorithm, so that D 0 and Di fall at the beginning and at the end of a quadratic of the sub-sequence, respectively.
  • the sequence of quadratics is run with an appropriate sampling step, by obtaining a sequence of points for the new interpolation and the interpolation itself is performed.
  • the sampling step is chosen according to conventional modes and in particular so that it is small enough to allow a satisfying approximation of the deformed stroke.
  • the Schneider algorithm can be used for example (see for example: P. Schneider, "An algorithm for automatically fitting digitized curves", Graphic Gems, pages 612-626, 1990), already known in literature to this purpose.
  • Such algorithm receives as input a sequence of sampling points and the e ⁇ or wished on the interpolation and it returns as output a sequence of interpolating quadratics.
  • the just described step of reducing the control points does not necessarily involve the elimination of all or only of the local control points added before the deformation.
  • the control points at the end of the elimination step could be in lower number with respect to those utilized to describe the initial stroke. Nice versa, in case of an end curve more complex than the initial one, the number of control points at the end of the elimination step could be higher than the one related to the starting stroke K, although it is lower than the number of the control points of the enriched stroke K'.
  • the invention method can be advantageously implemented in several tools of graphic processing alternative to the "pinch” tool considered above.
  • the method can be utilized in a tool, which could be called “bender”, which allows the user to trace a segment on the screen and to rotate it and wherein the curves crossed by the traced segment are modified, following the rotation thereof, in the following manner: the curves on one side of the segment remain still, the curves on the other side follow the segment by properly deforming.
  • Such tool allows thus the creation of "elbow”-like deformations.
  • the invention method is obviously used for deforming the curves intersected by the segment.
  • An additional tool of graphic processing which can exploit the invention method is a tool, which could be called “magnet”, which allows the user to move a circular area on the screen, after which movement, by pressing the mouse button, the curves inside the circular area are deformed by following the movement direction.
  • magnet a tool, which could be called "magnet”
  • tool size is defined by the size of the circle in the magnet.
  • the subject filling method allows to detect the regions encompassed by a set of curves and to keep the filling information associated to each region upon varying the shape and kind of the region itself and upon varying the number of regions.
  • the subject method will be described by referring to a specific application thereof for colouring closed drawing regions delimited by stroke(s).
  • a region of such image is wholly defined by a sequence of branches, wherein under branch a "side" of the region itself is meant to be designated, which side is obviously constituted by a curve portion, a stroke in the present example.
  • w parameter (already introduced above) at the two ends of the branch itself.
  • Such values will be designated hereinafter, preferably expressed in double precision, by w b (conventionally associated to the initial end) and w e (conventionally associated to the final end), respectively.
  • an R region is identified by a sequence of triads of the kind (S, w b , w e ), wherein S designates an image sfroke and w b and w e are the relative values which define the branch on the stroke S. Therefore, if a region R is encompassed by M stroke, it could be written:
  • a first step of the filling method here proposed provides thus the detection and the organization of such intersections among strokes, as first step to detect regions.
  • an intersection is here defined as point P of (xp, yp) coordinates which a certain number of strokes converge.
  • the structure ID can be implemented under the form of a list of all the intersections present in the image.
  • the ID structure can also be implemented by means of a type of data structure alternative to the list and apt to contain the information in question.
  • the creation of a structure ID in the form of a list for each single image is provided.
  • each intersection is represented as a list of all the stroke branches which converge to the intersection.
  • the representation of each branch stored in the list of a certain intersection also contains a pointer to the corresponding representation of the branch itself in the other intersection involving the same branch. If the branch is not involved by more than one intersection, then the abovementioned pointer is null. Each branch appears in one or two different intersections.
  • each branch belonging to an intersection is identified by a combination of four values, that is: (S, w,-, v, u), wherein w,- designates the value of the parameter w at which the intersection occurs, v the running versus of the stroke S (and thus a boolean value, which designates if the branch enters or leaves the intersection) and u a pointer to the other possible intersection which contains the same branch.
  • figure 2 shows an example of a simple image constituted by three strokes and four intersections and in figure 3 the resulting relative structure ID is schematically shown.
  • the I 1 ⁇ I 2 , 1 3 and Lt letters each identify the list related to the respective intersection.
  • Each of such lists contains a data element - or "record" - for each branch involved by the intersection and each branch record comprises four fields, which, in the order, represent the relative stroke, the Wi value, a boolean value which indicates if the stroke is as inlet or outlet of the intersection and a reference to the other possible intersection related to the branch itself.
  • a label of the "Rab" kind which identifies the record itself, is assigned.
  • one of the two branches to be inserted is taken and the above mentioned outer product between it and each branch preexisting in the list portion is made, until the outer product with one of such preexisting branches has a sign change with respect to the preceding branch.
  • the new branch inserts between the two branches therebetween the sign change occurs.
  • the possible other new branch inserts simply in position diametrically opposed with respect to the already inserted one.
  • the ID structure is filled up except for the fourth field of the branch records.
  • the whole structure is scrolled, intersection by intersection and record by record, and, if such field is empty, among the records not yet examined the one referring to the same stroke, opposed versus (in/out), and the w,- value closer to the w,- value of the record under examination are searched.
  • the fourth field of the current record is assigned a pointer thereto and the fourth field of the found record is assigned a pointer to the current record.
  • FIGS 4A to 4G a practical example of the removal of dead branches and intersections performed according to the modes just described is shown.
  • the dead branch and the intersections to be eliminated at each step are represented in hatched.
  • figure 4A refers to the removal of two dead branches, each one belonging to one single intersection
  • figure 4B refers to the subsequent elimination of an intersection involved by one single branch
  • figure 4C refers to the consequent removal of one of the remaining dead branches
  • figure 4D refers to the removal of an intersection having one single branch, in a situation similar to the one of figure 4B
  • figure 4E refers to the elimination of the last remained dead branch
  • figure 4F shows the removal of a residual fictitious intersection
  • at last figure 4G shows the region defined at the end of all above- mentioned operations of removing dead branches and intersections.
  • the present method provides that they are recognized and removed.
  • the feature to recognize the global region(s) with respect to the other regions is that whereas these latter are run clockwise, the global region(s) are run counterclockwise, as shown by figure 5.
  • the method Based upon the calculation of all regions and upon the determination of the structure thereof as illustrated sofar, the method provides then the coloring of the regions themselves.
  • the modes for assigning a color to each of such regions will be now illustrated.
  • each branch in the ID structure as defined above is then modified by adding an additional (fifth, in the present example) field which contains the color information. It will be understood that such modification of the ID structure is shown at this point of the treatment only to explain more clearly, but practically the ID structure can be directly conceived as from the beginning with five or more fields for each branch.
  • the filling method here illustrated provides that, to each branch, information related to all colors of the regions delimited by the branch itself be associated.
  • the method here described allows keeping, as much as possible, the information about filling the region or regions involved by the stroke itself, as illustrated hereinafter.
  • a list of branch records referring to the stroke itself and defining real regions is assigned (that is a list of records having the first field equal to the identifier of the considered stroke).
  • a list of five branch records is assigned, that is: R02, R03, R22, R31 and R32.
  • a certain number of new records is associated.
  • Such records could possibly already contain associated filling color information.
  • a record will contain already associated filling information in case it belongs to a region formed by strokes not involved by the modification (therefore not cancelled at point IL), and which belonged to a region filled before the modification. It has already been said, in fact, that such filling information is propagated to all branch records of the region, and therefore to the new records of the sfroke added at point DI too.
  • this procedure is applied in case the user selects a group of stroke and moves it on the screen, or in case the user cuts a group of stroke and then glues it in other points or on other images and in other situations wherein additions or modifications are made, by wishing to keep the color information.
  • the filling method described sofar in its more general definition, provides as main innovative step the association of a piece of information representative of a certain region to each of the single curve branches delimiting the region itself, and keeping such branches even when the image is modified and such branches could belong to new regions or no region.

Abstract

Method for manipulating curves (K) described by means of approximating equations based upon control points, comprising the steps of: (i) generating a plurality of additional local control points at the curve portion to be deformed; (ii) deforming the curve; and (iii) eliminating control points after deformation.

Description

METHOD FOR MANIPULATING VECTORIAL CURVES
Description
The present invention relates to a method for manipulating vectorial curves, that is described by means of approximating equations based upon control points. In particular, the invention relates to a method for deforming drawing tracts - so-called "strokes" - in a program for graphic processing for making animated cartoons.
The traditional applications for animation are conceived to be used after the hand- drawing step, by handling for example the scanning and subsequent manipulation of drawings. Such programs thus do not contribute to the real processing of drawings and, as additional limits, they have the problem of requiring much time for scanning the drawings and the problem of allowing only a limited possibility for modifying what has been acquired.
There are then some programs of relatively new introduction which instead allow the direct realization of drawings by means of a special tool consisting in a graphic tablet and in an associated electronic pen or mouse to "draw" on the tablet. With such tools, the artist visualizes in real time the tracts "traced" on the tablet directly on the computer monitor. The advantages of this kind of programs lies obviously in the fact that the artist has the possibility of canceling or modifying what he/she has made in a much simpler way with respect to the drawing on paper support. Furthermore, the artist can easily utilize or adapt the images made for a certain scene - or "frame" - for the subsequent scenes, and this obviously makes the creation of the subsequent frames, starting from the existing ones, much more easier.
One of the most important functions of the just described processing programs is that associated with the modification of a drawing tract or curve, usually called "stroke".
More in particular, when the above mentioned graphic tablet is used with "stroke", a continuous tract drawn by the user on the screen, from the moment in which he/she lays the pen or the mouse onto the tablet until the moment in which he/she detaches it, is usually meant. The most advanced programs allow drawing strokes with thickness variable and proportional to the pressure applied by the user on the tablet.
As it is know for a person skilled in the art, one mode to store images - and thus the so-called strokes too - in a computer memory is the so-called vectorial mode. According to this mode, each tract of a drawing is represented as a primitive curve or a combination of primitive curves, for example parabolas, circumferences or more complex curves. Each primitive curve is described by a respective mathematic equation based upon parameters apt to detect it univocally and usually called control points.
The vectorial representation mode has the advantage of operating with continuous functions and of allowing an absolute control of the primitives and thus of the drawing tracts approximated by them. In particular, by modifying the control points
(by numer and position) the operator can obtain almost any pattern of the drawn tract.
Furthermore, the vectorial mode requires a limited memory occupation with respect to other representation modes, such as for example the so-called "raster" mode which instead consists in a pixel matrix representation of images. For not technical users it would be preferable to allow the manipulation of the drawn tract without the need for showing the control points and without the need for a direct intervention of the latter, that is to allow the artist to modify the drawn tract with simple and natural operations carried out directly and only on the tract itself. To this purpose, the curve control points have to be made "invisible" to the program end users and a correspondence must be established between the operations performed by the artist on the drawn tract and the relative necessary modification of the control points which describe the tract itself.
However, in order to obtain all this, it is necessary to associate a very large number of control points to each drawn tract.
Furthermore, the number of the control points necessary for a satisfying approximation of a drawn tract depends, to an important extent, upon the need of obtaining a fine control of the tract deformation and such number is as much larger as better such control must be. However, a large number of control points involve a huge memory occupation and a less execution speed - the resources being the same - of the drawing and manipulation functions.
The methods of known art for manipulating drawing tracts and the associated computer programs do not achieve an optimum compromise between the opposite needs just mentioned.
The technical problem underlying the present invention is therefore to provide a method for manipulating vectorial curves and a relative program for graphic processing which allow obviating to the drawbacks mentioned above by referring to the known art. Such problem is solved by a method according to claim 1.
According to the same inventive concept, the present invention also provides a program for graphic processing according to claim 22.
The invention further provides a computer system according to claim 31.
Prefeπed features of the present invention are provided in the depending claims thereof.
The present invention provides some important advantages. The main advantage lies in the fact that by adding local control points only at the portion of the curve involved by the deformation and only for the duration of the actual deformation step, a fine control of the manipulation is allowed, but with a limited - and only temporary - increase in the necessary memory resources and without sacrifying the execution speed of operations.
Other advantages, features and the application modes of the present invention will be evident from the following detailed description of some embodiments thereof, illustrated by way of example and not for limitative purpose. The figures of the accompanying drawings will be referred to, wherein: figure 1 shows a schematic representation of an application of the invention method; and figures from 2 to 8 refer to a method for adaptively coloring regions delimited by drawing tracts, showing schematic representations associated to the different steps of such method.
One embodiment of the method for manipulating vectorial curves according to the invention will be described hereinafter by referring to the deformation of a drawing tract, and in particular of a so-called "stroke" as above defined. It will further considered a specific application of the subject method wherein it is used in a program for graphic processing for implementing animated cartoons.
hi the present embodiment, by way of example a stroke is approximated by means of a sequence of Bezier curves of second order, which will be called quadratic, each curve being described by an equation of the kind: b(t) = ∑b,R;(t),
wherein n=2 and wherein by are (n+l) control points which belong to the bidimensional set of real numbers 9Ϊ2 and B"(t) are Bernstein polynomials explicitly defined as:
Figure imgf000004_0001
f„\ with binomial coefficients given by:
\ZJ
Figure imgf000004_0002
As it is well known to a skilled in the art, a quadratic Bezier curve is wholly defined and identified by three control points, here designated as P0, Pi and P2, respectively. In turn, each control point is defined by the values of two coordinates, that is X-axis coordinate and 7-axis coordinate with respect to a predetermined reference system.
In the quadratic sequence forming the approximated stroke, the P2 control point of each quadratic coincides with the P0 control point of the adjacent subsequent quadratic.
As it results from the above equations, a quadratic Bezier curve is a parametric curve described by a parameter, here designated by t, variable in the closed range [0, 1]. If t=0 the curve passes by P0, and if t=l the curve passes by P2.
Similarly, for the stroke approximated by the above mentioned equations, a w parameter is defined so that for w=0 the stroke passes by the P0 control point of the first quadratic of the sequence and for w=l the stroke passes by the P2 control point of the last quadratic of the sequence.
Another variable utilized to define the stroke is the length of the latter from the start until a certain point, which will be called s and which, thus, represents a curvilinear coordinate on the stroke itself. This latter variable has then a value of 0 for w=0 and it has a value equal to the entire length of the stroke for w=l . Obviously, there are conversion functions between s, w, and (i, t), wherein i designates the i-th quadratic (i=0 designates the first quadratic of the sequence, i=N-l designates the last quadratic). In particular, given a stroke composed by N quadratics, the formula to calculate w starting from the pair (i, t) is: w = [i+t]/N
As the properties and the descriptive equations of the Bezier curves are well known to the person skilled in the art, one will not further dwell upon these aspects.
The method of the invention will be now described by referring to an implementation thereof in a specific tool of the above mentioned graphic processing program for implementing animated cartoons. Such tool, which can be defined "pinch", allows indeed the user to "hook", typically by means of a mouse "click", any point of the stroke reproduced on the screen and to deform the stroke itself by means of a dragging operation of the locked point with the mouse, while keeping pressed the button, in a very intuitive way.
By referring to figure 1, a first method step provides indeed that the user select on the screen the image portion, that is in the present example the stroke tract, to be modified. Such selection is performed by detecting the D point of the portion itself which will have to undergo the maximum deformation or a point on the screen in the proximity thereof.
Once identified the coordinates of the D point selected on the screen, among all the strokes of the drawing which is being made by the user the stroke the distance of which from D is the smallest one is detected. Once such stroke is detected, the value Wmin of the w parameter is calculated at which such minimum occurs, that is the point of the approximating quadratic coπesponding to the mimmum value.
Since either the detection of the nearest stroke or the wmt„ calculation can be implemented by means of modes and algorithms well known to a person skilled in the art, one will not further dwell upon these aspects.
Further to said selection, the method also provides the automatic addition of one or preferably more local control points of the curve or curves which locally approximate the stroke, that is the addition of control points about the stroke maximum deformation point.
The specific adding modes of such control points provided in the present embodiment will be now illustrated in detail. The method provides the use of an / function for adding control points which receives as input variables an identifier of the specific K stroke to be deformed (and thus the relative approximating equations), the above-mentioned wmi„ coordinate (or the corresponding value of smin curvilinear coordinate) and a so-called def deforming function which will be defined shortly. The output of the / function is the mathematic expression approximating an "enriched" K' stroke defined as a function of the input parameters, that is:
K.' =f(K, wmin, def)
The above-mentioned def deformer depends upon the specific modification tool which is being used (the pinch, in the present case) and it comprises a set of sub- functions or procedures. Each of latter ones defines a deformation rule of a stroke such that the deformation itself does not occur in the selected D point only, but also in a stroke portion about D and according to a pre-set rule of distribution of the deformation decreasing from the D point towards the ends of the portion itself. The specific pattern of the deformation and the extension of the deformed region vary according to the specific function or procedure of the def deformer used. For example, in the context of the pinch tool, it is provided the use of a def function which provides to the deformation a Gaussian pattern with peak in the D point, as it is highlighted in figure 1. Such def deformer further provides as pre-set parameter - and which can be modified by the user before the deformation - the (maximum) size of the region involved by the deformation, which can be defined as "tool size" TS. In case of the pinch tool, the TS variable defines the length of the stroke portion about the D point involved by the deformation. hi order to calculate the control points to be added, each deformer e/provides, given the D point and the ds distance therefrom of the points belonging to the region to be deformed (still in s curvilinear coordinates), the deformation percentage to be applied with respect to the maximum in D.
Another parameter provided by the def deformer is the mindw minimum entity of percentage deformation of the stroke, expressed for example in terms of variation of the relative w parameter, for which it is necessary to add a local control point. The value of such parameter, which is generally constant for a given modification tool, typically varies from tool to tool. Such value can also be set in an empiric way by means of a tool using test of the kind usually carried out by a person skilled in the art. In order to better illustrate what has been above described, in figure 1 the effect of applying the above mentioned pinch tool to the K stroke is represented in a schematic way and by simple way of example, such figure, the Do and Di points on the K stroke define the edges of the region involved by the deformation.
Starting from the def data mentioned sofar, the method provides, by means of the / function, the calculation of an appropriate running pitch ? of the K stroke in order to add local control points. Such pitch p is proportional to the pixel size on the screen and in particular it depends upon the specific display modes of the stroke. If, for example, the manipulation tool is applied on the stroke while it is displayed in so- called "zoom out", that is with reduced sizes, the curve can be sampled with a relative large pitch, as it is required a less precision in the deformation, and viceversa if, on the contrary, the image displayed is being enlarged by a "zoom in".
Therefore, if / is the total length of the stroke tract to be deformed (that is the "tool size" ts), the pitch/? is equal to: p = (constxpixelSize) 11, wherein pixelSize is the pixel size and const is a constant which can be chosen in an empiric way and which, in normal display modes (that is with pixelsize = 1), must be smaller than /. const is thus a positive value smaller than 1.
The K curve is then scanned with a sampling rate p, calculating the deformation difference between a sampled point and the subsequent point in terms of dw difference of percentage variation of parameter w between the two points of the stroke after the deformation. If such difference is greater than mindw, it is then necessary to add a local control point at a point with curvilinear coordinate comprised between (sAds) and (sn+ds+p), wherein so designates the curvilinear X- axis of the D selected point.
The control point is added in the point with curvilinear coordinate (so+ds ") having the minimum value of ds ', with dsj <ds '<p, for which the dw>mindw condition takes place for the first time.
In other words, given a small, positive, at will entity ε and defined getDeforAm a function that provides as output the percentage deformation at a specific point of the region involved by the deformation, the ds' which is looked for is such that, by defining: dw ' = getDeforAm(def K, s,, so+ds ') - getDeforAm(def K, SD, SD+ds) and dw " = getDeforAm(def, K, SD, s +ds '-ε) - getDeforAm(def K, SD, s^+ds), be dw ' > mindw and dw" < mindw.
Thus, by calling the sub-function which calculates such ds' value, as findMinDs for simplicity, it is obtained that: ds ' — findMinDs(def, K, sp, ds, ds+p, ε). ε defines thus an eπor and the value thereof can be set in an arbitrary way by the program according to the tool kind to be implemented. The ε value can also be made modifiable by the user and/or adaptively modifiable by the program to obtain a better approximation. The choice of such value, apart from modifying the modifying precision, has a not negligible impact on the algorithm execution speed, since for lower values of ε there will be a larger number of additional control points, and therefore more calculation time for the actual modification of the stroke and for the subsequent elimination of the exceeding control points (see below).
Once calculated ds ', the method provides the generation of a new local confrol point corresponding, indeed, to the point with curvilinear coordinate (so+ds "). To this purpose, the De Casteljeu algorithm is used, well known to a skilled in the art.
The sampling of the K stroke and the insertion of local control points about D continues then starting from the new point of curvilinear coordinate (so+ds ') until reaching the extreme point of the curve portion to be modified.
In the subsequent method step, the K' enriched stroke is actually deformed, the absolute entity of the deformation being determined by the user. For example, in case of the pinch tool such entity coπesponds to the entity of the space on the screen covered by the cursor driven by the user. In figure 1, the I arrow at full tract schematizes indeed such user's input, provided, as said above, by dragging the mouse while keeping pressed the button.
The descriptive mathematic expression of the deformed stroke, designated with K ef in figure 1, is obviously obtained starting from the equations which define the sfroke enriched by the additional local control points.
The specific modes for handling the deformation depend upon the used specific modifying tool and, anyway, they are within the knowledge of a skilled in the art. Therefore, one will not further dwell upon this step.
Once performed the deformation, in the end step of the process, the added local control points are eliminated by re-sampling and interpolating the curve, i case of the pinch tool considered sofar, such elimination step starts with the releasing of the mouse button by the user at the end of dragging. In the present embodiment, the elimination of the control points is carried out by means of a function which receives as input the descriptive equations of the K' enriched stroke and the coordinates of the two points D0 and Di on the stroke which define the edges of the region involved by the deformation and which thus represent the points within which the reduction has to be made. The function detects the sub-sequence of quadratic curves approximating the K' stroke in the segment comprised between D0 and Di. h general, D0 and Di will lie on the stroke near intermediate points of two quadratics which constitute the stroke. The involved quadratics are then divided into two quadratics, by utilizing the already mentioned De Casteljeu algorithm, so that D0 and Di fall at the beginning and at the end of a quadratic of the sub-sequence, respectively.
At this point, according to conventional modes, the sequence of quadratics is run with an appropriate sampling step, by obtaining a sequence of points for the new interpolation and the interpolation itself is performed.
The sampling step is chosen according to conventional modes and in particular so that it is small enough to allow a satisfying approximation of the deformed stroke.
For the interpolation the Schneider algorithm can be used for example (see for example: P. Schneider, "An algorithm for automatically fitting digitized curves", Graphic Gems, pages 612-626, 1990), already known in literature to this purpose. Such algorithm receives as input a sequence of sampling points and the eπor wished on the interpolation and it returns as output a sequence of interpolating quadratics.
Once obtained the new sequence of quadratics (which, generally, will be formed by a lower number of quadratics compared to the original sequence approximating the K' enriched sfroke), the respective equations in the mathematic expression approximating the deformed stroke are replaced, by obtaining the desired reduction of the control points.
It is to be noted that the just described step of reducing the control points does not necessarily involve the elimination of all or only of the local control points added before the deformation. For example, in case the deformation has produced a "simpler" end curve (for example, less convoluted or articulated) than the initial one, the control points at the end of the elimination step could be in lower number with respect to those utilized to describe the initial stroke. Nice versa, in case of an end curve more complex than the initial one, the number of control points at the end of the elimination step could be higher than the one related to the starting stroke K, although it is lower than the number of the control points of the enriched stroke K'. In other words, once inserted the additional confrol points, they are treated in the same way as the original ones (and indeed there is no way to distinguish them) and the elimination step simply eliminates all redundant points with respect to the wished approximation level. It will be understood that the present invention may be subject to several embodiment variants alternative to the ones described sofar, some of which are briefly illustrated hereinafter by referring only to the aspects which differentiate them from the embodiments considered sofar.
First of all, it is possible to represent the stroke by means of primitive curves different from Bezier quadratic curves, for example by means of Bezier cubic curves, splines, B-splines and any other vectorial representation based upon control points.
Furthermore, the invention method can be advantageously implemented in several tools of graphic processing alternative to the "pinch" tool considered above. For example, the method can be utilized in a tool, which could be called "bender", which allows the user to trace a segment on the screen and to rotate it and wherein the curves crossed by the traced segment are modified, following the rotation thereof, in the following manner: the curves on one side of the segment remain still, the curves on the other side follow the segment by properly deforming. Such tool allows thus the creation of "elbow"-like deformations. In such "bender" tool, the invention method is obviously used for deforming the curves intersected by the segment.
An additional tool of graphic processing which can exploit the invention method is a tool, which could be called "magnet", which allows the user to move a circular area on the screen, after which movement, by pressing the mouse button, the curves inside the circular area are deformed by following the movement direction. In this case, the above-mentioned "tool size" is defined by the size of the circle in the magnet.
It will be better appreciated at this point that the method of the invention allows an efficient manipulation of vectorial curves and a deformation mode intuitive for the user.
* * *
A method for filling regions (the so-called "fill") of vectorial images defined by relative curves will be now described, which filling method can be efficiently associated with the method for deforming a vectorial curve considered sofar. For the description of such filling method, the same definitions and nomenclature already introduced above in the description of the curve deformation algorithm will be utilized. Furthermore, we will assume that the curves, and in particular in the present example the strokes, be represented by means of the same mathematic expressions already introduced.
Shortly, the subject filling method allows to detect the regions encompassed by a set of curves and to keep the filling information associated to each region upon varying the shape and kind of the region itself and upon varying the number of regions. The subject method will be described by referring to a specific application thereof for colouring closed drawing regions delimited by stroke(s).
First of all, hereinafter a definition of the "region" entity valid in the present context is provided. Given an image represented in vectorial mode and simply consisting in a sequence of curves, a region of such image is wholly defined by a sequence of branches, wherein under branch a "side" of the region itself is meant to be designated, which side is obviously constituted by a curve portion, a stroke in the present example. In order to identify such stroke portion which constitutes a region branch, it is sufficient to determine the values of the w parameter (already introduced above) at the two ends of the branch itself. Such values will be designated hereinafter, preferably expressed in double precision, by wb (conventionally associated to the initial end) and we (conventionally associated to the final end), respectively. Therefore, an R region is identified by a sequence of triads of the kind (S, wb, we), wherein S designates an image sfroke and wb and we are the relative values which define the branch on the stroke S. Therefore, if a region R is encompassed by M stroke, it could be written:
R = {(So, WbO, Weθ), (Si, Wbl, Weι), ..., (S(M-l), Wb(M-l), We(M-l))} . Since the final point of the z'-th branch coincides with the initial one of the (z+l)th branch, the relation: S,{wei) = Sι+ι Wb(i+i) will be valid, wherein S(w) designates the coordinates (x, y) of the point on the stroke S corresponding to a certain value of the parameter w.
Furthermore, since the involved regions in the present context are necessarily closed, there will be also: S(M-I) (we(M-ιj) = So(ww)-
A region can also have the same stroke repeated more times. Furthermore, even regions formed by a single stroke can exist, which stroke self-intersects in one or more points. For example, a loop-region C formed by a single stroke which self- intersects in a single point is defined by one single triad, and precisely: C= {(So, Wbo, Weo)} , with Wbo different from weo .
As said above, in a vectorial image constituted by a sequence of strokes, such strokes will have a set of mutual intersections. A first step of the filling method here proposed provides thus the detection and the organization of such intersections among strokes, as first step to detect regions.
To this purpose, the filling method here considered provides the construction and the continuous updating of an intermediate data structure for the structured storing of information related to the intersections among strokes. A possible embodiment of such structure, which hereinafter will be cited as ID (from "IntersectionData"), is described hereinafter.
First of all, an intersection is here defined as point P of (xp, yp) coordinates which a certain number of strokes converge. K strokes intersect in point P if k values w exist such that: So(w0) = S/(w;) = .... = Sk(w/c) = (xP, yP). The structure ID can be implemented under the form of a list of all the intersections present in the image. Of course, the ID structure can also be implemented by means of a type of data structure alternative to the list and apt to contain the information in question. In the present embodiment, the creation of a structure ID in the form of a list for each single image is provided.
Still in the present embodiment, each intersection, in turn, is represented as a list of all the stroke branches which converge to the intersection. Each branch, in turn, is identified, apart from the belonging sfroke, also by the value of parameter w which corresponds to the point wherein the stroke passes through the intersection. It will be understood that if a stroke passes through the intersection, it will have two distinct branches belonging thereto. By attributing a running versus to the stroke, for example the one going from w=0 to w= , such two branches will be one at the inlet of the intersection and one at the outlet thereof. In the definition of a closed region, each of such branches will belong to two different intersections, in one thereof it will be the inlet branch whereas in the other one it will be the outlet branch.
In the present example, the representation of each branch stored in the list of a certain intersection also contains a pointer to the corresponding representation of the branch itself in the other intersection involving the same branch. If the branch is not involved by more than one intersection, then the abovementioned pointer is null. Each branch appears in one or two different intersections.
Thus, it can be said that each branch belonging to an intersection is identified by a combination of four values, that is: (S, w,-, v, u), wherein w,- designates the value of the parameter w at which the intersection occurs, v the running versus of the stroke S (and thus a boolean value, which designates if the branch enters or leaves the intersection) and u a pointer to the other possible intersection which contains the same branch.
The branch list related to an intersection can be ordered so that the various branches are run clockwise or counterclockwise with respect to the intersection itself. Obviously, if an intersection has only two branches, it is not important the order in which they are ordered in the list.
To make clear the concepts just described, figure 2 shows an example of a simple image constituted by three strokes and four intersections and in figure 3 the resulting relative structure ID is schematically shown. The I1} I2, 13 and Lt letters each identify the list related to the respective intersection. Each of such lists, in turn, contains a data element - or "record" - for each branch involved by the intersection and each branch record comprises four fields, which, in the order, represent the relative stroke, the Wi value, a boolean value which indicates if the stroke is as inlet or outlet of the intersection and a reference to the other possible intersection related to the branch itself. Furthermore, to each branch record a label of the "Rab" kind, which identifies the record itself, is assigned.
In order to construct the structure ID, for each pair of strokes the possible mutual intersections are calculated. Such calculation is made also between a stroke and itself, to identify possible self-intersections. The calculation modes of such intersections are within the common knowledgeof a person skilled in the art, and one will not further dwell upon this aspect. However, since the known algorithms for the calculation of the intersections are quite expensive in terms of time, to speed up the procedure, before calculating the intersections between the real strokes it is checked whether the so-called "bounding box" of the involved stroke intersect, wherein under "bounding box" of a stroke the smallest rectangle which contains it is meant. In case such check gives negative result, surely there is no intersection between the relative strokes, and therefore the calculation procedure of the intersections is not carried out. The intersection between two bounding boxes is simply the geometrical intersection between two rectangles on the plane. For each intersection calculated between a pair of strokes, it is checked whether in the ID structure an intersection of (xp, vp) coordinates equal to the one just detected already exists. In the negative case, a new list related to the new intersection is created, comprising a number of branch records which depends upon the w; value of the strokes involved by the found intersection. In particular, if the intersection takes place at one end of a certain stroke, that is if wr=0 or w,=l, for that stroke a single branch record is created, otherwise two of them are created. Therefore, a "new" intersection has from a minimum of two branch records (as in Ii in the example of figure 3) to a maximum of four branch records (as in I2 still in the example of figure 3). Conventionally, in the present example a registration order of the branch records has been chosen so that the branches themselves are run counterclockwise. To this purpose, the record related to a first branch Su involved by the intersection and the record of the other branch S2 are inserted in the relative list. Depending upon the w intersection value thereof, each branch is inserted twice or once. In the worse case, that is when four branches have to be inserted, they are put in the following order: Su(in) Si2(in) Sn(out) S (out), that is alternated. Then, for the first two inserted branches, the tangent in the intersection point of the branches themselves is calculated and the outer product between the versors of such tangents is carried out. If such product has a negative value, this means that the branches are ordered clockwise and the list has then to be reverted. On the contrary, if the intersection already exists (case which happens, in the example of figure 3, for the third and fourth record of I0), the branch (if wr=0 or wt =1) or the two new branches in the preexisting structure are to be inserted. To perform such insertion so that the counterclockwise order is observed, one of the two branches to be inserted is taken and the above mentioned outer product between it and each branch preexisting in the list portion is made, until the outer product with one of such preexisting branches has a sign change with respect to the preceding branch. As soon as such this occurs, the new branch inserts between the two branches therebetween the sign change occurs. The possible other new branch inserts simply in position diametrically opposed with respect to the already inserted one. At this point of the filling method, the ID structure is filled up except for the fourth field of the branch records. To fill such field, the whole structure is scrolled, intersection by intersection and record by record, and, if such field is empty, among the records not yet examined the one referring to the same stroke, opposed versus (in/out), and the w,- value closer to the w,- value of the record under examination are searched. Once found such record, the fourth field of the current record is assigned a pointer thereto and the fourth field of the found record is assigned a pointer to the current record.
At this point the ID structure is complete.
The subsequent step consists in eliminating from the ID structure those branches which surely do not belong to valid regions, that is closed regions. Such branches will be called "dead branches". Such dead branches thus are those having one of the two edges belonging to one intersection, and which thus have the fourth field (u) empty (as the Ro0 record in the example of figure 3). Once eliminated such dead branches, the relative intersections could be no more valid and this happens in the following two cases:
■ the intersection, after the elimination, has one single branch;
the intersection, after the elimination, has two branches which refer to the same stroke with the same w,- value (if the w; value were different, the intersection would be valid and would be a loop intersection).
In both cases mentioned above, the intersection is removed, hi particular in the first one of the mentioned cases the u field of the coπesponding branch record of the adjacent intersection will have to be put to 0, thus creating a new dead branch and making the algorithm to reiterate. On the contrary, in the second of the mentioned cases, the relative intersection is simply removed and the u fields of the two adjacent intersections are properly modified so as to point one to the other.
In figures 4A to 4G a practical example of the removal of dead branches and intersections performed according to the modes just described is shown. In such figures, the dead branch and the intersections to be eliminated at each step are represented in hatched. In particular: figure 4A refers to the removal of two dead branches, each one belonging to one single intersection; figure 4B refers to the subsequent elimination of an intersection involved by one single branch; figure 4C refers to the consequent removal of one of the remaining dead branches; figure 4D refers to the removal of an intersection having one single branch, in a situation similar to the one of figure 4B; figure 4E refers to the elimination of the last remained dead branch; figure 4F shows the removal of a residual fictitious intersection; and at last figure 4G shows the region defined at the end of all above- mentioned operations of removing dead branches and intersections.
Actually, the method preferably does not provide a real elimination of the above mentioned dead branches and "fictitious" intersections, but a marking thereof apt to cause that they be ignored in the subsequent calculation of regions. The reason of such failed elimination is that the ID structure is kept updated even in the subsequent additional image changes, which additional change can involve the removal and/or adding of stroke and then make valid again the fictitious intersections and dead branches.
Once constructed the ID structure, the method provides the actual calculation of the regions. Such calculation follows the following operating scheme:
(1) scrolling of the ID structure; (2) creation of a new empty region if a certain record of the ID structure has not been visited before;
(3) marking of the record as visited and passage to the record pointed to the u field of the current record; (4) insertion in the branch region (S, v we), with S equal to the one of the current record, Wb equal to the one of the current record and we equal to the one of the pointed record (see point (3));
(5) passage to the subsequent record in the list related to the intersection; if the record is the last one in the list, one passes to the first record; (6) checking of the record identifier: if it is a record equal to the initial one of point
(2), the region is finished and one goes back to point (1); otherwise one passes to point (3).
By applying such scheme to create a new Rego region in the example of figure 3, and by keeping in mind that the first record is ROl since ROO has been eliminated as relative to a dead branch, a sequence of operations is obtained of the kind:
(a) one marks ROl and passes to R10 (u field of ROl); the R01-R10 pair defines the branch (S2, 0.4, 1.0) of the Rego region;
(b) from R10 one passes to the subsequent in the list, that is Rl 1;
(c) one marks Rll and one passes to R21; the R11-R21 pair defines the branch (S;, 0.0, 0.5) of the Rego region;
(d) from R21 one passes to the subsequent in the list, that is R22;
(e) one marks R22 and passes to R31; the R22-R31 pair defines the branch (So, 0.3, 0.6) of the Re o region;
(f) from R31 one passes to the subsequent in the list, that is R32; (g) one marks R32 and passes to R03; the R32-R03 pair defines the branch (So,
0.6, 1.0) of the Rego region;
(h) from R10 one passes to the subsequent in the list, that is ROl (the list is circular);
(i) ROl is already marked, the Rego region is thus completed and is stored. With the above (a)-(i) iteration the Rego region composed by the following four branches has been thus created:
Rego = (S2, 0.4, 1.0)→(S;, 0.0, 0.5)->(S0, 0.3, 0.6)- (So, 0.6, 1.0).
In figure 5, Rego is the most outer region encompassing the whole drawing.
The next not marked record is R02. By applying the scheme (l)-(6) shown above the branch records: R02, R20, R21, Rl 1, R10 and ROl are visited in sequence, obtaining the region:
Regi = (So, 0.0, 0.3) → (Si, 0.5, 0.0) → (S2, 1.0, 0.4) The next not marked record is R03. By applying the algorithm the branches: R03, R32, R30, R23, R20 and R02 are visited in sequence, obtaining the region: Reg2 = (So, 1.0, 0.6) → (S 1.0, 0.5) → (S0, 0.3, 0.0)
The next not marked record is R23. By applying the algorithm the branches: R23, R30, R31 and R22 are visited in sequence, obtaining the region: Reg3 = (Si, 0.5, 1.0) → (So, 0.6, 0.3)
At this point, all records have been marked and the iterative algorithm ends.
In figure 5, the Rego, Regi, Reg2 and Reg3 regions are highlighted.
It will be understood that each region can be stored directly as sequence of pointers to the branch records, instead of as sequence of triads of the kind (S, Wb, we). For example, the region Regiof the example shown above can be represented in a manner wholly equivalent as: Regi = (R02, R21, R10), and the same can be said for all other regions introduced sofar.
The creation of the structure of regions will be now described.
As one understands from what illustrated sofar, the regions detected in the preceding step are the real regions of the image plus a "global" region Re o which encompasses the whole image. Generally, if the image is composed by different disjointed parts, each of such parts will have a global region encompassing it.
Since the global region or the regions do not interest for the filling, the present method provides that they are recognized and removed.
The feature to recognize the global region(s) with respect to the other regions is that whereas these latter are run clockwise, the global region(s) are run counterclockwise, as shown by figure 5. Such features causes that, by calculating the region area utilizing the known formula for calculate a polygon area (by previous sampling of the perimeter of each region to obtain a polygon): area = ∑(y.+yi +ι)*( Xi-x,+ι), wherein (XJ, yi) are the coordinates of the i-th point of the polygon, for the global regions the area has a negative value.
At this point, the regions can be organized into a structure which considers possible inclusions. In the present embodiment, a region is judged included into another one if each point of the first one is inside the second one and if the contour of the first one does not touch the second one. The second condition makes the first one weaker: in fact, it is sufficient that a single point of the first one is inside, that all the points thereof are inside too. To perform this inclusion assessment, the filling method comprises a function which accepts as input two regions and returns as output an assessment of the inclusion. Such function can be implemented immediately for a person skilled in the art and thus one will not further dwell upon the description thereof.
The filling method provides then a step of organizing the regions into a tree-like structure, wherein each tree node represents a region and wherein a region is daughter of another one if it is contained therein and if no other region contains it. If this last condition were verified, the containing region, in turn, would be contained into the first region, and it would be a daughter region too.
In figure 6A a simplifying image is schematically represented, divided into R0-R5 regions and in figure 6B the tree resulting from the application of the step of the method step just described to an image Image is schematically represented. The tree- like structure is necessary for displaying on screen the colored regions by utilizing standard image display libraries (such for example the openGl standard multi- platform (the definition thereof is available on the site www.opengl.org).
Based upon the calculation of all regions and upon the determination of the structure thereof as illustrated sofar, the method provides then the coloring of the regions themselves. The modes for assigning a color to each of such regions will be now illustrated.
According to the innovative filling method shown here, the color is treated as an attribute not simply associated to a region, but, instead, assigned to each branch defining the region itself. To this purpose, the records of the ID structure are made apt to represent such branches with the assigned colors. It is important noting that the branch (S, Wb, we) is, generally, different from the branch (S, we,_ Wb), since each branch can have a different color on each of its "banks", that is of its sides or longitudinal margins, since each of such banks can face a respective, different region and the order of we> b values provides the indication about which bank is being considered.
The record structure of each branch in the ID structure as defined above is then modified by adding an additional (fifth, in the present example) field which contains the color information. It will be understood that such modification of the ID structure is shown at this point of the treatment only to explain more clearly, but practically the ID structure can be directly conceived as from the beginning with five or more fields for each branch.
Therefore, the record identified above as (S, w, v, u) will include in reality an additional c field too, thus it can be denoted as: (S, w, v, u, c).
Generally, the filling method here illustrated provides that, to each branch, information related to all colors of the regions delimited by the branch itself be associated.
According to the method here described, when the user selects a region, typically by means of a mouse "click" inside the region itself, the region is filled with the current color. To obtain this, first of all the method provides the detection of the region containing the coordinates of the click point, and thus the application of a coloring function which accepts as input the Reg region to be colored and the current color and which fixes the color for the Reg region. This last function simply scrolls the list of branch records which represent the Reg region and sets the fifth field c of such records equal to the value of the current color.
In the figures 7 A and 7B, the image of the example of figure 2 is proposed again, this time filled with the color and with the relative ID structure modified to receive the color information, hi figure 7B, the records remained uncolored refer to dead branches or global regions.
In figure 8, an exemplifying representation of the color assignment of the regions to the branch records is provided, by referring to the branches of the S/ stroke. Based upon what illustrated sofar, in order to know which is the color associated to one region, in principle line it would suffice reading the associated color to any branch record constituting it. However, as it will be soon illustrated, after canceling, modifying or adding stroke to the drawing the region can be formed by a mixture of not colored and colored records, and even by records formed by different colors. In the example of figure 7A, this last case would occur if the Si stroke was removed. In such case, in fact, the two Reg2 and Reg3 regions would fuse into a new region, with records with different colors. As a precise rule can exist establishing which color is the "right" one, when, after a request of the color attribute of a region, a case of "mixed" colors occurs, the method provides the assignment to the region of the first color found in the branch record list, which color is assigned also to all other branch records involving the region in question.
As it will be clear by the preceding description as well as by the following examples, with the filling method described sofar it is possible keeping all preexisting colour information, and at the same time avoiding to perform again the most expensive parts associated to the modification algorithms of the curves which define the coloured regions.
The canceling modes and adding modes of a stroke to an image already filled according to the method here illustrated will be now described. When a stroke is cancelled, the method provides that the ID structure is run by canceling all the records related to the stroke in question. Once done this, all dead branches and the fictitious intersections, which have possibly created after the branch removal, are cancelled (actually marked, as seen above). Such cancellation of the dead branches and of the intersections takes places exactly as previously described. At this point, the method provides that the regions starting from the modified ID structure are recalculated. As already mentioned above, at this point some regions could have more different colors in the relative branch record list. This situation has been already treated above and thus one will not dwell upon it again.
On the contrary, when a new stroke is added, the method provides that the intersections of the added stroke with all the preexisting strokes are calculated. The new obtained intersections are inserted in the structure in the same way as when the ID structure is created ex-novo, and thus the algorithm to be followed is the one already previously described. In particular, the calculation of the dead branches and of the fictitious intersections is remade on the whole ID structure. In fact, the introduction of a new stroke can have made previously discarded branches and intersections valid. Once done this, the method provides that the regions starting from the modified ID structure are calculated again. As already said, some regions could now have some records without color together with other colored ones. This situation too has been treated above and thus one will not dwell upon it again.
The stroke modifying, cutting, copying and gluing modes according to the method here illustrated will be now described.
When a stroke is modified by utilizing anyone of the above mentioned tools, or a deforming tool according to the invention, the method here described allows keeping, as much as possible, the information about filling the region or regions involved by the stroke itself, as illustrated hereinafter.
In the method here described, during the stroke modification, nothing from the point of view of the color information contained in the corresponding branch records is modified. When the stroke modification has ended (typically, this coincides with the releasing of the mouse link button by the user), the method provides the following operations:
I. storing the color information of the original (that is not modified) stroke;
II. removing the original stroke from the ID structure, by invalidating the relative regions;
-TJ. adding the modified stroke in ID, as if it were a new sfroke, and recalculating the relative regions; and
IN. restoring the information about the region filling by means of the color information stored at point I. The operations II. and m. are carried out exactly as explained above by referring, respectively, to the operation of canceling and adding a stroke.
The storing and restoring modes of the information for filling a stroke of the operations I. and IN. are illustrated hereinafter.
During the creation of the ID structure, to each stroke a list of branch records referring to the stroke itself and defining real regions is assigned (that is a list of records having the first field equal to the identifier of the considered stroke). For more clarity, it is to be considered that, in the example of figure 2 or 7A, to the So stroke a list of five branch records is assigned, that is: R02, R03, R22, R31 and R32.
Therefore, the operation I. simply consists in "putting aside" the sequence of records associated to the original stroke. This storing is necessary, as the subsequent operation II. cancels such records from ID.
At the end of the operation HI., to the stroke in question a certain number of new records is associated. Such records could possibly already contain associated filling color information. hi particular, a record will contain already associated filling information in case it belongs to a region formed by strokes not involved by the modification (therefore not cancelled at point IL), and which belonged to a region filled before the modification. It has already been said, in fact, that such filling information is propagated to all branch records of the region, and therefore to the new records of the sfroke added at point DI too.
For those branches which, instead, do not have color attributes in the respective records, the method provides a comparison with the records stored at point I. More specifically, the method provides to proceed in the following way: for each "not colored" branch, the respective Wb and we values are analyzed, and from them he lengths on the stroke in the interesting interval are calculated. Then, in the stored records, the colors present in the identified tract are searched for. Generally, in that tract several colors may be present and the one covering the greatest length is chosen, assigning it to the record. The procedure just described for a single sfroke is valid also for whole groups of sfroke. In this way, this procedure is applied in case the user selects a group of stroke and moves it on the screen, or in case the user cuts a group of stroke and then glues it in other points or on other images and in other situations wherein additions or modifications are made, by wishing to keep the color information.
For example, in case of the typical copy & glue tool, the filling method here described allows to not remove anything from the original image, since it simply allows to copy the stroke with all colored records, and to follow the operations DI. and TV. described above when gluing is performed.
All steps and operations described sofar of the filling method can be implemented by hardware and/or software means and algorithms within the common knowledge of a skilled in the art, and thus one will not further dwell upon the description thereof.
It will be appreciated at this point that what above described represents an effective adaptive filling method of regions of images defined by vectorial curves, which method can be effectively used in programs for graphic processing, and in particular programs for supporting animation.
It will be further appreciated that the filling method described sofar, in its more general definition, provides as main innovative step the association of a piece of information representative of a certain region to each of the single curve branches delimiting the region itself, and keeping such branches even when the image is modified and such branches could belong to new regions or no region.
* * *
The present invention has been sofar described by referring to preferred embodiments. It is to be meant that other embodiment belonging to the same inventive core may exist, all however comprised within the protective scope of the herebelow reported claims.

Claims

Claims
1. Method for manipulating curves (K) described by approximating equations based upon confrol points, comprising the steps of:
(i) generating at least one additional local confrol point at a curve portion (Do - Di) to be deformed, immediately before the deformation of the latter;
(ii) deforming said curve portion (Do - D^; and
(iii) eliminating one or more confrol points immediately after said deformation.
2. The method according to claim 1, wherein said step (i) provides the generation of a plurality of additional local confrol points.
3. The method according to claim 1 or 2, wherein said step (i) provides the determination of the number and/or arrangement of the additional local control point(s) to be generated according to the deformation variation of the curve (K) between adjacent points of the portion to be deformed (Do - Di).
4. The method according to any of the preceding claims, wherein said step (i) provides the use of De Casteljeu algorithm to generate the additional local confrol point(s).
5. The method according to any of the preceding claims, wherein said step (i) provides the definition of a curve region (Do - Di) to be deformed about a point of maximum deformation (D).
6. The method according to the preceding claim, wherein said point of maximum deformation (D) is a point selected by a user on the screen of a computer.
7. The method according to claim 5 or 6, wherein said step (ii) provides that the curve (K) be deformed by applying in the points of said region to be deformed (Do - Di) a deformation of a predetermined percentage amount with respect to the point of maximum deformation (D).
8. The method according to any of the claims 5 to 7, wherein said step (ii) provides that said region to be deformed (Do - Di) be deformed according to a Gaussian deformation distribution defined by a mathematic curve about the point of maximum deformation (D).
9. The method according to any of the preceding claims, wherein said step (i) in turn comprises a sampling step of the curve portion to be deformed (Do - Di), during which sampling step the additional control point(s) is(are) generated.
10. The method according to the preceding claim, wherein the sampling step is carried out according to a sampling rate (p) depending upon the display modes of the curve (K) on the screen.
11. The method according to any of the preceding claims, wherein said step (i) provides the use of a function for adding control points (f) which receives as input the descriptive equations of the curve to be deformed (K) and information defining a point of maximum deformation (D) and a type of deformation (def) to give to the curve (K) and which provides as output descriptive equations of the curve enriched by the additional local control point(s) (K').
12. The method according to any of the preceding claims, wherein the curve to be deformed (K) is approximated by a sequence of quadratic primitives.
13. The method according to any of the preceding claims, wherein the curve to be deformed (K) is approximated by a sequence of Bezier curves of any order.
14. The method according to any of the preceding claims, wherein the curve to be deformed is a drawing tract (K) obtained by means of graphic processing programs.
15. The method according to the preceding claim, comprising, before said step (i), the detection of the curve to be deformed (K) as the curve having minimum distance from a point (D) selected by a user onto the screen of a computer.
16. The method according to the preceding claim, comprising, before said step (i), the detection of the tract of said curve to be deformed (K) having minimum distance from said point (D) selected by the user onto the screen.
17. The method according to any of the preceding claims, wherein said step (iii) provides a re-sampling and a subsequent interpolation on the curve (K') at the deformed portion (D0 - Di).
18. The method according to the preceding claim, wherein said interpolation step provides the use of the Schneider algorithm.
19. The method according to any of the preceding claims, wherein said step (iii) provides the elimination of a number of confrol points depending upon the approximation level desired for the representation of the deformed curve (K<ief).
20. The method according to any of the preceding claims, wherein said step (iii) provides the elimination of a number of control points smaller than the number of control points added in said step (i).
21. The method according to any of the preceding claims, wherein said step (iii) provides the elimination of a number of control points greater than the number of confrol points added in said step (i).
22. A computer program product for graphic processing directly loadable into the internal memory of a digital computer, comprising software code portions for performing the method steps according to any of the preceding claims when such program is run on a computer.
23. The program according to the preceding claim, comprising program means readable by a computer for determining the extension (TS) of the portion (Do - Di) of curve (K) involved in the deformation.
24. The program according to the preceding claim, comprising program means readable by a computer to allow the modification of said extension (TS) by the end user.
25. The program according to claim 23 or 24, comprising program means readable by a computer to allow an adaptive modification of said extension (TS).
26. The program according to any of the claims 22 to 25, comprising program means readable by a computer to determine the number and/or the aπangement of the additional local confrol point(s) to be generated according to the deformation variation of the curve (K) between adjacent points of the portion to be deformed (Do - Di), which means is apt to allow a modification by the end user of the minimum entity of said variation starting from which it is necessary to add a local confrol point.
27. The program according to any of the claims 22 to 26, comprising program means readable by a computer to determine the number and/or arrangement of the additional local control point(s) to be generated according to the deformation variation of the curve (K) between adjacent points (D0 - Di) of the portion to be deformed, which means is apt to allow an adaptive modification of the minimum entity of said variation starting from which it is necessary to add a local control point.
28. The program according to any of the claims 22 to 27, comprising a graphic tool apt to allow a user to lock with a cursor one point (D) of a curve reproduced on the screen (K) and to deform the curve itself by dragging the locked point (D), wherein said deformation is performed according to the deformation method according to any of the claims 1 to 21.
29. The program according to the preceding claim, wherein said graphic tool comprises means for allowing an end user to lock said curve point (D) by means of a mouse "click".
30. The program according to any of the claims 22 to 29, stored on a medium readable by a computer.
31. A computer system, comprising means for implementing the steps of the method according to any of the claims 1 to 21.
PCT/IT2003/000281 2003-05-09 2003-05-09 Method for manipulating vectorial curves WO2004100071A1 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/IT2003/000281 WO2004100071A1 (en) 2003-05-09 2003-05-09 Method for manipulating vectorial curves
EP03727944A EP1623384A1 (en) 2003-05-09 2003-05-09 Method for manipulating vectorial curves
AU2003233189A AU2003233189A1 (en) 2003-05-09 2003-05-09 Method for manipulating vectorial curves

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/IT2003/000281 WO2004100071A1 (en) 2003-05-09 2003-05-09 Method for manipulating vectorial curves

Publications (1)

Publication Number Publication Date
WO2004100071A1 true WO2004100071A1 (en) 2004-11-18

Family

ID=33428290

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/IT2003/000281 WO2004100071A1 (en) 2003-05-09 2003-05-09 Method for manipulating vectorial curves

Country Status (3)

Country Link
EP (1) EP1623384A1 (en)
AU (1) AU2003233189A1 (en)
WO (1) WO2004100071A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011080776A1 (en) 2009-12-30 2011-07-07 Telecom Italia S.P.A. . Method for the calculation of the bounding box of vectorial graphic shapes
CN101458818B (en) * 2008-09-26 2011-07-20 深圳市路畅科技有限公司 Graphic data compression processing method based on folding line evacuating algorithm
US9418454B1 (en) 2015-07-23 2016-08-16 Axure Software Solutions, Inc. Generating markup encodings for the compact rendering of curves in interactive graphical designs

Non-Patent Citations (7)

* Cited by examiner, † Cited by third party
Title
BORREL P ET AL: "SIMPLE CONSTRAINED DEFORMATIONS FOR GEOMETRIC MODELING AND INTERACTIVE DESIGN", ACM TRANSACTIONS ON GRAPHICS, ASSOCIATION FOR COMPUTING MACHINERY, NEW YORK, US, vol. 13, no. 2, 1 April 1994 (1994-04-01), pages 137 - 155, XP000461728, ISSN: 0730-0301 *
COLETTE J. MULLENHOFF: "physically-based b-spline surface sculpting", MASTER OF SCIENCE THESIS, 1 December 1998 (1998-12-01), utah. usa, pages 1 - 68, XP002259674, Retrieved from the Internet <URL:www.cs.utah.edu/gdc/publications/ papers/cmullen_thesis.pdf> [retrieved on 20031029] *
HSU W M ET AL: "DIRECT MANIPULATION OF FREE-FORM DEFORMATIONS", COMPUTER GRAPHICS, NEW YORK, NY, US, vol. 26, no. 2, July 1992 (1992-07-01), pages 177 - 184, XP008011515, ISSN: 0097-8930 *
IMINE M ET AL: "A new approach in polynomial and Bezier parametric piecewise modeling", COMPUTER NETWORKS AND ISDN SYSTEMS, NORTH HOLLAND PUBLISHING. AMSTERDAM, NL, vol. 29, no. 14, 1 October 1997 (1997-10-01), pages 1559 - 1570, XP004099458, ISSN: 0169-7552 *
QUNSHENG PENG ET AL: "Arc-length-based axial deformation and length preserved animation", COMPUTER ANIMATION '97 GENEVA, SWITZERLAND 5-6 JUNE 1997, LOS ALAMITOS, CA, USA,IEEE COPUT. SOC. P, US, 5 June 1997 (1997-06-05), pages 86 - 92, XP010227325, ISBN: 0-8186-7984-0 *
See also references of EP1623384A1 *
SNIBBE S S: "A direct manipulation interface for 3D computer animation", EUROGRAPHICS '95, MAASTRICHT, NETHERLANDS, 18 AUG.-1 SEPT. 1995, vol. 14, no. 3, Computer Graphics Forum, 1995, UK, pages C/271 - 83, XP002259675, ISSN: 0167-7055 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101458818B (en) * 2008-09-26 2011-07-20 深圳市路畅科技有限公司 Graphic data compression processing method based on folding line evacuating algorithm
WO2011080776A1 (en) 2009-12-30 2011-07-07 Telecom Italia S.P.A. . Method for the calculation of the bounding box of vectorial graphic shapes
US9013487B2 (en) 2009-12-30 2015-04-21 Telecom Italia S.P.A. Method for the calculation of the bounding box of vectorial graphic shapes
US9418454B1 (en) 2015-07-23 2016-08-16 Axure Software Solutions, Inc. Generating markup encodings for the compact rendering of curves in interactive graphical designs

Also Published As

Publication number Publication date
AU2003233189A1 (en) 2004-11-26
EP1623384A1 (en) 2006-02-08

Similar Documents

Publication Publication Date Title
US20180374184A1 (en) Methods and apparatuses for providing a hardware accelerated web engine
Diepstraten et al. Transparency in interactive technical illustrations
US6483519B1 (en) Processing graphic objects for fast rasterised rendering
AU2006236289B2 (en) Techniques and workflows for computer graphics animation system
US5058042A (en) Method for employing a hierarchical display list in global rendering
AU742444B2 (en) System and method for modification of the visual characteristics of digital 3D objects
EP1918881B1 (en) Techniques and workflows for computer graphics animation system
US7714866B2 (en) Rendering a simulated vector marker stroke
KR20050030595A (en) Image processing apparatus and method
WO1992009966A1 (en) Image synthesis and processing
JPH06507743A (en) Image synthesis and processing
US11830051B2 (en) System and method for high quality renderings of synthetic views of custom products
KR20050030569A (en) Image processing apparatus and method thereof
Pietriga et al. Representation-independent in-place magnification with sigma lenses
US7184044B2 (en) Electronic drawing viewer
US7916141B2 (en) Image processing system using vector pixel
JP2001134633A5 (en)
EP1623384A1 (en) Method for manipulating vectorial curves
Wicke et al. CSG tree rendering for point-sampled objects
Xu et al. Interactive silhouette rendering for point-based models
CN110517343A (en) A kind of optimization method and system of the program mode texture based on OpenGL shading language
US6603486B1 (en) Electronic drawing data translation
Conversy et al. The svgl toolkit: enabling fast rendering of rich 2D graphics
US8077183B1 (en) Stepmode animation visualization
Isenberg et al. G-strokes: A concept for simplifying line stylization

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NO NZ OM PH PL PT RO RU SC SD SE SG SK SL TJ TM TN TR TT TZ UA UG US UZ VC VN YU ZA ZM ZW

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): GH GM KE LS MW MZ SD SL SZ TZ UG ZM ZW AM AZ BY KG KZ MD RU TJ TM AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IT LU MC NL PT RO SE SI SK TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG

DFPE Request for preliminary examination filed prior to expiration of 19th month from priority date (pct application filed before 20040101)
121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 2003727944

Country of ref document: EP

WWP Wipo information: published in national office

Ref document number: 2003727944

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: JP