• 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
Re: NSImage > trapezium...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage > trapezium...


  • Subject: Re: NSImage > trapezium...
  • From: John Stiles <email@hidden>
  • Date: Sun, 23 Mar 2008 19:39:27 -0700

FWIW, if you find yourself needing to do much more in the way of distorting images, I'd recommend looking into OpenGL directly.
It's extremely fast since it goes straight to the hardware, and doing something like "map an image to a trapezoid" is /very/ few lines of code. Much simpler than trying to do it yourself.



Cathy Shive wrote:
Luca, I am sorry for being snippy. I automatically assumed you were referring to an NSImage when all you said was image. Many many apologies!!

Glenn has you on the right track :)

Again, good luck and sorry *blush*
Cathy


On Mar 23, 2008, at 3:10 PM, glenn andreas wrote:


On Mar 23, 2008, at 8:54 AM, Cathy Shive wrote:
On Mar 23, 2008, at 2:14 PM, Luca wrote:

Hello. Do you know how can I transform a rectangular image in a trapezium?

Seriously?

You aren't going to be able to distort your bitmap like this with NSImage and there is no ready-made CIFilter to do this distortion that I'm aware of. If I'm wrong about that, then that's the way to go. But, I think you've gotta do your own pixel pushing for this one.


Actually, the CIPerspectiveTransform will do this perfectly (you even just give it the resulting four corner points)


You can't do that will an affine transform though (since perspective is, by definition, non-affine), so you'll need to use CoreImage.


Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium | flame : flame fractals & strange attractors : build, mutate, evolve, animate




_______________________________________________

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

_______________________________________________

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
_______________________________________________

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


References: 
 >NSImage > trapezium... (From: Luca <email@hidden>)
 >Re: NSImage > trapezium... (From: Cathy Shive <email@hidden>)
 >Re: NSImage > trapezium... (From: glenn andreas <email@hidden>)
 >Re: NSImage > trapezium... (From: Cathy Shive <email@hidden>)

  • Prev by Date: Re: How do I disable this warning: "local declaration of 'varname' hides instance variable"
  • Next by Date: Re: How do I disable this warning: "local declaration of 'varname' hides instance variable"
  • Previous by thread: Re: NSImage > trapezium...
  • Next by thread: Re: NSImage > trapezium...
  • Index(es):
    • Date
    • Thread