Re: "Live" image preview, huge memory usage...
Re: "Live" image preview, huge memory usage...
- Subject: Re: "Live" image preview, huge memory usage...
- From: Rob Keniger <email@hidden>
- Date: Thu, 4 Dec 2008 11:27:33 +1000
On 03/12/2008, at 6:22 PM, Jean-Nicolas Jolivet wrote:
Quick question (2 actually), right now Im drawing my CIImage in a
custom view... would drawing the CIImage in my view's drawRect
method achieve the same (leak-free) result as your piece of code???
i.e. something simple like:
<snip>
As far as I know, as long as you are drawing the CIImage to an on-
screen context there will be no memory leak, so this should be fine if
the view is in an on-screen window.
Second question; my app does batch image processing so eventually I
will have to draw those CIImage offscreen.. (only for the Color
Control Filter actually)... I assume I have to live with the leak??
No, just use the code I posted which will prevent the leak from
occurring when drawing offscreen, you just have to get an existing on-
screen context to draw into. The drawing itself happens offscreen, you
are just "borrowing" the on-screen context. You could get the context
from anywhere as long as it's a valid on-screen context - in the
example I posted I used the main window's context ([[NSApp mainWindow]
graphicsContext]) but this is not the only way to do it.
--
Rob Keniger
_______________________________________________
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
References: | |
| >"Live" image preview, huge memory usage... (From: Jean-Nicolas Jolivet <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: glenn andreas <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Jean-Nicolas Jolivet <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: douglas welton <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Jean-Nicolas Jolivet <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Rob Keniger <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Jean-Nicolas Jolivet <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Jean-Nicolas Jolivet <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Jean-Nicolas Jolivet <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Rob Keniger <email@hidden>) |
| >Re: "Live" image preview, huge memory usage... (From: Jean-Nicolas Jolivet <email@hidden>) |