gnustep-dev
[Top][All Lists]
Advanced

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

Re: [Gnustep-cvs] r31195 - in /libs/gui/trunk: ChangeLog ColorPickers/GS


From: Fred Kiefer
Subject: Re: [Gnustep-cvs] r31195 - in /libs/gui/trunk: ChangeLog ColorPickers/GSWheelColorPicker.m Source/NSColorPanel.m
Date: Wed, 25 Aug 2010 21:35:42 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.11) Gecko/20100714 SUSE/3.0.6 Thunderbird/3.0.6

Am 25.08.2010 19:47, schrieb Eric Wasylishen:
>> Now this is not fair :-( I specifically asked to not use the
>> NSBitmapImage method as this is horribly slow (I did write it, so I
>> should know). What I wanted you to test is use the colour conversion
>> from NSColor. In this case create an NSColor object and ask it for the
>> RGB values.
>>
>> NSColor c = [NSColor colorWithCalibratedHue: h saturation: s
>>  brightness: v alpha: A];
>>
>> [c getRed: &r green: &g blue: &b alpha: &A];
>>
>> I just want to know whether this is also prohibitive slow, or if we
>> could recommend this as a general solution.
> 
> Actually, I made a mistake in my previous test and forgot to create an
> autorelease pool around each row of image processing.
> 
> With the autorelease pools,
> 
> NSColor c = [NSColor colorWithCalibratedHue: h saturation: s
> brightness: v alpha: A];
> [c getRed: &r green: &g blue: &b alpha: &A];
> 
> takes 380ms, and
> 
> [bmp setColor: [NSColor colorWithCalibratedHue:h saturation:s
>  brightness:v alpha:A] atX: x y: y];
> 
> takes 415ms, so it's not so bad after all (vs 100ms for the current code).
> 
>> And of course we should also think about ways to make all that code
>> faster :-)

Wow, these numbers are quite surprising. I would have thought that the
bitmap image handling code would be a lot slower. That code should be at
least four more method calls per pixel. The bad thing about the NSColor
code must be the allocation and auto releasing of the object itself. Not
much we can do about that.




reply via email to

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