GPUImage和Voronoi过滤器

时间:2013-05-15 11:12:20

标签: gpuimage voronoi

我正在尝试让Voronoi过滤器在我的UIImage上工作,无论我做什么 - 我都无法使它工作....

这是我的代码:

GPUImageJFAVoronoiFilter *jfaVoronoiFilter = [[GPUImageJFAVoronoiFilter alloc] init];
[jfaVoronoiFilter setSizeInPixels:CGSizeMake(1024.0, 1024.0)];

GPUImagePicture *voronoiPointsPicture = [[GPUImagePicture alloc] initWithImage:[UIImage imageNamed:@"Voroni.png"]];
[voronoiPointsPicture addTarget:jfaVoronoiFilter];

GPUImageVoronoiConsumerFilter *voronoiFilter = [[GPUImageVoronoiConsumerFilter alloc] init];
[jfaVoronoiFilter setSizeInPixels:CGSizeMake(1024.0, 1024.0)];
[voronoiFilter setSizeInPixels:CGSizeMake(1024.0, 1024.0)];
[jfaVoronoiFilter addTarget:voronoiFilter];
[voronoiPointsPicture processImage];

return [jfaVoronoiFilter imageByFilteringImage:theImage];

我做错了什么?

0 个答案:

没有答案