• 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
Anyone else think this is a CIFilter bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Anyone else think this is a CIFilter bug?


  • Subject: Anyone else think this is a CIFilter bug?
  • From: Ken Tozier <email@hidden>
  • Date: Sat, 30 Apr 2005 03:13:32 -0400

I've only been using Affine transforms for a few days and CIFilters for about a week, but this seems like a bug in the "CIAffineTransform" filter.

// Load an image
NSImage    *sourceImage    = [[NSImage alloc] initWithContentsOfFile: @"path to an image file"];

// Convert to a CIImage
CIImage        *ciImage    = [[CIImage alloc] initWithData: [sourceImage TIFFRepresentation]];

// Create an affine transform
NSAffineTransform    *transform    = [NSAffineTransform transform];
[transform    translateXBy: 50 yBy: 50];

// Create a "CIAffineTransform" filter and add the transform above
CIFilter        *filter        = [CIFilter filterWithName: @"CIAffineTransform"];


[filter setDefaults];

[filter setValue: ciImage forKey: @"inputImage"];  
[filter setValue: transform forKey: @"inputTransform"];

// Get the result
ciImage    = [filter valueForKey: @"outputImage"];

// Put result in an image rep, add to an image
NSCIImageRep     *imgRep       = [NSCIImageRep imageRepWithCIImage: ciImage];
NSImage          *resultImage  = [[NSImage alloc] initWithSize: sourceImage.size];


[resultImage addRepresentation: imgRep];


// display resultImage in a window.

Result: Image appears in the same location it would if none of the above had happened.

Other affine transforms work fine with the "CIAffineTransform" filter (rotate and scale) but not translate. 

I thought I'd run it by a few more sets of eyes, in case I'm making an obvious error, before submitting a bug report.

Ken
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Folks without the retail version of Tiger may...
  • Next by Date: CoreData - how to write new kind of PersistentStore?
  • Previous by thread: Re: Tiger X tools crash
  • Next by thread: CoreData - how to write new kind of PersistentStore?
  • Index(es):
    • Date
    • Thread