discuss-gnustep
[Top][All Lists]
Advanced

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

Re: New bitmap code - testers required


From: Willem Rein Oudshoorn
Subject: Re: New bitmap code - testers required
Date: 31 Jan 2002 22:40:35 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Pete French <pete@twisted.org.uk> writes:

> > (1) Performance,  this is a minor concern.  The code
> >     can be optimized and improved.
> 
> Indeed, adding a flag so that large bitmaps get reduced by
> simple point picking rather than colour averaging for starters.

I was not speaking about the code that does the down sampling.
Actually, I would also like to see code does magnification
better. 
I was refering to the ordinary case without any fancy stuff at all.
The code in XGBitmap.m was highly optimized code.  (It might
have been over optimized but who knows).  And your 
code, even in the ordinary case does:

* 4 x malloc  (shouldn't that be objc_malloc, but I don't know)
* 4 x free 
* and copies all the data.

Now I am not saying this is an issue.  I just thought it might
be some thing to watch out for.  Remember that this code
might also be used a lot for small images.  (like 6x6 pixels for
the diple in the scrollbar's divider panes and there might be more).


With regards to the flag for determining the behaviour.  It might
be best to add an defaults value indicating what kind of scaling
ought to be used.
> >
> > (2) I am not sure the approach is right.  From a glance
> >     at the source code it seems that you ALWAY scale
> >     the image in _bitmap_combine_alpha
> >     And I do not think that this is correct.   The scaling
> >     should be determined by the different transformation
> 
> It *is* determined by the transformation matrix - thats doen before
> _bitmap_combine__alpha is actually called. You can do a
> PSscale(0.5,1.5) before displaying the image and it honours it. You
> can do a PStranslate() and the origin willmove. In fact thats how it
> works with drawInRect which simply adapts the transofrmation matrix
> such that a straigh "draw" method will fill the rect given - these
> methods are in the general NSImageRep code and are not bitmap
> specific. Try it out...

You are right.  But I was confused by all the width and height
floating around.  I thought you scaled to the destination rectangle 
on the screen instead of the transformed source rectangle. Sorry.

> Can you giuve me an exmaple of where you think it might go wrng and I'll
> try it and look into fixing it. The aim is to get it behaving exactly as
> a real OS system would after all...

I was just confused.

Wim Oudshoorn.




reply via email to

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