带浮动RGB数据的CIImage(无alpha)

时间:2011-10-20 04:15:44

标签: objective-c cocoa core-image

我正在努力显示正确的浮动RGB HDR数据,我使用此代码创建CIImage,但显示的图像看起来渐变 这是我的代码,我非常感谢任何建议

NSBitmapImageRep *bitmapRep = [[[NSBitmapImageRep alloc] 
                    initWithBitmapDataPlanes:(unsigned char **)&hdr_ctxt.img
                    pixelsWide:hdr_ctxt.width
                    pixelsHigh:hdr_ctxt.height
                    bitsPerSample:32
                    samplesPerPixel:hdr_ctxt.channels
                    hasAlpha:NO
                    isPlanar:NO
colorSpaceName:hdr_ctxt.channels == 1?NSDeviceWhiteColorSpace:NSDeviceRGBColorSpace
                    bitmapFormat:NSFloatingPointSamplesBitmapFormat
                    bytesPerRow:0
                    bitsPerPixel:0] autorelease];
    ciImageHdr = [[[CIImage alloc] initWithBitmapImageRep:bitmapRep] autorelease];

0 个答案:

没有答案