Interactive Multireslution Curve Editing Using

Precise curve fitting is an important feature of many computer applications, from statistical analysis cools, co the editors used by font and graphic designers, co the sophisticated computer-aided design/manufacturing environments developed for engineering systems. B-splines are the most widely used curve forms in such applications; composed of piecewise parametric cubic segments, they are notable for their compact representation, computational efficiency and, in particular, the high degree of continuity they enforce between successive curve segments. Such continuity, however, inhibits the freedom with which local, finer resolution editing may be performed on these curves. Refinement is most directly accomplished by inserting knots into the curve, subdividing the curve into a larger number of segments. Mulciresolution analysis, a form of data analysis based on the use of wavelets, offers a means of determining a unique such subdivision of a given curve. The application of chis process is also reversible so chat curve smooching or knot removal operations may be performed with the same economy as refinement operations. Furthermore, the special computational properties of wavelets guarantee chat such shifts of resolution may be performed in time linear with the size of the curve, suggesting chat editing operations on a curve, at a variety of resolutions, may be done at interactive speeds.

ACKNOWLEDGMENT I would like co cake chis opporcunicy co chank che encire faculcy of che Deparcmenc of Com purer Science and Scaciscics ac che U niversicy of Rhode Island, all of whom I have had che honor and che privilege of working wich or learning from ac one rime or anocher over my course of scudy. This has easily been che mosc challenging and, ac che same rime, che mosc rewarding academic experience I have parcicipaced in, and I've parcicipaced in a few. In chis regard, I would in parcicular like co honor Dr. Bala Ravikumar for providing scudencs like myself wich a model example of pacienc incelleccual inquiry and a love for che grand challenge.

PREFACE
Wavelets are mathematical tools, functions satisfying a specific set of properties, which are used to encode information in a different, more practical form. The encoding takes the form of abstracting from the input data set a coarser, average distribution of the data, which is referred to in signal processing parlance as putting the data through a low-pass filter. At the same time, a high-pass filter, the set of wavelet functions d1emselves, is applied to the same input so that the high-contrast data lost from the averaging procedure may be preserved as a sec of detail values. Such a procedure may be recursively reapplied to each successive coarser data set until a desired resolution of the data is reached. The result is termed a wavelet transform of the original data and it contains not only a coarse approximation to the original data sec but the accumulated secs of detail coefficients that apply to that data set at different scales of resolution. These accumulated details may be reapplied to the coarsened data plot to retrieve the behavior of that data at finer scales of resolution.
Such a transformed image of an input data set provides views of that data at a variety of scales, providing a form of "mathematical microscope" [Hubb96]. This tool has been of practical benefit in a surprising variety of scientific disciplines. The term "wavelet" actually arose in connection with geological analysis where seismic plots are analyzed to determine the presence of substrata where regions of oil may occur. Signals and two-dimensional imagery may be "denoised" by abstracting out the high-contrast values using wavelets. The special properties satisfied by wavelets also allow them to be used in probability wave analysis IV in quantum mechanics where they complement more conventional Fourier analysis cools in addressing the restrictions imposed by the uncertainty principle [Hubb96].
Researchers in computer graphics have recently found several practical uses for wavelets in their work, including both theoretical and practical applications in areas such as image compression, image editing and database querying, surface reconstruction from contour plots, and physical simulation for global illumination and animation. (For an excellent survey of chis material, see Scollnitz,et al. [Stol96].) Among chis work is the research presented by Finkelstein and Salesin [Fink94] concerning the application of multiresolution analysis, a set of techniques chat use wavelets co obtain information about a signal at a multitude of scales, to the problem of curve and, by extension, surface representation. In particular, they observe chat the recursively defined structure of multiresolution analysis has an advantageous correspondence with the recursive procedure for subdividing curves (and surfaces) generated by the set of basis functions known as B-splines. The authors claim chat the resulting representation, a multiresolution curve, is a unified framework capable of supporting a variety of editing operations including changing the "sweep" of a curve while maintaining its "character" or detail or, alternately, changing its "character" while maintaining its "sweep", or applying continuous levels of smooching or being able to edit a curve at a continuous level of detail. Furthermore, since a multiresolution decomposition can be obtained in time chat is linear in the size of the input data, in chis case the set of control points for a given curve, the manipulations described above may be performed in real time.
The goal of chis thesis is to construct a working component capable of modeling multiresolution curves and the above operations in an interactive environment. Such a component, written in an object-oriented language, may be placed in a simple application v for editing such curves directly; or it may be readily integrated within a more complex editing environment, such as a CAD/CAM system, where it would offer a subset of a more general set of precise editing tools. We shall place this component within a simple GUIbased application frame in order to verify the claims of the original research that such curve operations may be performed at interactive speeds. Although this thesis does nor extend the theoretical basis of this work, it does enhance its practical utility by realizing the application as a set ofJava class files, making it available to any platform supporting a Java Virtual Machine and, at the same time, making this application available for use as a component in a larger Java-based graphical editing environment.

CURVE REPRESENTATIONS
A curve is essencially a sec of poincs. More precisely, in a cwo-dimensional environmenc, we may refer co a curve as a sec of ordered pairs. Mathematically, this gives us a very precise description of a curve. Bue the enumeration of such a sec, typically drawn from the domain of the real numbers, will be unbounded and of little use in a finite compucacional environmenc. Furthermore, since such a sec is unbounded, ic cannot be exhaustive and a simple enumeration of a sequence of poincs will have no prediccive value for those poincs omined from the lisc. These observations provide the rationale for the procedure of curve fitting which anempcs co find a relation becween an independenc variable and a sec of poincs forming the closest approximation co the given sequence of poincs. This found relation is referred co as a curve representation and provides a more economical means for scoring and describing the behavior of a given curve. In this seccion, we will presenc several forms of curve represencacions, evaluating their respective merits and defects with regard co the range of curves they are capable of modeling.
Before discussing these more economical represencacions, however, ic should be mencioned that a finite sec of points frequently serves as the direct represencacion of a curve in the form of a polygonal line or, in the three-dimensional case, as a polygon mesh [Fole96].
Such modeling is used when the individual daca poincs are themselves subject co direct editing and often where determining an accurate represencacion of the curve or surface may be compucacionally incractable. (We shall see, in face, that the accual rendering procedure used in our application basically draws jusc such a polygonal line connecting a sequence of poims.) The procedures for determining a mulciresolution curve cannot make use of such direct represemacions, however, so we will noc discuss them further.

Functions, Parameuic Curves and Piecewise Polynomial Segments
Since, by definicion, a fancti.on is considered co be a sec of ordered pairs (again, in a cwodimensional environmenc), chis would seem ac firsc glance co sacisfy our basic requiremencs for an economical curve represencacion. A function describes a sec of poincs of che form Functions are also nor rocacionally invarianc (implied somewhac by Figure I) and che descripcion of curves wich vercical cangencs is hampered due co che face char a slope of infinicy is difficulc co represenc [Fole96].
Funccions are somecimes referred co as explicit representati.ons, as opposed co equacions of che form f ( x, y) = 0 which are known as implicit representati.ons [Ange97]. An example of such an equation is the formula x 2 + y 2 -r 2 = 0 which describes the sec of points forming a circle around the origin with radius r. While clearly capable of modeling some curves chat functions are unable co model, such equations are frequently underdetermined and may have more solutions than is practical. le is also difficult to use such forms co model a portion of a curve, say, for example, the cop half of the circle just described, without applying external constraints co the calculation, in chis case constraining y ~ 0 [Ange97,Fole96] .
A form of representation chat overcomes the limitations of both the explicit and implicit forms is the parametric representation, where the elements of each ordered pair (x,y) are in fact functions on an independent variable t, meaning chat a point should more properly be expressed in the form ( x(t), y(t)) . The variable t can be thought of as being plotced on an axis perpendicular to the x,y plane and the two-dimensional curve generated as the projection on chis plane of the track of chis variable as it proceeds along the taxis (see Figure 2) . One advantage of parametric curves is char they replace the use of geometric slopes with parametric tangent vectors, which can never cake on infinite values [Fole96]. This means char ic is possible co cake a single parametric curve, which may prove co be compucacionally difficult as a monolithic curve, and decompose ic into a succession of parametric curve 3 segments. The points where adjacent segments join are referred to as knots. The plotting of the tangent vectors at the endpoints of each segment verifies the continuity of a curve form from segment to segment.
These segments are then individual parametric functions on t, forming a piecewise parametric curve. Computationally, the most convenient way for these segments co approximate a given curve is for each segment to model a.polynomial function in t, typically with values oft on the interval [O, 1]. The simplest such polynomials to compute would be piecewise linear curve segments, but the resulting "curve" would resemble a polygonal line, with typically not very good approximation over the length of a curve segment. Piecewise quadratic segments would be more supple in terms of modeling a given segment but, as we will see shortly, cannot guarantee adequate continuity from segment to segment [Ange97].
In practice, piecewise cubic parametric curves are most often used. Quartic curves are sometimes used in applications where higher-degree derivatives are needed to determine curves and surfaces that are aerodynamically efficient, such as in car and airplane design.
However, these curves require more computation to determine the coefficients of each polynomial term and often produce additional "wiggle" in the representation as well [Fole96].
Where piecewise parametric cubic curves are used, we have four unknown coefficients to determine the curve. There must therefore be four knowns coming into the computation of the curve to solve for these unknown coefficients. The next section examines several piecewise cubic curve representations differentiated by the manner in which these four "knowns" are introduced into the curve solution.

Piecewise Parameuic Cubic Curves
In the following, we shall be presenting alcernace representations of the cubic curve segment q(t) denoted by where 0~t~1. Although we are concerned with two-dimensional curves, che parametric cubic is the lowest-degree curve char is non-planar in three dimensions [Fole96] and ic is useful co indicate char che representations we are describing for two-dimensional curves are available for three-dimensional ones as well. In any event, che functions x(t), y(t) and z(t) are entirely independent of each ocher so, rather than having co find twelve equations co solve for twelve unknowns, we need only co find che four constraints char will determine che four coefficients for each of che equations in q(t). These constraints are known as che control points of che curve segment and che following representations are differentiated by how they make use of chis control information.

Hermite Forms
In all of che following representations, we are seeking a way co calculate che values of che control points pk given a parametric cubic segment with coefficients C1c so char we can reverse che process, i.e.: determine C1c given che control points pk. In che case of che Hermite representation (named for che mathematician), as shown in Figure 3, two of che p'o p~p',

