[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] [ OT ] Re: Chinese Scroll



On 10 Nov 1999, Nicholas G. Thornton wrote:

> I asked some while back about a project here at work involving a chinese scroll,
> and scrolling and zooming it.
> 
> Someone brought up a Java tiff-viewer they made. I was wondering if I could get
> a copy of it? hoew good it is with large files? can it be altered to do jpegs?
> 
That was myself. :-)

The complete viewer isn't mine to hand away, although I wrote it. But I
can certainly send a demo CD, if you provide your mailing address. The
demo uses the viewer as a standalone, which is not the primary intended
application, so I haven't even obfuscated the code in the JAR file, and
you'd be able to check it out.

The app uses the Java Advanced Imaging Library, so for now that means
(since the JAI needs Java2D, and needs some porting itself) a 1.2 JVM or
better, so no MRJ. In point of fact you'd want to have Windows or Solaris
(Intel Linux may have JAI ported soon), and a relatively decent machine -
48+ megs RAM, 200+ MHz. I've put installers for Java 1.3 and JAI1.0 on the
CD.

Although JAI has codecs for a whole whack of image file formats, and is
easily extended to add more, I am using TIFF in such a way that maybe the
performance of JPEG with this thing might not be so hot. It's hard to say
- the target sizes for the TIFFs we have in mind are 5000 x 5000, or
10,000 x 10,000, or whatever you have storage for. The algorithm uses the
approach of precomputing zoom levels (which, if you use factors of 2, only
adds another 33% to original file size) for speed. TIFF has the advantage
of supporting tiling (in the file, not just in the raster storage in
memory), and so retrieves are fast, and for elegance multiple images can
be put in the same multi-page file.

But even with JPEG in mind it's probably worth a look. JAI is so easy to
use that a basic prototype app to grab a rectangle of JPEG, crop,
translate, scale and display it in a ScrollingImagePanel or ImageCanvas
only needs maybe 200 lines of code. You could have a basic app working in
a day or twothat would tell you whether it's worth exploring the concept
further.

HTH, Arved



# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org