segImageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
                       pixelsWide:5
                       pixelsHigh:5
                       bitsPerSample:8
                       samplesPerPixel:4
                       hasAlpha:YES
                       isPlanar:NO
                       colorSpaceName:NSDeviceRGBColorSpace
                       bitmapFormat:NSAlphaFirstBitmapFormat
                       bytesPerRow:5 * 4
                       bitsPerPixel:32];

segBaseAddr = [segImageRep bitmapData];

NSImage *  image = [NSImage imageNamed:@"colorNew.png"];
    
[NSGraphicsContext saveGraphicsState];
[NSGraphicsContext setCurrentContext:[NSGraphicsContext
graphicsContextWithBitmapImageRep:segImageRep]];

image drawInRect:NSMakeRect(0,0,5,5) fromRect:NSMakeRect(0,0,5,5)
operation:NSCompositeCopy fraction:1.0];

NSGraphicsContext restoreGraphicsState];


When looking at the source image in PhotoShop (no color management in file),
the first row is (ignoring alpha).

FF FF 00    FF 00 00    00 00 00    00 00 FF    FF FF FF

But my bitmap gets:

FE FF 00    F6 00 06    00 00 00    13 00 FF    FF FF FF


Why the shift? This is not a jpg file. Is there a better choice over
NSDeviceRGBColorSpace?

Thanks,

Trygve


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to