Re: Which color space?
Re: Which color space?
- Subject: Re: Which color space?
- From: Steve Christensen <email@hidden>
- Date: Sun, 30 May 2010 16:31:16 -0700
Is either NSCalibratedWhiteColorSpace or NSDeviceWhiteColorSpace not
working for you?
Also, just a style note, but you don't need to cast every parameter
passed to a function; the compiler typically figures that out. The
only time you really need to do it is if there could be confusion of
type or if you're specifically changing the type, e.g., malloc'd
memory (void*) passed to something looking for a char*; in either case
the compiler is typically good enough to let you know something's amiss.
On May 29, 2010, at 7:09 AM, Simon Raisin wrote:
I would like to create an 8-bit grayscale image but I cannot find a
color
space that uses only 1 8-bit value per pixel. Everything seems to
either be
RGB, RGBA, or one color *plus* an alpha channel.
Am I going about this the wrong way?
Thank you in advance,
Simon
NSBitmapImageRep* outputImageRep = [[NSBitmapImageRep alloc]
initWithBitmapDataPlanes:
(unsigned char **)NULL
pixelsWide:(int)
[inputImageRep pixelsWide]
pixelsHigh:(int)
[inputImageRep pixelsHigh]
bitsPerSample:(int)8
samplesPerPixel:(int)1
hasAlpha:(BOOL)NO
isPlanar:(BOOL)NO
colorSpaceName:(NSString
*) ??? ***???
bytesPerRow:(int)
([inputImageRep pixelsWide] * sizeof(unsigned char))
bitsPerPixel:(int)0];
_______________________________________________
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