I've been looking around for a while for an answer to this, but haven't found anything. I'm trying to use the CIAffineTransform thats apart of iOS 5 Beta, and have come across an issue. The documentation says that the 'inputTransform' property accepts an NSAffineTransform, but near as I can tell, there is no way to instantiate one of these in iOS, all the research I've done tells me this particular class is for MacOS (correct me if I'm wrong).
If thats the case, then what value do I put into the inputTransform?
Here's some simple code to explain what I'm trying to accomplish.
CIImage* result = "Some CIImage";
CIFilter* filter = [CIFilter filterWithName:@"CIAffineTransform"];
[filter setValue:result forKey:kCIInputImageKey];
[filter setValue:transform forKey:@"inputTransform"]; //What type/class of value do I set here if I can't use an NSAffineTransform
result = [filter outputImage];
Any help will be greatly apprecriated.
I found the solution, I was simply looking in the wrong place.
Instead of using the CIAffineTransform filter on the CIImage, CIImage actually provides a method called:
-(CIImage*) imageByApplyingTransform:(CGAffineTransform)transform
This method returns an image that has the CGAffineTransform argument applied to it.
Hope that helps somebody :)
Per the Core Image Filter Reference.
CGAffineTransform xForm = whatever;
[myFilter setValue:[NSValue valueWithBytes:&xForm objCType:@encode(CGAffineTransform)] forKey:@"inputTransform"];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With