views:

186

answers:

2

Hi All,

In 10.6 with some systems CoreImage CIPerspectiveTransform (And other api's too) results in colored patches in output image. (It seems like hardware related issue And it occurs only with images with resolution above 4000X2500)

Is there ay way to come out of this bug? At-last is it possible to use NSAffineTransform instead? If yes how to use it.

Thanks, Dhana.

+4  A: 

When creating your CIContext, have you tried disabling the hardware renderer? This fixed problems for me:

CIContext *context = [CIContext contextWithCGContext:[[NSGraphicsContext currentContext] graphicsPort]
                                             options:[NSDictionary dictionaryWithObjectsAndKeys:
                      [NSNumber numberWithBool:YES], kCIContextUseSoftwareRenderer, nil]];
iKenndac
Great info! Probably makes sense to make disabling of hardware rendering dependent on the image size so you would still use it for smaller images,
VoidPointer
Thank you iKenndac,This one worked for me too..
Dhanaraj
A: 

Hello, I have the Core Image Problems in 10.6. I try this:

// Create CIImage from CGImageRef (contents CALayer)
CIImage *myCIImage = [CIImage imageWithCGImage:(CGImageRef) sublayer.contents];

// Create PerspectiveTransform filter
CIFilter *perspectiveFilter = [CIFilter filterWithName:@"CIPerspectiveTransform"];
// Set filter's parameter
[perspectiveFilter setDefaults];
[perspectiveFilter setValue:myCIImage forKey:@"inputImage"];
[perspectiveFilter setValue:topLeft forKey:@"inputTopLeft"];
// And the other ones using CIVector
[perspectiveFilter setName:@"perspective"];
// Set filter's parameter
[perspectiveFilter setDefaults];
[perspectiveFilter setValue:myCIImage forKey:@"inputImage"];
[perspectiveFilter setValue:topLeft forKey:@"inputTopLeft"];
// And the other ones using CIVector
[perspectiveFilter setName:@"perspective"];

// Apply CIPerspectiveTransform
sublayer.filters = [NSArray arrayWithObject:perspectiveFilter];

I compile and build and when I apply filter in runtime, console print this:

CoreImage: ROI is not tilable:
APPLY perspective DOD [50,50 50x50] ROI [50,50 26x26] RGBA_H
AFFINE [1 -0 -0 1 -16517.9 -16564] DOD [-16517.9,-16564 32768x32768] ROI [-16518,-16564   17041x17041] ARGB_8 ...

I have read this post.

How I could disable the hardware renderer? Where I have to read and apply CIContext? Excuse my bad english, thank.

soulless
This does not answer this question. Please post it as a separate question.
Peter Hosey