discuss-gnustep
[Top][All Lists]
Advanced

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

Re: tiff image blues


From: Alexander Malmberg
Subject: Re: tiff image blues
Date: Thu, 06 Mar 2003 03:28:27 +0100

Marko Riedel wrote:
> 
> Hi folks,
> 
> perhaps the following remarks may be of use to you.
> 
> I am trying to display TIFF images quickly.
> 
> 1. For some reason I could not get NSImageView to work with my setup,
> as it seems to draw the whole image every time.
> 
> 2. Therefore I designed my own view that uses compositeToPoint. This
> works fine, but not when the application is set to display on a remote
> X server over the network. I was shocked to discover that
> 
> (a) NSImage always uses an off-screen window to cache the image, even
> when there exists a perfectly suitable bitmap image rep. among its
> representations and
> 
> (b) NSImage draws the entire cache during the first composite
> operation, as opposed to the rectangle that was asked for. This means
> that the entire image goes over the network, making the first
> composite operation very slow.

AFAIK, both these are by design. NSImage seems to be meant more for
generic image displaying than fast image displaying.

> 3. I was not satisfied with this and decided to ask the bitmap image
> rep. to draw itself. The first display was much faster, but subsequent
> displays that were triggered by a scroll view were slow, because the
> bitmap would re-draw itself in its entirety every time!

Setting a clipping rect around the area you want want to redraw should
fix that (although it's backend specific; I know that back-art only does
(significant) work for the unclipped part and ignores the rest).

> 4. I decided to take advantage of the fact that you can index bitmap
> image planes to obtain a horizontal strip of the image. Hence you can
> restrict drawing to those lines of the image that were asked
> for. An inefficiency remains: the left or right portions of the strip
> may not have been demanded, but they are drawn anyway.

Have you looked at using NSDrawBitmap() directly? Not much uglier than
the NSBitmapImageRep code, and it avoids the overhead of creating
instances.

- Alexander Malmberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]