On Mon, 11 Jun 2007 07:43:25, David Duncan <email@hidden> wrote:
> On Jun 11, 2007, at 12:32 AM, Mike Kluev wrote:
>
>> To extent, QuickDraw was as (or even more) powerful in transparency
>> than Quartz is. CopyMask allowed per pixel per color component
>> alpha transparency!
>
> And I can't think of a convenient way to do this in Quartz :). I
> would think it's possible, but I'd have to poke around in a lot of
> places.
I think it's not possible. However, I don't view it as an
essential feature anyway.
>> CopyMask aside, plain primitives (rects, regions, etc) could also
>> been drawn with
>> blend mode - per color component alpha transparency.
>
> From what I can tell however, that requires you to obliterate what
> is in the destination to specify the alpha. Whereas with Quartz you
> can specify the alpha directly (albeit not per-component).
Why?! Blend mode drawing used the formula:
dst = src*weight + dst*(1 - weight)
Where weigth is the appropriate component of the OPColor.
If OpColor.red=green=blue this is essentially what Quartz alpha
drawing is about. Why not?!
One of the mentioned translucent pictures (somewhere on my
other computer) used blend drawing with pure QuickDraw commands!
> Those both aside however, I think in general per-component alpha
> processing might simply be better handled outside of either library.
> Quartz isn't really designed for pixels, but for areas of color. Even
> Images are handled conceptually as a grid of colored areas. When a
> "color" is your basic unit of color, rather than color components, it
> doesn't really make sense to break them into components to operate on
> each separately.
Yes I agree. (And the grapes are sour! :)
>> - As we saw recently there are no easy ways (as of 10.4) to create
>> shapes (regions of new era) from polygons, paths and bitmaps.
>
> Of course, unless you need to communicate with HIToolbox, your
> welcome to use CGPathRefs for your clipping needs :).
Who said "clipping"?! :)
>> - no easy way to mimic QD clipping handling with Quartz code (not
>> necessarily bad for Quartz, just a major difference).
>
> I'm not certain what you mean by this. Quartz does have a different
> clipping model, but you should be able to get similar, if not exactly
> the same clips as you got with Quickdraw. Although you may have to
> use a Mask to do so.
I mean it is hard (if possible at all) to try to mimic QuickDraw
drawing command sequence with Quartz: QuickDraw sequence could set
clipping to what it like at will, interleaving it with setting other
context attributes. In Quartz you can only "subtract" from clipping,
if you want to go to "larger" unclipped area you'll have to restore
context from the saved stack, and doing so will restore (ruin) other
information as well. Besides, as there are no (or few) accessors
for most of the info in context, you can't just grab the info from
context, restore state (to reset clipping to some other area) and
reapply info to context - no accessors. Hmm, I'm not sure I speak
clear enough this time of day, am I?
>> - there was no such a thing in QuickDraw, but I naively thought
>> it will be in Quartz, but it is not: ability to represent
>> arbitrary images (vector, bitmap, different formats, drawing proc)
>> by a "ref".
>
> PDF can handle most of that.
Err... I mean the "ref" that is format agnostic (pdf, tif, jpg, etc...
So, e.g. I can write: ref = XXXNewRefFromFile without caring about
what particular format the file is and then XXXRefDraw(ref).
> No drawing procs, sorry :).
... plus drawing proc :)
ref = XXXNewRefFromDrawingProc(proc, userData);
> If you need
> to interface with the toolbox,
Who doesn't? :)
> you can always convert a CGPDFPageRef
> to a CGImageRef in about half a dozen lines of code - although I
> agree that isn't convenient and you lose the advantages of PDFs.
Mike
_______________________________________________
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
This email sent to email@hidden