Figure 3: A Hermite curve representation
control points, p 0 and p 3 (they are indexed in chis manner for consistency with the Bezier representation char we will see shortly) , are marked by the accual endpoints of the curve segment. Since ac one end of the segment t = 0 and ac the ocher end t = 1, we have che following values for p 0 and p 3 : The ocher two "points" in chis representation are, accually, two tangent veccors passing through P o and p 3 which correspond co the firsc-order derivatives of the parametric curve segment ac chose poincs (also known as the "velocicy" of the curve). These values, p' 0 and p' 3 are given by the following: We may rewrite these equations in matrix form as the following: We observe that the matrix relating the coefficients to the set of control points in the previous expression is invertible. The inverse of this matrix is called the Hermite geometry matrix MH and thus the formula for the parametric cubic curve is given by Figure 4: Two adjac.cnc Hermite curves.
When two adjacent Hermite segments meet, as shown in Figure 4, not only do the endpoints of the adjacent segments match but the derivatives of both curves at that point match as well. The former condition is termed C 0 continuity and the latter is termed C' continuity. The superscript in both cases corresponds to the order of the derivative both curves share in common at that point. A similar property, G 1 continuity, means that the 7 value of the tangent vector on one curve is proportional to the tangent vector of the neighboring curve.

J.22 Bezier Curves
Like the Hermite representation, the Bezier curve, named after Pierre Bezier, specifies the two endpoints of the segment as control points for the curve. The other two control points, p 1 and p 2 , control the ends of the tangent vectors through the endpoints of the curve. All four control points, then, describe a polygon within which the curve segment spans (see The points p 0 and p 3 have the same relation to the coefficients of the curve as in the Hermite representation. The remaining points, p 1 and p 2 , are used to approximate the tangents at t = 0 and t = 1, respectively. Using linear approximations and relating these to the derivatives of the polynomial, we have the following equations: Taking these equations, we can solve as before to find the Bezier geometry matrix M 8 and so the formula for the cubic Bezier curve is Unlike the Hermite representation, adjacent Bezier curve segments sharing an endpoint will obviously have C 0 continuity but they do not enforce C' continuity since different approximations are used to the left and the right of a join point [Ange97]. However, the Bezier curve satisfies an interesting property known as the convex hull property. To show this, we will first obtain the values for the blending functions of the Bezier curve, which are given by the transpose of the first rwo factors in the computation of q(t) above: The plot of these func~ions over the interval [O,l] is shown in Figure 6. Notice that all of the zeros occur when t = 0 or t = 1. In addition, the value of each function over the interval 3 is ~ 1 and furthermore L bi (1) = 1. This means that the representation of the polynomial i=O is a convex sum and that the entire curve lies within the convex hull described by the polygon formed by the control points of the curve, which is clear from Figure 5 [Ange97,Fole96].

B-splines
The term spline originated with shipbuilding and the _early days of aircraft design and referred co a long lath of wood or metal chat was weighted with metal "ducks". This was done co bend the spline judiciously for the purpose of producing a curve chat could be traced and reproduced and chat exhibited second-order or C 2 continuity [Barc87] . Cubic B-splines also enforce C 2 continuity (which is often referred co as the "acceleration" of the curve) , as we shall see.
B-splines differ from Hermite and Bezier representations in a number of ways. First of all, the curve chat the four control points describe typically does not interpolate (or pass through) any of the control points (see Figure 7a). Secondly, an individual segment muse be considered in the context of its adjacent curve segments since three of the four control points defining a particular curve segment also participate in the· definition of the neighboring segment (see Figure 7b). Thus, each control point in a B-spline representation can influence up co four adjacent curve segments and so, in a curve with m such segments, the number of control points ism+ 3, versus thac of a Bezier or Hermice curve where the number of poincs is 3m + 1.
~~-: Once again, we are inceresced in determining the coefficiencs ck of the sec of polynomials forming the paramecric curve segmenc qi (I) from the sec of concrol poincs p k . Thar is, we are looking for a macrix M such thac P H P i -2 q i -I (I)= [1 I 12 13 Ju P i-2 and qi (I)= [1 I 12 13 Ju P i-! P i -I P i

-
Solving these equations for che coefficients ck gives us che B-spline geometry matrix M: B-splines, like Bezier curves, also satisfy che convex-hull property, as can be seen in

12
We note chat, again, che only zeros occuring over che interval [O, 1] are ac t = 0 and at t = 1 and, in addition, only one blending function accains a zero value. What is more interesting abouc chese functions is char when we juxtapose che blending functions for any adjacent segments wich chose of our firsc segment, we gee che diagram shown in Figure 9. le is clear from chis representation chat every control point has associated wich ic a C 2 piecewise cubic "hac" function, centered over che control point, and chat chis function is che same when shifted and applied co all of che control points in che curve representation. Thus, each curve segment is che sum of che values of each of chese shifted blending functions over ics respective interval. In ocher words, chese blending functions form a basis for che polynomial curves ch us described and in face che "B" in B-spline scands for "basis" [Ange97,Barc87].  Lastly, ic should be noted char, since all of che above representations relate a sec of control points co a sec of coefficients chrough che use of matrix transformations, chis means char we can convert from one representation co anocher using a composition of chese matrices. Thus, all of chese representations are equivalent, chough of varying economy and precision.

13
J .24 Types of B-splines The blending funccions described above are applicable co whar are known as unifonn Bsplines, char is, chose curves in possession of a uniform knor sequence. Such a sequence occurs when each knoc in che curve is uniformly spaced and there are no mulriplicicies or repecirions of a knoc ar a cerrain poinr. This class of B-splines is a special case of che more general form of non-unifonn B-splines, which admic disconrinuicies and mulciplicicies in che knor sequence. We noce char, anycime a knor is repeated, chis has che effect of pulling che curve closer to che corresponding conrrol point. If a multiplicicy of 3 or greater occurs, che knot(s) and control point coincide and che curve inrerpolaces char conrrol point. Under such condicions, che blending functions defined above muse be redefined ar che poinrs chese discontinuicies occur. Boch Foley, er al. [Fole96] and Barrels,er al. [Barr87] describe che sec of recurrences required co redefine che blending functions over che affected inrervals.
Boch uniform and non-uniform B-splines, as described, are invarianr under rorarion, scaling and cranslacion rransformacions. However, such curves are nor invariant under perspective cransformarions. To guaranree chis condicion; che curve muse be defined as a non-unifonn rational B-spline or NU RBS [Ange97,Fole96]. Such a curve plots each component of qi (t) as a ratio between char component paramecric function and anocher parametric function w i (t). The non-rational B-splines we have discussed would chen be modeled as special cases where wi (t) = 1. NURBS are a standard tool in most high-end graphic design environments and chey account for most of che popularicy in che use of Bspline represenrations in such environments.
Wich regard to representing multiresolucion curves, we shall be using endpointinrerpolating B-splines, which are B-splines chat have an overall uniform knot sequence 14 except at the beginning and ending of the rurve where a multiplicity of at least 3 occurs in the sequence. This wilJ necessitate the development of special end-conditions with regard to using the blending (basis) functions but the behavior of the curve away from the ends will be somewhat regular, which will be of great advantage in the final implementation of the mulciresolution engine.

1.3
Curve refinement ' \ [J Figure 10: Editing a B-spline at a lower and higher resolution.
One of the chief advantages of the B-spline representation is the high degree of continuity it enforces between adjacent curve segments. However, this becomes a drawback if local editing of a curve is desired since a single control point may affect up to four adjacent curve segments. The most direct way to overcome chis problem is to refine the curve, introducing more segments into the curve through a procedure for knot insertion, as suggested by Figure 10.
Several algorithms for knot insertion exist in the literature. The simplest may be the deCasceljau algorithm for Bezier curves which consists of first finding the midpoints A, B and C of the three lines forming the control polygon of the curve, then connecting these with the lines AB and BC. Next, find the midpoints of each of these lines. The line connecting these midpoints will also be tangent co the curve and the point at which it contacts the curve is the location of the new knot [Barc87,Fole96].
Farin [Fari88] and Bartels,et al. [Barc87] present some complex algorithms for inserting an arbitrary number of knots into a non-uniform B-spline. These algorithms have some efficiency if a group of knots is inserted at one time but d? not perform as well when a sequence of edits is made. Since any knots may be added or removed from any location, there is also no correspondence between a regime of knot insertions and an increase in the objective "resolution" of the curve.
A scheme that attempts co correlate knot insertions with levels of resolution is the hierarchical B-spline refinement technique proposed by Forsey and Barrels [Fors88]. In this idea, an explicit hierarchical framework designed by the user is deployed co permit the editing of the overall form of a curve while preserving any details it acquired at higher levels of resolution. Besides the problem of maintaining the data structures necessary co model this hierarchy, however, the resulting curve will have an infinite number of possible representations.
The research presented by Finkelstein and Salesin [Fink94] improves upon this method by formulating a mulciresolution curve representation that uses no additional structures other than the set of control points. Such a representation will implicitly model a hierarchy because of the manner in which finer detail edits are preserved within the representation using the techniques of mulciresolution analysis. Furthermore, because the mulciresolution 16 cechniques recursively subdivide che curve ac each increas~ng level of resolucion, doubling che number of segmencs ac each level, chis resulcs in a unique mulciresolucion represencacion. ln order co underscand how such a represencacion is possible we will, in che nexc seccion, survey che propercies of wavelecs and che role chey play in mulciresolucion analysis.
In summary, chen, among all of che curve represencacions we have surveyed , che B-spline is ac che same rime che mosc economical, in terms of che size of ics daca sec, and che mosc precise, for che level of concinuicy ic enforces across che segmencs of a curve. The high concinuicy enforced inhibits local level of concrol and so a syscemacic and efficienc mechod for knoc insercion is desirable for increasing che resolucion of a curve. Mulciresolucion curve represencations will meec chese requiremencs, using cechniques obcained from che cheory of multiresolution analysis.

WAVELETS AND MULTIRESOLUTION ANALYSIS
In chis section, we will survey the properties of wavelets and the role char the wavelet transform plays in modeling a general theory of mulciresolucion analysis.

What arc Wavdcts?
The mathematical cools known as wavelets gained their initial reputation for success in the context of signal processing. le is difficult co describe what a wavelet is or what its significance is in isolation from such a context; wavelets basically serve as catalyses in such settings, bringing co light certain interesting properties. Compounding chis difficulty is the face char even the most introductory of materials on wavelets relies on an exposition chat draws on mathematics of considerable depth. (See, for example, [Chui92] and the "opcimiscically tided" A Friendly Guide to Wavelets [Kais94].) In chis section, then, we will not attempt co present apy of the deeper results from the theory of wavelets or provide any validation for some of its stronger claims. Rather, following the style of presentation in [Fink94] and [Scol96], we will accept certain claims as faces and will make use of these in presenting the more salient aspects of the wavelet transform with regard co modeling a mulciresolucion analysis.

Scaling fonctions and Wavelets
Mose introductions co wavelets [Hubb96,Chui92] preface their discussion of chis material by presenting, for contrast and context, another cool used in signal processing for discovering the underlying behavior of a signal which is Fourier analysis. Briefly explained, a Fourier transform takes a given signal or dara sec and rewrites chis signal as a linear combination of sine and cosine basis functions. le is, in fact, a striking face chat nearly all signals may be decomposed in such a manner. The information conveyed by this transform, the composition of the component frequencies underlying a given signal, unfortunately does not yield any time-dependent details about the signal, just as the original signal itself, with its time-specific events, yields no information about its composite frequencies. A modified version of the Fourier transform, known as the Windowe~ Fourier Transform, is sometimes used to discover time-related signal behaviors at a more refined level. This version of the transform applies a window to a selected interval of the original signal and essentially performs a Fourier transform on that windowed portion of the signal, obtaining frequency data on that selected interval.
To describe the operation of a wavelet transform let us first assume, without loss of generality, that n = 2 m, for integer m, is the size of the signal or data set. A wavelet transform, rather than rewriting the original signal as a linear combination of basis functions, uses two sets of basis functions, one set to coarsen the signal co a lower resolution, the other set to disclose the events of significance at that same scale. The functions in the former group are referred to as scaling foncrions. Although they form a basis, these functions are designed for compact support, i.e.: the output of an individual function is nonzero over only a restricted or bounded interval. The formation of a basis consists then of "sliding" a specific instance of this function over distinct sub-intervals of the domain. They are called scaling functions because to coarsen a signal representation, for example, the individual instance of the sliding function is dilated (expanded) to admit twice the interval over the domain as that of the next finer level of resolution. Notationally, the i-th scaling function of the set of functions at resolution level j is expressed as rp/ ( x) where i = 0, · · · ,2 1 -1 and j = 0, · · · , m and the vector space spanned by these basis functions is denoted V 1 .
Since che coarsening of a signal representation removes data from chat representation, ic is desirable to retain chis data in some form in che event we wane to reconstitute che signal at its original resolution. This data is preserved by che ocher set of basis functions discussed above in che form of a sec of detail or difference values, one for each data point removed to produce che coarser signal represencacion. These basis functions are defined to span che vector space W 1 which is che orthogonal complement co che space V 1 under che inner produce (/ I g); chat is, for each f in V 1 and each g in W 1 , che condition (/ I g) = 0 muse be true, where typically le is these basis functions, chose spanning W 1 , chat are the functions formally defined as wavelets. Notationally, che i-ch wavelet of the sec of functions at resolution level j is

Example: the Haar Wavelet
An example may help co make the preceding discussion somewhat clearer. Suppose we are given che following "signal": To coarsen chis image by one level, we lower the resolution by one half, averaging the pixel values pairwise over che dilated intervals. This leads co the following lower-resolution image: [8 4] where 8 is the average of che first pixel pair and 4 the average of che last pair. Ac the same time we produce chis coarsening of the image, we wish co preserve the original information 20 contained in the four-value image. We save this information in the form of derail coefficients, which capture the amount of the difference of the old values from the new average. For this first pass, we have the value 1 for the first detail coefficient since the original value 9 is I more than the average 8 and the original value 7 is 1 less. Similarly, we obtain -1 as the other derail coefficient since the original value 3 is -1 more than the average 4 and 5 is -1 less. We may repeat this procedure recursively on the new low-resolution image to obtain the final one-dimensional image [6] and saving the derail coefficient 2 since 8 is 2 greater than the average 6 and 4 is 2 less.
Note that at each level change, the size of the data sec of the coarser image is the same as the number of derail coefficients preserved and the sum of both these quantities equals the size of the higher-resolution image. That means that at each stage, we can convert from the high to the low-resolution image and save the detail information all within a set of data of constant dimension. If we preserve the image in this way, we have the following sequence of In the foregoing analysis of the Haar basis we have already observed that the wavelet transform is an information-preserving decomposition which maintains a data set of constant size at all levels of the decomposition. It should also be noted that this is clearly a reversible 22 decomposition as well. The following are cwo machemacically equivalent expressions for che value of che same image: The first expression simply multiplies che original pixel values by che Haar scaling function relating one pixel co one interval. The lase expression first applies che average value using che Haar scaling function relating four pixels co one interval, chen applies che first set of differences co chat average, and lastly it applies che remaining differences to che previously changed image, resulting in the original sec of pixel values again. Implicit in these expressions as well is the idea chat the higher-resolution function space is che same as the lower-resolution function and wavelet spaces combined, chat is   l'g(x) 'Iii (x) 'I'; (x) Figure 12: The Haar wavdets for 'W', W 1 and W. 23 The last point of interest concerns the efficiency of the procedure for producing the wavelet transform. The cransformacion on the original sec of pixels required operacions of both the scaling functions and the wavelet funccions on all n pixels. Afrer this firsc cransformarion, a coarser set of pixels of size n 12 and a set of derail coefficients of size n I 2 remain. The transformation may now be recursively applied on the coarser image representation, which is now half the size of the original input. The sec of derail coefficiencs already obtained plays no part in this lower scale cransformarion, however, so the size of the sub-problem is strictly n I 2. Thus, if we concinue to recursively reapply the cransform algorithm to the coarsened image at each level uncil we reach the base case of the single average value, the number of seeps we will cake co completely transform the image is n n n + -+ -+ · · · + 4 + 2 + 1 :::;; 2n 2 4 And so, the rime it cakes to produce a wavelet transform is linear in the size of the original data set.

Some Applications
The "image" used in our illustration of the Haar basis was somewhat small and it also generated derail coefficients of relatively high value. A more real-world instance of this problem would involve an image with a much larger number of pixels {say, a large power of 2). Suppose that this image is converted into a wavelet transform. If we examine the accumulated derail values in this transform, we are likely to discover that a number of these derail values are either 0 or are fairly close to 0, either on the positive or negative side. Whac this means is that, in the process of averaging that generaced the coarsened image at that level, no change was registered between the image ac char level and the nexc finer level. le is obvious, then, char such values may be left out of the representation with impunity since 24 cheir concriburion co rescoring che overall image is minimal co nil. This is che basis of che idea of wavelet compression, which is clearly a lossy compression technique. An obvious application of chis technique would involve real-cime networked video: since wavelet cransforms rake cime around cwice che size of che daca sec to perform, one could simply drop every ocher video frame in a feed, compress ic by performing che transform and dropping a sec number of derail coefficiencs off of che result, send che reduced frame, pad che message wich zeros and chen reconscituce che frame by reversing ~e transform.
Another incerescing use of wavelets is in che area of fingerprinc cacegorizacion. While individual secs of fingerprincs are unique, chey do evince well-known secs of paccerns (e.g.: whorls, loops, ecc) which are used as che basis for cataloguing and idencifying fingerprincs and fingerprinc owners. A wavelet transform of a fingerprinc image caken co a certain level of coarseness would provide, in numerical form, a similar kind of general paccern signature for a fingerprinc, making it a candidate for matching ocher such signatures wich che same classification. This has proven to be such a successful notion in practice chac che FBI actually employs wavelet-based fingerprinc analysis cools as part of ics database environmenc [Hubb96].
Another incerescing use of wavelet signatures, discussed in [Scol96], involves che use of a wavelet transform of an image as a query co find marches in an image database. For example, if one is searching for a picture of a sunset over a blue ocean, one might sketch a round red sphere for che sun above a larger blue volume for che ocean in a picture or bitmap editor.
Then, che wavelet transform of chis image is obtained and ic is cross-checked against elemencs in che database, reporting scores on possible matches and, in che application presenced, delivering thumbnail represencacions of these marches co che user for possible selection.

Multircsolution Analysis
The preceding macerial on che generation and che propercies of che wavelec cransform finds ics codification in che development of che general framework of multiresolucion analysis. The mocivacion for che development of chis analysis, as narraced in che canonical paper on mulciresolucion analysis writcen by Scephane Mallar [Mall89], was a compucer vision problem: how to extract meaningful data ac an arbitrary scale &om two-dimensional imagery. The goal of multiresolution analysis, as scared, is to provide a decomposition char enables a "scale-invariant interprecation" of an image. Of course, we may subscicuce che word "image" wich any meaningful sec of data under consideracion.
The prerequisice for a mulciresolution analysis to occur is che existence wichin che domain of che representation of a nested sec of linear spaces. Such a hierarchy of spaces is possible only when che sec of scaling basis funccions spanning a given space Vi is refinable, 1.e.: for all j in [l, m] chere must exist a macrix pi such char <I>i-1 = <1>i pi where <I> i is che set of scaling basis funccions ac level j. It can be shown char all funccions which can be subdivided are refinable, char is che sets of funccions at neighboring levels of resolucion can be related in chis way. Anocher way to express che idea of chis nesced hierarchy of spaces is in che form Note that, if we conjoin these matrices in block matrix form, they form a square matrix that is also invertible, which will have some important implications, as we will see shortly. In fact, we may express the general equations stated above in block matrix form as well: This is referred to as a two-scale re/,arion for scaling functions and wavelets and the matrices P 1 and Q 1 are known as synthesis matrices.
If the preceding precondition regarding the existence of such nested spaces is met, the master strategy of a multiresolution analysis is to deploy a filter bank for transforming an input image into a wavelet transform. A filter bank for converting an input image cm into a wavelet transform would be diagrammed as follows: In order co build this filcer bank, we muse find analysis matrices A , the low-pass, downsampling filcer thac coarsens the signal, and Ii , the high-pass filcer thac records the derails of significance ac this scale, such thac cj-1 =Ajcj and dj-1 =B 1 cj If these macrices are chosen appropriacely, then the original sec of coefficients cj can be recovered from c j-l and d 1 -1 by using the synthesis macrices P j and Q 1 as previously defined: This works because the coefficients being modified are the linear mulcipliers for the basis funccions already relaced by P 1 and Q 1 and so they can be directly relaced in this fashion.
This observation gives us a way co express the inverse relacion of the scaling and wavelec funccions at adjacent levels. Using the analysis filters A j and B 1 and the face chat v(j -1) + w(j -1) = v(j)' we can build the block macrix [A I I B 1 r co obcain the following: Like the block macrix previously described for combining the synthesis macrices, this square macrix is also invertible. In face, ic is clear from comparing both of these equacions that For example, the analysis macrices for the Haar basis at level 2 are as follows: If these are combined in block matrix form and inverted, the result will be the block matrix [P2 I Q 2 ]. The following are some useful identities obtainable from this result: Ai pi =BiQi =PiAi +Qi Bi =I Jc should be pointed out that the Haar basis is one of the rare wavelet bases where the sec of wavelets at a given level is orthogonal not only co the sec of scaling functions ac that same level but also orthogonal to the scaling functions ac every coarser level of resolution as well.
This is known as an orthogonal multiresolution basis and has the nice result that the block matrix forming the sec of analysis filters for any level j is actually the transpose of the block matrix forming the sec of synthesis filters at that same level (within a scaling factor), that is This happy result is not the norm for most wavelet bases. The only restriction for this majority of cases is that the spaces V 1 and W 1 be orthogonal to each other at that level which means that, once the synthesis filters P 1 and Q 1 have been determined from the refinement relations between the wavelets and the scaling functions at each level j, we can invert the block matrix holding the synthesis filters to obtain the block matrix containing the analysis filters.
To sum up, multiresolucion analysis leverages the properties of the wavelet transform co produce a linear-time decomposition of an image, obtaining a scale-invariant representation of that image. Perhaps most important is that once the filter bank effecting this analysis has been defined, data representations of different scales may be directly related by these filters without recourse co any of the scaling functions or wavelets that built them in the first place.

3. MULTIRESOLUTION CURVES
In this section, we will combine the analysis techniques described in the previous section with the curve representation for endpoint-interpolating B-splines obtained in section 1 co produce a unified representation for a mulciresolucion curve. The material in this section is almost entirely drawn from [Fink94] and [Scol96].

B-splines and Spline Wavdcts
In order for a curve representation co be modeled at a number of different scales, by the requirements of mulciresolucion analysis the sec of basis functions spanning the vector space containing the finest scale representation of the curve muse be refinable. For a cubic Bspline, the basis functions in this case correspond co the sec of blending functions from which each curve segment is formed. From Figure 9, in face, we can observe that the piecewise cubic "hat" function, whose pieces form the blending functions over a specific segment, behaves in exactly the manner we would expect from a scaling function. That is, the same function, which is nonzero only over a bounded interval, is shifted co cover successive and, in this case non-distinct, intervals, where the maximum value of the function is centered over the point along the curve where the corresponding control point exerts the greatest influence.
Lascly, we know there are several algorithms for knot insertion or for subdividing a given curve. Since the curve representation is capable of subdivision, chis means its basis functions are refinable and so the cubic B-spline representation is a · candidate for mulciresolucion analysis.
The task now is co generate the synthesis filters P and Q for each level of resolution.
This seep is somewhat complicated due co the face chat we are using endpoint-interpolating B-splines, meaning chat we have mulciplicicies at both ends of the knot sequence for our 30 curves. The usual method for finding che blending funccions for a curve wich a no:l-uniform knoc sequence is co compuce chem using che Cox-deBoor recurrence [Fari88]: where che values ti are che indexed knocs in che knoc sequence and che subscripc d refers co che degree of che polynomial; chus, chis recurrence muse be called up co three levels co find Thus, che matrix Ji has i + 3 rows by Y' + 3 columns. After finding Ji, a matrix Q is found which satisfies che equation where [( <l> 1 I <l> 1 )] is che matrix of inner produces of all che basis funccions in <l> 1 . In essence, che problem is co find Y' column basis veccors chac can span che nullspace There are many ways co selecc such veccors buc, in praccice, che best way is to constrain che number of nonzero encries in each column and require these encries to be consecucive. Puccing as many zeros as possible at che cop and boccom of each column 31 will guarantee that the wavelets will have compact supports. Appendix B contains MATLAB code for the routines that compute the P and Q matrices for any input arguments d, for the degree of the polynomial, and j, for the level of resolution. Figure 14 shows the plots of the scaling functions and the first four wavelets at resolution level 3 . Figure 14: The B-spline scaling functions and the first four wavdets at lcvd 3. [Fink94] The filter banks for cubic endpoint-interpolating B-splines produced by these routines are shown in Appendix A for the first few levels of resolution. The impact of the nonuniform behavior of the basis functions at the endpoints is revealed in the irregular pattern of values in the first few and lase few column vectors in both the P and Q matrices. However, above level 3 for the P matrix and level 4 for the Q matrix, the behavior of the inner column vectors is extremely regular; in fact, the same column vector is repeated, offset vertically by two rows from its neighbor, with these repeated vectors framed by the irregular end conditions. This simple structure makes the creation of filters for higher levels of resolution relatively easy. Furthermore, the face that both secs of matrices are banded diagonal matrices means that the number of multiplications, although still linear in the number of rows (i.e.: the number of refined control points), is bounded by the largest number of nonzero entries in the repeated column vectors, making refinement a linear rime operation [Pres92].
Although we may combine the P and Q filters in block matrix form and invert this to create the analysis filters A and B, the resulting matrix will most likely not be a banded diagonal macrix. Thus, coarsening operations would take quadratic time to compuce while refinement operations took linear time. A way to get around this problem is to recast this problem as an instance of a solution of Ax = b , where we are solving for x. This is done by caking the LU decomposition of the combined synthesis matrix PQ. We will solve for the set of control points c 1 -1 knowing the macrix PQ and the input c 1 : This is done in two passes: first, solve for Ly = c 1 with backsubstitution; next, solve for Uc1-1 = y using the same method. The LU decomposition of the matrix PQ will maintain the efficiencies of the original' s banded diagonal form so this operation also can be performed in time linear to the size of the data set.

Integral and Fractional levds of Resolution
Once the filter bank has been created, a multiresolution curve representation is capable of supporting a number of graphical editing operations, including the ability to apply continuous levels of smoothing to a curve; the ability to edit a curve at any continuous level of detail; the ability to change the "sweep" or direction of a curve while maintaining its texture or "character" or, conversely, the ability to modify the "character" of a curve withouc affecting its overall "sweep".
The coarsening or refinement of a curve to integral levels of resolucion becomes trivial once the filter banks for those levels have been created. Suppose we are given a curve q(t) which has m control points c = [c 0 · · · cm-I] and we wish to construct the approximating curve using m' control points c' both curves are endpoint-interpolating B-splines. If we assume for the moment that 33 m = 2 i + 3 and m' = 2 i ' + 3 for nonnegative integers j' < j, then the control points c' of the approximating curve are given by That is, we run the mulciresolution decomposition algorithm, recursively passing each coarsened set of control points through the filter bank until the desired resolution is reached.
Again, since the computations performed at each level are done using the linear time LU decomposition algorithm previously described, this modification of the curve can be performed at interactive speeds. Note that, in practice, we would also be presenting each coarsened set of control points to the corresponding B filters as well, preserving the detail information lost through coarsening at each pass in a set of detail coefficients d i-I , · · ·, d i' .
This process is straightforward when the desired levels of resolution are discrete in nature. If a fractional level of resolution is desired, there is no obvious way in which a quick approximation can be constructed. Instead, a more practical solution is to define a fractional-level curve qi+µ (t) for some value 0::; µ::; 1 which is a linear interpolation between its two nearest integer-level curves q i (t) and q i+ I (t) , expressed by the following: This interpolation allows smoothing to take place at any continuous level. An example of such a fractional-level curve is shown in Figure 15.  [Fink94] Ar any poinr in our application of coarsening and refinemenr operations on a mulriresolurion curve, the curve representation may contain a sequence of low-resolurion Th' . conrrol poinrs c , · · ·, c an a sec o 1g -reso unon era1 pares , · · · , . 1s perm1rs cwo very different kinds of editing co be performed on such a curve. If we edir some lowresolurion version of the curve cf and then add back the derail values d f, d f+ I ,.
• · , d J-l , we will have changed the overall sweep of the curve while preserving ics derails (see Figure 16).
Conversely, if we leave the low-resolution control points intact and modify instead the set of derail values, we will have altered the character of the curve while preserving irs overall sweep (see Figure 17). We nexc describe these editing operations in more derail. Editing a curve ar an integral level of resolurion is simple. Lee cJ be the control points of the original curve qJ (t), lee cf be a low-resolurion version of cJ, and lee cf be an edited version of CJ' given by cf =cf + tJ..cf. The edited version of the highest-resolution curve AJ J J c = c + Lie can be computed and reconstructed as follows: The lower the value for], the greater the change co the overall sweep of the curve.
Editing a fractional-level curve is somewhat more complicated. Since a fractional-level curve is an interpolation between curves ac neighboring integral levels of resolution based on some value for µ , we would like che effect of any edits we perform on a curve of level j + µ co interpolate che proportional changes co che curves at levels j and j + 1. Thac is, as µ moves from 0 co l, che curve at level j is less affected by an edit and che curve ac level j + 1 is more affected. Lee qf+µ (t) be a fractional-level curve and lee cf+µ be the sec of control points associated with this curve, chat is This formulation suggests that the number of control points in cf+µ marches the size of cf+J which is incuicively correct; in practice, these same control points are used co edic che curve.
Suppose the user modifies one of the control points erµ. To propagate the effect of chis change, the system will have co move some of che nearby control points when erµ is modified. The distance these nearby points are moved is inversely proportional to µ ; for example, when µ is near 0, the control points at level j + µ are subject co a wider propagation of che edit whereas when µ is near 1, the displacement co nearby points is more confined.
Let !J.cf+µ be a vector recording the change co the control points of the fractional-level curve; this is essentially a zero vector except for the i-th entry which records the edit co e;+µ.
We will break chis vector into two components: a vector !J.cf recording che changes to the control points of the nearest integral lower-resolution curve and a vector lld f recording the changes to the wavelet coefficients of the same lower-resolution curve and defined as lld f = Bf+ 1 !J.cf+I. The changes to the higher-resolution curve at level j are then reconstructed as follows: We can obtain an expression for !l.c j+µ by the following derivation: And so Next, we need co define a new vector !l.c'j which records the changes co the control points at level} necessary co move the modified point cf+ µ co its new position. We also define the vector !l.c'j+µ co record the user's change co the i-ch control point of the curve ac level}+µ , char is an otherwise zero vector whose i-ch entry is !l.c/+µ . The propagation of the effect of the edit is then determined by interpolating between these two vectors, using some interpolation function g(µ) : So, !l.cj+µ will move the selected point co its new position and will also propagate the proportional effect of chis change to its neighboring control points as a function of µ . If we equate the right-hand sides of both versions of the equation and multiply the results by either A j+I Bj+I ch c ll . or , we get e 10 owmg: If we apply to these expressions the "invercibility" identities we listed in section 2.2, we get the following simplified expressions: In practice, any function on µ chac increases monoconically on [O, I], such as µ 2 , would be suicable for g. The lase derail co be defined is che definition of che veccor /!,.c' '. This also will be a vector which is zero everywhere except for one or cwo entries, depending on che index i of che modified control point and che i-ch row of che refinement matrix p i+l . We wish co determine che column index k of chis matrix chac identifies che point of maximal influence in che i-ch row of chac matrix. If one such point exerts che maximal influence, chis means chac che modified control point is mosc influenced by che control point cf+ 1 and we can define The reverse of che previous sequence of derivations chen boils down into che following sequence of seeps for modifying a fractional-level curve: We may now discuss the ocher form of editing operations we can perform on multiresolucion curves, namely chose involving the detail coefficients. The goal of chis process is co perform edits similar to chose shown in Figure 17 where the texture or character of a curve may be modified while its general sweep is left unchanged.
To edit the character of a curve at resolution level j, one simply replaces the detail coefficients d j, • • ·, d J-I with some new set d j, • • ·, d J -I and then reconstructs the curve back to level]. Finkelstein and Salesin [Fink94] discuss the possibility of preserving a repertoire of such textures in the form of a library of detail coefficients. The actual replacement of some subset of detail coefficients must be performed at some integer level, of course, but the resulting curve will still be subject to all of the ocher fractional-level manipulations described so far.
There are different ways in which we can process these detail coefficients. The high-level description of these editing operations as we have described chem so far ultimately rests on a representation of a parametric curve chat we can treat in terms of its separate functions on x and y. This is indeed how we process and modify the control points of the curve and how we would practically render the curve in some graphic context. This may nor be the best way co handle the derail coefficients of the curve representation. For example, Figure 18 shows how the derail values, if they are also computed and reconstructed using an x,y orientation, may result in some non-intuitive and undesirable behavior in the reapplication of char cexcure. An alternative co chis is co specify a change in the curve relative co the tangent and normal directions of the lower-resolution curve q 1 -1 (t) . These tangent and normal values are computed using the parameter value 1 0 corresponding co the peak of the wavelet If// (t). The implication is chat the curve representation is no longer a simple linear combination of the control points and the detail coefficients; instead, a change of coordinates must be applied, both when the details are computed and again when they are reapplied.
Since chis process is linear in the number of control points, however, chis should add no degradation co the overall performance of the algorithm.
D~tail l'r fati •~ to dr~ tangrnt. These arguments seem persuasive and we may prefer to be convinced by chem or at least to use these arguments as the foundation for a more rigorous proof of correctness chat would substantiate chis claim. However, the most convincing validation (if not proof) of chis claim would come from actually building an application chat could model these operations in a thorough and convincing manner and to see if, in practice, these theoretical benefits can actually occur.
The remainder of chis paper will describe the design and implementation of a GUI-based application designed for the construction and manipulation of multiresolution curve representations and modeling all of the operations described in chis section.

IMPLEMENTATION DESIGN AND RESULTS
In this seccion we will describe the design and implemencacion of an inceraccive, GUIbased applicacion we shall chriscen as "CurvEdicor". The purpose of the CurvEdicor is co provide an environmenc for the conscruccion, edicing, and refinemenc and coarsening of mulciresolucion curves, i.e.: cwo-dimensional curves whose represencacions are capable of embedding a range of derail abouc the curve ac a variecy of differenc scales of resolucion.
Beyond the implemencacion of this sec of operacions, as described in seccion 3 of this paper, the applicacion also models a sec of reasonable scandard incerface operacions, such as the abilicy co score and recrieve curve represencacions as files; the abilicy co edic mulciple curves; the abilicy co undo/redo edics and other operacions; the abilicy co modify the display of edicorial derail in the graphic environmenc; and other "good policy" operacions.
We shall firsc of all presenc a high-level overview of the modular conscruccion of the design, explaining the roles of these separace componencs. Nexc, we will discuss the implemencacion of each of chese modules, focusing on che more imporcanc funccionalicy in each module and how ics serves co model che operacions described in seccion 3. Lascly, we will have some remarks on che performance of che applicacion, boch in cerms of inceraccive performance and also correccness, some descripcion of che limicacions of che applicacion and unimplemenced feacures, and some remarks on excensions and fucure work.
This applicacion was wriccen in che high-level programming language Java using che implemencacion of che language provided in che JDK Qava Developer's Kie) v.

Overall Structure of Application
A fundamencally sound scracegy for organizing GUI (graphic user incerface) based applicacions of any scale is co firsc decouple whac is known as che "business logic", or che componenc(s) where all of che primary compucacion involved in che applicacion cakes place, from che "UI logic", che derailed and often highly complex code char organizes che visual information displayed co che user and refaces che requests for services char che user makes through chis interface co che proper routines in che business logic. This scracegy was pursued from che oucsec in che design of chis application and, as a resulc, che organization of chis application is builc upon two key componencs: firsc, che multiresolution engine which performs che business logic of che application; and secondly, che application interface which is icself organized inco subcomponencs, as we shall see.
The mulciresolucion engine is che portion of che code dedicaced co creacing che filcer bank, i.e.: the syscem of analysis and synthesis filcers which enable shifts in resolucion, and also co supplying che basic operacions coarsen and refine, through which che resolucion shifts occur. These operations cake as inpucs a sec of concrol points, che basis of the curve represencacion, and an inceger for che resolucion level which also funccions as an index inco che arrays of matrices forming che filcer bank. Boch operations return che cransformed sec of concrol points as a return value. The ocher major operation in chis module is edi tcurve which is invoked when an edic on a &accional-level curve is performed; chis mechod recurns che modified set of concrol poincs recording che discribuced effecc of a fraccional-level edic, as described in section 3.2.
The design of the application interface borrows an organizational idea from graphics and Java programmer Leen Ammeraal [Amme98]. The interface itself is split into two major components: the application frame, which contains the main method for initiating the program and contains the typical repertoire of GUI components, such as a menu bar, a toolbar and a slider bar, and all of the requisite interfacing logic; and the application canvas, the field within which the curves are actually drawn and manipulated. Structurally, the application frame contains the canvas object and the canvas contains, among its member data, an instantiation of the multiresolucion engine. The.canvas object also contains an instance of an undo stack, a modified version of the Java Stack object, and a Vector containing possibly multiple instantiations of CurveState objects which is the representation this application uses co score information defining a curve.
The complete code listing for this application can be found in Appendix C.

Multiresolution Engine
The component serving as the multiresolucion engine in this application is defined in the file Mul tires. j ava as the Multires class. The fundamental data comprising a Multires object are the arrays for storing the matrices or two-dimensional arrays that represent the analysis and synthesis filters of the filter bank. The primary purpose of this module is to create a filter bank designed explicitly to operate on sequences of control points that represent endpoint-interpolating cubic B-spline curves and to provide coarsen and refine methods which employ this filter bank.
The creation of the filter bank is helped greatly by the repetitive structure of these matrices above a certain level of resolution (see section 3.1 and Appendix A). While the lower resolution filters are more irregular, che construction of che higher-level matrices may be automated to a great extent. In che Multires object, chis automated matrix generation is done by che initMatrices method, which is called from che constructor.
The initMatrices method first of all inserts che macrices for che first three levels of resolution into che arrays PQ and AB. These matrices have already been hardcoded as statically declared arrays in che class definition. The reason for declaring chem as static is an attempt at optimization; a static declaration forces chis data to reside as part of che class definition rather than within an instance of a class so chis may employ one less level of indirection in terms of data access. The naming of che arrays as PQ and AB refers to che fact chat these matrices are modeling che synthesis and analysis filters as block macrices, with both che P and che Q matrices, for example, combined in che same matrix. The sources for che P and Q matrices are che filters shown in Appendix A. The corresponding AB matrices are che inverses of che PQ matrices. The hardcoded values in these matrices were computed using MATLAB. These matrices are small enough not to warrant any extra optimization regarding macrix multiplications.
Above chis level, che matrices are built in a much more optimized manner. To understand what is happening we need to look at che structure of che combined PQ matrix at higher levels. First of all, che P and Q matrices at level j have, respectively, (2 1 + 3) rows by (2 f-I + 3) columns and (2 1 + 3) rows by 2 f -I columns. Figure 19 shows che structure, though not che actual values, of a block matrix containing che P and Q matrices at level 4. using chis form would cake quadratic rather than linear time, which is not accepcable. p q p p q q p p q q q p p p q q q q p p q q q q p p p q q q q q p p q q q q q p p p q q q q q q p p q q q q q p p p q q q q q q p p q q q q q p p p q q q q q q p p q q q q q p p p q q q q q p p q q q q p p p q q q q p p q q q p p q q p q Figure 19: Block matrix diagram of synthesis filters P and Q.

As in che matrices shown in Appendix
The optimization strategy comes in two pares. The first seep is co observe chat, since both P and Q in isolation are structured as banded diagonal matrices (recall chat we constructed the Q matrices co support explicitly chis kind of structure) , we may interleave the column vectors of chis block matrix co produce a single banded diagonal matrix. The difference in the number of columns is chat P has 3 more column vectors than Q. Therefore, such an interleaved matrix will have the first 2 columns and the lase 2 columns from P and an alternation of columns from P and Q between these ends. The paccern of the resulting interleaved matrix is shown in Figure 20 again with the elements of the repeated column vectors in bold and also with the elements on the main diagonal highlighted in boldface and caps. Note chat the effect of the alternation of the repeating column vectors from P and Q is co position the center of the sequence of nonzero elements of these vectors directly on the main diagonal.
p q p p q q p Q p q q p q p q p q q q p Q p q q q p q p q p q q q q p Q p q q q q p q p q p q q q q p Q p q q q q p q p q p q q q q p Q p q q q q p q p q p q q q q p Q p q q q q p q p q p q q q p Q p q q q p q p q p q q p Q p q q p p q p Figure 20: Revised block matrix after interleaving.
Once we have created chis banded diagonal matrix we next need to find a way to make the form more compact as a means to optimize matrix multiplications. Press, et al. [Pres92] in the book Numerical Recipes in C describe a series of highly optimized algorithms for manipulating a banded diagonal matrix expressed in a certain form. The transformation 47 used is co essentially declare scorage for a matrix with the same number of rows but with the number of columns equal co the sum of the number of subdiagonals (diagonal "rows" below the main diagonal) plus the number of superdiagonals (those above the main diagonal) plus 1 (the main diagonal). Next, the column veccors are entered into this matrix in anti-diagonal fashion so that the column that is indexed at a position equal co the subdiagonal width plus one contains all of the entries of the main diagonal. Performing this redistribution on our example gives us the final compacted form in Figure 21.
q p Q p q q q q p q p q p q q q q p Q p q q q q p q p q p q q q q p Q p q q q q p q p q p q q q q p Q p q q q q p q p q p q q q p Q p q q q p q p q p q q p Q p q q p p q p

Figure 21: Optimiud banded diagonal form for block matrix PQ.
This matrix is still somewhat sparse, as evidenced by all the (implicitly) zero entries, but the number of such entries per row is now fewer. More to the point, as the level j increases and the number of rows approximacely doubles for each increase, che widch of che macrices generaced will always be the same. This is due co che repecicive column veccor in che Q macrices, whose lengch of nonzero elemencs decides che widch of che cransformed block macrix. Thus, the execucion rime for macrix mulciplicacion is reduced co che number of encries in che column veccor co be mulciplied rimes a conscanc and cherefore becomes linear rime. The initMatrices mechod licerally conscruccs chese compacc form macrices by populacing che respeccive anci-diagonals of che macrix wich che values concained in che repeated column veccors, which are declared as static one-dimensional arrays. The column vectors belonging co che Q macrix muse firsc be mulciplied by a scalar normalizacion value which is resolucion-level dependenc (see Appendix A). The opcimized roucine banmul, char cakes a macrix in chis form and a column veccor as argumencs and recurns che compuced column veccor recording cheir produce, is drawn almosc directly from che code liscing presenced in [Pres92].
(A remark abouc che code concained in [Pres92] is in order. As inescimable as chis book is in its praccical ucilicy, ic has che racher unforcunace habic of demonscracing array processing roucines, which are clearly written in C, by indexing inco an array of size n wich values in che range l..n, whereas che syncax normally expecced in chis hrnguage, and in Java as well, handles index values from 0 con-1 as legal. No explanacion for chis scrange usage is offered. To use chis code, chen, one can do one of cwo chings. One can eicher declare excra scorage, i.e.: declare an array of size n + 1 where one of size n is needed, forgeccing abouc che entry at index 0 and using che remaining range oflegal indices. Or, one can rewrite che code so char proper indices are used, which is a highly non-crivial cask given che opcimizacions inherenc in che code. In chis applicacion, che laccer course was taken. So, as an addicional public service, che code liscing presenced in Appendix C contains highly optimized code for 49 manipulating and performing operations on banded diagonal matrices which indexes the arrays forming these matrices in a legal and proper manner.) Having manufactured the PQ matrices for several levels of resolution in this manner, initMatrices must also create the analysis filters or the AB matrices as well. This rime, however, we cannot simply invert the corresponding PQ matrix since the result will not be a banded diagonal matrix and so we will have no opportunity for optimization. Instead, we muse decompose the PQ matrix into upper triangular and lower triangular matrices and use these co find a solution for a given sec of control points using backsubscicucion, as described in section 3.1.
We can describe the LU decomposition algorithm with a simple example. Suppose we are given a square matrix A and a column vector b and we wish co find the column vector x such that Ax= b. For clarity, lee us work with an actual example and lee We first of all declare another matrix L which is initialized as the identity matrix with the same dimensions as A. We next begin reducing matrix A co form U. For example, co reduce the second row, we multiply the first row by 2 and add this co the second row, since the entry in the pivot of the first row is 1. At the same, we place this multiplier, 2, in the first column of the second row, yielding the following two ma"trices for U and L ac this seep: Note chat the next logical step is to interchange the second and third rows in U in order to have a nonzero pivot value on the second row. We must save chis permutation information and so we will maintain an array named indx whose i-ch entry is the index of the row chat When A is a banded diagonal matrix and is also of the compact form described above, we can perform an LU decomposition on chis matrix using the routine bandec which has also been adapted from [Pres92]. This routine changes the original input matrix A, just as in our example above, so in practice, when initMatrices calls chis routine to decompose a PQ 51 macrix, ic firsc makes a copy of chis macrix and passes chis copy. This copy will concain che upper criangular componenc as a result and che lower triangular macrix AL is contained in anocher macrix which has che same number of rows but a. The major utility mechods of che Mulcires object are coarsen, refine and edi tCurve.
The coarsen mechod cakes as inputs an array of Point20 objects and an inceger corresponding co che resolution level of che desired analysis filter. First, che Point20 class, as defined in che file Point20.java, is a lightweight object for maintaining an x,y coordinate, wich chese elements scored as floats. The input points in chis case represent che sec of control points for a curve wich resolution value}. The coarsen mechod first converts the points to dual one-dimensional arrays of x and y coordinates and chen applies che analysis filters corresponding co resolution level j co each of chese arrays. In boch arrays, che results should be a shortened list of control point data followed by a list of detail coefficients making up che difference of che lengch. What coarsen must do is decide what co do based upon che input level j. If j is low enough, one of che low-resolution hard-coded analysis filters is used and so che results are obtained by executing a simple matrix multiplication. If j > 3, chen che multiplication result muse be obtained chrough backsubscimcion chrough che scored 52 decomposed upper and lower triangular matrices for char level. This compucacion is performed by calling che banbks mechod, again adapted from [Pres92], which backsubscicuces chrough boch matrices corresponding co char level, using che array of inpuc x coordinates, chen che array of y coordinates. After chis compucacion is made, we muse change che order of che elements in che array; recall char co build die banded diagonal matrix in che first place we had co interleave che order of che column vectors. The oucpuc of che backsubscicucion evinces chis same interleaving and so, as a resulc, we muse un-interleave boch of chese x and y arrays first before we chen convert chem back into an array of Point2D objects and return chis array.
The work involved in che refine mechod is very similar. The input sec of Point2D objects in chis case contains a list of control points for a low-resolution curve followed by a lisc of derail coefficients representing any significant behavior, if any, char when applied co chis curve will show up ac che nexc level. Once again, after converting che points co arrays of x and y coordinates, a decision is made based upon che value of j for che mulciplicacion procedure co be used. For low values, again, a simple mulciplicacion using che hard-coded synchesis matrix is performed. For j > 3, we use che banded diagonal forms which means char che inpuc secs of x and y coordinates muse be interleaved in che same manner as che column vectors char went into che building of chis matrix. Once done, a call is made for each of che x and y arrays co che mechod banmul, again adapted from [Pres92], which returns che result of che matrix mulciplicacion. Nore char no un-interleaving is necessary here; che column vectors were interchanged bur che rows were lefc intact. These x and y arrays are convened back co Point2D objects and che resulting array is returned.
Nore char in che current implementation, che only valid values for j are chose between 0 and 8. This means char che highest resolution curve char can be computed ac present is one 53 with 256 segments, which was thought sufficient for testing. The edi tcurve method is used when a modification is made to a control point of a curve at a fractional-level of resolution. This method represents the implementation of the algorithm described in section 3.2. The inputs to this method are the set of control points for the high-resolution curve bracketing this curve (recall chat a fractional-level curve is represented by interpolating between two integer level curves), the floor or the next integer resolution down from the current level, the value for the fractional amount, mu, and the delta-x and delta-y and the array index of the moved point. The input array of points is first converted to arrays of x and y coordinates and these arrays are then coarsened to the next lower level of resolution, using similar logic to the coarsen method. The control point portion of this new array is then multiplied by g(µ) , here µ 2 , and the detail coefficient portion by g(µ) Iµ. Next, we compute the small vector del taCprirne which will store the entries of the synthesis matrix of the next level that maximally affect the control point at the current index. The function that computes this vector basically exploits the regular structure of the higher scale synthesis matrices, making decisions on a case by case basis depending on whether one entry has rhe maximum value in rhe row corresponding co rhe index of che conrrol poinr or whether rwo enrries do. The column corresponding co char entry is rerurned by chis funcrion and chis value marks che index in the lower-resolution curve where che computed del tacprime vector is applied. Lastly, after these adjusred delta values are computed chey are applied co che input sec of control points and this lisr is chen returned.

The Applicati.on Frame
The interface for the CurvEdicor is composed of two major components: the application   Next, we shall discuss the menubar, which contains four menu categories: File, Edit, Options and Help. The pulldown menus associated wich each of chese entries are shown in Figure 23.
The File menu displays, first of all, options for New, Open and Save and Save As. All of these invoke file dialog boxes or JFileChooser objects for displaying the selected contents of a 57 parcicular cargec direccory. An objecc thac implements a FileFilcer interface may be invoked co associate icons with specific file cypes in che pictorial representation of the directory concents offered in the dialog box. A seleccion of a file for opening will result in the loading of che objecc contained in thac file into che graphic environment, with the dialog box event handler calling the canvas object's loadCurve method. Conversely, a save file opcion will invoke anocher event handler thac will recrieve the objecc to be saved from che canvas's saveCurve method. Noce that what is actually being loaded and/or saved in this situacion are accual objects since the basic curve objects in our syscem implement the Java Serializable interface and can therefore be exported, as objects with syscem scace, to any stream, including a file.

58
The remaining oprions offered under rhe File menu have co do wirh manipulating rhe rexcure of an existing curve. Imporr Texture brings up a picrorial lisr of rhree generic cexcures and an oprional menu for loading a user-defined .texrure into rhe environment.
Once again, an object is read in from a file, this time using rhe member loadTexture merhod, and this object is passed along co the canvas's irnportTexture method which will rhen revise whatever curve has been selected with the new set of details. The option Save As Texcure also invokes a dialog box, chis one prompting the user to save a curve as a rexcure rarher rhan as a full-blown curve representation, which involves a different file format.
Under rhe Edie menu we first of all have rhe oprions for Undo and Redo. These selections invoke rhe obvious operations on the canvas objecr's undo stack which holds rhe most recent moves up co a limir char rhe user selects under rhe Oprions menu. In principle, anytime a curve is augmented wirh rhe Build curve selecrion or is edired by moving one of irs control points, these qualify as moves co be saved co the undo stack. The remaining entries under rhe Edit menu, Selecr, Sketch, Build, Zoom In/Our and Clear Screen, all repear rhe funcrionality already indicared for rhe corresponding bucrons on rhe roolbar.
The Oprions menu also offers backup selection capability, chis rime echoing rhe roggle funcrionality of all of the Show/Hide bucrons in rhe roolbar. In addition co rhese selections we have two additional submenus, one co selecr rhe grid size, which offers rhe user the choices of 10, 15 or 25 coordinate points for the grid dimension; rhe other co set the undo limit, i.e. rhe deprh or rhe number of moves rhe undo stack will "remember", wirh options for 1, 5 and 10 moves.
The Help menu simply has an About option which brings up a dialog box identifying rhe authorship of the application.

59
The ocher major componenc of the incerface is the prominent slider bar located at the bottom of the window. As may be inferred, chis slider bar controls the shifts in resolution for a selected curve. The currenc value of the slider is displayed in a }Label object with the caption "Resolution value: ". The actual value obtained from a slider is an inceger so chis object is calibrated with 80 ticks and the return value is simply divided by 10 and displayed chis way. (Recall chat the current implementation of the ~ultiresolution engine constructs ics filter banks with a maximum level value of 8.) This value is also transmitted in chis way co the member canvas object; in face, a reference-to the slider itself is passed directly to the canvas object when it is instantiated.
The canvas object once declared is passed as an argument to the constructor of a JScrollPane object set within the application frame. Doing chis makes the canvas a scrollable client of the scroll pane, allowing the canvas to be able to display curves chat may be larger than the field afforded by the frame.

The Application Canvas
The canvas component of the interface is a member object of the application frame class and it contains among its own member data an instantiation of a Multires object. The canvas class in chis application is the CvBspline class which extends the }Label class and is implemented in the file CvBspline. j ava. The canvas object maintains two classes of member data. First, the system state, meaning the characteristics of all of the curves being drawn in the canvas at any one moment, is preserved in the Vector object state. This Vector stores CurveState objects, defined in the file curves ta te. j a va, which contain the set of control points (arrays of Point20 objects) needed to define a single curve as well as some additional information such as the curve's current resolution value (an integer) and its fractional resolution value (a float). Also belonging to this first class of member data are the cwo scacks for managing the Undo and Redo commands. Boch of these are of type UndoStack, defined in the file Undo Stack. j ava, which extends the basic capabilities of a Stack object by defining a stack depth limit d and overloading the push operation co make sure chat only the last d entries into the stack are preserved. As the user makes moves (either through building a curve or editing one of its control points) the prior CurveState is saved co the undo stack by a call within one or another of the mouse event handlers, known as rnouseListener methods. If the user selects Undo, the current CurveState (maintained as a state variable C) is pushed onto the Redo stack and che lase move popped from the Undo scack and redrawn. If Redo is subsequently selected, the current state is pushed co the Undo stack, the prior scare is popped from the Redo stack, and the lase move is redrawn again. If, after undoing a move, the user makes a new move in the canvas, the Redo stack is erased.
Lastly, there is a Vector called Scribble used for recording a sketched curve in the canvas environment, sketched in chis case by means of mouse input. This Vector is used when the application is in SKETCH mode and the user wishes co hand sketch a curve representation.
Once such a curve has been completed, i.e.: at the point char the mouse is released, the next seep is co convert the resulting sec of data points, which has been saved in the Vector by gee updated every cime the merhod paintcomponent is invoked since rhe most efficienc way co plot whether che locacion of a mouse evenc is close enough co some specific visual feature, such as a concrol po inc for a specific curve, is co compare rhe locacions of both of rhese as rhe feature is being redrawn.
A small third class of member data involves a sec of helping objects, including a reference co che slider bar in rhe applicacion frame, a ]Label for displaying the currenc coordinate values of the mouse cursor, and, of course, an inscance of rhe mulciresolucion engine.
As mencioned, rhere are four edicing modes in che canvas environmenc, only rwo of which, EDIT and ORA W, have been fully implemenced. Much of the evenc handling logic is performed by rhe various mouseListener classes defined locally wirhin rhe constructor.
The primary methods of rhese classes, mousePressed, mouseDragged, mouseReleased, etc., perform some sophisticated checks and upgrades of the scare variables of the canvas on a case basis, depending on the currenc edicing mode.
When the system is in ORA W mode, the user can either build a new curve in the canvas window or add to a previously selected one, a selection having been made while in EDIT mode. To build a curve, the user simply clicks the mouse at a location, after which a new control point is drawn on the canvas. After four such control points are drawn, the first segment of the described curve appears. If the user has toggled the control polygon, the points and the knots to appear, then these will be drawn also. As the user adds additional clicks, additional control points appear and more segments are added to the curve (see Figure   24). To exit ORA W mode, the user must selecn new editing option from the toolbar or the menu bar. When the system is in EDIT mode, the user can click on an empry region of the canvas to reset the statelndex state variable, thereby allowing a new curve to be initiated. The user may also click on either the control points of a curve or the curve proper to select that curve for editing, also updating the statelndex variable to the value corresponding to the index of this curve in the State vector. Once a curve is selected, which is denoted visually as the curve whose control points are filled squares versus outlined ones, the user may click down on a control point and drag ic co a new posicion, modifying as a resulc che representation of the curve. This of course can happen ac both integral and fractional scales of resolucion. At an integer level, che selecced control point is icself the only one whose position is updated as a result of the user selection. At a fraccional level of resolution, che proporrional changes co neighboring control points must be calculaced using the edi tcurve method of the member Mulcires object. This is done from both the mouse Dragged and the mouseReleased mouse listener methods. The CurveStace object maintains within its representation, at all times, two sets of control points: that of che high-resolution curve and thac of the low-resolucion curve. The reason for chis is thac ic is more convenient co have both integer resolution curves handy when we need to render a fraccional-level curve.
(When an integer level curve is rendered, only the high-res curve representacion is used.) To make use of the edi tcurve method, then, che low-resolution sec of control points is passed as an argument, along with ics resolution level, che current mu value, and che index of che control poinc and its delta-x and delta-y values. This method returns the revised sec of control poincs afrer the effecc of che delca has been propagaced proporrionally co che neighboring control points. Once obcained, this low-resolution curve is then refined co produce the corresponding high-resolution curve at the nexc level and chis high-res curve then replaces che prior high-res curve in che current CurveScate. Now, the newly ediced curve can be rendered.
The other major accivicy chac can occur only in EDIT mode is the shifting of che resolution of the currently selected curve. (In our implemencacion, ic is noc possible co coarsen or refine mulciple curves since they may begin ac differenc levels.) When che user adjuscs the slider concrol in che applicacion frame, che changeListener associated wich that slider invokes the canvas objecc method shiftResolution, passing co this method call the 64 floar representing the new resolution value of the curve. Note that the only time any actual change to the sets of control points is necessary is either when we shift down from resolution j.1 ro j.O or shift up from j.O to j. l since, at these points , the integer-level curves within the current CurveState will both have to be upgraded one way or the other. When a shift down occurs, from level j. I to j.O, the curve goes from a fractional-level representation to an integral-level one. The resolutions of the low and high-res curves formerly bracketing the fractional-level were j and j + 1, respectively. We must now shift these to j -I and j. This means first of all the low-res curve is copied to the high-res curve in the CurveSrate. Then, we coarsen a copy of this high-res curve to produce the corresponding curve at the next lowest level of resolution, j -1, and make this our low-res curve in the CurveState. When the user increases the resolution, from j.O to j.1, we repeat roughly the same procedure in reverse. Since the bracketing curve resolutions now shift from j -1 and j to j and j + 1, respectively, the high-res curve now gets copied co the low-res curve and the high-res curve then undergoes refinement by calling the Mulrires object's refine method. All other shifts of resolution simply change the current value of the mu variable in the CurveSrare, which subsequently affects how the curve is rendered.
Every change to a srace variable and every mouse event processed within the application canvas triggers a call to the canvas object's inherited repaint method which, in turn, calls the paintComponent method. This method goes through all of the curves in the State Vector and renders them, one by one, using a call to the overloaded bspline method. Ar the same rime, as elements are being plocred and redrawn, a comparison with the last recorded mouse position is made since, when the system is in EDIT mode, it is by these comparisons char any changes to state variables such as stateindex or Inde x are obtained.
If any scare variables regarding che drawing of control points, polygons, knots or grids are sec ac chis rime, these elements are also drawn.
The bspline method has two forms: one cakes as arguments a single sec of control points and che number of points in che set; che ocher rakes two sets of control points, che length of che higher resolution set, and the value mu. The first form is for drawing integerlevel resolution curves and the second form is for fractional-level curves. If the value of mu in che second form of the method is 0, that method calls the integer version of the method.
The integer-level resolution version of bspllne is the more straightforward of the two.
The rendering algorithm basically iterates through the set of control points, in successive overlapping groups of four, and computes the coefficient values ck from each group of control points. After this, the x and y position of the next point in the curve is plotted using Homer's method: Each point in the curve, except the first, connects with its preceding neighbor by drawing a line between them. Thus, after all of the attempted precision and clever computation, the curves we finally generate are nothing more than polygonal lines after all!
The rendering of the fractional-level curve is somewhat trickier. Recall that in order to render a curve of fractional resolution we interpolate proportionally between the two adjacent integer level resolution curves on the basis of the value of mu. Since the refinement of a low-resolution curve segment evolves into two adjacent high-resolution curve segments, this means we are actually interpolating between one curve on the low-resolution end and a sequence of two curves on the high-resolution end. This means, first of all, we have to be somewhat careful in the manner in which we sample values for ton the interval [O, 1]. For the integer-level renderings, sampling 50 such points works well in practice. However, if we maincain chis praccice for interpolacion purposes, we will have 50 points on che low end versus 100 points on che high end. Obviously, whac we will need to do is co sample che firsc 2 5 poincs of che low end curve and every ocher po inc from a 50 point sample of che firsc high-end curve and incerpolace che firsc 25 poincs, chen repeac che process for che remaining half of che curve. In compucing che coefficiencs char decermine chese curve segmencs, we muse also nocice char che low-end curve segment is builc from four concrol poincs while che high-end pair of curve segmencs are builc from five control poincs, chree of which are shared by che cwo segmencs. The coefficiencs for each of che high-end segmencs, however, will be discincc. Thus, even chough che high-end curve segmencs share concrol informacion, we muse generace chree overall discincc secs of four coefficients to describe each of che chree segmencs as a basis for compucing che interpolacion. Once we have done all chis, we may ploc che respeccive x and y posicions of che fraccional-level curve by ploccing che samples from che low-end curve and each segment of che high-end curve, mulciplying che laccer by mu and che former by 1 -mu. Figure 25 shows an example of such a ploc. Once a segmenc of che fraccional-level curve has been rendered, we adjusc che indices into boch secs of concrol poincs so char we evaluace che nexc adjacenc low-resolucion curve segment and che nexc pair of highresolucion curve segmencs. The lase funccionalicy of inceresc in che CvBspline class is chac for saving and importing textures. The formac of a cexrure is simply che wavelec cransform of che curve describing che cexcure, i.e.: a Veccor concaining a sec of four concrol points decermining che lowescresolucion form of chac curve followed by a sec of detail coefficiencs which record che desired cexcure. To save a cexcure is simply co coarsen che selecced curve, excracc che Vector concaining che control poincs and detail information from che curve's CurveScace, and recurn chis Veccor co the event handler in che applicacion frame calling chis mechod. To import a texcure, a curve in che canvas environment muse firsc be selecced. This curve is chen coarsened down co four concrol points and the decail coefficients from che imported Veccor of texture points are chen copied over into che selecced curve. (If che size of che cexcure is greacer, che size of che curve is increased accordingly.) Once done, che curve is chen refined back co its prior level of resolution. Lastly, coarsening this curve creates the companion lowresolution curve co this one in the selected CurveState. Note that, in these operations and in the loadCurve and savecurve methods, which simply load and return the State Veccor, respectively, only the CvBspline class has any dealings with CurveState objects. The 1/0 routines of the application frame deal only with the more generic Veccor objects (which happen to contain CurveState objects or Point20 objects!.

