setInputRotation:atIndex:

1 reply [Last post]
robin_
User offline. Last seen 8 years 42 weeks ago. Offline
Joined: 08/02/2012
Posts:

Hey Guys, this is my first Post and it's nice to have a forum for Problems with GPUImage!

My name is Robin, I'm 15 years old and I'm from germany. I hope you're enjoying my bad english :)

My first Questions is:

I am testing with the project: SimplePhotoFilter, an Filter from an live camera stream. I've found a method to rotate the content if the view does:

- (void)setInputRotation:atIndex:

I can use a kGPUImageRotate-Key and thats working fine, but, what the hell, who needs an index? I've [ALT]-clicked this method and i come to GPUImageOpenGLESContext but there, the Method isn't implemented yet, so i can't see, for whats the index.

Robin

Brad Larson
Brad Larson's picture
User offline. Last seen 4 years 22 weeks ago. Offline
Joined: 05/14/2008
Posts:

You only need to use that method if you want to manually override the default rotation of an image at some part in the processing pipeline.

Instead, you want to use the outputImageOrientation property of the camera input to set the rotation of the input image to match your interface. You use code like the following to do that:

videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait

with the orientation being replaced by whatever your actual interface orientation is at that moment. You change this value in response to changes in the rotation of your interface.

As far as what's meant by the index in the method you're referring to, you can see that defined in GPUImageFilter. The index is the location of the particular input you're trying to rotate. This primarily comes into play for two-input blends and filters like that.

Syndicate content