ios - Is this use of dispatch queues and CIFilters likely to get my app rejected? -
i've been looking around day @ various ways apply single cifilter dynamically in animation.
i'm looking apply strong cipixellation filter image , gradually animate out original image, without using alpha fade, wouldn't have desired animation effect.
i looked @ brad's gpuimage, importing mb's of framework simple app scared me off slightly, though looks perfect fit.
so thing left felt little bit hacky , cheaty, i'm asking; below code app rejected? , if so, on grounds?
cheers.
- (void)pixellateimage:(uiimage *)image fromvalue:(int)from tovalue:(int)to { dispatch_queue_t bgqueue = dispatch_queue_create("bgqueue", null); (int = from; >= to; i--) { dispatch_async(bgqueue, ^{ cicontext *context = [cicontext contextwithoptions:nil]; ciimage *ciimage = [[ciimage alloc] initwithimage:[uiimage imagenamed:@"c3po"]]; cifilter *blur = [cifilter filterwithname:@"cipixellate"]; [blur setvalue:ciimage forkey:kciinputimagekey]; [blur setvalue:[nsnumber numberwithint:i] forkey:@"inputscale"]; cgimageref imageref = [context createcgimage:blur.outputimage fromrect:[blur.outputimage extent]]; uiimage *returnimage = [uiimage imagewithcgimage:imageref]; cgimagerelease(imageref); dispatch_async(dispatch_get_main_queue(), ^{ self.imageview.image = returnimage; }); }); } }
as long aren't using private api's, hacky code won't rejected.
ios animation ios7 core-graphics appstore-approval
No comments:
Post a Comment