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
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
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
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
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
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
_
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
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 =