Questions tagged [nsimagerep]

26 questions
5
votes
1 answer

NSImage drawInRect and NSView cacheDisplayInRect memory retained

Application that I am working process images. It's like user drops at max 4 images and app layout them based on user's selected template. One image might be added 2-3 times in final view. Each image in layout is drawn in NSView (drawRect method of…
M P
  • 352
  • 3
  • 14
3
votes
1 answer

32 bits big endian floating point data to CGImage

I am trying to write an application which read FITS image. FITS stand for Flexible Image Transport format and it is a format wish is primarily used to store scientific data related to astrophysics, and secondarily, it is used by most amator…
3
votes
1 answer

NSImage and UIImage give different NSData representations

Scenario: I have an image in the iPhone camera roll. I access it using ALAssetLibrary and get an ALAsset object. I get a UIImage and NSData object from it using something like the following code. ALAssetRepresentation *rep = [myasset…
Tayyab
  • 422
  • 5
  • 17
2
votes
1 answer

Using layer backed NSView as NSDockTile contentView

Is there a way to use layer backed NSView as the contentView of a NSDockTile? Tried all sorts of tricks, but all I get is transparent area. Also tried going different route and get an image out of the CALayer and use that for [NSApp…
Tom
  • 1,522
  • 9
  • 10
2
votes
1 answer

Why is TIFFRepresentation bigger than the actual image file?

Here's the code I use: NSImage *image = [[NSBundle bundleForClass:[self class]] imageForResource:@"test.jpg"]; NSData *originalData = [image TIFFRepresentationUsingCompression:NSTIFFCompressionJPEG factor:1.]; The originalData.length gives me…
peetonn
  • 2,942
  • 4
  • 32
  • 49
2
votes
1 answer

Best practice of storing and retrieving an NSImage in binary

I'm working with NSImage's and want to store them in a Core Data binary object. I got things working, but I read a lot of different ways that are using NSImageRep to do this. Currently I'm doing the following: Creating binary data from an image -…
sidneydobber
  • 2,790
  • 1
  • 23
  • 32
2
votes
1 answer

Most efficient way to glTexture from NSImage?

(UPDATE BELOW...) OpenGL Cocoa/OSX Desktop ap targeting 10.8+ I have a situation where I am receiving an NSImage object once per frame and would like to convert it to an openGL texture (it is a video frame from an IPCamera). From SO and the…
andrew
  • 218
  • 3
  • 12
2
votes
2 answers

Is there a best way to size an NSImage to a maximum filesize?

Here's what I've got so far: NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData: [file.image TIFFRepresentation]]; // Resize image to 200x200 CGFloat maxSize = 200.0; NSSize imageSize = imageRep.size; if…
kubi
  • 48,104
  • 19
  • 94
  • 118
2
votes
2 answers

NSImageRep confusion

I have an NSImage that came from a PDF, so it has one representation, of type NSPDFImageRep. I do an image setDataRetained:YES; to make sure that it remains a NSPDFImageRep. Later, I want to change the page, so I get the rep, and set the current…
Brian Postow
  • 11,709
  • 17
  • 81
  • 125
2
votes
2 answers

How to avoid a NSCachedImageRep

I'm working with an NSImage which comes from a PDF. When I initially create the image, it has only one NSImageRep and that is NSPDFImageRep. This is good. I can work with it. I can find out how many pages it has, and go to a specified page, and draw…
Brian Postow
  • 11,709
  • 17
  • 81
  • 125
1
vote
1 answer

How to Implement Custom Image representation for NSImage

I am developing an application to draw and process specific image format not currently supported by the NSimage class. In this specific format, the images are in form of a 1D binary table preceded by an ASCII header which describe the data (number…
1
vote
3 answers

NSImage size is wrong

I think i'm missing something really basic here. If I do this with a legal URL/path which I know exists: NSImage* img = [[NSImage alloc] initWithContentsOfFile:[[selectedItem url] path]]; NSLog(@"Image width: %d height: %d", [img size].width, [img…
evilfred
  • 2,314
  • 4
  • 29
  • 44
1
vote
1 answer

How to implement -draw for custom NSImageRep subclass

I'm interested in creating an NSImageRep subclass that can hold double precision values. The standard NSBitmapImageRep can hold single precision floats, but chokes on doubles. I like that the NSBitmapImageRep exposes the data buffer for…
Omegaman
  • 2,189
  • 2
  • 18
  • 30
1
vote
0 answers

-[NSBitmapImageRep representationUsingType:properties:] export specific BMP configuration?

I'm trying to figure out how to export BMP data from an NSBitmapImageRep, but it doesn't appear there are any properties I can add to specify how the BMP should be created. Specifically, I wanted to export one that is ARGB8 (that is, alpha, red,…
eyebrowsoffire
  • 957
  • 7
  • 15
1
vote
1 answer

Change CGImageDestination dpi

I know how to change the dpi of a NSImageRep, but I can't figure out how to make CGImage APIs reflect this change... Is there a way to make CGImage write a file which is NOT a standard 72dpi? If I set a NSImageRep to be 144dpi, when I write it to…
user732274
  • 1,069
  • 1
  • 12
  • 28
1
2