• 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
ColorSpace Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ColorSpace Question


  • Subject: ColorSpace Question
  • From: David Blanton <email@hidden>
  • Date: Thu, 7 Jan 2010 16:51:08 -0700

I have been using

CGContextRef context;
context = CGBitmapContextCreate (m_bitmap.m_array.m_array, m_bitmap.m_array.m_pixelsx, m_bitmap.m_array.m_pixelsy, 8, m_bitmap.m_array.m_pixelsx * 4, colorSpace,kCGImageAlphaNoneSkipFirst| kCGBitmapByteOrder32Host);
CGImageRelease(m_BitmapImage);
CGContextRelease(context);
CGImageRetain(m_BitmapImage);


Then

CGContextDrawImage(cellViewContext, r, m_BitmapImage);

and all is well.


Now I use an NSBitMapImageRep and my colors are off

m_ptrs[0] = (unsigned char*)m_bitmap.m_array;
m_NSBitmapImageRep = [[NSBitmapImageRep alloc]
initWithBitmapDataPlanes:m_ptrs
pixelsWide:m_bitmap.m_pixelsx
pixelsHigh:m_bitmap.m_pixelsy
bitsPerSample:8
samplesPerPixel:3
hasAlpha:NO
isPlanar:NO
colorSpaceName:NSCalibratedRGBColorSpace
bitmapFormat:NSAlphaNonpremultipliedBitmapFormat| kCGBitmapByteOrder32Host
bytesPerRow:(4*m_bitmap.m_pixelsx)
bitsPerPixel:32];
I am confused by this as m_bitmap.m_array is created identically in both examples
_______________________________________________


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: ColorSpace Question
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: binding NSComboBox default selection
  • Next by Date: Re: Revolving scoreboard
  • Previous by thread: Re: Trouble with dragging and file promises
  • Next by thread: Re: ColorSpace Question
  • Index(es):
    • Date
    • Thread