• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CoreAnimation and CIPerspectiveTransform
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CoreAnimation and CIPerspectiveTransform


  • Subject: CoreAnimation and CIPerspectiveTransform
  • From: vance <email@hidden>
  • Date: Sun, 6 Apr 2008 18:02:41 -0700


I am trying to apply the CIPerspectiveTransform to a CoreAnimation Layer. But for some reason I am getting this debugger output and nothing gets displayed:


CoreImage: ROI is not tilable:
APPLY perspective DOD [118,140 528x367] ROI [258,296 22x24] RGBA_14
AFFINE [1 -0 -0 1 -16384 -16384] DOD [-16384,-16384 32768x32768] ROI [-7087,10 1667x2312] ARGB_8
IMAGE CIImage:0x9de20 DOD [0,0 32768x32768] ARGB_8



Any ideas what could be happening?

This is the code:

[[self window] makeFirstResponder:self];
[self becomeFirstResponder];

NSImage *img = [[NSImage alloc] initWithContentsOfFile:
[[NSBundle mainBundle] pathForResource:@"Picture 2" ofType:@"png"]
];

NSBitmapImageRep *bitmap = [NSBitmapImageRep imageRepWithData:[img TIFFRepresentation]];
CIImage * ciImage = [[CIImage alloc] initWithBitmapImageRep:bitmap];


	rootLayer = [[CALayer layer] retain];
	rootLayer.name = @"myRootLayer";
	rootLayer.contents = ciImage;

	rootLayer.cornerRadius = 50.0;
	rootLayer.borderWidth = 3.0;
	rootLayer.masksToBounds = YES;

	[self setLayer:rootLayer];
	[self setWantsLayer:YES];


// Setpu the filer to scale down the image
CIFilter *filter = [CIFilter filterWithName:@"CILanczosScaleTransform"];
[filter setDefaults];
[filter setValue:ciImage forKey:@"inputImage"];
[filter setValue:[NSNumber numberWithFloat:1.5] forKey:@"inputScale"];


// Setup the filter
CIFilter *filter2 = [CIFilter filterWithName:@"CIPerspectiveTransform"];
[filter2 setDefaults];
[filter2 setValue:ciImage forKey:@"inputImage"];
//[filter2 setValue:[CIVector vectorWithX:100 Y:500 ] forKey:@"inputTopLeft"];
//[filter2 setValue:[CIVector vectorWithX:600 Y:500 ] forKey:@"inputTopRight"];
//[filter2 setValue:[CIVector vectorWithX:600 Y:0 ] forKey:@"inputBottomLeft"];
//[filter2 setValue:[CIVector vectorWithX:0 Y:0 ] forKey:@"inputBottomRight"];
[filter2 setName:@"myPulseFilter"];
CIImage *ciImageOut = [filter2 valueForKey:@"outputImage"];
NSImage *i3 = [self imageFromCIImage: ciImageOut];
[[i3 TIFFRepresentation] writeToFile:@"myimage.tif" atomically:YES];
[rootLayer setFilters:[NSArray arrayWithObject: filter2]];


"myimage.tff" has the a good image. If I comment the last line where i set the filters, the code works and I can see the image. But if I Apply the filter, then nothing is displayed.

Thank you
Vance

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Beginner reading, etc.
  • Next by Date: Re: NSTreeController KVO
  • Previous by thread: Re: NSTreeController KVO
  • Next by thread: Using existing SQLite database with core data?
  • Index(es):
    • Date
    • Thread