Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: speeding up jpeg writing to disk from CIImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: speeding up jpeg writing to disk from CIImage



Have you looked at using ImageIO to write out the file? I haven't compared the numbers but it could be a little bit more efficient. Check out the CI Annotation sample code.

Frank

On Nov 16, 2005, at 12:54 PM, Samuel DeVore wrote:

So I am processing some large ( >30Meg) tif files by applying some filters and then writing out to disk as jpegs and it seems to be pretty slow. I am using the following to do the writing (resultImage is the CIImage after the filters) Are there any things I can try to squeeze a little more performance out of this?

theBitMapToBeSaved = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:newSize.width pixelsHigh:newSize.height bitsPerSample:kBitsPerSample samplesPerPixel:kSamplesPerPixel hasAlpha:YES isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bytesPerRow:0 bitsPerPixel: 0];

NSGraphicsContext *nsContext = [NSGraphicsContext graphicsContextWithBitmapImageRep:theBitMapToBeSaved];

[[nsContext CIContext] drawImage:[self resultImage] atPoint:imageDestinationRect.origin fromRect:[[self resultImage] extent]];

theFileSaveDictionary = [NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat: ([jpegQuality floatValue] / 100.0)], NSImageCompressionFactor, nil];

[[theBitMapToBeSaved representationUsingType:NSJPEGFileType properties:theFileSaveDictionary] writeToURL:url atomically:YES];




_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartz-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartz-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >speeding up jpeg writing to disk from CIImage (From: Samuel DeVore <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.