我现在已经设法在我的应用程序中使用 GPUImage,并尝试在单击按钮时将过滤器放入我的照片中,但还有另一个问题。
GPUImageFilter *selectedFilter;
if (sender.tag == 1) {
selectedFilter = [[GPUImageFilter alloc] init];
} else if (sender.tag == 2) {
selectedFilter = [[GPUImageThresholdEdgeDetection alloc] init];
} else if (sender.tag == 3) {
selectedFilter = [[GPUImageSketchFilter alloc] init];
} else if (sender.tag == 4) {
selectedFilter = [[GPUImageToneCurveFilter alloc] initWithACV:@"crossprocess.acv"];
} else if (sender.tag == 5) {
selectedFilter = [[GPUImageToneCurveFilter alloc] initWithACV:@"Summer.acv"];
} else if (sender.tag == 6) {
selectedFilter = [[GPUImageToneCurveFilter alloc] initWithACV:@"NightCat.acv"];
} else if (sender.tag == 7) {
selectedFilter = [[GPUImageToneCurveFilter alloc] initWithACV:@"Breeze.acv"];
} else if (sender.tag == 8) {
selectedFilter = [[GPUImageToneCurveFilter alloc] initWithACV:@"OldTone.acv"];
} else if (sender.tag == 9) {
selectedFilter = [[GPUImageToneCurveFilter alloc] initWithACV:@"Sky.acv"];
}
filteredImg = [selectedFilter imageByFilteringImage:image];
[insertPhoto1 setImage:filteredImg];
GPUImageToneCurveFilter 不起作用,每当我单击带有 .acv 过滤器的按钮时,它都会使应用程序崩溃并引发此错误。
Thread 1: Program received signal: "EXC_BAD_ACCESS".
这部分有亮点
version = CFSwapInt16BigToHost(*(int*)([databuffer bytes]));
我应该怎么办?错误是什么意思?