Re: Efficient way to composite large images?
Re: Efficient way to composite large images?
- Subject: Re: Efficient way to composite large images?
- From: "Matt Ball" <email@hidden>
- Date: Sun, 12 Mar 2006 21:00:17 -0500
Well, I tried using CIImage, and the results are pretty much the same.
The code I used was (in my drawing function):
NSGraphicsContext *currentContext = [NSGraphicsContext currentContext];
CIContext *coreContext = [currentContext CIContext];
for(i = [anArray count]; i != 0; )
{
MBLayer *item = [anArray objectAtIndex:--i];
if(children = [item children]) {
if([[item keyValue:@"visible"] boolValue])
[self drawLayerImagesFromArray:children];
}
if([item keyValue:@"image"] != nil && [[item keyValue:@"visible"]
boolValue]) {
// If "image" key info is an NSImage (Raster)
NSImage *image = [item keyValue:@"image"];
float opacity = [[item keyValue:@"opacity"] floatValue];
opacity = opacity/100;
CIImage *layerImage = [CIImage imageWithData:[image TIFFRepresentation]];
[coreContext drawImage:layerImage inRect:[self frame]
fromRect:NSMakeRect(0,0,[image size].width, [image size].height)];
}
}
I'm wondering if maybe it is the actual drag code? Is there a better
way using CI to move the image, but shift its origin back to (0,0)
like my existing code? My cursory look over the CI docs didn't produce
anything.
Thanks,
Matt Ball
On 3/12/06, Ricky Sharp <email@hidden> wrote:
>
> On Mar 12, 2006, at 4:44 PM, Matt Ball wrote:
>
> > Does anyone know of a more efficient way to composite my layers
> > together? The slowdown when working with large images is pretty
> > unbearable.
>
> Have you looked into using CoreImage?
> ___________________________________________________________
> Ricky A. Sharp mailto:email@hidden
> Instant Interactive(tm) http://www.instantinteractive.com
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden