• 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: Cocoa and PICT
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa and PICT


  • Subject: Re: Cocoa and PICT
  • From: Scott Thompson <email@hidden>
  • Date: Fri, 10 Aug 2007 09:21:10 -0500


On Aug 10, 2007, at 9:02 AM, I. Savant wrote:

On 8/10/07, glenn andreas <email@hidden> wrote:

So the bottom line is that anything beyond simple lines, rects, ovals
and arcs you're going to have to go through a lot of work to make a
decent looking PICT for the various "nice looking" PDF/Quartz
features, often resorting to, you guessed it, rendering a bitmap.

To be clear, this is all I really need. I'm drawing pie and bar graphs with text labels.
I'd *love* for it to be as pretty as a PDF equivalent, but that's not possible, apparently,
without a *lot* of work.

Right. If nothing else, QuickDraw has no support for subpixel sampling and antialiasing which make graphics look a lot better. I've written those facilities for QuickDraw-based applications before and can vouch for the fact that it is "a *lot*" of work :-)


Quickdraw doesn't have any sort of alpha transparency at all - it
does support per component alpha masks on bitmap drawing
(CopyDeepMask), but that's not exactly the same (see above comment
about how QD treats the byte that one would expect to be used as alpha).

Now *this* bothers me. The existing version of this application, which uses PowerPlant, yields only one pasteboard type: PICT. There *is* "transparency", though there may be a slight difference in definition: I mean anywhere there *isn't* drawing is "transparent" (no fill in the background). I *don't* mean "a translucent pie graph", those tend not to print well anyway. ;-)

 Given that distinction, can you be more specific about the
limitations you mentioned?

Well, QuickDraw only "understands" the RGB color model. In particular it provides no support for alpha channels. Even 32 bpp QuickDraw Pixmaps are considered XRGB. The X is an undefined channel; QuickDraw does not make any guarantees about changing or preserving the values in this channel. QuickDraw has no support for blending modes for handling alpha compositing (e.g. sourceOver) and as a result QuickDraw does not handle transparency.


(Actually it is possible to use alpha channel effects for QuickDraw through some QuickTime APIs but that's another story. There are also some QuickDraw routines with very limited support for alpha-like behaviors, the aforementioned CopyDeepMask, but again, that's not quite the same).

What you're describing is not necessarily transparency. What you would like, based on your statement, is that you want QuickDraw to use the painters algorithm with it's vector graphics support. That's a pretty safe bet, and is the expected behavior from QuickDraw.

Scott

P.S. As for the suggestion that you generate the PICT by following the documentation and spitting out opcodes yourself, I think that would be a Really Bad Idea(tm). QuickDraw is deprecated, not missing. If you find a bug in QuickDraw while writing this code, I wouldn't expect Apple to fix it, but if the APIs as they stand meet your needs, using them would be much more reliable than trying to spit out valid op- codes yourself.
_______________________________________________


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: Cocoa and PICT
      • From: "I. Savant" <email@hidden>
References: 
 >Cocoa and PICT (From: "I. Savant" <email@hidden>)
 >Re: Cocoa and PICT (From: Uli Kusterer <email@hidden>)
 >Re: Cocoa and PICT (From: glenn andreas <email@hidden>)
 >Re: Cocoa and PICT (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: Cocoa and PICT
  • Next by Date: Re: Cocoa and PICT
  • Previous by thread: Re: Cocoa and PICT
  • Next by thread: Re: Cocoa and PICT
  • Index(es):
    • Date
    • Thread