Evaluation and Results
The evaluation of the performance of an interactive application is somewhat difficult co objectify. For this particular application we are concerned with two predominant iss ues.
One, the correctness of the rendering of B-spline curves at integral and fractional levels of resolution and, by implication, the correctness of the coarsening and refinement operations as applied co the representations of these curves. Two, the efficient performance of these coarsen and refine operations; are these operations capable of modeling shifts of resolution at interactive speeds?
As partial validation of the first issue, a number of the figures used in the illusrration of this paper are screen captures of curves constructed using.the CurvEdicor application, which at least indicates that the curve rendering procedures actually function. A more precise diagnostic is supplied by the grid option of the display. We can, in practice, deploy a set of control points at explicit grid coordinates and compare the curve produced in the canvas environment with one similarly generated by a tool such as MATLAB and make a visual comparison of the results. A number of such sample curves produced discernably identical curves in both environments. Figure 26 demonstrates one such comparison. In terms of testing the coarsening and refinement operations, perhaps the best way to verify their accuracy is to construct a sample low-resolution curve, using a set of pre-determined grid coordinates, refine chis curve to the maximum serring, and then coarsen the curve back co its

MATLAB.
The performance of the coarsen and refine operations was reseed by raking a sec of 1000 curves, with randomly instantiated control point information, and refining each of these curves to the maximum level of resolution, recording the execution time at each level and averaging the results over all 1000 curves. Next, the procedure was repeated, chis time in the reverse direction timing the coarsening operation. A graph showing the plot of execution time vs. resolution level for both operations is shown in Figure 27, clearly demonstrating char even for larger sers of conrrol poinrs, the amounr of rime spenr in these respecrive operations is nor a facror in rhe overall performance of the applicarion. We had inrended ro generate another graph demonsrraring the execution times of these operations plus that of the graphic redrawing co ger an estimate on how much delay is attributable co the graphics operations versus the coarsening and refinemenr operations. Unforrunarely, rhe implemenracion of the Java inrerprerer in the resring environmenr used in this research appears ro consign graphic redrawing operarions co a separare thread of execution. This makes ir difficulr co bracket the beginning and ending of a sequence of rasks, including a graphic redraw with rimer checks, co derermine irs overall execurion rime. Anecdorally, rhe delay incurred from redrawing is much more noriceable at higher levels of resolution, due no doubr co rhe number of curve segmenrs co plor and render. The inclusion of the grid sreps this delay up even more so.
However, the delay is nor prohibirive and does nor undermine rhe utiliry of basic ediring operarions such as moving a conrrol poinr. We have already menrioned several componenrs of the application that were nor fully implemented ar publicarion rime, such as the procedure for convening a skerched curve co a 71 sec of concrol poincs or the zoom feacure. One other feacure not implemented is the plotting of the change of orientation of the detail coefficients mentioned in section 3.2. The methodology for applying this change of coordinates calculation was still being researched at publicacion rime and its implemencacion would conscicuce the first desirable revision of the presenc applicacion. Another sub-performing feacure, one belonging in this case co the Swing libraries, is the ]Slider object. Like the graphics redrawing procedure, che event handler underlying the slider seems also to operace on a different thread of execucion, making ics manipulacion somewhac difficulc in praccice. (The cescing environment used for this application uses a couchpad instead of a mouse; che slider may conceivably perform beccer when a mouse is used.) We have circumvented chis problem in this application by allowing the slider co be manipulated by the arrow keys on the keyboard.
Despite the aforementioned problems and deficiencies, the overall performance of this application is quite good and seems co provide the confirmation we sought regarding the ability of multiresolucion curve representations to be modeled ac interactive speeds. The fact thac we have been able co confirm this using a language as nocoriously compromised in its execucion rime as Java only serves to amplify the success of these concepts.
Avenues for fucure work on this material are plentiful. Since the publication of the original paper on mulciresolucion curves [Fink94], research on modeling multiresolucion surfaces has already made significant headway, the most promising research being done in conjunction with Pixar Scudios (see Scollnitz,et al. [Scol96]). The extension of the mathematics involved uses the well-researched construction of so-called Bezier and B-spline patches, which are the surface equivalents of curve segments [Barc87]. Among the preliminary conclusions of this research is that any surfaces copologically related co a twodimensional mesh are candidates for multiresolution analysis [Scol96]. The present application could conceivably be rewriccen co model such surfaces using che Java 3D API which leverages a high degree of efficiency by mapping Java calls co DirectX or OpenGL libraries on the host system.
In its present form, che application is, by design, already extensible. Since che canvas is effectively decoupled from che application interface, it may already serve as a ready-made object capable of being plugged in co a larger, richer Java-based graphical editing application.
Furthermore, since che basic data types in che system, che CurveState objects , are serializable, they may be exported co any data stream, which opens up the possiblicy for constructing a discribuced, Java-based curve editing environment.

