Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

display image with embedded CMYK profile



  Dear All,
            I have an imageViewing application, in which i can display images with
embedded RGB profiles. But in my application, it shows blank page when i try to open
an image with embedded CMYK Profile.


I am getting an NSBitmapImage representation of the image to be displayed.
I am adding the above NSBitmapImage representaion for one of the NSImage instance.

I have used this below code to get the NSBitmapImage representation for RGB color
space and it works fine.

  bitsPerSample      = 8;
         samplesPerPixel = 4;
        hasAlpha          = YES;
        isPlanar           = NO;
        destRowBytes      = portWidth * samplesPerPixel;
        imageRep           = [[NSBitmapImageRep alloc]     initWithBitmapDataPlanes:NULL
                                                                pixelsWide:portWidth
                                                                pixelsHigh:portHeight
                                                              bitsPerSample:bitsPerSample
                                                              samplesPerPixel:samplesPerPixel
                                                                hasAlpha:hasAlpha
                                                                isPlanar:NO                         
                                                              colorSpaceName:NSDeviceRGBColorSpace
                                                  bytesPerRow:destRowBytes
                                                              bitsPerPixel:0];


But for CMYK colorspace, i used the below code,

bitsPerSample      = 8;
         samplesPerPixel = 5;
        hasAlpha          = YES;
        isPlanar           = NO;
        destRowBytes      = portWidth * samplesPerPixel;
        imageRep           = [[NSBitmapImageRep alloc]     initWithBitmapDataPlanes:NULL
                                                                pixelsWide:portWidth
                                                                pixelsHigh:portHeight
                                                              bitsPerSample:bitsPerSample
                                                              samplesPerPixel:samplesPerPixel
                                                                hasAlpha:hasAlpha
                                                                isPlanar:NO                         
                                                              colorSpaceName:NSDeviceCMYKColorSpace
                                                  bytesPerRow:destRowBytes
                                                              bitsPerPixel:0];


And i  get only blank page.( and the error log shows that it is an invalid 
representation).


Can  any one please help me out, where i am wrong.

thanks in advance.
pathu.



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.