• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Convert GWorldPtr into a NSImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Convert GWorldPtr into a NSImage


  • Subject: Re: Convert GWorldPtr into a NSImage
  • From: Graham Cox <email@hidden>
  • Date: Wed, 7 Jan 2009 10:42:31 +1100


On 7 Jan 2009, at 10:03 am, Eric Gorr wrote:

I have something that comes close, but the problem I believe is that the pixelFormat for the GWorldPtr is BGRA.

Why do you believe that? My recollection* is that a 32-bit RGB GWorld uses URGB (where U means 'unused' - GWorlds do not have an alpha channel). It's been a while but I used to work extensively with GWorlds. There may be a byte ordering issue on PPC vs. Intel though, since GWorlds were very much part of the 68k/PPC universe. Where has your GWorld come from?


*I looked it up in Inside Macintosh Volume 6, it's on page 17-6.

When I tried to setup a NSBitmapImageRep, I tried NSDeviceRGBColorSpace for the colorSpaceName which I believe expects the pixelFormat for the GWorldPtr to be either RGBA or ARGB.


It should be straightforward to wrap an NSBitmapImageRep around some of the GWorld formats. Not all of them are supported but ARGB 32-bit is. While GWorlds do not have an alpha channel QuickDraw does preserve the bits in the unused byte, but you will need to address the issue of setting those bits yourself somehow.

You don't say what you're trying to do or what you've tried, so I'm not sure what other advice I can give.

--Graham


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Convert GWorldPtr into a NSImage
      • From: Eric Gorr <email@hidden>
    • Re: Convert GWorldPtr into a NSImage
      • From: glenn andreas <email@hidden>
References: 
 >Convert GWorldPtr into a NSImage (From: Eric Gorr <email@hidden>)

  • Prev by Date: Re: QTMovieLayer and QCCompositionLayer Don't Start
  • Next by Date: iPhoto API to access the shared photos
  • Previous by thread: Convert GWorldPtr into a NSImage
  • Next by thread: Re: Convert GWorldPtr into a NSImage
  • Index(es):
    • Date
    • Thread