Re: Transparency Help 2

2009-11-28 Thread Uli Kusterer
On 23.11.2009, at 19:01, R T wrote: > Given: A litho Image, Black & White pixels only. > I want to show just the Black Pixels in a subclassed NSView. Use CoreGraphics. The CGxxx APIs let you set a mask on the current graphics context. Essentially you get a CGImage from your NSImage, specify that

Re: Transparency Help 2

2009-11-23 Thread BravoBug Software
Here is a method that applies 'mask' based on a given NSColor. ie, you pass it an NSImage, a NSColor (in your case, white), and a threshold, and it will make transparent all the pixels of that color within a threshold. So you can use this to knock out the white pixels of an NSImage. Then, of cours

Re: Transparency Help 2

2009-11-23 Thread Alexander Spohr
Am 23.11.2009 um 19:01 schrieb R T: > Given: A litho Image, Black & White pixels only. > I want to show just the Black Pixels in a subclassed NSView. Underlay all white pixel with an alpha of 0 and composite that? atze ___ Cocoa-dev mailing

Re: Transparency Help

2009-11-23 Thread Kyle Sluder
On Mon, Nov 23, 2009 at 8:12 AM, R T wrote: > I have a litho image (black & white pixels only) and I want to make all the > white pixels transparent. I am using Quartz 2d to display the image and I > have a Quartz composition containing a single .cikernel... This is more appropriate to the quar

Re: Transparency Help

2009-11-23 Thread Greg Guerin
R T wrote: kernel vec4 whiteToTransparent(sampler source_image) { vec4 pixValue; pixValue = sample(source_image, samplerCoord(source_image)); return (pixValue == vec4(1,1,1,1) ? vec4(1,1,1,0) : vec4(pixValue)); } I'm ignorant of GL shading, but something looks wrong here. If pixValue's ty

Transparency Help 2

2009-11-23 Thread R T
Given: A litho Image, Black & White pixels only. I want to show just the Black Pixels in a subclassed NSView. I've posted previously with some code and had 1 simple response that has not panned out for me. Any ideas out there, anybody been down this road? Thanks Rick _

Re: Transparency Help

2009-11-23 Thread glenn andreas
On Nov 23, 2009, at 10:12 AM, R T wrote: > I have a litho image (black & white pixels only) and I want to make all the > white pixels transparent. I am using Quartz 2d to display the image and I > have a Quartz composition containing a single .cikernel... > Any ideas? > Why not just draw it

Transparency Help

2009-11-23 Thread R T
I have a litho image (black & white pixels only) and I want to make all the white pixels transparent. I am using Quartz 2d to display the image and I have a Quartz composition containing a single .cikernel... kernel vec4 whiteToTransparent(sampler source_image) { vec4 pixValue; pixValue =