CONCLUSIONS
We have presented in this paper a unified representation that is capable of modeling a given two-dimensional curve at multiple scales of resolution. As outlined in the original research published by Finkelstein and Salesin [Fink94], this representation is based on the use of the wavelet transform. Such a curve representation consists of a set of control points defining a succession of piecewise cubic B-spline segments and a set of detail values marking or recording changes to, or events occuring on, this curve at higher levels of resolution. We have shown that the techniques for manipulating wavelet transforms used in multiresolution analysis are also applicable to this curve representation. Furthermore, when special care is taken ro optimize the construction of the filter bank used to shift these representations between adjacent levels of resolution, we have shown that these operations may be performed in time linear with the size of the curve.
Besides operations for coarsening and refining the resolution of a curve, we have also described operations for rendering these curves at continuous levels of resolution, i.e.: at both integer and also at so-called fractional levels of resolution . This latter depiction is effected by performing a linear interpolation between neighboring integer level resolution curves. We have also defined operations for editing a curve's "sweep" and a curve's "character" independently by modifying the set of control points and the set of derail coefficients respectively within the curve representation. In the case of editing the "sweep", we have further defined operations for both integer and fractional level curves.
Mu/tires.Java Contains the code for the multiresolurion· engine. Creates the synthesis matrices P and Q for the first eight resolution levels. The marrices for the lowest three resolution levels are just hardcoded in place, as are the analysis filters A and B for these levels.
Above level 3, the column vectors for the P and Q matrices are interleaved and the resulting matrices are reformed into more compact forms to support efficient banded-diagonal matrix multiplication operations. The corresponding an_ alysis matrices at these levels are built by performing an LU decomposition on the PQ banded diagonal matrix, storing these resulting matrices and solving for the value of x in the equation L( U(x))=b by backsubstirution.
CurvEditor.java. Contains the application frame and the basic interfacing functionality for processing GUI-based events and requests and relaying these to its member CvBspline object, which processes all of the curve editing operations. Also contains functionality for handling file-based 1/0 of Vector objects representing curve and texture objects.   II  II  II  II  II  II  II  II  II  I I  II  II  II  I I  II  II  II  II  II  II Author: This file contains the implementation o f an object of t ype Multires. A Multires object performs two primary actions: coarsen and refine. The inputs to these operations are arrays of Point2D objects, representing the control points for a parametric cubic B-spline curve representation.
The coarsen operation takes an input set of control points and performs a knot removal operation on the curve, removing half of the curve's segments.
The returned array, of the same dimension, contains the reduced set of control points in the top half of the array and, in the bottom half, the difference coefficients obtained from the multi-resolution decomposition.
The refine operation takes as input? an array of control points and an array of difference coefficients and returns an enlarged array of control points doubling the number of curve segments featured in the input representation and incorporating any features conveyed by the input difference coefficients.