Looks great to me. Thanks for doing this. At some point if you are bored you might try to get a CG version working. I'm not sure if the current code is thread-safe, and I'd like it to be. I'm using it as if it is thread-safe (assuming the caller is only using the NSImage from within the calling thread) and so far no problems, but I just don't know enough about image processing to be sure. I'd expect that it is just doing CoreGraphics underneath anyway, so if that is thread-safe maybe this should be as well?
I'm glad you noticed that image interpolation is not saved when you save off the graphics state. I wonder why they did it that way? ted On Jan 10, 2008 8:29 AM, Dave MacLachlan <[EMAIL PROTECTED]> wrote: > > Instead of antialiasing, we probably want better imageinterpolation. > The icons will come out looking better. > > Also, added some headers that are required in some cases. > > Cheers, > Dave > > Index: /Users/dmaclach/src/opensource/macfuse/filesystems-objc/Support/ > NSImage+IconData.m > =================================================================== > --- /Users/dmaclach/src/opensource/macfuse/filesystems-objc/Support/ > NSImage+IconData.m (revision 733) > +++ /Users/dmaclach/src/opensource/macfuse/filesystems-objc/Support/ > NSImage+IconData.m (working copy) > @@ -19,7 +19,7 @@ > // > // Created by ted on 12/28/07. > // > -#import <Foundation/Foundation.h> > +#import <AppKit/AppKit.h> > +#import <CoreServices/CoreServices.h> > #import <Accelerate/Accelerate.h> > #import "NSImage+IconData.h" > > @@ -84,9 +84,11 @@ > [NSGraphicsContext saveGraphicsState]; > NSGraphicsContext* context = > [NSGraphicsContext graphicsContextWithBitmapImageRep:rep]; > - [context setShouldAntialias:YES]; // TODO: Do we want this? > [NSGraphicsContext setCurrentContext:context]; > + NSImageInterpolation interpolation = [context imageInterpolation]; > + [context setImageInterpolation:NSImageInterpolationHigh]; > [self drawInRect:rect fromRect:NSZeroRect > operation:NSCompositeCopy fraction:1.0]; > + [context setImageInterpolation:interpolation]; > [NSGraphicsContext restoreGraphicsState]; > > // On Tiger, the above actually returns RGBA data. Probably a bug > in Tiger? > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "macfuse-devel" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/macfuse-devel?hl=en -~----------~----~----~----~------~----~------~--~---
