2012-10-04 36 views
0

我使用GPUImage框架進行實況照片編輯。轉換點擊點焦點在GPUImageView中的興趣點

我有結構,像這樣: - GPUImageStillCamera - GPUImageCropFilter ---其他視覺過濾器 ---- GPUImageView

我想抽頭點從GPUImageView轉換爲指向GPUImageStillCamera座標,因爲需要設置焦點。

我的作物過濾器初始化:

cropFilter = [[GPUImageCropFilter alloc] initWithCropRegion:CGRectMake(0.06f, 0.0f, 0.9, 1.0f)]; 

GPUImageView填充模式爲默認值。

你有任何想法或樣品?

回答

1

//獲取POI

CGPoint viewCoordinates=[gestureRecognizer locationInView:self.view]; 
CGSize frameSize=self.view.frame.size; 
CGPoint pointOfInterest = CGPointMake(viewCoordinates.y/frameSize.height, 1.f - (viewCoordinates.x/frameSize.width)); 

可以b有益

+0

真可惜,這GPUImageView仍然不公開AVCaptureVideoPreviewLayer,其中有一個方法,這個https://developer.apple.com/reference/avfoundation/avcapturevideopreviewlayer/1623497-capturedevicepointofinterest。 –