Prefuse is a Java -based toolkit for building interactive information visualization applications. It supports a rich set of features for data modeling , visualization and interaction. It provides optimized data structures for tables , graphs , and trees , a host of layout and visual encoding techniques, and support for animation , dynamic queries, integrated search, and database connectivity.
54-531: Prefuse uses the Java 2D graphics library , and is easily integrated into Swing applications or Java applets . Prefuse is licensed under the terms of a BSD license , and can be used freely for commercial and non-commercial purposes. Prefuse is a Java -based extensible software framework for creating interactive information visualization applications. It can be used to build standalone applications, visual components and Java applets . Prefuse intends to simplify
108-403: A transform , so that shapes may be translated, rotated, sheared, and scaled as they are drawn. The active transform is most often the identity transform , which does nothing. Filling using a transform can be viewed as simply creating a new, transformed shape and then filling that shape. In addition to the fill operation, Java 2D provides a draw operation. While fill draws the interior of
162-413: A "distance estimator" algorithm, points were identified that are very close to the edge of the set, so that unusually fine detail is aliased in from the rapidly changing escape times near the edge of the set. The colours derived from these calculated points have been identified as unusually unrepresentative of their pixels. The set changes more rapidly there, so a single point sample is less representative of
216-420: A Button (see JOGL ). Spatial anti-aliasing In digital signal processing , spatial anti-aliasing is a technique for minimizing the distortion artifacts ( aliasing ) when representing a high-resolution image at a lower resolution. Anti-aliasing is used in digital photography , computer graphics , digital audio , and many other applications. Anti-aliasing means removing signal components that have
270-412: A color for each of the pixels to be painted. In the common case of a solid-color fill, each pixel will be set to the same color. The composite takes the pixels generated by the paint and combines them with the pixels already onscreen to produce the final result. These objects can be viewed as performing their duties in terms of the simpler objects described above. Every Java 2D operation is subject to
324-477: A handful of primitives used at the lowest level in a real-time rendering engine (either software or hardware accelerated). These include "points", "lines" and "triangles". If one is to draw such a primitive in white against a black background, it is possible to design such a primitive to have fuzzy edges, achieving some sort of anti-aliasing. However, this approach has difficulty dealing with adjacent primitives (such as triangles that share an edge). To approximate
378-530: A hardware-based anti-aliasing filter as is done in the OLPC XO-1 laptop's display controller. Pixel geometry affects all of this, whether the anti-aliasing and sub-pixel addressing are done in software or hardware. The most basic approach to anti-aliasing a pixel is determining what percentage of the pixel is occupied by a given region in the vector graphic - in this case a pixel-sized square, possibly transposed over several pixels - and using that percentage as
432-405: A higher frequency than is able to be properly resolved by the recording (or sampling) device. This removal is done before (re)sampling at a lower resolution. When sampling is performed without removing this part of the signal, it causes undesirable artifacts such as black-and-white noise. In signal acquisition and audio, anti-aliasing is often done using an analog anti-aliasing filter to remove
486-494: A new, stroked object and then filling that object. Technically speaking, the stroke is only required to accept an input shape and produce a new shape. The stroke implementation provided with Java 2D implements the outline rules described above, but a custom-written stroke could produce any shape it wished. Conceptually, drawing a straight black line in Java 2D can be thought of as creating a line segment, transforming it according to
540-420: A pixel grid with higher resolution than the target display surface (usually a multiple that is a power of 2 to reduce distortion), then using bicubic interpolation to determine the average intensity of each real pixel on the display surface. In this approach, the ideal image is regarded as a signal . The image displayed on the screen is taken as samples, at each ( x,y ) pixel position, of a filtered version of
594-474: A shape, draw draws its outline. The outline can be as simple as a thin line, or as complicated as a dashed line with each dash having rounded edges. The object responsible for generating the outline is the stroke . Given an input shape, the stroke produces a new shape representing its outline. For instance, an infinitely thin line segment (with no interior) might be stroked into a one-pixel-wide rectangle. A draw operation can therefore be described as creating
SECTION 10
#1732802007028648-428: Is a source (the pixels being produced by the paint) and a destination (the pixels already onscreen). Normally, the source pixels simply overwrite the destination pixels, but the composite allows this behavior to be changed. The composite, given the source and destination pixels, produces the final result that ultimately ends up onscreen. The most common composite is java.awt.AlphaComposite , which can treat
702-424: Is a boundary which defines an inside and an outside. Pixels inside the shape are affected by the drawing operation, those outside are not. Trying to fill a straight line segment will result in no pixels being affected, as such a shape does not contain any pixels itself. Instead, a thin rectangle must be used so that the shape contains some pixels. A paint generates the colors to be used for each pixel of
756-434: Is calculated at five times the sampling rate and down-sampled with anti-aliasing. Assuming that one would really like something like the average colour over each pixel, this one is getting closer. It is clearly more orderly than the first. In order to properly compare these images, viewing them at full-scale is necessary. It happens that, in this case, there is additional information that can be used. By re-calculating with
810-444: Is chosen and hence the texture pixels (texels) are already filtered when they arrive on the screen. Mipmapping is generally combined with various forms of texture filtering in order to improve the final result. Because fractals have unlimited detail and no noise other than arithmetic round-off error, they illustrate aliasing more clearly than do photographs or other measured data. The escape times , which are converted to colours at
864-427: Is needed, which can degrade performance and frame rate. Sometimes FSAA is implemented in hardware in such a way that a graphical application is unaware the images are being super-sampled and then down-sampled before being displayed. A graphics rendering system creates an image based on objects constructed of polygonal primitives; the aliasing effects in the image can be reduced by applying an anti-aliasing scheme only to
918-459: Is not sufficient, in general, to say what approach will look best. The previous discussion assumes that the rectangular mesh sampling is the dominant part of the problem. The filter usually considered optimal is not rotationally symmetrical, as shown in this first figure; this is because the data is sampled on a square lattice , not using a continuous image. This sampling pattern is the justification for doing signal processing along each axis, as it
972-399: Is so regular that systematic (Moiré) aliasing can clearly be seen near the main "turbine axis" when it is downsized by taking the nearest pixel. The aliasing in the first image appears random because it comes from all levels of detail, below the pixel size. When the lower level aliasing is suppressed, to make the third image and then that is down-sampled once more, without anti-aliasing, to make
1026-445: Is traditionally done on one dimensional data. Lanczos resampling is based on convolution of the data with a discrete representation of the sinc function. If the resolution is not limited by the rectangular sampling rate of either the source or target image, then one should ideally use rotationally symmetrical filter or interpolation functions, as though the data were a two dimensional function of continuous x and y. The sinc function of
1080-482: The Java programming language . Every Java 2D drawing operation can ultimately be treated as filling a shape using a paint and compositing the result onto the screen . The Java 2D API and its documentation are available for download as a part of JDK 6. Java 2D API classes are organised into the following packages in JDK 6: These objects are a necessary part of every Java 2D drawing operation. A shape in Java 2D
1134-406: The sinc filter , which is considered a better anti-aliasing algorithm. When magnified, it can be seen how anti-aliasing interpolates the brightness of the pixels at the boundaries to produce grey pixels since the space is occupied by both black and white tiles. These help make the sinc filter antialiased image appear much smoother than the original. In a simple diamond image, anti-aliasing blends
SECTION 20
#17328020070281188-469: The y direction. The goal of an anti-aliasing filter is to greatly reduce frequencies above a certain limit, known as the Nyquist frequency , so that the signal will be accurately represented by its samples, or nearly so, in accordance with the sampling theorem ; there are many different choices of detailed algorithm, with different filter transfer functions . Current knowledge of human visual perception
1242-445: The advent of multisample anti-aliasing (MSAA) support on GPUs, it is no longer widely used in real time applications. MSAA provides somewhat lower graphic quality, but also tremendous savings in computational power. The resulting image of SSAA may seem softer, and should also appear more realistic. However, while useful for photo-like images, a simple anti-aliasing approach (such as super-sampling and then averaging) may actually worsen
1296-448: The anti-aliasing filter, and finally convert it back to a gamma compressed format. Using linear arithmetic on a gamma-compressed image results in values which are slightly different from the ideal filter. This error is larger when dealing with high contrast areas, causing high contrast areas to become dimmer: bright details (such as a cat's whiskers) become visually thinner, and dark details (such as tree branches) become thicker, relative to
1350-423: The appearance of some types of line art or diagrams (making the image appear fuzzy), especially where most lines are horizontal or vertical. In these cases, a prior grid-fitting step may be useful (see hinting ). In general, super-sampling is a technique of collecting data points at a greater resolution (usually by a power of two) than the final data resolution. These data points are then combined (down-sampled) to
1404-508: The areas of the image representing silhouette edges of the objects. The silhouette edges are anti-aliased by creating anti-aliasing primitives which vary in opacity. These anti-aliasing primitives are joined to the silhouetted edges , and create a region in the image where the objects appear to blend into the background. The method has some important advantages over classical methods based on the accumulation buffer since it generates full-scene anti-aliasing in only two passes and does not require
1458-737: The boundary pixels; this reduces the aesthetically jarring effect of the sharp, step-like boundaries that appear in the aliased graphic. Anti-aliasing is often applied in rendering text on a computer screen, to suggest smooth contours that better emulate the appearance of text produced by conventional ink-and-paper printing. Particularly with fonts displayed on typical LCD screens, it is common to use subpixel rendering techniques like ClearType . Sub-pixel rendering requires special colour-balanced anti-aliasing filters to turn what would be severe colour distortion into barely-noticeable colour fringes. Equivalent results can be had by making individual sub-pixels addressable as if they were full pixels, and supplying
1512-424: The colour. A very basic plot of a single, white-on-black anti-aliased point using that method can be done as follows: This method is generally best suited for simple graphics, such as basic lines or curves, and applications that would otherwise have to convert absolute coordinates to pixel-constrained coordinates, such as 3D graphics. It is a fairly fast function, but it is relatively low-quality, and gets slower as
1566-416: The complexity of the shape increases. For purposes requiring very high-quality graphics or very complex vector shapes, this will probably not be the best approach. Note: The draw_pixel routine above cannot blindly set the colour value to the percent calculated. It must add the new value to the existing value at that location up to a maximum of 1. Otherwise, the brightness of each pixel will be equal to
1620-437: The current transform, stroking it to create a thin rectangle, querying this shape to compute the pixels being affected, generating the pixels using java.awt.Color.BLACK , and then compositing the results onto the screen. However, performing this entire sequence of steps for each drawing operation would be very inefficient. Java 2D therefore optimizes common drawing operations so that many of these steps can be skipped. If
1674-409: The darkest value calculated in time for that location which produces a very bad result. For example, if one point sets a brightness level of 0.90 for a given pixel and another point calculated later barely touches that pixel and has a brightness of 0.05, the final value set for that pixel should be 0.95, not 0.05. For more sophisticated shapes, the algorithm may be generalized as rendering the shape to
Prefuse - Misplaced Pages Continue
1728-530: The desired resolution, often just by a simple average . The combined data points have less visible aliasing artifacts (or moiré patterns ). Full-scene anti-aliasing by super-sampling usually means that each full frame is rendered at double (2x) or quadruple (4x) the display resolution, and then down-sampled to match the display resolution. Thus, a 2x FSAA would render 4 super-sampled pixels for each single pixel of each frame. Rendering at larger resolutions will produce better results; however, more processor power
1782-419: The exact centres of the pixels, go to infinity at the border of the set, so colours from centres near borders are unpredictable, due to aliasing. This example has edges in about half of its pixels, so it shows much aliasing. The first image is uploaded at its original sampling rate. (Since most modern software anti-aliases, one may have to download the full-size version to see all of the aliasing.) The second image
1836-486: The fifth image, the order on the scale of the third image appears as systematic aliasing in the fifth image. Pure down-sampling of an image has the following effect (viewing at full-scale is recommended): Super sampling anti-aliasing (SSAA) , also called full-scene anti-aliasing (FSAA), is used to avoid aliasing (or " jaggies ") on full-screen images. SSAA was the first type of anti-aliasing available with early video cards. But due to its tremendous computational cost and
1890-446: The fill operation. The simplest paint is java.awt.Color , which generates the same color for all pixels. More complicated paints may produce gradients, images , or indeed any combination of colors. Filling a circular shape using the color yellow results in a solid yellow circle, while filling the same circular shape using a paint that generates an image produces a circular cutout of the image. During any drawing operation, there
1944-484: The latest methods simply have two or more full sub-pixels per pixel, including full color information for each sub-pixel. Some information may be shared between the sub-pixels (such as the Z-buffer .) There is also an approach specialised for texture mapping called mipmapping , which works by creating lower resolution, pre-filtered versions of the texture map. When rendering the image, the appropriate-resolution mipmap
1998-412: The lower the achievable resolution at the sensor level). In computer graphics, anti-aliasing improves the appearance of "jagged" polygon edges, or " jaggies ", so they are smoothed out on the screen. However, it incurs a performance cost for the graphics card and uses more video memory . The level of anti-aliasing determines how smooth polygon edges are (and how much video memory it consumes). Near
2052-409: The maximum possible detail, and thus the second derivative is added. As an example, when printing a photographic negative with plentiful processing capability and on a printer with a hexagonal pattern, there is no reason to use sinc function interpolation. Such interpolation would treat diagonal lines differently from horizontal and vertical lines, which is like a weak form of aliasing. There are only
2106-543: The model was functionally equivalent to the data flow model used in existing graphics toolkits such as VTK. In their work, "Readings in Information Visualization: Using Vision to Think", Stuart K. Card, Jock D. Mackinlay, and Ben Shneiderman present their own interpretation of this pattern, dubbing it the "information visualization reference model". Java 2D Java 2D is an API for drawing two-dimensional graphics using
2160-599: The optically anti-aliased image. Each pixel is individually distorted, meaning outlines become unsmooth after anti-aliasing. Because the conversion to and from a linear format greatly slows down the process, and because the differences are usually subtle, most image editing software , including Final Cut Pro and Adobe Photoshop , process images in the gamma-compressed domain. Most modern GPUs support storing textures in memory in sRGB format, and can perform transformation to linear space and back transparently, with essentially no loss in performance. Important early works in
2214-415: The out-of-band component of the input signal prior to sampling with an analog-to-digital converter . In digital photography, optical anti-aliasing filters made of birefringent materials smooth the signal in the spatial optical domain. The anti-aliasing filter essentially blurs the image slightly in order to reduce the resolution to or below that achievable by the digital sensor (the larger the pixel pitch ,
Prefuse - Misplaced Pages Continue
2268-506: The paint is a simple solid color, for instance, there is no need to actually command it to generate a list of colors to be painted. Likewise, if the default fully opaque composite is in use, actually asking it to perform the compositing operation is unnecessary and would waste effort. Java 2D performs the minimum amount of work necessary to make it seem as if it is performing all of these steps for each operation, therefore retaining both great flexibility and high performance. For simplicity,
2322-419: The pixels being drawn as partially transparent, so that the destination pixels show through to some degree. To fill a shape, the first step is to identify which pixels fall inside the shape. These pixels will be affected by the fill operation. Pixels that are partially inside and partially outside the shape may be affected to a lesser degree if anti-aliasing is enabled. The paint is then asked to generate
2376-429: The processes of visualizing, handling and mapping of data, as well as user interaction. Some of Prefuse's features include: (and perhaps most importantly) Prefuse has been used in school course projects, academic and industrial research, and commercial software development . The design of the prefuse toolkit is based upon the information visualization reference model , a software architecture pattern that breaks up
2430-426: The radius has too long a tail to make a good filter (it is not even square-integrable ). A more appropriate analog to the one-dimensional sinc is the two-dimensional Airy disc amplitude, the 2D Fourier transform of a circular region in 2D frequency space, as opposed to a square region. One might consider a Gaussian plus enough of its second derivative to flatten the top (in the frequency domain) or sharpen it up (in
2484-489: The signal. Ideally, one would understand how the human brain would process the original signal, and provide an on-screen image that will yield the most similar response by the brain. The most widely accepted analytic tool for such problems is the Fourier transform ; this decomposes a signal into basis functions of different frequencies, known as frequency components, and gives us the amplitude of each frequency component in
2538-402: The signal. The waves are of the form: where j and k are arbitrary non-negative integers . There are also frequency components involving the sine functions in one or both dimensions, but for the purpose of this discussion, the cosine will suffice. The numbers j and k together are the frequency of the component: j is the frequency in the x direction, and k is the frequency in
2592-504: The spatial domain), as shown. Functions based on the Gaussian function are natural choices, because convolution with a Gaussian gives another Gaussian whether applied to x and y or to the radius. Similarly to wavelets, another of its properties is that it is halfway between being localized in the configuration (x and y) and in the spectral (j and k) representation. As an interpolation function, a Gaussian alone seems too spread out to preserve
2646-437: The textual examples provided in this article have assumed that the screen is the destination device. However, the destination can be anything, such as a printer, memory image, or even an object which accepts Java 2D graphics commands and translates them into vector graphic image files. Since Java SE 6 , Java2D and OpenGL have become interoperable, allowing, for example, the drawing of animated 3D graphics instead of icons on
2700-433: The top of an image with a receding checker-board pattern, the image is both difficult to recognise and not aesthetically appealing. In contrast, when anti-aliased the checker-board near the top blends into grey, which is usually the desired effect when the resolution is insufficient to show the detail. Even near the bottom of the image, the edges appear much smoother in the anti-aliased image. Multiple methods exist, including
2754-439: The uniform averaging algorithm, one may use an extra buffer for sub-pixel data. The initial (and least memory-hungry) approach used 16 extra bits per pixel, in a 4 × 4 grid. If one renders the primitives in a careful order, such as front-to-back, it is possible to create a reasonable image. Since this requires that the primitives be in some order, and hence interacts poorly with an application programming interface such as OpenGL ,
SECTION 50
#17328020070282808-413: The use of additional memory required by the accumulation buffer. Object-based anti-aliasing was first developed at Silicon Graphics for their Indy workstation. Digital images are usually stored in a gamma-compressed format, but most optical anti-aliasing filters are linear. So to down-sample an image in a way that would match optical blurring, one should first convert it to a linear format, then apply
2862-490: The visualization process into a series of discrete steps. "Prefuse: a toolkit for interactive information visualization" provides more details on implementation and evaluation. The information visualization reference model was developed in the Ph.D. thesis work of Ed Chi, under the name of the data state model . Chi showed that the framework successfully modeled a wide array of visualization applications. Later, Chi's work showed that
2916-446: The whole pixel. Those points were replaced, in the third image, by interpolating the points around them. This reduces the noisiness of the image but has the side effect of brightening the colours. So this image is not exactly the same that would be obtained with an even larger set of calculated points. To show what was discarded, the rejected points, blended into a grey background, are shown in the fourth image. Finally, "Budding Turbines"
#27972