werbary
werbary

Reputation: 1095

Convert tap point to focus interest point in GPUImageView

I'm using GPUImage framework for live photo editing.

I have structure, like this: - GPUImageStillCamera -- GPUImageCropFilter --- Other visual filters ---- GPUImageView

I want to convert tap point from GPUImageView to point in GPUImageStillCamera coordinates, because It's needed to set focus point.

My crop filter initialization:

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

GPUImageView fill mode is default.

Have you any ideas or sample?

Upvotes: 0

Views: 650

Answers (1)

user2021205
user2021205

Reputation:

// get 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));

may b helpful

Upvotes: 1

Related Questions