On Sep 22, 2009, at 9:42 AM, Roland King wrote:

Thanks David .. I'm a little confused by this though. The documentation for masks doesn't really tell you where alpha fits in to the overall 'mask value',

When you use an image as a mask, the alpha *is* the mask value. 1.0 means full passthrough, 0.0 full block (which is opposite of using an image mask, and yes that does sound confusing...).

in fact they don't really say how a general RGB value maps to 0- >1.0. They talk totally about color as in RGB(1,1,1) maps to 1 and RGB(0,0,0) maps to 0 in the mask. The docs don't say for instance what RGB(1,0,0) maps to, I've been assuming it's 1/3 or so.

If the image doesn't have alpha, then the mask is essentially 1.0 everywhere. There is no attempt to map the RGB triple to anything.

The mask images I'm using can be a bit degenerate however. They have a lot of one primary colour and nothing else, but that colour is still alpha=1 and if I'm using a mask I'd need that to map to 1. My experiments indicate that doesn't happen. ie I'd need RGBA(1,0,0,1), RGBA(0,1,0,1), RGBA(0,0,1,1), RGBA( 0,0,0,1) and RGBA(1,1,1,1) all to map to .. one and it seems to me that's not how the masks work.

As above, these colors all have 1.0 alpha, so they are all passthrough.

I really just want the alpha channel and nothing else, my experiments seem to show that RGBA(0,0,0,1) for instance maps to 0, I need that to map to 1.

That seems odd, that representation should always be 100% black... care to share some code?

If you think I've missed something vital here about masks please point it out.


When using a plain image as a mask, the alpha value is the only thing that should matter.
--
David Duncan
Apple DTS Animation and Printing

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to