On Jun 10, 2007, at 02:04 PM, Ingemar Ragnemalm wrote:
Well, that is one of my arguments: Contrary to what is often
claimed, QuickDraw natively
understands full alpha transparency (although not in the RGBA
grouping) and can antialias
everything with very little extra effort. Wrap your drawing routine
with a supersampling
ditherCopy, and wrap drawing with transparency with calls that
CopyMask your drawing
properly. No problem, no low-level pixel processing, not much extra
code, it is all in
standard QuickDraw.
The only problem with this is that you incur a significant cost to
implement either of these. You have to allocate at least 4 times as
many pixels as you need for supersampling, and then downsample them
afterwards. For transparency, the only method I can see is to take a
CopyMask call for every time you want to draw an object with
transparency.
Neither of these are fast or convenient, and aren't done for you. So
while it is possible, I would feel it's fair to say it is not truly
supported either. Not to mention that without doing anything special
you get better results for both operations with Quartz.
I am not in any way trying to point backwards, not saying that QD
should be of much use
today, other than possibly making QD-CG glue to ease porting, but
it somewhat fun to
show that some popular CG "strengths" are mostly void, they were
already there, while
noting what REALLY counts. And there are things to learn by
expanding the list.
I have no doubt, I simply have the perspective of trying to help
people with such needs :). For some trivial QD operations, QD => CG
glue code is possible, if you are fine with the fact that you won't
get pixel identical results. But in general, you should look at a
port to Quartz as an opportunity to enhance your graphics, rather
than to simply port them over.
On more thing: QD Bottlenecks. (Could have been a subject of its own.)
I think that this has to be tackled on a purpose-by-purpose basis.
Quartz is designed to follow the PDF spec, which doesn't have
bottlenecks (last I heard at least).
As an example, I have often used PICTs for storing polygonal paths,
for example for animation
paths. They should really have been splines, but I can always do a
Catmull-Rom along the
polygon and get a nice result. But how do I do the same in CG? How
can I take a standard
document from a drawing program (e.g. Illustrator) and extract a
path from it? Parse a PS file?
I want something that is stable, simple and fast, because that's
what I had before.
You can use PDF or Postscript files for that (PDF is faster). You can
load a PDF file for drawing using the CGPDFDocument APIs or PDFKit.
For Postscript there is also the CGPSConvertor APIs that convert
Postscript to PDF, which is what Preview uses.
As an added bonus, Illustrator exports PDF files (it's been a while,
but I think even it's basic format is just a heavily marked up PDF).
--
Reality is what, when you stop believing in it, doesn't go away.
Failure is not an option. It is a privilege reserved for those who try.
David Duncan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden