Re: BitMap data format and autorelease
Re: BitMap data format and autorelease
- Subject: Re: BitMap data format and autorelease
- From: Trygve Inda <email@hidden>
- Date: Wed, 12 Mar 2008 17:11:46 +0000
- Thread-topic: BitMap data format and autorelease
>
> On 12 Mar '08, at 9:09 AM, Trygve Inda wrote:
>
>> NSImage * image = [NSImage imageNamed:@"colorTest"];
>> NSBitmapImageRep * imageRep = [NSBitmapImageRep imageRepWithData:
>> [image
>> TIFFRepresentation]];
This comes from here:
http://www.cocoadev.com/index.pl?NSBitMapImageRep
The easiest way to get a guaranteed bitmap from an arbitrary NSImage is to
use TIFF as an intermediate representation. It's not fast but it gets the
job done.
NSData *tiff_data = [[NSData alloc] initWithData:[any_image
TIFFRepresentation]];
NSBitmapImageRep *bitmap = [[NSBitmapImageRep alloc]
initWithData:tiff_data];
What I need to do, is read a jpg... And get at the RGB data directly.
And
Create a pixel buffer directly (which I will fill with pixel data), then
make this some sort of image that I can draw over with semi-transparent text
and save the result to a new jpg.
None of this will ever appear on screen (at least in my app).
Trygve
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden