Re: "Live" image preview, huge memory usage...
Re: "Live" image preview, huge memory usage...
- Subject: Re: "Live" image preview, huge memory usage...
- From: Jean-Nicolas Jolivet <email@hidden>
- Date: Wed, 03 Dec 2008 20:44:27 -0500
Mmm I guess I was doing something wrong then!
When I tried the code you posted, my image covered my main window...
which, I assumed was not the expected behavior hehe....
(I did modify it a bit though... the thing is, I need to get a
BitmapImageRep out of it and I'm not so sure how to do it with the
code you posted...)
J-N
On 3-Dec-08, at 8:27 PM, Rob Keniger wrote:
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
Jean-Nicolas Jolivet
email@hidden
http://www.silverscripting.com
_______________________________________________
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>) |
| >Re: "Live" image preview, huge memory usage... (From: Rob Keniger <email@hidden>) |