• 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
drawing/masking one image with the alpha value from another
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

drawing/masking one image with the alpha value from another


  • Subject: drawing/masking one image with the alpha value from another
  • From: Roland King <email@hidden>
  • Date: Tue, 22 Sep 2009 12:32:19 +0800

I'm trying to construct an image which is colored according to the alpha value of a different image. I've been hunting around the Quartz Core docs and I can't figure out a good way to do this. The motivation is to do something similar to what apple does on the iphone tabbar items which are drawn white or blue using the alpha of the image you supply and it's a pretty good effect I want to reuse.

So for instance if I my drawing color is D and the point on my underlying image is {r,g,b,a}, I want to draw a point of color S * a.

Assume that I have the image I want to process and I can get that into a bitmap - because I do and I have.

I've looked at all the colour blending modes but unless I've missed something, all of them deal, as you'd expect, in colour, not alpha, so I can't find one of those I think I can use which totally ignores the colour information.

I thought about using a CFImageMask which has points which are white where the underlyer is alpha=1 and black where it's 0 and all points between but creating that from the original image is the same problem..

I thought about wandering through the bytes of data in the bitmap (assuming I can even figure out how to access them which currently I cannot) and changing them but that seems pretty hokey even if I deal correctly with the byte orderings the packing and .. getting to the data in the first place.

I'm sure I've entirely missed some piece of Quartz or CF here which does exactly what I want, or a blending mode I can use cleverly for this. Any pointers would be very useful.

Roland
_______________________________________________

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: drawing/masking one image with the alpha value from another
      • From: David Duncan <email@hidden>
    • Re: drawing/masking one image with the alpha value from another
      • From: BravoBug Software <email@hidden>
  • Prev by Date: Re: Printing to NSData
  • Next by Date: Re: Core Data threading fun
  • Previous by thread: Preferencepanel.xib file with an extra delegate object place inside
  • Next by thread: Re: drawing/masking one image with the alpha value from another
  • Index(es):
    • Date
    • Thread