Questions tagged [nsbitmapimagerep]

The NSBitmapImageRep class renders an image from bitmap data. Bitmap data formats supported include GIF, JPEG, TIFF, PNG, and various permutations of raw bitmap data.

The NSBitmapImageRep class renders an image from bitmap data. If a coverage (alpha) plane exists, a bitmap’s color components are premultiplied with it. If you modify the contents of the bitmap, you are therefore responsible for premultiplying the data. For this reason, though, if you want to manipulate the actual data, an NSBitmapImageRep object is not recommended for storage. If you need to work with data that is not premultiplied, you should use Quartz, specifically CGImageCreate with kCGImageAlphaLast.

More : NSBitmapImageRep Class Reference

56 questions
0
votes
1 answer

writeToFile: returning correct path, but no file?

I have this code to make a PNG out of NSData I have for an NSImage, but no file is created in the Downloads folder? - (IBAction)saveToDownloadsFolder:(id)sender { NSInteger selected = [tvContent selectedRow]; ImageCell *selectedRow =…
user2284295
0
votes
1 answer

NSBitmapImageRep: Inconsistent set of values

I am trying to read a 12-bit grayscale (DICOM:MONOCHROME2) image. I can read DICOM RGB files fine. When I attempt to load a grayscale image into NSBitmapImageRep, I get the following error message: Inconsistent set of values to create…
user1092808
  • 283
  • 4
  • 12
0
votes
1 answer

Trying to create a 32 bpc NSBitmapImageRep, getting hit with errors

I'm trying to create an NSBitmapImageRep object with 32 bits per sample and an alpha channel (128 bits per pixel in total). My code looks like this: let renderSize = NSSize(width: 640, height: 360) let bitmapRep = NSBitmapImageRep(bitmapDataPlanes:…
Peter W.
  • 2,323
  • 4
  • 22
  • 42
0
votes
1 answer

I need help optimizing BGR888 blitting to NSView

This is best I've come up with for blitting a 24-bit BGR image out to an NSView. I did trim a significant amount of CPU time by ensuring that the NSWindow host also had the same colorSpace. I think there are 4 or 5 pixel copies going on here: in…
zzyzy
  • 973
  • 6
  • 21
0
votes
1 answer

variable gets reset when getPixel is called

Well, the title is pretty self-explanatory. I have tested this code thoroughly, and what I have found is that the code is somehow resetting "y" when getPixel is called. It shouldn't be possible you'd think, because the method doesn't take a pointer,…
0
votes
1 answer

NSBitmapImageRep bug

This code produces some very strange output. Why? All I do is copying an image. NSData *data = [NSData dataWithContentsOfFile: @"/Users/Jojo/Desktop/k2.jpg"]; NSBitmapImageRep *image = [NSBitmapImageRep imageRepWithData:…
Atomix
  • 13,427
  • 9
  • 38
  • 46
0
votes
2 answers

OS X - How to save NSImage or NSBitmapImageRep to PNG file without alpha channel?

I'm building an OS X app that needs to save the file to disk. I'm currently using NSBitmapImageRep to represent the image in my code, and while saving the image to disk with representationUsingType:properties: method, I want to set the hasAlpha…
Void Main
  • 2,241
  • 3
  • 27
  • 36
0
votes
1 answer

Resized image not drawn correctly to bitmap

I wrote this method to resize an image and save it to a file: - (BOOL) saveImage: (NSImage*) image withSize: (NSSize) size type: (NSBitmapImageFileType) type toURL: (NSURL*) URL { NSImage* outputImage= [[NSImage alloc]initWithSize: size]; …
Ramy Al Zuhouri
  • 21,580
  • 26
  • 105
  • 187
0
votes
1 answer

How to compress jpeg image with Cocoa?

I have an jpeg image and I want to be able to incrementally compress it using Cocoa/Core Image/Core Graphics. For example, I have A.jpg (3MB), I compress A and get B.jpg (1MB), compress B and get C.jpg (400KB), and so on till the image can't be…
phi
  • 1,513
  • 1
  • 15
  • 34
0
votes
1 answer

NSBitmapImageRep to NSMutableArray or NSMutableDictionary

Is it possible to store NSBitmapImageRep copy to NSMutableDictionary or NSMutableArray? I need to save copy of OpenGL texture somewhere so, that I could use it later. So if I would do glReadPixels, store readed pixels to NSBitmapImageRep and somehow…
-1
votes
1 answer

how to get NSBitmapImageRep for displayed IKImageBrowserView?

i have a two-paned NSSplitView, one subview of it is an IKImageBrowserView. i need to capture a bitmap of it to swap into place before animating the NSSplitView with a CATransition. using cacheDisplayInRect does not capture the IKImageBrowserView…
lulu
  • 669
  • 10
  • 26
1 2 3
4