ios - Why do subsequent update calls to GPUImageUIElement result in black output? -
problem: i'm trying apply gaussian blur changing uiview
, display live blurred result using gpuimage. many of gpuimage's filters work perfectly, gpuimagegaussianblurfilter
behaves differently in unusual way. after sec update
phone call of gpuimageuielement
without re-instantiating input, , filter, resulting output black , blank.
example:
- (void) viewwillappear:(bool)animated { // blurinput --> blurfilter --> bluroutput gpuimageuielement *blurinput = [[gpuimageuielement alloc] initwithview:self.changingview]; gpuimagegaussianblurfilter *blurfilter = [[gpuimagegaussianblurfilter alloc] init]; gpuimageview *bluroutput = [[gpuimageview alloc] initwithframe:self.view.frame]; [blurinput addtarget:self.blurfilter]; [blurfilter addtarget:self.bluroutput]; [self.view insertsubview:self.bluroutput]; [blurinput update]; }
what happens: @ point blur working, subsequent phone call [blurinput update]
(ie. underlying self.changingview
when updates) results in bluroutput
view turning black …unless re-instantiate blurintput
/blurfilter
, add together targets again, , phone call [blurinput update]
. isn't necessary many of gpuimage's other filters.
notes:
the part ofchangingview
updating it's gradient layer (cagradientlayer) in actual code 3 gpuimage variables held strong ivars. ios objective-c gpuimage
No comments:
Post a Comment