Currently our apps render a lot of simple drop shadows.
Our approach is very basic:
- Render a silhouette of the image in grayscale
- Apply a gaussian blur (via a ConvolveOp)
- Render this underneath the original image at a certain offset
(This is basically applied from Vincent Hardy’s “Java2D Graphics” book.)
The catch is that the ConvolveOp takes a long time for large images. This makes sense to you and me: a 800x600 image, with a blur matrix of 6x6, comes to about 17.2 million calculations. But our users aren’t impressed with this explanation. So my questions are:
-
Is there a pure Java approach to a faster shadow? It doesn’t have to be a kosher Gaussian blur… anything that allows varying degrees of blurring the edges is fine.
-
Is there another road we should look down? JOGL, JNI, etc?